致力于运行Linux内核4.19的Rcar Gen 3入门套件的早期开发。我想在安装主rootfs之前加载初始ramdisk。
下面是我的配置。
内核命令行:
load_dtb=ext4load mmc 0:1 0x48000000 /boot/r8a7796-m3ulcb.dtb
load_initramfs=ext4load mmc 0:1 0x5C3F9520 /boot/initramfs-netboot-image-m3ulcb.ext4.gz
load_ker=ext4load mmc 0:1 0x48080000 /boot/Image
bootargs=console=ttySC0,115200 vmalloc=384M video=HDMI-A-1:1920x1080-32@60 /dev/ram0 ramdisk_size=16384 rw rootfstype=ext4 rootwait quiet
bootcmd=run load_ker; run load_dtb; run load_initramfs; booti 0x48080000 0x5C3F9520:3A6AB6 0x48000000
(基于README.renesas-gen3文档的修改)
启动日志(未完成)
...
[ 2.546095] RAMDISK: gzip image found at block 0
[ 2.551787] RAMDISK: gzip decompressor not configured!
[ 2.557952] Invalid ramdisk decompression routine. Select appropriate config option.
[ 2.565817] Kernel panic - not syncing: Could not decompress initial ramdisk image.
[ 2.573470] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G B 4.14.35-yocto-standard #11
[ 2.582073] Hardware name: Renesas M3ULCB board based on r8a7796 (DT)
[ 2.588506] Call trace:
[ 2.590958] [<ffff000008089af0>] dump_backtrace+0x0/0x3c8
[ 2.596352] [<ffff000008089ecc>] show_stack+0x14/0x20
[ 2.601400] [<ffff000008af8140>] dump_stack+0x9c/0xbc
[ 2.606450] [<ffff0000080ce6e8>] panic+0x11c/0x28c
[ 2.611236] [<ffff000008f51a54>] rd_load_image+0x2e0/0x5d0
[ 2.616713] [<ffff000008f51e5c>] initrd_load+0x50/0x2c8
[ 2.621933] [<ffff000008f51554>] prepare_namespace+0xd8/0x1b8
[ 2.627674] [<ffff000008f50d8c>] kernel_init_freeable+0x208/0x22c
[ 2.633762] [<ffff000008b0aa38>] kernel_init+0x10/0x100
[ 2.638980] [<ffff000008084d20>] ret_from_fork+0x10/0x18
[ 2.644290] SMP: stopping secondary CPUs
[ 2.648208] Kernel Offset: disabled
[ 2.651691] CPU features: 0x1802000
[ 2.655173] Memory Limit: none
[ 2.658226] ---[ end Kernel panic - not syncing: Could not decompress initial ramdisk image.
[ 2.892822] mmc1: new ultra high speed SDR104 SDHC card at address aaaa
[ 2.907083] mmcblk1: mmc1:aaaa SB16G 14.8 GiB
[ 2.915770] mmcblk1: p1
[ 98.363653] random: crng init done
... kernel hung-up.
该错误是由于缺少用于gzip的解压缩工具所致。
事实上,我已经通过内核menuconfig禁用了所有其他压缩方法
#
# Kernel compression mode
#
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_KERNEL_LZO=y
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_DECOMPRESS_GZIP=n
CONFIG_DECOMPRESS_BZIP2=n
CONFIG_DECOMPRESS_LZMA=n
CONFIG_DECOMPRESS_XZ=n
CONFIG_DECOMPRESS_LZO=y
CONFIG_DECOMPRESS_LZ4=n
CONFIG_RD_GZIP=n
CONFIG_RD_BZIP2=n
CONFIG_RD_LZMA=n
CONFIG_RD_XZ=n
CONFIG_RD_LZO=y
CONFIG_RD_LZ4=n
但是我不知道ramdisk仍然是Gzip。我只想保留LZO格式以加快解压缩速度。那么,如何配置以LZO压缩模式构建initRAMFS?