genimage.cfg.template hacking

#*********************************************************************************
#*                     genimage.cfg.template hacking
#* 说明:
#*     分析i.MX6 genimage.cfg.template模板配置原理。
#*
#*                                              2018-1-23 深圳 宝安西乡 曾剑锋
#********************************************************************************/

# 一、参考文档:
#    1. Genimage - The Image Creation Tool
#        https://github.com/pengutronix/genimage

# Minimal SD card image for the Freescale boards Template
#
# We mimic the .sdcard Freescale's image format:
# * the SD card must have 1 kB free space at the beginning,
# * U-Boot is dumped as is,
# * a FAT partition at offset 8 MB is containing zImage/uImage and DTB files
# * a single root filesystem partition is required (ext2, ext3 or ext4)
#

# boot分区,vfat格式
image boot.vfat {
  vfat {
    files = {
      %FILES%   # 需要拷贝的文件名称
    }
  }
  size = 16M    # 分区大小
}

image sdcard.img {
  hdimage {
  }

  # 直接拷贝的u-boot文件
  partition u-boot {
    in-partition-table = "no"   # Boolean specifying whether to include this partition in the partition table.
    image = "u-boot.imx"
    offset = 1024
  }

  # 指定分区类型,引用前面定义的boot.vfat分区
  partition boot {
    partition-type = 0xC
    bootable = "true"
    image = "boot.vfat"
    offset = 8M
  }

  # 文件系统分区
  partition rootfs {
    partition-type = 0x83
    image = "rootfs.ext2"
  }
}

 

posted on 2018-01-23 12:02  zengjf  阅读(778)  评论(0编辑  收藏  举报

导航