91 lines
3.1 KiB
Bash
91 lines
3.1 KiB
Bash
# Template file for 'mkinitcpio'
|
|
pkgname=mkinitcpio
|
|
version=36
|
|
revision=2
|
|
build_style=gnu-makefile
|
|
hostmakedepends="asciidoc"
|
|
depends="busybox-static bsdtar bash"
|
|
checkdepends="busybox-static bats-assert lz4 xz zstd"
|
|
short_desc="Next generation of initramfs creation"
|
|
maintainer="Andrew J. Hesford <ajh@sideband.org>"
|
|
license="GPL-2.0-only"
|
|
homepage="https://git.archlinux.org/mkinitcpio.git"
|
|
distfiles="https://sources.archlinux.org/other/${pkgname}/${pkgname}-${version}.tar.gz"
|
|
checksum=7b3b1cdf546922f47845a3ac4353ca97899a4bb68cfff29098c45135e5fb8b5e
|
|
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"
|
|
|
|
post_install() {
|
|
# Install udev hooks
|
|
vinstall ${FILESDIR}/udev_hook 644 usr/lib/initcpio/hooks udev
|
|
vinstall ${FILESDIR}/udev_install 644 usr/lib/initcpio/install udev
|
|
|
|
# Install udev rule used by both lvm2 and encrypt hook
|
|
vinstall ${FILESDIR}/11-dm-initramfs.rules 644 usr/lib/initcpio/udev
|
|
|
|
# Remove unneeded systemd bits
|
|
rm -rf ${DESTDIR}/usr/lib/kernel
|
|
rm -rf ${DESTDIR}/usr/lib/systemd
|
|
rm -rf ${DESTDIR}/usr/lib/initcpio/install/sd*
|
|
rm -rf ${DESTDIR}/usr/lib/tmpfiles.d
|
|
|
|
# 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() {
|
|
vinstall ${FILESDIR}/lvm2_hook 644 usr/lib/initcpio/hooks lvm2
|
|
vinstall ${FILESDIR}/lvm2_install 644 usr/lib/initcpio/install lvm2
|
|
vinstall ${FILESDIR}/69-dm-lvm-metad.rules 644 usr/lib/initcpio/udev
|
|
}
|
|
}
|
|
|
|
mkinitcpio-encrypt_package() {
|
|
depends="${sourcepkg}>=${version}_${revision} cryptsetup"
|
|
short_desc+=" - encrypt support"
|
|
pkg_install() {
|
|
vinstall ${FILESDIR}/encrypt_hook 644 usr/lib/initcpio/hooks encrypt
|
|
vinstall ${FILESDIR}/encrypt_install 644 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
|
|
vinstall ${FILESDIR}/mdadm_udev_install 644 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
|
|
}
|
|
}
|