From 07d71233a0b7c556048d7d4d38b56144ca27a4cb Mon Sep 17 00:00:00 2001 From: "Andrew J. Hesford" Date: Wed, 17 Jun 2020 15:49:18 -0400 Subject: [PATCH] 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. --- srcpkgs/zfs/INSTALL | 13 +++++++++++++ srcpkgs/zfs/template | 5 ++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/zfs/INSTALL diff --git a/srcpkgs/zfs/INSTALL b/srcpkgs/zfs/INSTALL new file mode 100644 index 0000000000..2991003856 --- /dev/null +++ b/srcpkgs/zfs/INSTALL @@ -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 diff --git a/srcpkgs/zfs/template b/srcpkgs/zfs/template index 717ffb45f0..74c1425572 100644 --- a/srcpkgs/zfs/template +++ b/srcpkgs/zfs/template @@ -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 . }