生成boot.scr
boot.cmd 文件内容
setenv bootdelay 0
setenv bootargs "console=ttyS0,115200 panic=5 rootwait root=/dev/ram0 rdinit=/linuxrc earlyprintk rw"
bootz 0x41000000 0x41A00000 0x41800000```
mkimage -C none -A arm -T script -d boot.cmd boot.scr
制作rootfs.cpio.gz.uboot
cpio 打包操作:
find . | cpio -o -H newc | gzip > ${myDIR}/rootfs.cpio.gz
mkimage -A arm -T ramdisk -C none -n uInitrd -d rootfs.cpio.gz rootfs.cpio.gz.uboot
cpio 解包操作:
gunzip initramfs.cpio.gz
cpio -idmv < initramfs.cpio
v3s run in ram
sudo sunxi-fel -p -v uboot u-boot-sunxi-with-spl.bin \
write 0x41000000 zImage \
write 0x41800000 sun8i-v3s-licheepi-zero-dock.dtb \
write 0x41900000 boot.scr \
write 0x41A00000 rootfs.cpio.uboot
mkimage 的用法
Usage: mkimage -l image
-l ==> list image header information
mkimage [-x] -A arch -O os -T type -C comp -a addr -e ep -n name -d data_file[:data_file...] image
-A ==> set architecture to 'arch'
-O ==> set operating system to 'os'
-T ==> set image type to 'type'
-C ==> set compression type 'comp'
-a ==> set load address to 'addr' (hex)
-e ==> set entry point to 'ep' (hex)
-n ==> set image name to 'name'
-d ==> use image data from 'datafile'
-x ==> set XIP (execute in place)
mkimage [-D dtc_options] [-f fit-image.its|-f auto|-F] [-b <dtb> [-b <dtb>]] [-i <ramdisk.cpio.gz>] fit-image
<dtb> file is used with -f auto, it may occur multiple times.
-D => set all options for device tree compiler
-f => input filename for FIT source
-i => input filename for ramdisk file
Signing / verified boot options: [-E] [-B size] [-k keydir] [-K dtb] [ -c <comment>] [-p addr] [-r] [-N engine]
-E => place data outside of the FIT structure
-B => align size in hex for FIT structure and header
-k => set directory containing private keys
-K => write public keys to this .dtb file
-c => add comment in signature node
-F => re-sign existing FIT image
-p => place external data at a static position
-r => mark keys used as 'required' in dtb
-N => openssl engine to use for signing
mkimage -V ==> print version information and exit
Use '-T list' to see a list of available image types
Invalid image type, supported are:
aisimage Davinci AIS image
atmelimage ATMEL ROM-Boot Image
copro Coprocessor Image
filesystem Filesystem Image
firmware Firmware
firmware_ivt Firmware with HABv4 IVT
flat_dt Flat Device Tree
fpga FPGA Image
gpimage TI Keystone SPL Image
imx8image NXP i.MX8 Boot Image
imx8mimage NXP i.MX8M Boot Image
imximage Freescale i.MX Boot Image
invalid Invalid Image
kernel Kernel Image
kernel_noload Kernel Image (no loading done)
kwbimage Kirkwood Boot Image
lpc32xximage LPC32XX Boot Image
mtk_image MediaTek BootROM loadable Image
multi Multi-File Image
mxsimage Freescale MXS Boot Image
omapimage TI OMAP SPL With GP CH
pblimage Freescale PBL Boot Image
pmmc TI Power Management Micro-Controller Firmware
ramdisk RAMDisk Image
rkimage Rockchip Boot Image
rksd Rockchip SD Boot Image
rkspi Rockchip SPI Boot Image
script Script
socfpgaimage Altera SoCFPGA CV/AV preloader
socfpgaimage_v1 Altera SoCFPGA A10 preloader
standalone Standalone Program
stm32image STMicroelectronics STM32 Image
tee Trusted Execution Environment Image
ublimage Davinci UBL image
vybridimage Vybrid Boot Image
x86_setup x86 setup.bin
zynqimage Xilinx Zynq Boot Image
zynqmpbif Xilinx ZynqMP Boot Image (bif)
zynqmpimage Xilinx ZynqMP Boot Image