diff mbox series

[V4,1/2] rootfs-postcommands.bbclass: fix echo + '\n' in 'no password' banner

Message ID 20251201052523.1222217-1-Qi.Chen@windriver.com
State New
Headers show
Series [V4,1/2] rootfs-postcommands.bbclass: fix echo + '\n' in 'no password' banner | expand

Commit Message

ChenQi Dec. 1, 2025, 5:25 a.m. UTC
From: Chen Qi <Qi.Chen@windriver.com>

The '\n' means hostname instead of new line in /etc/issues.

bash and dash have different behavior on echo + '\n'.
So we avoid this '\n' and use an extra echo "" instead.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/classes-recipe/rootfs-postcommands.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/rootfs-postcommands.bbclass b/meta/classes-recipe/rootfs-postcommands.bbclass
index d3a569ba3e..f4fbc4c57e 100644
--- a/meta/classes-recipe/rootfs-postcommands.bbclass
+++ b/meta/classes-recipe/rootfs-postcommands.bbclass
@@ -259,7 +259,8 @@  zap_empty_root_password () {
 # This function adds a note to the login banner that the system is configured for root logins without password
 #
 add_empty_root_password_note () {
-	echo "Type 'root' to login with superuser privileges (no password will be asked).\n" >> ${IMAGE_ROOTFS}/etc/issue
+	echo "Type 'root' to login with superuser privileges (no password will be asked)." >> ${IMAGE_ROOTFS}/etc/issue
+	echo "" >> ${IMAGE_ROOTFS}/etc/issue
 }
 
 #