--- ./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 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 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