mkimageでやっていること
このファイルを参考に考えてみる。
create_usb_image.sh
code: txt
The file structure of "misc.img"
-------------------------------------------------------------------------------------------------
| 1byte | 1byte | mbytes | nbytes | 64bytes | |
-------------------------------------------------------------------------------------------------
|bootargs length|bootcmd length|bootargs string|bootcmd string|image header|u-boot|kernel|ramdisk|
-------------------------------------------------------------------------------------------------
m = bootargs length; n = bootcmd length;
u-boot, kernel and ramdisk have their own image header.
./mkimage -n 'U-boot' -A arm -O linux -T firmware -C none -d large_su-boot.bin large_su-boot.img
./mkimage -n 'Ramdisk' -A arm -O linux -T ramdisk -C none -d $ramdisk_name {$ramdisk_name}.img
./mkimage -n 'Misc image' -A arm -O linux -T firmware -C none -d misc.bin misc.temp
で作成される。
kernelの部分は、カーネルを作り次第すぐに作っているように見える(というか、kernelでmake uImageする際にmkimageを呼んでいる)
また、ビルド中に出るmkimgの出力はこんな感じ(kernelのみ?)
code: stdout
Image Name: kernel
Created: Wed May 12 01:05:18 2021
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2515044 Bytes = 2456.10 kB = 2.40 MB
Load Address: 00008000
Entry Point: 00008000