From accb708c6068c174212ae9f24369d5c273e7cb51 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 | 46 +++++++++++++++++++ srcpkgs/runit-void/template | 2 +- 2 files changed, 47 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..afc8212516779a --- /dev/null +++ b/srcpkgs/runit-void/patches/blkdev-write-mounted.patch @@ -0,0 +1,46 @@ +From 7bc7d92ea6c9387b76e98099d51515b1b83493ed 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: don't fsck mounted + filesystems + +gate this behind linux>=6.8 and the relevant cmdline argument + +see also: void-linux/void-packages#50124 +--- + core-services/03-filesystems.sh | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/core-services/03-filesystems.sh b/core-services/03-filesystems.sh +index bb7eac0..a6dbec4 100644 +--- a/core-services/03-filesystems.sh ++++ b/core-services/03-filesystems.sh +@@ -56,18 +56,27 @@ if [ -x /usr/bin/zpool -a -x /usr/bin/zfs ]; then + # anybody is doing that, so we aren't supporting it for now. + fi + ++# linux>=6.8 probably has CONFIG_BLK_DEV_WRITE_MOUNTED disabled, ++# which breaks fsck of mounted partitions, unless bdev_allow_write_mounted ++# is in the cmdline (see below) ++xbps-uhelper pkgmatch "linux-$(uname -r)" "linux>=6.8.0_1" >/dev/null 2>&1 ++if [ $? -eq 1 ]; then ++ NOMOUNTED="-M" ++fi ++ + [ -f /fastboot ] && FASTBOOT=1 + [ -f /forcefsck ] && FORCEFSCK="-f" + for arg in $(cat /proc/cmdline); do + case $arg in + fastboot) FASTBOOT=1;; + forcefsck) FORCEFSCK="-f";; ++ bdev_allow_write_mounted*) NOMOUNTED="";; + esac + done + + if [ -z "$FASTBOOT" ]; then + msg "Checking filesystems:" +- fsck -A -T -a -t noopts=_netdev $FORCEFSCK ++ fsck -A -T -a -t noopts=_netdev $FORCEFSCK $NOMOUNTED + if [ $? -gt 1 ]; then + emergency_shell + fi diff --git a/srcpkgs/runit-void/template b/srcpkgs/runit-void/template index 66dd4ac88832d3..9b99964752e809 100644 --- a/srcpkgs/runit-void/template +++ b/srcpkgs/runit-void/template @@ -1,7 +1,7 @@ # Template file for 'runit-void' pkgname=runit-void version=20231124 -revision=1 +revision=2 build_style=gnu-makefile short_desc="Void Linux runit scripts" maintainer="Enno Boland "