linux - INITRAMFS_IMAGE_BUNDLE 上的 Yocto Warrior 和 SD 卡映像上的 Linux 内核映像
问题描述
我正在 Ubuntu 18.04 上使用 Yocto Warriors 构建我的嵌入式 Linux 系统。我有自己的核心图像配方和 initramfs 图像配方。
我一直在阅读文档(https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#var-INITRAMFS_IMAGE)和互联网上的各种帖子,以便提出以下内容在我的 local.conf 中:
# Use the INITRAMFS bundled in kernel
#KERNEL_IMAGETYPE = "Image-initramfs-jetson-nano.bin"
#KERNEL_IMAGE_BASE_NAME = "Image-initramfs-jetson-nano.bin"
#INITRAMFS_LINK_NAME = ""
INITRAMFS_NAME = "Initramfs"
INITRAMFS_IMAGE = "tegra-minimal-initramfs"
INITRAMFS_IMAGE_BUNDLE = "1"
这些行实际上创建了一个 initramfs 内置版本的我的内核,并将其放在名为Image-Initramfs.bin的部署目录中。它比成功启动的Image内核文件略大。所以 Yocto 最终构建了 2 个内核,一个带有 initramfs,一个没有。
ubuntu@ip:~/Desktop/jetson-yocto/build$ du -sh tmp/deploy/images/jetson-nano/Image-Initramfs.bin
36M tmp/deploy/images/jetson-nano/Image-Initramfs.bin
ubuntu@ip:~/Desktop/jetson-yocto/build$ du -sh tmp/deploy/images/jetson-nano/Image--4.9+git0+3c02a65d91-r0-jetson-nano-20190729195650.bin
33M tmp/deploy/images/jetson-nano/Image--4.9+git0+3c02a65d91-r0-jetson-nano-20190729195650.bin
文档说这是通过辅助编译路径完成的:
Controls whether or not the image recipe specified by INITRAMFS_IMAGE is run through an extra pass (do_bundle_initramfs) during kernel compilation in order to build a single binary that contains both the kernel image and the initial RAM filesystem (initramfs) image. This makes use of the CONFIG_INITRAMFS_SOURCE kernel feature.
Note
Using an extra compilation pass to bundle the initramfs avoids a circular dependency between the kernel recipe and the initramfs recipe should the initramfs include kernel modules. Should that be the case, the initramfs recipe depends on the kernel for the kernel modules, and the kernel depends on the initramfs recipe since the initramfs is bundled inside the kernel image.
问题是 Yocto 没有将这个 initramfs 内核安装到最终的 SD 卡映像中。仅安装了非 initramfs 内核。我无法找到有关如何使其安装 initramfs 版本而不是非 initramfs 版本的 Yocto 指令/设置。
我怎样才能做到这一点?谢谢。
解决方案
如果您使用wic
工具生成 SD 卡映像,那么您可以添加如下内容local.conf
`IMAGE_BOOT_FILES_append = " Image-Initramfs.bin;${KERNEL_IMAGETYPE}"`
但是,如果您使用自定义脚本,则必须提供更多信息并自定义 SD 卡生成脚本。
推荐阅读
- ios - 无效的捆绑包 - Info.plist 应指定 CFBundleSupportedPlatforms 与包含单个平台的数组
- c# - 为什么 Authorize.net 正在逐步淘汰基于 MD5 的哈希用于交易?SHA512 哈希算法的使用现在应该可以解决问题吧?
- java - 在 cxf-rt-frontend-jaxrs-3.3.0 中找不到 JAXRSClientFactory
- javascript - 如何从数组中提取字段?
- ios - 在 TableView 中突出显示搜索字母 - ios
- python - scipy.stats 不适用于冷冻房车
- linux - python threading.ident和Linux进程id一样吗?
- c# - .net core 2 如何正确实现存储库
- flutter - 使用 FLutter 创建自定义标签
- active-directory - 无法在 Windows 2008 R2 环境中创建服务帐户