这里会显示出您选择的修订版和当前版本之间的差别。
jaysnote:pack_tool [2018/12/18 19:34] jaylee |
jaysnote:pack_tool [2021/06/22 23:14] |
||
---|---|---|---|
行 1: | 行 1: | ||
- | < | ||
- | |||
- | # pack tool | ||
- | |||
- | 编译打包相关脚本文件。 | ||
- | |||
- | ```bash | ||
- | vim -p build.sh buildroot/ | ||
- | ``` | ||
- | |||
- | |||
- | ## boot0 | ||
- | |||
- | * 拷贝`tools/ | ||
- | |||
- | ```bash | ||
- | # | ||
- | boot_file_list=( | ||
- | chips/ | ||
- | ) | ||
- | # | ||
- | for file in ${boot_file_list[@]} ; do | ||
- | cp -f `echo $file | awk -F: ' | ||
- | `echo $file | awk -F: ' | ||
- | done | ||
- | ``` | ||
- | |||
- | * 通过sys_config.bin 更新boot0,最终生成boot0_sdcard.fex。 | ||
- | |||
- | ``` | ||
- | # | ||
- | update_boot0 boot0_sdcard.fex | ||
- | ``` | ||
- | |||
- | ## u-boot | ||
- | |||
- | ```bash | ||
- | $./build.sh -p sun50iw1p1 | ||
- | ``` | ||
- | |||
- | * `brandy/ | ||
- | |||
- | * tools/ | ||
- | |||
- | ```bash | ||
- | # | ||
- | boot_file_list=( | ||
- | chips/ | ||
- | ) | ||
- | ``` | ||
- | |||
- | ```bash | ||
- | # | ||
- | for file in ${boot_file_list[@]} ; do | ||
- | cp -f `echo $file | awk -F: ' | ||
- | `echo $file | awk -F: ' | ||
- | done | ||
- | ``` | ||
- | |||
- | * 通过sys_config更新uboot 文件头的元数据; | ||
- | |||
- | ```bash | ||
- | update_uboot u-boot.fex sys_config.bin > /dev/null | ||
- | ``` | ||
- | * 合并monitor.fex、scp.fex、sunxi.fex | ||
- | |||
- | ```bash | ||
- | merge_uboot u-boot.fex monitor.fex u-boot.fex secmonitor | ||
- | merge_uboot u-boot.fex scp.fex u-boot.fex scp | ||
- | ``` | ||
- | |||
- | ```bash | ||
- | # | ||
- | update_uboot_fdt u-boot.fex sunxi.fex u-boot.fex | ||
- | ``` | ||
- | |||
- | > **提示**:monitor.fex、scp.fex 直接位应用,sunxi.fex 为sys_config.fex 最终文件,参考[sys_config](# | ||
- | |||
- | ## sys_config | ||
- | |||
- | sys_config 是全志 sunxi的配置脚本,区别linux kernel的dts,但是会作用于dts,以下梳理其完整链路。 | ||
- | |||
- | * 应用sys_config.fex,通过dts生成sunxi.dtb; | ||
- | |||
- | ```bash | ||
- | local DTC_INI_FILE_BASE=${LICHEE_OUT}/ | ||
- | local DTC_INI_FILE=${LICHEE_OUT}/ | ||
- | cp $DTC_INI_FILE_BASE $DTC_INI_FILE | ||
- | $DTC_COMPILER -O dtb -o ${LICHEE_OUT}/ | ||
- | -b 0 \ | ||
- | -i $DTC_SRC_PATH | ||
- | -F $DTC_INI_FILE | ||
- | -d $DTC_DEP_FILE $DTC_SRC_FILE | ||
- | ``` | ||
- | |||
- | * 通过生成sys_config.bin 拷贝config.fex,sys_config.bin 用以后面的其他文件更新,config.fex暂时未发现使用; | ||
- | |||
- | ```bash | ||
- | busybox unix2dos sys_config.fex | ||
- | script | ||
- | cp -f | ||
- | ``` | ||
- | |||
- | * 使用sys_config.bin 更新boot0、uboot、fes1、toc0。 | ||
- | |||
- | ```bash | ||
- | update_boot0 boot0_spinor.fex | ||
- | update_uboot u-boot-spinor.fex | ||
- | | ||
- | update_boot0 boot0_nand.fex | ||
- | update_boot0 boot0_sdcard.fex | ||
- | update_uboot u-boot.fex | ||
- | update_fes1 | ||
- | update_toc0 | ||
- | ``` | ||
- | |||
- | ## dts | ||
- | |||
- | * 应用sys_config.fex 通过dts生成sunxi.dtb | ||
- | |||
- | ```bash | ||
- | $DTC_COMPILER -O dtb -o ${LICHEE_OUT}/ | ||
- | -b 0 \ | ||
- | -i $DTC_SRC_PATH | ||
- | -F $DTC_INI_FILE | ||
- | -d $DTC_DEP_FILE $DTC_SRC_FILE | ||
- | ``` | ||
- | |||
- | > **提示**:使用sys_config 主要是更新dts中的`status` 。 | ||
- | |||
- | * 拷贝生成 sunxi.fex 合并到uboot | ||
- | |||
- | ```bash | ||
- | # | ||
- | update_uboot_fdt u-boot.fex sunxi.fex u-boot.fex | ||
- | ``` | ||
- | |||
- | ```bash | ||
- | hexdump -C -n 1000 | ||
- | hexdump -C -n 1000 -s 0xda800 | ||
- | ``` | ||
- | |||
- | ## boot-resouce | ||
- | |||
- | boot-resource为用以uboot引导的一些资源文件,主要是包含一些背景图片。 | ||
- | |||
- | * 背景图bootlogo.bmp | ||
- | |||
- | ``` | ||
- | ../ | ||
- | ../ | ||
- | ``` | ||
- | |||
- | 整合资源文件后生成boot-resource.fex 和boot-resouce.ini 之后通过fat16 文件系统写入/ | ||
- | |||
- | ## | ||
- | |||
- | boot.img 为安卓引导的内核格式,其主要包含描述镜像的文件头和可执行的kernel和ramdisk。相信参考[android boot image](http:// | ||
- | |||
- | linux-3.10/ | ||
- | |||
- | ```bash | ||
- | #" | ||
- | if [ ${bss_sz} -gt $((16# | ||
- | | ||
- | else | ||
- | | ||
- | fi | ||
- | # | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | -o output/ | ||
- | ``` | ||
- | |||
- | pack打包工具未对镜像做任何处理,软连接到了boot.fex。 | ||
- | |||
- | ```bash | ||
- | ln -s ${LICHEE_OUT}/ | ||
- | ``` | ||
- | |||
- | ## rootfs | ||
- | |||
- | rootfs 的制作通过build.sh moudle=all 制作,会选择`buildroot/ | ||
- | |||
- | ```bash | ||
- | OUT_PATH=" | ||
- | #" | ||
- | buildroot/ | ||
- | cp -v rootfs.ext4 $OUT_PATH/ | ||
- | ``` | ||
- | |||
- | pack打包工具未对镜像做任何处理,软连接到了rootfs.fex。 | ||
- | |||
- | ```bash | ||
- | ln -s ${LICHEE_OUT}/ | ||
- | ``` | ||
- | |||
- | </ | ||
- | |||
- | |||