From fd2a6b88f135271a65062b45db2bb69736d17462 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Sat, 4 May 2024 16:17:01 -0400 Subject: [PATCH] runit-void: fix issue with fsck on mounted partitions --- .../patches/blkdev-write-mounted.patch | 44 +++++++++++++++++++ srcpkgs/runit-void/template | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/runit-void/patches/blkdev-write-mounted.patch diff --git a/srcpkgs/runit-void/patches/blkdev-write-mounted.patch b/srcpkgs/runit-void/patches/blkdev-write-mounted.patch new file mode 100644 index 00000000000000..564ed42d189d47 --- /dev/null +++ b/srcpkgs/runit-void/patches/blkdev-write-mounted.patch @@ -0,0 +1,44 @@ +From b54ab39243ebba0820e3a5001733487fc137ece7 Mon Sep 17 00:00:00 2001 +From: classabbyamp +Date: Sat, 4 May 2024 15:50:38 -0400 +Subject: [PATCH] core-services/03-filesystems.sh: fsck mounted filesystems + separately + +see also: void-linux/void-packages#50124 +--- + core-services/03-filesystems.sh | 22 +++++++++++++++++++++- + 1 file changed, 21 insertions(+), 1 deletion(-) + +diff --git a/core-services/03-filesystems.sh b/core-services/03-filesystems.sh +index bb7eac0..a246a49 100644 +--- a/core-services/03-filesystems.sh ++++ b/core-services/03-filesystems.sh +@@ -67,7 +67,27 @@ done + + if [ -z "$FASTBOOT" ]; then + msg "Checking filesystems:" +- fsck -A -T -a -t noopts=_netdev $FORCEFSCK ++ # check rootfs first ++ fsck -T -a $FORCEFSCK / ++ ret="$?" ++ # exit code of 8 indicates "operational error", ++ # which can happen if CONFIG_BLK_DEV_WRITE_MOUNTED ++ # is disabled on linux>=6.8 ++ if [ "$ret" -ne 0 ] && [ "$ret" -ne 8 ]; then ++ emergency_shell ++ fi ++ # then check any mounted partitions ++ while read -r part mntpt rest; do ++ if [ "${part#/dev}" != "$part" ] && [ "$mntpt" != "/" ]; then ++ fsck -T -a $FORCEFSCK "$mntpt" ++ ret="$?" ++ if [ "$ret" -ne 0 ] && [ "$ret" -ne 8 ]; then ++ emergency_shell ++ fi ++ fi ++ done