首页 > 解决方案 > 在 Yocto 生成的 initramfs 映像中访问 initramfs-tools 功能

问题描述

我想加载一些内核模块,并在 Plymouth 启动之前激活帧缓冲区访问。这通常使用/etc/initramfs-toolsinitramfs-tools. 但是,当使用 Yocto 构建 initramfs 映像时,没有这样的目录可用。这意味着,据我所知,无论initramfs-tools加载模块和初始化帧缓冲区,都必须在图像中手动完成。initramfs

notro 在https://github.com/notro/fbtft/wiki/Bootsplash中非常细致地解释了我想要完成的任务 。我想做与下面所做的等效的事情:

通过我的研究,我可以找到initramfs-framework-base 包,其中包含一些 initramfs 引导使用的脚本。我认为这可能是一个很好的起点。但是,我不知道如何明确告诉 initramfs 做我想要完成的事情(上面的任务)。

注意:目前,我的 initramfs 映像由以下配方生成:

include recipes-core/images/rpi-basic-image.bb
BASEPACKS = " \
    base-passwd \
    busybox \
    initramfs-live-boot \
    initramfs-framework-base \
    udev \
    ${ROOTFS_BOOTSTRAP_INSTALL} \
"

IMAGE_INSTALL = " ${BASEPACKS} \
                  plymouth plymouth-set-default-theme  \
                "

# Do not pollute the initrd image with rootfs features
IMAGE_FEATURES = "splash"
SPLASH = "plymouth"

IMAGE_LINGUAS = ""
LICENSE = "MIT"

IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
IMAGE_ROOTFS_SIZE = "8192"
IMAGE_OVERHEAD_FACTOR = "1.0"
IMAGE_ROOTFS_EXTRA_SPACE = "0"
IMAGE_ROOTFS_MAXSIZE = "12288"

CMDLINE_append = " quiet splash nomodeset plymouth.ignore-serial-consoles consoleblank=0"

BAD_RECOMMENDATIONS += "busybox-syslog"

另请注意:我正在使用带有 U-boot 引导加载程序的基于 ARMv6 的机器。编译原始文件initramfs-tools(最初是为 Debian 开发的)生成 0 字节图像。我猜这是它的兼容性问题。所以我不得不求助于使用 yocto 的内部工具生成 initramfs。

任何帮助表示赞赏。提前致谢。

标签: linux-kernelinityoctobootinitrd

解决方案


推荐阅读