post-image.sh hacking
#*********************************************************************************
#* post-image.sh hacking
#* 说明:
#* 分析i.MX6 post-images.sh合成SD card工作原理。
#*
#* -- 深圳 宝安西乡 曾剑锋
#********************************************************************************/ # 一、参考文档:
# . Linux mktemp命令
# http://www.runoob.com/linux/linux-comm-mktemp.html
# . Genimage - The Image Creation Tool
# https://github.com/pengutronix/genimage #!/usr/bin/env bash #
# dtb_list extracts the list of DTB files from BR2_LINUX_KERNEL_INTREE_DTS_NAME
# in ${BR_CONFIG}, then prints the corresponding list of file names for the
# genimage configuration file
#
dtb_list()
{
local DTB_LIST="$(sed -n 's/^BR2_LINUX_KERNEL_INTREE_DTS_NAME="\([a-z0- \-]*\)"$/\1/p' ${BR2_CONFIG})" for dt in $DTB_LIST; do
echo -n "\"$dt.dtb\", "
done
} #
# linux_image extracts the Linux image format from BR2_LINUX_KERNEL_UIMAGE in
# ${BR_CONFIG}, then prints the corresponding file name for the genimage
# configuration file
#
linux_image()
{
if grep -Eq "^BR2_LINUX_KERNEL_UIMAGE=y$" ${BR2_CONFIG}; then
echo "\"uImage\""
else
echo "\"zImage\""
fi
} main()
{
# 获取dtb和linux image
local FILES="$(dtb_list) $(linux_image)"
# 创建配置文件文件
local GENIMAGE_CFG="$(mktemp --suffix genimage.cfg)"
local GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp" # 替换掉cfg模板文件中的FILES字段
sed -e "s/%FILES%/${FILES}/" \
board/freescale/common/imx/genimage.cfg.template > ${GENIMAGE_CFG} # 可能存在上次的暂存目录,删除
rm -rf "${GENIMAGE_TMP}" #
# outputpath: default: images Mandatory path where all images are written to (must exist).
# inputpath: default: input This mandatory path is searched for input images, for example bootloader binaries, kernel images (must exist).
# rootpath: default: root Mandatory path to the root filesystem (must exist).
# tmppath: default: tmp Optional path to a temporary directory. There must be enough space available here to hold a copy of the root filesystem.
# config: default: genimage.cfg Path to the genimage config file.
#
# ${TARGET_DIR} = /home/zengjf/zengjf/Buildroot/buildroot/output/target
# ${GENIMAGE_TMP} = /home/zengjf/zengjf/Buildroot/buildroot/output/build/genimage.tmp
# ${BINARIES_DIR} = /home/zengjf/zengjf/Buildroot/buildroot/output/images
# ${BINARIES_DIR} = /home/zengjf/zengjf/Buildroot/buildroot/output/images
# ${GENIMAGE_CFG} = /tmp/tmp.1Kks4kDC5mgenimage.cfg
#
genimage \
--rootpath "${TARGET_DIR}" \
--tmppath "${GENIMAGE_TMP}" \
--inputpath "${BINARIES_DIR}" \
--outputpath "${BINARIES_DIR}" \
--config "${GENIMAGE_CFG}" // 删除配置文件
rm -f ${GENIMAGE_CFG} exit $?
} main $@
post-image.sh hacking的更多相关文章
- Woobuntu woobuntu_build.sh hacking
# Woobuntu woobuntu_build.sh hacking # 说明: # 有时候因为一些需求,我们需要定制一些系统,包括Ubuntu系统,于是 # 我们自然需要知道如何去解包一个Ubu ...
- OK335xS psplash make-image-header.sh hacking
/***************************************************************************** * OK335xS psplash mak ...
- ti processor sdk linux am335x evm setup.sh hacking
#!/bin/sh # # ti processor sdk linux am335x evm setup.sh hacking # 说明: # 本文主要对TI的sdk中的setup.sh脚本进行解读 ...
- ti processor sdk linux am335x evm /bin/setup-host-check.sh hacking
#!/bin/sh # # ti processor sdk linux am335x evm /bin/setup-host-check.sh hacking # 说明: # 本文主要对TI的sdk ...
- ti processor sdk linux am335x evm /bin/create-sdcard.sh hacking
#!/bin/bash # # ti processor sdk linux am335x evm /bin/create-sdcard.sh hacking # 说明: # 本文主要对TI的sdk中 ...
- ti processor sdk linux am335x evm /bin/unshallow-repositories.sh hacking
#!/bin/bash # # ti processor sdk linux am335x evm /bin/unshallow-repositories.sh hacking # 说明: # 本文主 ...
- ti processor sdk linux am335x evm /bin/setup-package-install.sh hacking
#!/bin/sh # # ti processor sdk linux am335x evm /bin/setup-package-install.sh hacking # 说明: # 本文主要对T ...
- ti processor sdk linux am335x evm /bin/setup-uboot-env.sh hacking
#!/bin/sh # # ti processor sdk linux am335x evm /bin/setup-uboot-env.sh hacking # 说明: # 本文主要对TI的sdk中 ...
- ti processor sdk linux am335x evm /bin/setup-minicom.sh hacking
#!/bin/sh # # ti processor sdk linux am335x evm /bin/setup-minicom.sh hacking # 说明: # 本文主要对TI的sdk中的s ...
- ti processor sdk linux am335x evm /bin/setup-targetfs-nfs.sh hacking
#!/bin/sh # # ti processor sdk linux am335x evm /bin/setup-targetfs-nfs.sh hacking # 说明: # 本文主要对TI的s ...
随机推荐
- dp 入门
1.HDU 1003 求最长连续相加的和. dp[i]=max(a[i],dp[i-1]+a[i]); dp[i]表示以 i 结尾的最大值. 再开/个strat去标记从哪里开始. #include & ...
- JQuary中的FullPage属性的用法
$(document).ready(function(){ //常用方法 //$.fn.fullpage.moveSectionUp() //向上滚动一页 //$.fn.fullpage.m ...
- 如何将两个字段合成一个字段显示(oracle和sqlserver的区别)
oracle中,如何将两个字段数据合并成一个字段显示,接下来看一下在sql server和pl/sql的区别 sql server中如何合并(用Cast()函数) --1.创建模拟的数据表--- cr ...
- vue项目如何打包前后端不分离发布手把手教学apache、nginx
vue项目如何不分离发布 1.首先yarn build 我用了vue-cli脚手架,bulid后的dist文件夹里的index.html有加版本号,那么为什么需要加版本号呢? a.回滚 b.解决浏览器 ...
- laravel中判断当前页面与连接地址是否一致,并添加效果:
- MAVEN 自定义骨架
1)根据原由的骨架先创建出一个骨架模板,例如创建一个web框架可以先通过命令 mvn archetype:generate -DarchetypeCatalog=internal 创建出一个web的 ...
- WPS处理个人信息一种方法
下面是WPS处理个人信息的方法,具体步骤如下: 第一步:任意打开一个文件: 第二步:点击左上角WPS的小三角,找到工具——选项,如图: 第三步:进入选项后,点击用户信息: 第四步:修改个人信息,用户名 ...
- 升级pip10.0.0后出现ModuleNotFoundError: No module named 'pip'的问题
pip10升级后各种pip install出错----- Traceback (most recent call last): File "/usr/local/bin/pip", ...
- 安装连接mysql8时候遇到的问题以及解决(转)
官网下载mysql8的安装包: https://dev.mysql.com/downloads/ 下一步安装即可. mysql8增加了传说中的安全性校验 遇到的几个问题: 1.natcat连接不上.参 ...
- SharePoint REST API - 概述
博客地址:http://blog.csdn.net/FoxDave SharePoint REST API不同于传统的Server Object Model和Client Object Model ...