From: ericonr <ericonr@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] dracut: add EFI kernel hook
Date: Mon, 27 Jul 2020 15:20:41 +0200 [thread overview]
Message-ID: <20200727132041.awkcfPkiwsJKCcARIj0Ap51gxyIj8yN-kyiuy6NSYwE@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-22484@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 370 bytes --]
There is an updated pull request by ericonr against master on the void-packages repository
https://github.com/ericonr/void-packages dracut
https://github.com/void-linux/void-packages/pull/22484
dracut: add EFI kernel hook
Also made some small formatting changes.
@ahesford
A patch file from https://github.com/void-linux/void-packages/pull/22484.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dracut-22484.patch --]
[-- Type: text/x-diff, Size: 6496 bytes --]
From 9e3e7cb1b3c07ebe1c92c3d381fe211567cbb06b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sun, 31 May 2020 21:39:55 -0300
Subject: [PATCH] dracut: add UEFI bundle hook in dracut-uefi subpkg
- small formatting changes
- use relative path in kernel-hook-postrm
---
srcpkgs/dracut-uefi | 1 +
srcpkgs/dracut/files/dracut-uefi-hook.confd | 19 +++++++++++
srcpkgs/dracut/files/kernel-hook-postrm | 4 +--
.../dracut/files/kernel-uefi-hook-postinst | 23 +++++++++++++
srcpkgs/dracut/files/kernel-uefi-hook-postrm | 17 ++++++++++
srcpkgs/dracut/template | 34 ++++++++++++++++---
6 files changed, 92 insertions(+), 6 deletions(-)
create mode 120000 srcpkgs/dracut-uefi
create mode 100644 srcpkgs/dracut/files/dracut-uefi-hook.confd
create mode 100644 srcpkgs/dracut/files/kernel-uefi-hook-postinst
create mode 100644 srcpkgs/dracut/files/kernel-uefi-hook-postrm
diff --git a/srcpkgs/dracut-uefi b/srcpkgs/dracut-uefi
new file mode 120000
index 00000000000..b3ae25a9bdd
--- /dev/null
+++ b/srcpkgs/dracut-uefi
@@ -0,0 +1 @@
+dracut
\ No newline at end of file
diff --git a/srcpkgs/dracut/files/dracut-uefi-hook.confd b/srcpkgs/dracut/files/dracut-uefi-hook.confd
new file mode 100644
index 00000000000..50647c483a9
--- /dev/null
+++ b/srcpkgs/dracut/files/dracut-uefi-hook.confd
@@ -0,0 +1,19 @@
+# Options for the dracut-uefi kernel hook script installed by the dracut package.
+
+# To enable EFI bundle creation in dracut, uncomment
+#CREATE_UEFI_BUNDLES=yes
+# This requires an EFI stub, provided by the gummiboot package,
+# as well as setting the kernel command line.
+# Booting without a kernel command line is unsupported.
+
+# You can set the kernel command line with
+#KERNEL_CMDLINE="loglevel=4 slub_debug=P page_poison=1"
+# or by setting kernel_cmdline in a dracut.conf(5) file.
+# The bundle can also use the command line from a bootloader / boot manager
+# if Secure Boot is disabled.
+
+# You can set command line options for the dracut command
+#DRACUT_OPTIONS=
+
+# Output directory for the EFI bundle
+#UEFI_BUNDLE_DIR="boot/efi/EFI/void/"
diff --git a/srcpkgs/dracut/files/kernel-hook-postrm b/srcpkgs/dracut/files/kernel-hook-postrm
index f35d076193b..f99458a4bfa 100644
--- a/srcpkgs/dracut/files/kernel-hook-postrm
+++ b/srcpkgs/dracut/files/kernel-hook-postrm
@@ -7,7 +7,7 @@
PKGNAME="$1"
VERSION="$2"
-if [ -f /boot/initramfs-${VERSION}.img ]; then
- rm -f /boot/initramfs-${VERSION}.img
+if [ -f boot/initramfs-${VERSION}.img ]; then
+ rm -f boot/initramfs-${VERSION}.img
fi
exit $?
diff --git a/srcpkgs/dracut/files/kernel-uefi-hook-postinst b/srcpkgs/dracut/files/kernel-uefi-hook-postinst
new file mode 100644
index 00000000000..d623c3f86df
--- /dev/null
+++ b/srcpkgs/dracut/files/kernel-uefi-hook-postinst
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# Kernel post-install hook for dracut EFI bundle.
+#
+# Arguments passed to this script: $1 pkgname, $2 version.
+#
+PKGNAME="$1"
+VERSION="$2"
+
+. "${ROOTDIR}/etc/default/dracut-uefi-hook"
+if [ -z "${CREATE_UEFI_BUNDLES}" ]; then
+ exit 0
+fi
+
+if [ ! -x bin/dracut ]; then
+ exit 0
+fi
+
+mkdir -p ${UEFI_BUNDLE_DIR:=boot/efi/EFI/void}
+
+dracut -q --force ${KERNEL_CMDLINE:+--kernel-cmdline="${KERNEL_CMDLINE}"} ${DRACUT_OPTIONS} \
+ --uefi ${UEFI_BUNDLE_DIR}/linux-${VERSION}.efi ${VERSION}
+exit $?
diff --git a/srcpkgs/dracut/files/kernel-uefi-hook-postrm b/srcpkgs/dracut/files/kernel-uefi-hook-postrm
new file mode 100644
index 00000000000..8183bb26f08
--- /dev/null
+++ b/srcpkgs/dracut/files/kernel-uefi-hook-postrm
@@ -0,0 +1,17 @@
+#!/bin/sh
+#
+# Kernel post-remove hook for dracut EFI bundle.
+#
+# Arguments passed to this script: $1 pkgname, $2 version.
+#
+PKGNAME="$1"
+VERSION="$2"
+
+. "${ROOTDIR}/etc/default/dracut-uefi-hook"
+
+: "${UEFI_BUNDLE_DIR:=boot/efi/EFI/void}"
+
+if [ -f "${UEFI_BUNDLE_DIR}/linux-${VERSION}.efi" ]; then
+ rm -fv "${UEFI_BUNDLE_DIR}/linux-${VERSION}.efi"
+fi
+exit $?
diff --git a/srcpkgs/dracut/template b/srcpkgs/dracut/template
index b11335d06e3..00a7f801192 100644
--- a/srcpkgs/dracut/template
+++ b/srcpkgs/dracut/template
@@ -1,7 +1,7 @@
# Template file for 'dracut'
pkgname=dracut
version=050
-revision=3
+revision=4
build_style=configure
configure_args="--prefix=/usr --sysconfdir=/etc"
conf_files="/etc/dracut.conf"
@@ -14,10 +14,11 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later"
homepage="http://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html"
distfiles="https://github.com/dracutdevs/dracut/archive/${version}.tar.gz"
checksum=f9dbf18597e5929221365964293212c8c9ffb7d84529c5a338c834ecab06e333
+subpackages="dracut-network"
make_dirs="
- /etc/dracut.conf.d 0755 root root
- /usr/lib/dracut/dracut.conf.d 0755 root root"
+ /etc/dracut.conf.d 0755 root root
+ /usr/lib/dracut/dracut.conf.d 0755 root root"
case "$XBPS_TARGET_MACHINE" in
*-musl) # Add musl-fts implementation
@@ -25,6 +26,13 @@ case "$XBPS_TARGET_MACHINE" in
;;
esac
+case "$XBPS_TARGET_MACHINE" in
+ i686*|x86_64*|aarch64*) # EFI bundle config and hooks
+ _efi_bundle=1
+ subpackages+=" dracut-uefi"
+ ;;
+esac
+
do_build() {
case "$XBPS_TARGET_MACHINE" in
*-musl) make ${makejobs} LDLIBS="-lfts" ;;
@@ -40,6 +48,13 @@ 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
+
+ if [ "${_efi_bundle}" ]; then
+ vinstall ${FILESDIR}/dracut-uefi-hook.confd 644 etc/default dracut-uefi-hook
+ vinstall ${FILESDIR}/kernel-uefi-hook-postinst 755 etc/kernel.d/post-install 20-dracut-uefi
+ vinstall ${FILESDIR}/kernel-uefi-hook-postrm 755 etc/kernel.d/post-remove 20-dracut-uefi
+ fi
+
# We don't need the systemd stuff.
rm -rf ${DESTDIR}/usr/lib/dracut/modules.d/*systemd*
rm -f ${DESTDIR}/usr/share/man/man8/*.service.*
@@ -52,8 +67,19 @@ dracut-network_package() {
archs=noarch
pkg_install() {
for f in 40network 90livenet 95fcoe 95iscsi \
- 95nbd 95nfs 95zfcp 95znet; do
+ 95nbd 95nfs 95zfcp 95znet; do
vmove usr/lib/dracut/modules.d/${f}
done
}
}
+
+dracut-uefi_package() {
+ depends="gummiboot dracut-${version}_${revision}"
+ short_desc+=" - UEFI bundle hook"
+ conf_files="/etc/default/dracut-uefi-hook"
+ pkg_install() {
+ vmove etc/kernel.d/post-install/20-dracut-uefi
+ vmove etc/kernel.d/post-remove/20-dracut-uefi
+ vmove etc/default/dracut-uefi-hook
+ }
+}
next prev parent reply other threads:[~2020-07-27 13:20 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-01 0:41 [PR PATCH] " ericonr
2020-06-01 0:47 ` [PR PATCH] [Updated] " ericonr
2020-06-01 1:06 ` ericonr
2020-06-01 2:59 ` ericonr
2020-06-01 3:57 ` ericonr
2020-06-01 7:32 ` ericonr
2020-07-20 3:58 ` ericonr
2020-07-20 14:41 ` [PR PATCH] [Updated] " ericonr
2020-07-20 16:07 ` [PR REVIEW] " Duncaen
2020-07-20 16:07 ` Duncaen
2020-07-20 16:07 ` Duncaen
2020-07-20 16:16 ` sgn
2020-07-20 16:16 ` sgn
2020-07-20 16:16 ` sgn
2020-07-20 16:16 ` sgn
2020-07-20 16:16 ` sgn
2020-07-20 16:16 ` sgn
2020-07-20 16:20 ` sgn
2020-07-20 16:28 ` sgn
2020-07-20 18:17 ` ericonr
2020-07-20 18:18 ` ericonr
2020-07-20 18:23 ` ericonr
2020-07-20 18:26 ` ericonr
2020-07-20 18:26 ` ericonr
2020-07-20 18:28 ` [PR PATCH] [Updated] " ericonr
2020-07-20 23:05 ` [PR REVIEW] " ericonr
2020-07-20 23:06 ` ericonr
2020-07-20 23:32 ` ahesford
2020-07-20 23:39 ` ericonr
2020-07-20 23:43 ` ericonr
2020-07-21 0:12 ` sgn
2020-07-21 0:12 ` sgn
2020-07-21 0:16 ` sgn
2020-07-21 0:17 ` ahesford
2020-07-21 0:27 ` ericonr
2020-07-21 1:05 ` sgn
2020-07-21 1:12 ` ericonr
2020-07-21 1:21 ` ericonr
2020-07-21 1:23 ` [PR PATCH] [Updated] " ericonr
2020-07-21 1:24 ` ericonr
2020-07-27 11:56 ` sgn
2020-07-27 12:39 ` ericonr
2020-07-27 12:49 ` [PR REVIEW] " sgn
2020-07-27 12:49 ` sgn
2020-07-27 12:51 ` [PR PATCH] [Updated] " ericonr
2020-07-27 12:52 ` [PR REVIEW] " ericonr
2020-07-27 12:52 ` [PR PATCH] [Updated] " ericonr
2020-07-27 12:53 ` sgn
2020-07-27 12:54 ` sgn
2020-07-27 12:56 ` sgn
2020-07-27 12:58 ` ericonr
2020-07-27 13:04 ` sgn
2020-07-27 13:09 ` ericonr
2020-07-27 13:18 ` [PR PATCH] [Updated] " ericonr
2020-07-27 13:19 ` ericonr
2020-07-27 13:20 ` ericonr [this message]
2020-07-27 13:25 ` sgn
2020-07-27 13:28 ` ericonr
2020-07-27 13:29 ` ericonr
2020-07-27 13:36 ` [PR REVIEW] " ahesford
2020-07-27 13:36 ` ahesford
2021-07-07 21:24 ` jirutka
2021-07-07 21:55 ` ahesford
2021-07-07 22:47 ` jirutka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200727132041.awkcfPkiwsJKCcARIj0Ap51gxyIj8yN-kyiuy6NSYwE@z \
--to=ericonr@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).