Created
March 18, 2020 15:10
-
-
Save CarbonChauvinist/b422d1255640663199fd0130dfbe7573 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Trigger] | |
Type = Path | |
Operation = Remove | |
Target = usr/lib/modules/*/pkgbase | |
Target = usr/lib/dracut/* | |
[Action] | |
Description = Removing linux initcpios... | |
When = PreTransaction | |
Exec = /usr/local/bin/dracut-remove.sh | |
NeedsTargets |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Trigger] | |
Type = Path | |
Operation = Install | |
Operation = Upgrade | |
Target = usr/lib/modules/*/pkgbase | |
Target = usr/lib/dracut/* | |
[Action] | |
Description = Updating linux initcpios (with dracut!)... | |
When = PostTransaction | |
Exec = /usr/local/bin/dracut-install.sh | |
NeedsTargets |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#args=(--add "i915 kvmgt vfio_pci vfio vfio-iommu-type1 vfio-virqfd vfio-mdev" --lz4 --hostonly-cmdline --quiet --early-microcode --omit-drivers "network iscsi" --include /etc/modprobe.d/i915.conf --include /etc/modprobe.d/modprobe.conf --include /etc/modprobe.d/kvm.conf --include /etc/environment) | |
while read -r line; do | |
if [[ "$line" == 'usr/lib/modules/'+([^/])'/pkgbase' ]]; then | |
read -r pkgbase < "/${line}" | |
kver="${line#'usr/lib/modules/'}" | |
kver="${kver%'/pkgbase'}" | |
install -Dm0644 "/${line%'/pkgbase'}/vmlinuz" "/boot/vmlinuz-dracut-${pkgbase}" | |
dracut --force "/boot/initramfs-dracut-${pkgbase}.img" --kver "$kver" | |
dracut --no-hostonly --force "/boot/initramfs-dracut-${pkgbase}-fallback.img" --kver "$kver" | |
fi | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
while read -r line; do | |
if [[ "$line" == 'usr/lib/modules/'+([^/])'/pkgbase' ]]; then | |
read -r pkgbase < "/${line}" | |
rm -f "/boot/vmlinuz-dracut-${pkgbase}" "/boot/initramfs-dracut-${pkgbase}.img" "/boot/initramfs-dracut-${pkgbase}-fallback.img" | |
fi | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hostonly_cmdline="yes" | |
compress="lz4" | |
force_drivers+=" i915 kvmgt vfio_pci vfio vfio-iommu-type1 vfio-virqfd vfio-mdev " | |
omit_dracutmodules+=" network iscsi " | |
early_microcode="yes" | |
install_optional_items+=" /etc/environment /etc/modprobe.d/i915.conf /etc/modprobe.d/modprobe.conf /etc/modprobe.d/kvm.conf " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment