From cd787eca4b12e6ab6ff303067a9cb7576d3631ac Mon Sep 17 00:00:00 2001 From: Alexis Ehret Date: Wed, 14 Sep 2022 12:18:21 +0200 Subject: [PATCH] dracut: split dracut package (dracut / dracut-default) When dracut-053_1 and dracut-uefi-053_1 are installed, there are two kernel hooks that will build two EFI images. This process is slow and will consume twice as much space. There is no reason why both hooks should be installed at the same time. So the user should therefore be able to choose if he wants the default hook. --- srcpkgs/dracut-default | 1 + srcpkgs/dracut/INSTALL.msg | 2 ++ srcpkgs/dracut/template | 18 ++++++++++++------ 3 files changed, 15 insertions(+), 6 deletions(-) create mode 120000 srcpkgs/dracut-default create mode 100644 srcpkgs/dracut/INSTALL.msg diff --git a/srcpkgs/dracut-default b/srcpkgs/dracut-default new file mode 120000 index 000000000000..b3ae25a9bdd9 --- /dev/null +++ b/srcpkgs/dracut-default @@ -0,0 +1 @@ +dracut \ No newline at end of file diff --git a/srcpkgs/dracut/INSTALL.msg b/srcpkgs/dracut/INSTALL.msg new file mode 100644 index 000000000000..7bc2a33a08f4 --- /dev/null +++ b/srcpkgs/dracut/INSTALL.msg @@ -0,0 +1,2 @@ +To install the default kernel hook: 'xbps-install dracut-default'. +To install the UEFI kernel hook: 'xbps-install dracut-uefi'. diff --git a/srcpkgs/dracut/template b/srcpkgs/dracut/template index 22ffa7a82c4e..1b27980eb838 100644 --- a/srcpkgs/dracut/template +++ b/srcpkgs/dracut/template @@ -1,7 +1,7 @@ # Template file for 'dracut' pkgname=dracut version=053 -revision=3 +revision=4 build_style=configure configure_args="--prefix=/usr --sysconfdir=/etc" conf_files="/etc/dracut.conf" @@ -14,7 +14,7 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later" homepage="http://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html" distfiles="${KERNEL_SITE}/utils/boot/dracut/dracut-${version}.tar.xz" checksum=d5a1b47cdb07919d8225d5b5f538e6ae604988f3df0afbde99a8dc775277b726 -subpackages="dracut-network" +subpackages="dracut-default dracut-network" # Checks require distfiles come from a git repository make_check=no @@ -33,16 +33,22 @@ case "$XBPS_TARGET_MACHINE" in esac post_install() { - # kernel hooks. - vinstall ${FILESDIR}/kernel-hook-postinst 755 etc/kernel.d/post-install 20-dracut - vinstall ${FILESDIR}/kernel-hook-postrm 755 etc/kernel.d/post-remove 20-dracut - # We don't need the systemd stuff. rm -rf ${DESTDIR}/usr/lib/dracut/modules.d/*systemd* rm -f ${DESTDIR}/usr/share/man/man8/*.service.* rm -rf ${DESTDIR}/usr/lib/kernel } +dracut-default_package() { + depends="${sourcepkg}>=${version}_${revision}" + short_desc+=" - default kernel hook" + + pkg_install() { + vinstall ${FILESDIR}/kernel-hook-postinst 755 etc/kernel.d/post-install 20-dracut + vinstall ${FILESDIR}/kernel-hook-postrm 755 etc/kernel.d/post-remove 20-dracut + } +} + dracut-network_package() { depends="dhclient ${sourcepkg}-${version}_${revision}" short_desc+=" - network modules"