From: Laszlo Gombos Date: Sun, 28 Aug 2022 13:35:36 +0000 (+0000) Subject: chore(base): do not output root entry while installing base X-Git-Tag: 058~155 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97345f0627f8834149bf71959d846780f4e1e64b;p=thirdparty%2Fdracut.git 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 *** --- 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"