在上一节的分析当中,已经知道了uboot kernel的源代码路径及编译选项,以及rootfs的版本,相关信息如下所示:

## BUILD CONFIGURATION

Build target:
Board: iotx-3
Branch: default
Desktop: Kernel configuration:
Repository: git://git.ti.com/processor-sdk/processor-sdk-linux.git
Branch: branch:processor-sdk-linux-04.03.00
Config file: linux-cloudwsn-default U-boot configuration:
Repository: git://git.ti.com/ti-u-boot/ti-u-boot.git
Branch: branch:ti-u-boot-2017.01
Config file: am335x_iotx3_config Partitioning configuration:
Root partition type: ext4
Boot partition type: (none)
User provided boot partition size: 0
Offset: 4 CPU configuration:
- with interactive
Displaying message: Downloading sources info
Displaying message: Checking git sources u-boot-am335x ti-u-boot-2017.01 info

 继续回到/ib/mian.sh当中

 # optimize build time with % CPU usage
CPUS=$(grep -c 'processor' /proc/cpuinfo)
if [[ $USEALLCORES != no ]]; then
CTHREADS="-j$(($CPUS + $CPUS/2))"
else
CTHREADS="-j1"
fi start=`date +%s`

219-225行的代码用来判断是否满负荷编译代码

227行,将编译的起始秒数保存至start变量当中。

接着看lib/main.sh脚本:

 [[ $CLEAN_LEVEL == *sources* ]] && cleaning "sources"

 # ignore updates help on building all images - for internal purposes
# fetch_from_repo <url> <dir> <ref> <subdir_flag>
if [[ $IGNORE_UPDATES != yes ]]; then
display_alert "Downloading sources" "" "info"
fetch_from_repo "$BOOTSOURCE" "$BOOTDIR" "$BOOTBRANCH" "yes"
fetch_from_repo "$KERNELSOURCE" "$KERNELDIR" "$KERNELBRANCH" "yes"
if [[ -n $ATFSOURCE ]]; then
fetch_from_repo "$ATFSOURCE" "$ATFDIR" "$ATFBRANCH" "yes"
fi
fetch_from_repo "https://github.com/linux-sunxi/sunxi-tools" "sunxi-tools" "branch:master"
fetch_from_repo "https://github.com/rockchip-linux/rkbin" "rkbin-tools" "branch:29mirror"
fetch_from_repo "https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell" "marvell-tools" "branch:A3700_utils-armada-17.10"
fetch_from_repo "https://github.com/armbian/odroidc2-blobs" "odroidc2-blobs" "branch:master"
fi if [[ $BETA == yes ]]; then
IMAGE_TYPE=nightly
elif [[ $BETA != "yes" && $BUILD_ALL == yes && -n $GPG_PASS ]]; then
IMAGE_TYPE=stable
else
IMAGE_TYPE=user-built
fi

228-252行代码:主要是用于通过git 拉取相关的代码。相关的源代码会保存至caach/sources 目录下面,如下所示, 默认的IMAGE_TYPE=user-built

cache/sources$ ls -al
total
drwxrwxr-x root root 1月 : .
drwxrwxr-x root sudo 1月 : ..
drwxrwxr-x root root 1月 : armbian-config
drwxrwxr-x root root 1月 : armbian-firmware
drwxrwxr-x root root 1月 : armbian-firmware-full
drwxrwxr-x root root 1月 : armbian-firmware-git
drwxrwxr-x root root 1月 : hostapd-cloudwsn
drwxrwxr-x root root 1月 : linux-am335x
drwxrwxr-x root root 1月 : marvell-tools
drwxrwxr-x root root 1月 : odroidc2-blobs
drwxrwxr-x root root 1月 : rkbin-tools
drwxrwxr-x root root 1月 : rs485-cloudwsn
drwxrwxr-x root root 1月 : rt8188eu
drwxrwxr-x root root 1月 : sunxi-tools
drwxrwxr-x root root 1月 : u-boot-am335x

