void-packages/srcpkgs/mkinitcpio/template
classabbyamp 16e63b5361 mkinitcpio: fix lvm2 hook
After discussion with upstream, the mkinitcpio-specific udev rules used
by the encrypt and lvm2 hooks will be vendored in the upstream repo.
This means we can avoid vendoring them in void-packages. The lvm2
runtime hook is no longer needed as lvmetad no longer exists. The
patches to the lvm2 install hook are no longer needed as mkinitcpio
detects the need to add the lvm2 and dm-setup binaries from the udev
rules, and the proper udev rules are now included.

Fixes: #53496
Closes: #53503
2024-12-18 23:27:59 -05:00

91 lines
2.9 KiB
Bash

# Template file for 'mkinitcpio'
pkgname=mkinitcpio
version=39.2
revision=3
build_style=gnu-makefile
hostmakedepends="asciidoc"
depends="busybox-static bsdtar bash zstd"
checkdepends="busybox-static bats-assert lz4 xz zstd lzop parallel ukify"
short_desc="Next generation of initramfs creation"
maintainer="classabbyamp <void@placeviolette.net>"
license="GPL-2.0-only"
homepage="https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio"
changelog="https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio/-/raw/master/CHANGELOG"
distfiles="https://sources.archlinux.org/other/mkinitcpio/mkinitcpio-${version}.tar.xz"
checksum=bc37195fab724c42e154a93e6ab797410161c07f223302898673c0e17afd8e0a
conf_files="/etc/mkinitcpio.conf"
alternatives="
initramfs:/etc/kernel.d/post-install/20-initramfs:/usr/libexec/mkinitcpio/kernel-hook-postinst
initramfs:/etc/kernel.d/post-remove/20-initramfs:/usr/libexec/mkinitcpio/kernel-hook-postrm
"
replaces="mkinitcpio-udev>=0"
make_dirs="/etc/mkinitcpio.conf.d 0755 root root"
pre_check() {
export BATS_ARGS="--filter-tags '!no_root'"
}
post_install() {
# Remove unneeded systemd bits
rm -r ${DESTDIR}/usr/lib/kernel
rm -r ${DESTDIR}/usr/lib/systemd
rm -r ${DESTDIR}/usr/lib/initcpio/install/sd*
rm -r ${DESTDIR}/usr/lib/initcpio/install/systemd
rm -r ${DESTDIR}/usr/lib/tmpfiles.d
# Remove patch remnants
rm "${DESTDIR}"/usr/lib/initcpio/{hooks,install}/*.orig
# Remove unneeded pacman hooks
rm -rf ${DESTDIR}/usr/share/libalpm
ln -s /usr/bin/busybox.static $DESTDIR/usr/lib/initcpio/busybox
vinstall ${FILESDIR}/kernel-hook-postinst 755 usr/libexec/mkinitcpio
vinstall ${FILESDIR}/kernel-hook-postrm 755 usr/libexec/mkinitcpio
}
mkinitcpio-lvm2_package() {
depends="${sourcepkg}>=${version}_${revision} lvm2 thin-provisioning-tools"
short_desc+=" - lvm2 support"
pkg_install() {
vmove usr/lib/initcpio/udev/69-dm-lvm.rules
vmove usr/lib/initcpio/install/lvm2
}
}
mkinitcpio-encrypt_package() {
depends="${sourcepkg}>=${version}_${revision} cryptsetup"
short_desc+=" - encrypt support"
pkg_install() {
vmove usr/lib/initcpio/hooks/encrypt
vmove usr/lib/initcpio/install/encrypt
}
}
mkinitcpio-mdadm_package() {
depends="${sourcepkg}>=${version}_${revision} mdadm"
short_desc+=" - mdadm support"
pkg_install() {
vinstall ${FILESDIR}/mdadm_hook 644 usr/lib/initcpio/hooks mdadm
vinstall ${FILESDIR}/mdadm_install 644 usr/lib/initcpio/install mdadm
vmove usr/lib/initcpio/install/mdadm_udev
}
}
mkinitcpio-xbps_package() {
depends="${sourcepkg}>=${version}_${revision} xbps"
short_desc+=" - xbps support"
pkg_install() {
vinstall ${FILESDIR}/xbps_install 644 usr/lib/initcpio/install xbps
}
}
mkinitcpio-zfs_package() {
depends="${sourcepkg}>=${version}_${revision} zfs"
short_desc+=" - ZFS support"
pkg_install() {
vinstall ${FILESDIR}/zfs_hook 644 usr/lib/initcpio/hooks zfs
vinstall ${FILESDIR}/zfs_install 644 usr/lib/initcpio/install zfs
}
}