tegra-minimal-initramfs.bb 是否有任何补丁可以防止此错误?

时间:2021-02-07 14:30:16

标签: yocto bitbake nvidia-jetson

我试图按照此链接的说明为 Jetson TX2 构建 core-image-minimal https://developer.ridgerun.com/wiki/index.php?title=Yocto_Support_for_NVIDIA_Jetson_Platforms-Old。 我的构建配置是

Build Configuration:
BB_VERSION           = "1.46.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "aarch64-poky-linux"
MACHINE              = "jetson-tx2"
DISTRO               = "poky"
DISTRO_VERSION       = "3.1.5"
TUNE_FEATURES        = "aarch64 armv8a crc"
TARGET_FPU           = ""
meta-tegra           = "dunfell-l4t-r32.4.3:3b4df1ac05e9f96e0363630c036f5445800af435"
meta                 
meta-poky            
meta-yocto-bsp       = "dunfell:6e89d668246fb37b2217aae7ae57390e793696d8"

但是我遇到了与 tegra-minimal-initramfs 配方相关的错误。

WARNING: tegra-minimal-initramfs-1.0-r0 do_image_complete: KeyError in .
ERROR: tegra-minimal-initramfs-1.0-r0 do_image_complete: Error executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
     0001:
 *** 0002:sstate_report_unihash(d)
     0003:
File: '/home/pc_1175/yocto-tegra/poky-dunfell/meta/classes/sstate.bbclass', lineno: 844, function: sstate_report_unihash
     0840:    report_unihash = getattr(bb.parse.siggen, 'report_unihash', None)
     0841:
     0842:    if report_unihash:
     0843:        ss = sstate_state_fromvars(d)
 *** 0844:        report_unihash(os.getcwd(), ss['task'], d)
     0845:}
     0846:
     0847:#
     0848:# Shell function to decompress and prepare a package for installation
File: '/home/pc_1175/yocto-tegra/poky-dunfell/bitbake/lib/bb/siggen.py', lineno: 555, function: report_unihash
     0551:
     0552:            if "." in self.method:
     0553:                (module, method) = self.method.rsplit('.', 1)
     0554:                locs['method'] = getattr(importlib.import_module(module), method)
 *** 0555:                outhash = bb.utils.better_eval('method(path, sigfile, task, d)', locs)
     0556:            else:
     0557:                outhash = bb.utils.better_eval(self.method + '(path, sigfile, task, d)', locs)
     0558:
     0559:            try:
File: '/home/pc_1175/yocto-tegra/poky-dunfell/bitbake/lib/bb/utils.py', lineno: 420, function: better_eval
     0416:    if extraglobals:
     0417:        ctx = copy.copy(ctx)
     0418:        for g in extraglobals:
     0419:            ctx[g] = extraglobals[g]
 *** 0420:    return eval(source, ctx, locals)
     0421:
     0422:@contextmanager
     0423:def fileslocked(files):
     0424:    """Context manager for locking and unlocking file locks."""
File: '<string>', lineno: 1, function: <module>
  File "<string>", line 1, in <module>

File: '/home/pc_1175/yocto-tegra/poky-dunfell/meta/lib/oe/sstatesig.py', lineno: 593, function: OEOuthashBasic
     0589:
     0590:                update_hash("\n")
     0591:
     0592:            # Process this directory and all its child files
 *** 0593:            process(root)
     0594:            for f in files:
     0595:                if f == 'fixmepath':
     0596:                    continue
     0597:                process(os.path.join(root, f))
File: '/home/pc_1175/yocto-tegra/poky-dunfell/meta/lib/oe/sstatesig.py', lineno: 553, function: process
     0549:                    add_perm(stat.S_IXOTH, 'x')
     0550:
     0551:                if include_owners:
     0552:                    try:
 *** 0553:                        update_hash(" %10s" % pwd.getpwuid(s.st_uid).pw_name)
     0554:                        update_hash(" %10s" % grp.getgrgid(s.st_gid).gr_name)
     0555:                    except KeyError:
     0556:                        bb.warn("KeyError in %s" % path)
     0557:                        raise
Exception: KeyError: 'getpwuid(): uid not found: 1000'

ERROR: Logfile of failure stored in: /home/pc_1175/yocto-tegra/build/tmp/work/jetson_tx2-poky-linux/tegra-minimal-initramfs/1.0-r0/temp/log.do_image_complete.23961
ERROR: Task (/home/pc_1175/yocto-tegra/meta-tegra/recipes-core/images/tegra-minimal-initramfs.bb:do_image_complete) failed with exit code '1'

问题是我之前使用相同的包构建了相同的映像,但没有出现此错误。 当我将 TEGRA_INITRAMFS_INITRD = "0" 添加到 local.conf 文件时,我没有收到此错误,但我想知道它是否会影响我的系统。

1 个答案:

答案 0 :(得分:0)

TLDR; 只需使用 bitbake -c cleansstate tegra-minimal-initramfsbitbake -c cleansstate core-image-minimal 清理图像配方工作目录,以防万一。比构建应该有效,但它可能无法重现。也就是说,也许您每次都必须在构建映像(cleansstatetegra-minimal-initramfs)之前调用这两个 core-image-minimal 命令。

将我的项目(未与 Tegra 连接)迁移到 Yocto 3.2 时,我遇到了同样的问题。问题出在 pseudo 上 - 它是一个 fakeroot 工具,在 Yocto 中用于生成具有正确文件权限的 rootfs(您以普通用户身份运行 bitbake,而不是 root,但获得所有 rootfs属于 root 的文件)。这是 bug 我随补丁一起发布的内容。

但正如我所见,您使用的是 Yocto 3.1.5,所以您的问题有所不同。核心原因是在某些包构建期间(被TEGRA_INITRAMFS_INITRD = "0"排除的那个)pseudo记得,某些文件应该属于用户1000,但是在构建 tegra-minimal-initramfs(initramfs 的生成)期间,在 initramfs 本身中找不到用户 1000...因为只有 root 和一些基本的 Linux 用户。

对于您的问题,如果您离开 TEGRA_INITRAMFS_INITRD = "0",可能会发生任何事情。可能Here 是应用此变量的地方。它在 U-Boot 构建期间使用,看起来它完全关闭了 initramfs 的使用。因此,使用 TEGRA_INITRAMFS_INITRD = "0",您的最终图像将不包含 initramfs 文件。如果设备有一些后备机制可以在没有 initramfs 的情况下启动,看起来你没问题。如果没有 - 尝试 cleansstate