Skip to content

Commit 97345f0

Browse files
LaszloGombosjohannbg
authored andcommitted
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 ***
1 parent b96f1af commit 97345f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules.d/99base/module-setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ install() {
3232
# add common users in /etc/passwd, it will be used by nfs/ssh currently
3333
# use password for hostonly images to facilitate secure sulogin in emergency console
3434
[[ $hostonly ]] && pwshadow='x'
35-
grep '^root:' "$initdir/etc/passwd" 2> /dev/null || echo "root:$pwshadow:0:0::/root:/bin/sh" >> "$initdir/etc/passwd"
35+
grep '^root:' "$initdir/etc/passwd" > /dev/null 2>&1 || echo "root:$pwshadow:0:0::/root:/bin/sh" >> "$initdir/etc/passwd"
3636
grep '^nobody:' "$dracutsysrootdir"/etc/passwd >> "$initdir/etc/passwd"
3737

3838
[[ $hostonly ]] && grep '^root:' "$dracutsysrootdir"/etc/shadow >> "$initdir/etc/shadow"

0 commit comments

Comments
 (0)