|
Harald Hoyer |
0840a3 |
From 6c9484f61440b71301f43cfa912fb9f1113352b1 Mon Sep 17 00:00:00 2001
|
|
Harald Hoyer |
0840a3 |
From: Andrei Borzenkov <arvidjaar@gmail.com>
|
|
Harald Hoyer |
0840a3 |
Date: Fri, 26 Jun 2015 16:55:56 +0200
|
|
Harald Hoyer |
0840a3 |
Subject: [PATCH] ensure pre-mount (and resume) run before root fsck
|
|
Harald Hoyer |
0840a3 |
|
|
Harald Hoyer |
0840a3 |
References:
|
|
Harald Hoyer |
0840a3 |
https://bugzilla.suse.com/show_bug.cgi?id=906592
|
|
Harald Hoyer |
0840a3 |
Signed-off-by: Thomas Renninger <trenn@suse.de>
|
|
Harald Hoyer |
0840a3 |
---
|
|
Harald Hoyer |
0840a3 |
modules.d/98dracut-systemd/rootfs-generator.sh | 18 ++++++++++++++++++
|
|
Harald Hoyer |
0840a3 |
1 file changed, 18 insertions(+)
|
|
Harald Hoyer |
0840a3 |
|
|
Harald Hoyer |
0840a3 |
diff --git a/modules.d/98dracut-systemd/rootfs-generator.sh b/modules.d/98dracut-systemd/rootfs-generator.sh
|
|
Harald Hoyer |
0840a3 |
index 670613e..5e79d0b 100755
|
|
Harald Hoyer |
0840a3 |
--- a/modules.d/98dracut-systemd/rootfs-generator.sh
|
|
Harald Hoyer |
0840a3 |
+++ b/modules.d/98dracut-systemd/rootfs-generator.sh
|
|
Harald Hoyer |
0840a3 |
@@ -65,6 +65,23 @@ generator_mount_rootfs()
|
|
Harald Hoyer |
0840a3 |
fi
|
|
Harald Hoyer |
0840a3 |
}
|
|
Harald Hoyer |
0840a3 |
|
|
Harald Hoyer |
0840a3 |
+generator_fsck_after_pre_mount()
|
|
Harald Hoyer |
0840a3 |
+{
|
|
Harald Hoyer |
0840a3 |
+ local _name
|
|
Harald Hoyer |
0840a3 |
+
|
|
Harald Hoyer |
0840a3 |
+ [ -z "$1" ] && return 0
|
|
Harald Hoyer |
0840a3 |
+
|
|
Harald Hoyer |
0840a3 |
+ _name=$(dev_unit_name "$1")
|
|
Harald Hoyer |
0840a3 |
+ [ -d /run/systemd/generator/systemd-fsck@${_name}.service.d ] || mkdir -p /run/systemd/generator/systemd-fsck@${_name}.service.d
|
|
Harald Hoyer |
0840a3 |
+ if ! [ -f /run/systemd/generator/systemd-fsck@${_name}.service.d/after-pre-mount.conf ]; then
|
|
Harald Hoyer |
0840a3 |
+ {
|
|
Harald Hoyer |
0840a3 |
+ echo "[Unit]"
|
|
Harald Hoyer |
0840a3 |
+ echo "After=dracut-pre-mount.service"
|
|
Harald Hoyer |
0840a3 |
+ } > /run/systemd/generator/systemd-fsck@${_name}.service.d/after-pre-mount.conf
|
|
Harald Hoyer |
0840a3 |
+ fi
|
|
Harald Hoyer |
0840a3 |
+
|
|
Harald Hoyer |
0840a3 |
+}
|
|
Harald Hoyer |
0840a3 |
+
|
|
Harald Hoyer |
0840a3 |
root=$(getarg root=)
|
|
Harald Hoyer |
0840a3 |
case "$root" in
|
|
Harald Hoyer |
0840a3 |
block:LABEL=*|LABEL=*)
|
|
Harald Hoyer |
0840a3 |
@@ -95,6 +112,7 @@ GENERATOR_DIR="$1"
|
|
Harald Hoyer |
0840a3 |
|
|
Harald Hoyer |
0840a3 |
if [ "$rootok" = "1" ]; then
|
|
Harald Hoyer |
0840a3 |
generator_wait_for_dev "${root#block:}" "$RDRETRY"
|
|
Harald Hoyer |
0840a3 |
+ generator_fsck_after_pre_mount "${root#block:}"
|
|
Harald Hoyer |
0840a3 |
strstr "$(cat /proc/cmdline)" 'root=' || generator_mount_rootfs "${root#block:}" "$(getarg rootfstype=)" "$(getarg rootflags=)"
|
|
Harald Hoyer |
0840a3 |
fi
|
|
Harald Hoyer |
0840a3 |
|