dracut/backport-mount-root.sh-fix-writing-fstab-file-with-missing-fs.patch
hongjinghao 2663ebded8 backport patchs from upstream
(cherry picked from commit e37aecb42764d47b923dd3280385bd5438f466b6)
2024-02-22 14:56:32 +08:00

41 lines
1.4 KiB
Diff

From acc782bad5c77a8e105c9c5a8fc8873bc2ff06ec Mon Sep 17 00:00:00 2001
From: Norbert Lange <norbert.lange@andritz.com>
Date: Mon, 6 Jul 2020 18:16:13 +0200
Subject: [PATCH] mount-root.sh: fix writing fstab file with missing fsck flag
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.
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/acc782bad5c77a8e105c9c5a8fc8873bc2ff06ec
Signed-off-by: Norbert Lange <norbert.lange@andritz.com>
---
modules.d/95rootfs-block/mount-root.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/95rootfs-block/mount-root.sh b/modules.d/95rootfs-block/mount-root.sh
index 0eddbcd5..6503b517 100755
--- a/modules.d/95rootfs-block/mount-root.sh
+++ b/modules.d/95rootfs-block/mount-root.sh
@@ -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}"
--
2.23.0