From 97345f0627f8834149bf71959d846780f4e1e64b Mon Sep 17 00:00:00 2001 From: Laszlo Gombos Date: Sun, 28 Aug 2022 13:35:36 +0000 Subject: [PATCH] chore(base): do not output root entry while installing base Silence the printing out root entry of passwd file while including base module. dracut: *** Including module: base *** root:x:0:0:root:/root:/bin/bash dracut: *** Including module: fs-lib *** --- modules.d/99base/module-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh index 10a44d91e..427cccb5a 100755 --- a/modules.d/99base/module-setup.sh +++ b/modules.d/99base/module-setup.sh @@ -32,7 +32,7 @@ install() { # add common users in /etc/passwd, it will be used by nfs/ssh currently # use password for hostonly images to facilitate secure sulogin in emergency console [[ $hostonly ]] && pwshadow='x' - grep '^root:' "$initdir/etc/passwd" 2> /dev/null || echo "root:$pwshadow:0:0::/root:/bin/sh" >> "$initdir/etc/passwd" + grep '^root:' "$initdir/etc/passwd" > /dev/null 2>&1 || echo "root:$pwshadow:0:0::/root:/bin/sh" >> "$initdir/etc/passwd" grep '^nobody:' "$dracutsysrootdir"/etc/passwd >> "$initdir/etc/passwd" [[ $hostonly ]] && grep '^root:' "$dracutsysrootdir"/etc/shadow >> "$initdir/etc/shadow" -- 2.47.3