Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] dracut: split dracut package (dracut / dracut-default)
@ 2022-09-14 10:44 08A
  2022-09-14 12:12 ` Duncaen
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: 08A @ 2022-09-14 10:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2752 bytes --]

There is a new pull request by 08A against master on the void-packages repository

https://github.com/08A/void-packages new-package-dracut-default
https://github.com/void-linux/void-packages/pull/39282

dracut: split dracut package (dracut / dracut-default)
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)


#### Rational

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.

#### Test

````sh
$ ./xbps-src pkg dracut
$ rm /etc/kernel.d/post-install/20-dracut
$ rm /etc/kernel.d/post-remove/20-dracut
$ xi dracut-uefi
$ tree /etc/kernel.d/ # no 20-dracut file
/etc/kernel.d
├── post-install
│   ├── 10-dkms
│   ├── 20-dracut-uefi
│   ├── 40-sbsigntool
│   ├── 50-efibootmgr
│   └── 50-refind
├── post-remove
│   ├── 20-dracut-uefi
│   ├── 40-sbsigntool
│   ├── 50-efibootmgr
│   └── 50-refind
├── pre-install
└── pre-remove
    └── 10-dkms
$ xi dracut-default
$ tree /etc/kernel.d/
/etc/kernel.d
├── post-install
│   ├── 10-dkms
│   ├── 20-dracut
│   ├── 20-dracut-uefi
│   ├── 40-sbsigntool
│   ├── 50-efibootmgr
│   └── 50-refind
├── post-remove
│   ├── 20-dracut
│   ├── 20-dracut-uefi
│   ├── 40-sbsigntool
│   ├── 50-efibootmgr
│   └── 50-refind
├── pre-install
└── pre-remove
    └── 10-dkms
````

#### PS

If this PR is merged I was thinking about splitting the same way other packages such as refind, efibootmgr, sbsigntools. What do you think ?



A patch file from https://github.com/void-linux/void-packages/pull/39282.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-new-package-dracut-default-39282.patch --]
[-- Type: text/x-diff, Size: 3008 bytes --]

From cd787eca4b12e6ab6ff303067a9cb7576d3631ac Mon Sep 17 00:00:00 2001
From: Alexis Ehret <git@08a.re>
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"

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-09-14 14:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-14 10:44 [PR PATCH] dracut: split dracut package (dracut / dracut-default) 08A
2022-09-14 12:12 ` Duncaen
2022-09-14 12:12 ` Duncaen
2022-09-14 12:13 ` [PR PATCH] [Closed]: " ahesford
2022-09-14 12:13 ` ahesford
2022-09-14 14:46 ` 08A
2022-09-14 14:57 ` ahesford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).