summaryrefslogtreecommitdiffstats
path: root/source/a/mkinitrd/0010-fix-test-for-jfs-xfs-repair-tools.patch
blob: 9d8e2d0601ff810b6af11c2fbca9d8218ba63b69 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--- ./mkinitrd.orig	2023-11-20 12:49:33.502016341 -0600
+++ ./mkinitrd	2023-11-20 12:50:30.142017608 -0600
@@ -60,6 +60,8 @@
 # Modified by Piter Punk <piterpunk@slackware.com> 25 April 2022
 #   Add support to specify additional filesystems to be mounted by
 #   initrd. Useful for those that have a separated '/usr'
+# Modified by Patrick Volkerding <volkerdi@slackware.com> 20 Movember 2023
+#   Add jfs/xfs repair tools if used for $ROOTFS
 
 MKINITRD_VERSION=1.4.11
 
@@ -773,10 +775,11 @@
       /sbin/modprobe --set-version $kver --show-depends --ignore-install $MODULE 2>/dev/null \
         | grep "^insmod " | cut -f 2 -d ' ' | while read SRCMOD; do
 
-        # If jfs or xfs filesystems are in use, add the repair tools to the initrd:
-        if [ "$(basename $SRCMOD .ko)" = "jfs" ]; then
+        # If the root filesystem is jfs, add the repair tools to the initrd:
+        if [ "$ROOTFS" = "jfs" ]; then
           cp -a /sbin/jfs_fsck $SOURCE_TREE/sbin/
-        elif [ "$(basename $SRCMOD .ko)" = "xfs" ]; then
+        # If the root filesystem is xfs, add the repair tools to the initrd:
+        elif [ "$ROOTFS" = "xfs" ]; then
           cp -a /sbin/xfs_repair $SOURCE_TREE/sbin/
         fi