zfs: trigger dracut on install and remove patch artifacts

dracut should be triggered to work around ordering issues in
https://github.com/void-linux/void-packages/issues/22817 that can
otherwise result in missing ZFS modules in initramfs images.
This commit is contained in:
Andrew J. Hesford 2020-06-17 15:49:18 -04:00 committed by Toyam Cox
parent e2155b49d9
commit 07d71233a0
2 changed files with 17 additions and 1 deletions

13
srcpkgs/zfs/INSTALL Normal file
View file

@ -0,0 +1,13 @@
case "${ACTION}" in
post)
if [ -x usr/bin/dracut ]; then
# Include new modules in all initramfs instances when possible,
# as simultaneous updates of linux and zfs may trigger creation
# of images without modules and unable to boot from ZFS pools.
#
# See https://github.com/void-linux/void-packages/issues/22817
echo "Regenerating initramfs, please wait..."
usr/bin/dracut -f -q --regenerate-all
fi
;;
esac

View file

@ -1,7 +1,7 @@
# Template file for 'zfs'
pkgname=zfs
version=0.8.4
revision=2
revision=3
build_style=gnu-configure
configure_args="--with-config=user --with-mounthelperdir=/usr/bin
--with-udevdir=/usr/lib/udev --with-udevruledir=/usr/lib/udev/rules.d
@ -26,6 +26,9 @@ pre_configure() {
autoreconf -fi
# configure relies on bashism to redirect stdout/stderr when building tests
sed -i '1 s@^#!\s*/bin/sh$@#!/bin/bash@' configure
# Prevent patch artifacts from being installed
rm -f dkms.patch scripts/dkms.mkconf.orig
tar czf ../clean.tar.gz .
}