Yocto将initramfs / initrd映像挂载到Raspberry Pi

时间:2018-05-22 11:02:36

标签: linux-kernel raspberry-pi init yocto boot

使用基于Yocto的工具,我可以生成多个文件进行部署。这些涉及:

    用于写入SD卡的
  • sdimg文件
  • cpio.gz存档(Initramfs)
  • Image-initramfs.bin(Initramfs)

我想在我的嵌入式主板(Raspberry Pi)中使用基于Yocto的Linux发行版激活plymouth。但是,我不确定如何挂载cpio.gz存档或Image-initramfs.bin。我在网上看到,vanilla Raspbian在启动分区/config.txt中有initramfs <file.gz> <start_address>条目,/cmdline.txt,启动分区initrd=<file.gz>中的内核命令行选项即cpio.gz。< / p>

到目前为止,我尝试过这两种方法。我将/boot文件复制到根文件系统分区中的 + Boot Partition + ---- overlays/ + ---- config.txt + ---- cmdline.txt + ---- kernel.img + 1.2GB Volume (rootfs) + ---- bin/ + ---- boot/ +--- <file>.cpio.gz + ---- var/ + ---- usr/ .... 并配置上述文件,这些文件无效。要打破它,它的外观如下:

config.txt

现在,在initramfs <file>.cpio.gz 0x00a00000 ramfsfile="<file>.cpio.gz" ramfsaddr=0x00a00000 中,我有类似的东西(尝试过多种变体):

cmdline.txt

initrd=<file>.cpio.gz dwc_otg.lpm_enable=0 console=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait 中,我有:

#> uname -a 
#> Linux raspberrypi0-wifi 4.9.77-rt61 #11 PREEMPT RT Tue May 22 01:14:26 +03 2018 armv6l armv6l armv6l GNU/Linux

但是,内核甚至没有足够的错误。这意味着,系统正常启动,并且没有使用initramfs的迹象。

我用yocto编译的内核如下:

#> modprobe configs
#> cat /proc/config.gz | gunzip > kernelconf.txt
...
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y

启用以下内核配置参数:

date    
01.01.2015                      
01.02.2015                      
01.03.2015                      
01.04.2015                    
01.05.2015                      
01.06.2015                      
01.07.2015                      
01.08.2015                      
01.09.2015                      
01.10.2015                      
01.11.2015                      
01.12.2015                      
02.01.2015                      
02.02.2015                      
02.03.2015                      
02.05.2015                      
02.06.2015 

我不知道我在这里缺少什么。任何引起你注意的事情,请告诉我。任何指导都很受欢迎。

1 个答案:

答案 0 :(得分:1)

通过将生成的.cpio.gz归档文件复制到sd卡的启动分区中,我能够启动到initramfs中。 然后,我从

编辑了config.txt选项。
#initramfs initramf.gz 0x00800000

initramfs <name-of-the-copied-archive>.cpio.gz

在启动树莓之后,它现在会引导到我的initramfs映像中。

相关问题