]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commit
rootfs-postcommands.bbclass: fix adding 'no password' banner
authorChen Qi <Qi.Chen@windriver.com>
Wed, 17 Dec 2025 05:22:40 +0000 (05:22 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 18 Dec 2025 13:53:50 +0000 (13:53 +0000)
commitb650bd2c94f9aefd4dec82b27285ed1d439778bc
tree969f31bdf254aa47ba5f6fd8b2ff45641d165c3c
parentc04d2811fcc63a3e1446e9b0fdce8d389185922c
rootfs-postcommands.bbclass: fix adding 'no password' banner

It's possible that users use EXTRA_USERS_PARAMS to set password
for root or explicitly expire root password. So we need to check
these two cases to ensure the 'no password' banner is not misleading.

As an example, below are configurations to make an image requiring
setting a root password on first boot, but without having to first enter
a static initial password:

  In conf/toolcfg.cfg:
  OE_FRAGMENTS += "distro/poky core/yocto/root-login-with-empty-password
  In local.conf:
  INHERIT += "extrausers"
  EXTRA_USERS_PARAMS += " passwd-expire root;"

Adding such banner is only meaningful when base-passwd and baes-files are
installed. In case of container image, they might not be installed (e.g.,
container-test-image). So add extra checking for it. With the above logic,
we avoid breaking the following oe-selftest test case:
containerimage.ContainerImageTests.test_expected_files

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/rootfs-postcommands.bbclass