]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
mount-root.sh: fix writing fstab file with missing fsck flag
authorNorbert Lange <norbert.lange@andritz.com>
Mon, 6 Jul 2020 16:16:13 +0000 (18:16 +0200)
committerDaniel Molkentin <daniel@molkentin.de>
Tue, 4 Aug 2020 11:26:33 +0000 (13:26 +0200)
if the kernel argument rootflags is set, then dracut will
not parse the rootfs fstab and rootfsck wil not be set.

if the filesystem can be fsck'ed then its unmounted,
and an entry to the local fstab is written, omitting the last
field.

mounting /sysroot using fstab will then fail.

This change makes sure that the filed is always written.

Signed-off-by: Norbert Lange <norbert.lange@andritz.com>
modules.d/95rootfs-block/mount-root.sh

index 0eddbcd532a82a587dcf646de81d432ea112dd71..6503b517b1dac3a0478dc69aa2a5b93955e08e4c 100755 (executable)
@@ -116,7 +116,7 @@ mount_root() {
         ran_fsck=1
     fi
 
-    echo "${root#block:} $NEWROOT $rootfs ${rflags:-defaults} 0 $rootfsck" >> /etc/fstab
+    echo "${root#block:} $NEWROOT $rootfs ${rflags:-defaults} 0 ${rootfsck:-0}" >> /etc/fstab
 
     if ! ismounted "$NEWROOT"; then
         info "Mounting ${root#block:} with -o ${rflags}"