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 ...
随机推荐
- 1.Liunx 文件管理
文件管理命令 1.基本命令:ls .cd .pwd .man 2.文件操作:touch . cp . rm . mv .ln . mkdir . rmdir 3.文件查看:cat .more .les ...
- 浏览器行为模拟之requests、selenium模块
requests模块 前言: 通常我们利用Python写一些WEB程序.webAPI部署在服务端,让客户端request,我们作为服务器端response数据: 但也可以反主为客利用Python的re ...
- time_wait 和 close_wait
tcp 四次握手状态图: 使用以下命令统计 tcp 连接信息: netstat -n |awk '/^tcp/ {++S[$NF]} END {for (a in S) print a, S[a]}' ...
- cmp的值到底是0还是1还是-1的问题
返回值不局限于这三个数返回负数,表示第一个参数小于第二个参数返回整数,表示第一个参数大于第二个参数返回0,表示他们相等
- jQuery封装 写的的确不错 转载
扩展jQuery插件和方法的作用是非常强大的,它可以节省大量开发时间.这篇文章将概述jQuery插件开发的基本知识,最佳做法和常见的陷阱. 入门 编写一个jQuery插件开始于给jQuery.fn加入 ...
- learning ddr mode register MR2
- java的八大排序
public class Sort2 { public static void main(String[] args) { Sort2 sort = new Sort2(); System.out.p ...
- java.lang.UnsatisfiedLinkError:no dll in java.library.path
报错:java.lang.UnsatisfiedLinkError:no dll in java.library.path 参考: Java调用Dll时,会出现no dll in java.libra ...
- 1.DNS基础及域名系统架构
一.域名: IP地址往往难以记忆,所以我们一般使用域名进行管理 www.LinuxCast.net 1.严格的域名最后还有一个".",但一般省略不写 2.域名分为三个部分,用&qu ...
- sqlalchemy(二)简单的连接示例
# -*- coding: utf-8 -*- import sqlalchemy from sqlalchemy import create_engine from sqlalchemy.ext.d ...