继续阅读lib/main.sh

 compile_sunxi_tools
install_rkbin_tools

这两个工具在自已配置的板子上面是用不到的,所示跳过不分析。

这个跟厂家的镜像打包有关系统,比如rockchip的RK3328 会通过rkbin_tools工具将其uboot kernel rootfs,打包成GPT格式的镜像。

通过dd命令或者通过带校验功能的etcher命令进行烧录。

继续阅读lib/main.sh  257行开始:

 BOOTSOURCEDIR=$BOOTDIR/${BOOTBRANCH##*:}
LINUXSOURCEDIR=$KERNELDIR/${KERNELBRANCH##*:}
[[ -n $ATFSOURCE ]] && ATFSOURCEDIR=$ATFDIR/${ATFBRANCH##*:} # define package names
DEB_BRANCH=${BRANCH//default}
# if not empty, append hyphen
DEB_BRANCH=${DEB_BRANCH:+${DEB_BRANCH}-}
CHOSEN_UBOOT=linux-u-boot-${DEB_BRANCH}${BOARD}
CHOSEN_KERNEL=linux-image-${DEB_BRANCH}${LINUXFAMILY}
CHOSEN_ROOTFS=linux-${RELEASE}-root-${DEB_BRANCH}${BOARD}
CHOSEN_DESKTOP=armbian-${RELEASE}-desktop
CHOSEN_KSRC=linux-source-${BRANCH}-${LINUXFAMILY}

相关的变量如下所示:

BOOTSOURCEDIR=u-boot-am335x/ti-u-boot-2017.01
LINUXSOURCEDIR=linux-am335x/processor-sdk-linux-04.03.00

CHOSE_UBOOT=linux-u-boot-iotx-3
CHOSE_KERNEL=linux-image-cloudwsn
CHOSE_ROOTFS=linux--root-iotx-3
CHOSE_DESKTOP=armbian--desktop
CHOSE_KSRC=linux-source-default-cloudwsn

继续阅读lib/main.sh

 # Compile u-boot if packed .deb does not exist
if [[ ! -f $DEST/debs/${CHOSEN_UBOOT}_${REVISION}_${ARCH}.deb ]]; then
if [[ -n $ATFSOURCE ]]; then
compile_atf
fi
compile_uboot
fi # Compile kernel if packed .deb does not exist
if [[ ! -f $DEST/debs/${CHOSEN_KERNEL}_${REVISION}_${ARCH}.deb ]]; then
compile_kernel
fi

上述的代码主要是判断uboot kernel 的deb包是否存在,否则的话就通过shell函数 compile_uboot compile_kernel进行编译。

我们先来看一下compile_boot

先跳至在 lib/compilation.sh:当中,里面有compile_uboot的实现,然后再回到/lib/main.sh脚本当中

compile_uboot()。

在下一章节我们会来好好分析compile_uboot的编译过程。

learning armbian steps(10) ----- armbian 源码分析(五)的更多相关文章

  1. kernel 3.10内核源码分析--hung task机制

    kernel 3.10内核源码分析--hung task机制 一.相关知识: 长期以来,处于D状态(TASK_UNINTERRUPTIBLE状态)的进程 都是让人比较烦恼的问题,处于D状态的进程不能接 ...

  2. 多线程高并发编程(10) -- ConcurrentHashMap源码分析

    一.背景 前文讲了HashMap的源码分析,从中可以看到下面的问题: HashMap的put/remove方法不是线程安全的,如果在多线程并发环境下,使用synchronized进行加锁,会导致效率低 ...

  3. Vue系列---理解Vue.nextTick使用及源码分析(五)

    _ 阅读目录 一. 什么是Vue.nextTick()? 二. Vue.nextTick()方法的应用场景有哪些? 2.1 更改数据后,进行节点DOM操作. 2.2 在created生命周期中进行DO ...

  4. ABP源码分析五:ABP初始化全过程

    ABP在初始化阶段做了哪些操作,前面的四篇文章大致描述了一下. 为个更清楚的描述其脉络,做了张流程图以辅助说明.其中每一步都涉及很多细节,难以在一张图中全部表现出来.每一步的细节(会涉及到较多接口,类 ...

  5. MPTCP 源码分析(五) 接收端窗口值

    简述:      在TCP协议中影响数据发送的三个因素分别为:发送端窗口值.接收端窗口值和拥塞窗口值. 本文主要分析MPTCP中各个子路径对接收端窗口值rcv_wnd的处理.   接收端窗口值的初始化 ...

  6. vuex 源码分析(五) action 详解

    action类似于mutation,不同的是Action提交的是mutation,而不是直接变更状态,而且action里可以包含任意异步操作,每个mutation的参数1是一个对象,可以包含如下六个属 ...

  7. jQuery 源码分析(五) map函数 $.map和$.fn.map函数 详解

    $.map() 函数用于使用指定函数处理数组中的每个元素(或对象的每个属性),并将处理结果封装为新的数组返回,该函数有三个参数,如下: elems Array/Object类型 指定的需要处理的数组或 ...

  8. Vue.js 源码分析(五) 基础篇 方法 methods属性详解

    methods中定义了Vue实例的方法,官网是这样介绍的: 例如:: <!DOCTYPE html> <html lang="en"> <head&g ...

  9. python成长之路10——socketserver源码分析

    s = socket.socket(socket.AF_INET,socket.SOCK_STREAM,0) 参数一:地址簇 socket.AF_INET ipv4(默认) socket.AF_INE ...

  10. java动态代理——代理方法的假设和验证及Proxy源码分析五

    前文地址 https://www.cnblogs.com/tera/p/13419025.html 本系列文章主要是博主在学习spring aop的过程中了解到其使用了java动态代理,本着究根问底的 ...

随机推荐

  1. PDO简单的DB类封装

    <?php class DB{ private $dbs = ""; private $fields = "*"; private $tables = n ...

  2. python中while循环打印星星的四种形状

    在控制台连续输出五行*,每一行星号数量一次递增 * ** *** **** ***** #1.定义一个行计数器 row = 1 while row <= 5: #定义一个列计数器 col = 1 ...

  3. PyQt5创建多线程

    参阅: https://blog.csdn.net/chengmo123/article/details/96477103 https://www.cnblogs.com/zhuminghui/p/9 ...

  4. Guava -- 集合类 和 Guava Cache

    Guava -- 集合类 和 Guava Caches 1. 什么是 Guava Guava 是 google 推出的一个第三方 java 库,用来代替 jdk 的一些公共操作,给我印象特别深的就是 ...

  5. C语言写郑州大学校友通讯录

    #include <stdio.h> #include <string.h> #include <stdlib.h> #define LEN sizeof(stru ...

  6. Python实现串口通信(pyserial)

    pyserial模块封装了对串口的访问,兼容各种平台. 安装 pip insatll pyserial 初始化 简单初始化示例 import serial ser = serial.Serial('c ...

  7. 渗透测试平台Vulnreport介绍与使用

    渗透测试平台Vulnreport介绍与使用   在这篇文章中,我们将跟大家讨论一些关于渗透测试方面的内容,并给大家介绍一款名叫Vulnreport的新型开源工具,而这款工具将能够让任何场景下的渗透测试 ...

  8. vim 绑定到 source insight 快捷键

    1. optioons -> custom commands 2. 选择然后写入run命令: "D:\Program Files (x86)\Vim\vim74\gvim.exe&qu ...

  9. Binlog_master

    二进制日志 记录导致数据改变或潜在导致数据改变的SQL语句 记录已提交的日志 不依赖于存储引擎类型 功能:通过"重放"日志文件中的事件来生成数据副本 注意:建议二进制日志和数据文件 ...

  10. JS笔记02

    回顾: html: 超文本标记语言 后缀名: *.html 或 *.htm 标签分类: 围堵标签: 双标签 <html>标签体</html> 空标签: 单标签 <br/& ...