【问题标题】:Yocto Initramfs Transaction Error adding cryptsetup packageYocto Initramfs Transaction Error 添加 cryptsetup 包
【发布时间】:2020-01-25 16:00:02
【问题描述】:

我在 Ubuntu 18.04 LTS 和 meta-tegra 层 (https://github.com/madisongh/meta-tegra) 上使用 Yocto Warrior 为我的 NVIDIA Jetson Nano 构建根文件系统。

我想加密我的 SD 卡上的某个分区,所以我需要 openembedded 层中可用的 cryptsetup 包。我已经将它添加到我的图像中,并且生成的根文件系统已安装它。

问题是我需要将它添加到我的 initramfs 以便在启动时自动解密我的加密卷。

我得到的错误显示为:

Transaction Summary
================================================================================
Install  50 Packages

Total size: 13 M
Installed size: 52 M
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Error: Transaction check error:
  file /proc conflicts between attempted installs of tegra-minimal-init-1.0-r0.aarch64 and base-files-3.0.14-r89.jetson_nano
  file /sys conflicts between attempted installs of tegra-minimal-init-1.0-r0.aarch64 and base-files-3.0.14-r89.jetson_nano

Error Summary
-------------

我将 cryptsetup 添加到我的 bbappend 文件中,用于 initramfs 配方,如下所示(显示的是整个 bbappend 文件):

PACKAGE_INSTALL_append = " e2fsprogs-e2fsck e2fsprogs-mke2fs e2fsprogs-tune2fs e2fsprogs-badblocks"
PACKAGE_INSTALL_append = " i2c-tools"
PACKAGE_INSTALL_append = " openssl"
PACKAGE_INSTALL_append = " cryptsetup"

如果我注释掉 cryptsetup 行,initramfs 任务完成就好了。

这是来自 meta-tegra 的 initramfs 的未附加原始配方文件:

DESCRIPTION = "Minimal initramfs image for Tegra platforms"
LICENSE = "MIT"

TEGRA_INITRD_INSTALL ??= ""
INITRD_FSTYPES ??= "${INITRAMFS_FSTYPES}"

PACKAGE_INSTALL = "\
    tegra-firmware-xusb \
    tegra-minimal-init \
    ${TEGRA_INITRD_INSTALL} \
"

IMAGE_FEATURES = ""
IMAGE_LINGUAS = ""

COPY_LIC_MANIFEST = "0"
COPY_LIC_DIRS = "0"

COMPATIBLE_MACHINE = "(tegra)"

KERNELDEPMODDEPEND = ""

IMAGE_ROOTFS_SIZE = "8192"
#IMAGE_ROOTFS_SIZE = "16384"

inherit core-image

IMAGE_FSTYPES = "${INITRD_FSTYPES}"


如何成功地将 cryptsetup 添加到 initramfs 配方?谢谢。

【问题讨论】:

    标签: linux embedded-linux yocto bitbake initramfs


    【解决方案1】:

    我收到了完全相同的错误消息,但它是由不同的配方(不是 cryptsetup,而是一些自定义配方)触发的。

    问题是配方 (tegra-minimal-init_1.0.bb) 和 base-files_3.0.14.bb 都尝试创建 '/sys 和 '/proc' 目录,但具有不同的权限(一个具有 0755,另一个具有 0555)。

    解决它的方法是简单地删除 tegra-minimal-init_1.0.bb 中的目录创建:

    [eliranl@somehost]$ git diff
    diff --git a/meta-tegra/recipes-core/initrdscripts/tegra-minimal-init_1.0.bb b/meta-tegra/recipes-core/initrdscripts/tegra-minimal-init_1.0.bb
    index ac16ff1..e7021bb 100644
    --- a/meta-tegra/recipes-core/initrdscripts/tegra-minimal-init_1.0.bb
    +++ b/meta-tegra/recipes-core/initrdscripts/tegra-minimal-init_1.0.bb
    @@ -12,7 +12,7 @@ S = "${WORKDIR}"
     
     do_install() {
         install -m 0755 ${WORKDIR}/init-boot.sh ${D}/init
    -    install -d ${D}/proc ${D}/sys ${D}/dev ${D}/tmp ${D}/mnt ${D}/run ${D}/usr
    +    install -d ${D}/dev ${D}/tmp ${D}/mnt ${D}/run ${D}/usr
         mknod -m 622 ${D}/dev/console c 5 1
         install -d ${D}${sysconfdir}
         if [ -e ${WORKDIR}/platform-preboot-cboot.sh ]; then
    

    或者,您可以升级到“dunfell”,因为它已通过更改 tegra-minimal-init_1.0.bb 以创建具有与基本文件中相同权限的“/proc”和“/sys”来修复,或者只需从the specific commit 向后移植这部分:

    -    install -d ${D}/proc ${D}/sys ${D}/dev ${D}/tmp ${D}/mnt ${D}/run ${D}/usr
    +    install -m 0555 -d ${D}/proc ${D}/sys
    +    install -m 0755 -d ${D}/dev ${D}/mnt ${D}/run ${D}/usr
    +    install -m 1777 -d ${D}/tmp
    

    【讨论】:

      猜你喜欢
      • 2020-05-25
      • 2018-11-01
      • 2021-11-09
      • 2016-06-01
      • 2018-07-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多