If I build a SDK with api-documentation DISTRO_FEATURE enabled: ERROR: core-image-base-1.0-r0 do_populate_sdk: Postinstall scriptlets of ['alsa-utils-doc', 'kmod-doc', 'libglib-2.0-doc', 'openssh-doc', 'systemd-doc', 'util-linux-doc'] have failed. If the intention is to defer them to first boot, Looking at the log: + chown man:man /yocto/ross/build/tmp/work/qemuarm64-poky-linux/core-image-base/1.0-r0/sdk/image/usr/local/oe-sdk-hardcoded-buildpath/sysroots/cortexa57-poky-linux/var/cache/man/./fr/index.db chown: invalid user: ‘man:man’ Error in POSTIN scriptlet in rpm package kmod-doc Is pseudo looking in the wrong place for the passwd?
It's not so much that pseudo is looking in the wrong place for a passwd file, it's that the passwd/group files it finds has no man:man in it. Adding man to ../meta/recipes-devtools/pseudo/files/fallback-group and ../meta/recipes-devtools/pseudo/files/fallback-passwd gets past the error (but is obviously not the correct fix) The correct fix is to probably adduser when api-documentation is set as a DISTRO_FEATURES. I'll have a patch soon.
So the issue here is deeper and has to do with the nativesdk-intercepts for chown and chgrp. Running either of these ends up corrupting the os.execv args. If we run: ./scripts/nativesdk-intercept/chown -R foo:foo bar The loop here ends up missing the conversion of foo:foo to root:root because it sees sys.argv[0] and assumes that it's the user:group argument and that we should convert that. We end up a os.execv(path, args) that have the following args: ['root:root', '-R', 'foo:foo', 'bar'] As os.execv ignores args[0], we can just populate it with sys.argv[0] and then loop through sys.argv[1:]. As both chgrp and chown would have either flags and USER[:GROUP] next, this fixes the issue. I have a patch for this, but the question I'm trying to answer now is where the PATH prepend goes. Looking at this, it might need to go down in oe/lib/sdk.py
https://git.yoctoproject.org/poky/commit/meta/lib/oe?id=9ccde59c5303abb04e9bb8e2c987ff4b8f44bb43