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

* Re: dracut: split dracut package (dracut / dracut-default)
  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
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Duncaen @ 2022-09-14 12:12 UTC (permalink / raw)
  To: ml

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

New comment by Duncaen on void-packages repository

https://github.com/void-linux/void-packages/pull/39282#issuecomment-1246672962

Comment:
This breaks everyones setup no?

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

* Re: dracut: split dracut package (dracut / dracut-default)
  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
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Duncaen @ 2022-09-14 12:12 UTC (permalink / raw)
  To: ml

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

New comment by Duncaen on void-packages repository

https://github.com/void-linux/void-packages/pull/39282#issuecomment-1246672962

Comment:
This breaks everyone's setup no?

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

* Re: dracut: split dracut package (dracut / dracut-default)
  2022-09-14 10:44 [PR PATCH] dracut: split dracut package (dracut / dracut-default) 08A
                   ` (2 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: ahesford @ 2022-09-14 12:13 UTC (permalink / raw)
  To: ml

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

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/39282#issuecomment-1246673581

Comment:
Absolutely not. This breaks the default dracut behavior and will render every system unbootable unless users take manual action to install the right hook. The only way around this would be to make the regular dracut package depend on this subpackage, rendering the division pointless.

If you don't want to build a standalone image (it's not a bad idea for recovery situations), just use an [XBPS `noextract` pattern](https://man.voidlinux.org/xbps.d#noextract=pattern).

In the long term, I have been thinking about an approach that would unify the handling of kernel hooks so that initramfs generators are switchable, but I am still not happy with the possibilities right now.

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

* Re: [PR PATCH] [Closed]: dracut: split dracut package (dracut / dracut-default)
  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 ` ahesford
  2022-09-14 12:13 ` ahesford
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ahesford @ 2022-09-14 12:13 UTC (permalink / raw)
  To: ml

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

There's a closed pull request on the void-packages repository

dracut: split dracut package (dracut / dracut-default)
https://github.com/void-linux/void-packages/pull/39282

Description:
<!-- 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 ?



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

* Re: dracut: split dracut package (dracut / dracut-default)
  2022-09-14 10:44 [PR PATCH] dracut: split dracut package (dracut / dracut-default) 08A
                   ` (3 preceding siblings ...)
  2022-09-14 12:13 ` ahesford
@ 2022-09-14 14:46 ` 08A
  2022-09-14 14:57 ` ahesford
  5 siblings, 0 replies; 7+ messages in thread
From: 08A @ 2022-09-14 14:46 UTC (permalink / raw)
  To: ml

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

New comment by 08A on void-packages repository

https://github.com/void-linux/void-packages/pull/39282#issuecomment-1246879503

Comment:
Another solution (a little bit weird but retro-compatible):

* dracut (the old dracut-default package) [depends: dracut-base]
* dracut-base (the old dracut package)
* dracut-uefi [depends: dracut-base]

What do you think?

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

* Re: dracut: split dracut package (dracut / dracut-default)
  2022-09-14 10:44 [PR PATCH] dracut: split dracut package (dracut / dracut-default) 08A
                   ` (4 preceding siblings ...)
  2022-09-14 14:46 ` 08A
@ 2022-09-14 14:57 ` ahesford
  5 siblings, 0 replies; 7+ messages in thread
From: ahesford @ 2022-09-14 14:57 UTC (permalink / raw)
  To: ml

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

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/39282#issuecomment-1246896464

Comment:
There's no value in this. We still need the default dependencies to pull in the full dracut package with hooks or everybody's installation will break. This means you wind up adding `ignorepkg` rules to skip the hooks you don't want. If you have to use `ignorepkg`, you might as well just use `noextract` and cut out the extra package.

Furthermore, if we develop a sensible way for reconciling conflicting hooks for all initramfs generators, we don't need additional package splits complicating the graph.

^ 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).