summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2021-03-05 11:28:57 +0800
committerRobert Yang <liezhi.yang@windriver.com>2021-03-05 11:57:24 +0800
commit870b35befc0b8fa9cd1c3a03fcfd2395440c2f41 (patch)
treef03ffdc3d1a6d98b8b2c6ba5102a9340c4a2dab0
parent6db24928d62aeb093a0e6da6619713eaca57a96f (diff)
downloadopenembedded-core-contrib-870b35befc0b8fa9cd1c3a03fcfd2395440c2f41.tar.gz
openembedded-core-contrib-870b35befc0b8fa9cd1c3a03fcfd2395440c2f41.tar.bz2
openembedded-core-contrib-870b35befc0b8fa9cd1c3a03fcfd2395440c2f41.zip
rootfs-postcommands.bbclass: Print a warning when login with root is disabledrbt/root
Fixed: EXTRA_IMAGE_FEATURES_remove = "debug-tweaks" $ bitbake core-image-minimal Then we can't login to the system with root without any messages. Add a warning makes it easy to debug. Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
-rw-r--r--meta/classes/rootfs-postcommands.bbclass6
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
index 1f27a3d07a..e4fe416ac9 100644
--- a/meta/classes/rootfs-postcommands.bbclass
+++ b/meta/classes/rootfs-postcommands.bbclass
@@ -147,7 +147,11 @@ read_only_rootfs_hook () {
zap_empty_root_password () {
if [ -e ${IMAGE_ROOTFS}/etc/shadow ]; then
sed -i 's%^root::%root:*:%' ${IMAGE_ROOTFS}/etc/shadow
- fi
+ grep -q '^root:*:' ${IMAGE_ROOTFS}/etc/shadow
+ if [ $? -eq 0 ]; then
+ bbwarn "Login with root user is disabled since zap_empty_root_password is enabled"
+ fi
+ fi
if [ -e ${IMAGE_ROOTFS}/etc/passwd ]; then
sed -i 's%^root::%root:*:%' ${IMAGE_ROOTFS}/etc/passwd
fi