首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Yocto Initramfs事务错误添加cryptsetup包

Yocto Initramfs事务错误添加cryptsetup包
EN

Stack Overflow用户
提问于 2019-09-25 20:45:35
回答 1查看 334关注 0票数 2

我正在使用Ubuntu18.04LTS上的Yocto Warrior和meta-tegra layer ( https://github.com/madisongh/meta-tegra )为我的NVIDIA Jetson Nano构建一个根文件系统。

我想要加密我的SD卡上的某个分区,所以我需要加密安装包,这是在开放嵌入式层可用。我已经将它添加到我的映像中,并且生成的根文件系统已经安装了它。

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

我得到的错误显示为:

代码语言:javascript
运行
复制
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
-------------

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

代码语言:javascript
运行
复制
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的未附加的原始配方文件:

代码语言:javascript
运行
复制
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配方中?谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-07-08 19:56:45

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

问题是,recipes (tegra-minimal-init_1.0.bb)和base-files_3.0.14.bb都试图创建“/sys”和“/proc”目录,但权限不同(一个权限为0755,另一个权限为0555)。

解决这个问题的方法是删除tegra-minimal-init_1.0.bb中的dir创建:

代码语言:javascript
运行
复制
[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向后移植这一部分

代码语言:javascript
运行
复制
-    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
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58098744

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档