Github messages for voidlinux
 help / color / mirror / Atom feed
From: classabbyamp <classabbyamp@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] New package: systemd-boot-efistub-253
Date: Fri, 17 Mar 2023 02:07:26 +0100	[thread overview]
Message-ID: <20230317010726.FHciXSO3NhzYsd7m0tLMXt6mbjSGU5790YkFINcCmB8@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-42667@inbox.vuxu.org>

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

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages sysd-boot-stub
https://github.com/void-linux/void-packages/pull/42667

New package: systemd-boot-efistub-253
<!-- Uncomment relevant sections and delete options which are not applicable -->

see #42566

thoroughly untested atm, but it builds the efistub

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

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



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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sysd-boot-stub-42667.patch --]
[-- Type: text/x-diff, Size: 12502 bytes --]

From 3800755944ed2df524cdf33adcf141e9349562a2 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 8 Mar 2023 19:24:00 -0500
Subject: [PATCH 1/2] New package: systemd-boot-efistub-253

---
 .../systemd-boot-efistub/patches/musl.patch   | 41 +++++++++++++++
 srcpkgs/systemd-boot-efistub/template         | 52 +++++++++++++++++++
 2 files changed, 93 insertions(+)
 create mode 100644 srcpkgs/systemd-boot-efistub/patches/musl.patch
 create mode 100644 srcpkgs/systemd-boot-efistub/template

diff --git a/srcpkgs/systemd-boot-efistub/patches/musl.patch b/srcpkgs/systemd-boot-efistub/patches/musl.patch
new file mode 100644
index 000000000000..85d5a7fd2642
--- /dev/null
+++ b/srcpkgs/systemd-boot-efistub/patches/musl.patch
@@ -0,0 +1,41 @@
+From a4ff7772acf1d983921833aa20ccd7c4d5e59a1c Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex@linutronix.de>
+Date: Mon, 6 Mar 2023 15:24:49 +0100
+Subject: [PATCH] src/boot/efi/efi-string.c: define wchar_t from __WCHAR_TYPE__
+
+systemd-boot relies on wchar_t being 16 bit, and breaks at build time otherwise.
+
+To set wchar_t to 16 bit it is passing -fshort-wchar to gcc; this has the
+desired effect on glibc (which sets wchar_t from __WCHAR_TYPE__) but not on
+musl (which hardcodes it to 32 bit).
+
+This patch ensures wchar_t is set from the compiler flags on all systems; note
+that systemd-boot is not actually using functions from musl or other libc, just their headers.
+
+Meanwhile upstream has refactored the code to not rely on libc headers at all;
+however this will not be backported to v253 and we need a different fix.
+
+Upstream-Status: Inappropriate [fixed differently in trunk according to https://github.com/systemd/systemd/pull/26689]
+Signed-off-by: Alexander Kanavin <alex@linutronix.de>
+---
+ src/boot/efi/efi-string.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/boot/efi/efi-string.c b/src/boot/efi/efi-string.c
+index 22923d60f6..22a8d1ef71 100644
+--- a/src/boot/efi/efi-string.c
++++ b/src/boot/efi/efi-string.c
+@@ -2,7 +2,13 @@
+ 
+ #include <stdbool.h>
+ #include <stdint.h>
++
++#if SD_BOOT
++typedef __WCHAR_TYPE__ wchar_t;
++#define __DEFINED_wchar_t
++#else
+ #include <wchar.h>
++#endif
+ 
+ #include "efi-string.h"
+ 
diff --git a/srcpkgs/systemd-boot-efistub/template b/srcpkgs/systemd-boot-efistub/template
new file mode 100644
index 000000000000..77e7f93a7910
--- /dev/null
+++ b/srcpkgs/systemd-boot-efistub/template
@@ -0,0 +1,52 @@
+# Template file for 'systemd-boot-efistub'
+pkgname=systemd-boot-efistub
+version=253
+revision=1
+build_style=meson
+configure_args="-Defi=true -Dgnu-efi=true -Defi-libdir=${XBPS_CROSS_BASE}/usr/lib
+ -Defi-includedir=${XBPS_CROSS_BASE}/usr/include/efi
+ -Dlink-boot-shared=false -Dstandalone-binaries=true
+ -Dacl=false -Dkmod=false -Dselinux=false -Dsysusers=false -Dtmpfiles=false
+ -Dadm-group=false -Danalyze=false -Dapparmor=false -Daudit=false
+ -Dbacklight=false -Dbinfmt=false -Dbpf-framework=false -Dbzip2=false
+ -Dcoredump=false -Ddbus=false -Delfutils=false -Denvironment-d=false
+ -Dfdisk=false -Dgcrypt=false -Dglib=false -Dgshadow=false -Dgnutls=false
+ -Dhibernate=false -Dhostnamed=false -Didn=false -Dima=false -Dinitrd=false
+ -Dfirstboot=false -Dldconfig=false -Dlibcryptsetup=false -Dlibcurl=false
+ -Dlibfido2=false -Dlibidn=false -Dlibidn2=false -Dlibiptc=false -Dlocaled=false
+ -Dlogind=false -Dlz4=false -Dmachined=false -Dmicrohttpd=false -Dnetworkd=false
+ -Dnscd=false -Dnss-myhostname=false -Dnss-resolve=false -Dnss-systemd=false
+ -Doomd=false -Dopenssl=false -Dp11kit=false -Dpam=false -Dpcre2=false
+ -Dpolkit=false -Dportabled=false -Dpstore=false -Dpwquality=false
+ -Drandomseed=false -Dresolve=false -Drfkill=false -Dseccomp=false -Dsmack=false
+ -Dsysext=false -Dtimedated=false -Dtimesyncd=false -Dtpm=false -Dqrencode=false
+ -Dquotacheck=false -Duserdb=false -Dutmp=false -Dvconsole=false -Dwheel-group=false
+ -Dxdg-autostart=false -Dxkbcommon=false -Dxz=false -Dzlib=false -Dzstd=false
+ -Dblkid=false -Dkernel-install=false
+ -Dsbat-distro=void -Dsbat-distro-summary=Void
+ -Dsbat-distro-url='https://github.com/void-linux/void-packages/issues'
+ -Dtests=false"
+# most of these aren't needed for what we're building but it's easier than patching
+hostmakedepends="pkg-config gperf python3-Jinja2"
+makedepends="gnu-efi-libs libcap-devel libmount-devel"
+short_desc="Linux UEFI stub from systemd-boot"
+maintainer="classabbyamp <void@placeviolette.net>"
+license="LGPL-2.1-or-later"
+homepage="https://systemd.io"
+distfiles="https://github.com/systemd/systemd/archive/refs/tags/v${version}.tar.gz"
+checksum=acbd86d42ebc2b443722cb469ad215a140f504689c7a9133ecf91b235275a491
+make_check=no  # missing printf.h
+
+case "${XBPS_TARGET_MACHINE}" in
+	x86_64*)  _efi_arch="x64"     ;;
+	i686*)    _efi_arch="ia32"    ;;
+	aarch64*) _efi_arch="aa64"    ;;
+	arm*)     _efi_arch="arm"     ;;
+	riscv64*) _efi_arch="riscv64" ;;
+	*) broken="unknown efi architecture" ;;
+esac
+make_build_target="src/boot/efi/linux${_efi_arch}.efi.stub"
+
+do_install() {
+	vinstall build/src/boot/efi/linux${_efi_arch}.efi.stub 644 usr/lib/systemd/boot/efi
+}

From 1bea2632fb2b86c38aac267fc035567a1d3ad31b Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 15 Mar 2023 20:40:35 -0400
Subject: [PATCH 2/2] fixup! New package: systemd-boot-efistub-253

---
 srcpkgs/systemd-boot-efistub                  |  1 +
 srcpkgs/systemd-boot/files/systemd-boot.confd |  2 +
 .../files/systemd-boot.post-install           | 45 ++++++++++++++++
 .../files/systemd-boot.post-remove            |  0
 .../patches/musl.patch                        |  0
 .../template                                  | 53 +++++++++++++++----
 6 files changed, 90 insertions(+), 11 deletions(-)
 create mode 120000 srcpkgs/systemd-boot-efistub
 create mode 100644 srcpkgs/systemd-boot/files/systemd-boot.confd
 create mode 100644 srcpkgs/systemd-boot/files/systemd-boot.post-install
 create mode 100644 srcpkgs/systemd-boot/files/systemd-boot.post-remove
 rename srcpkgs/{systemd-boot-efistub => systemd-boot}/patches/musl.patch (100%)
 rename srcpkgs/{systemd-boot-efistub => systemd-boot}/template (55%)

diff --git a/srcpkgs/systemd-boot-efistub b/srcpkgs/systemd-boot-efistub
new file mode 120000
index 000000000000..171756f5fb67
--- /dev/null
+++ b/srcpkgs/systemd-boot-efistub
@@ -0,0 +1 @@
+systemd-boot
\ No newline at end of file
diff --git a/srcpkgs/systemd-boot/files/systemd-boot.confd b/srcpkgs/systemd-boot/files/systemd-boot.confd
new file mode 100644
index 000000000000..eaad017a16ba
--- /dev/null
+++ b/srcpkgs/systemd-boot/files/systemd-boot.confd
@@ -0,0 +1,2 @@
+# uncomment this line to disable the systemd-boot hook
+# SYSTEMD_BOOT_DISABLE=1
diff --git a/srcpkgs/systemd-boot/files/systemd-boot.post-install b/srcpkgs/systemd-boot/files/systemd-boot.post-install
new file mode 100644
index 000000000000..707e2750eeec
--- /dev/null
+++ b/srcpkgs/systemd-boot/files/systemd-boot.post-install
@@ -0,0 +1,45 @@
+#!/bin/sh
+#
+# Kernel hook for systemd-boot.
+#
+# Arguments passed to this script: $1 pkgname, $2 version.
+#
+PKGNAME="$1"
+VERSION="$2"
+
+. "$ROOTDIR/etc/default/systemd-boot"
+
+if [ "$SYSTEMD_BOOT_DISABLE" ]; then
+	exit 0
+fi
+
+boot="$ROOTDIR/boot"
+entries="$boot/loader/entries"
+name="void-$VERSION"
+entry="$entries/$name.conf"
+options="$boot/loader/void-options.conf"
+loader="$boot/loader/loader.conf"
+
+[ -d "$boot" ] || exit 0
+
+mkdir -p "$entries"
+
+cat <<-EOF > "$entry"
+	title Void Linux
+	version $VERSION
+	linux /vmlinuz-$VERSION
+	initrd /initramfs-$VERSION.img
+EOF
+
+if [ -r "$options" ]; then
+	# Add user provided options from /boot/loader/void-options.conf:
+	printf 'options %s\n' "$(cat "$options" | sed '/^#/d;/^$/d')" >> "$entry"
+fi
+
+if grep -q ^default "$loader" 2>/dev/null; then
+	# Replace existing default entry with this entry:
+	sed -i "s/default.*/default $name/" "$loader"
+else
+	# Add this entry as the default:
+	printf 'default %s\n' $name >>"$loader"
+fi
diff --git a/srcpkgs/systemd-boot/files/systemd-boot.post-remove b/srcpkgs/systemd-boot/files/systemd-boot.post-remove
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/srcpkgs/systemd-boot-efistub/patches/musl.patch b/srcpkgs/systemd-boot/patches/musl.patch
similarity index 100%
rename from srcpkgs/systemd-boot-efistub/patches/musl.patch
rename to srcpkgs/systemd-boot/patches/musl.patch
diff --git a/srcpkgs/systemd-boot-efistub/template b/srcpkgs/systemd-boot/template
similarity index 55%
rename from srcpkgs/systemd-boot-efistub/template
rename to srcpkgs/systemd-boot/template
index 77e7f93a7910..007be7af1bf1 100644
--- a/srcpkgs/systemd-boot-efistub/template
+++ b/srcpkgs/systemd-boot/template
@@ -1,11 +1,14 @@
-# Template file for 'systemd-boot-efistub'
-pkgname=systemd-boot-efistub
+# Template file for 'systemd-boot'
+pkgname=systemd-boot
 version=253
 revision=1
 build_style=meson
 configure_args="-Defi=true -Dgnu-efi=true -Defi-libdir=${XBPS_CROSS_BASE}/usr/lib
  -Defi-includedir=${XBPS_CROSS_BASE}/usr/include/efi
- -Dlink-boot-shared=false -Dstandalone-binaries=true
+ -Dsbat-distro=void -Dsbat-distro-summary=Void
+ -Dsbat-distro-url=https://github.com/void-linux/void-packages/issues
+ -Dblkid=true -Dkernel-install=true -Dlink-boot-shared=false
+ -Dstandalone-binaries=true -Dman=true
  -Dacl=false -Dkmod=false -Dselinux=false -Dsysusers=false -Dtmpfiles=false
  -Dadm-group=false -Danalyze=false -Dapparmor=false -Daudit=false
  -Dbacklight=false -Dbinfmt=false -Dbpf-framework=false -Dbzip2=false
@@ -22,17 +25,15 @@ configure_args="-Defi=true -Dgnu-efi=true -Defi-libdir=${XBPS_CROSS_BASE}/usr/li
  -Dsysext=false -Dtimedated=false -Dtimesyncd=false -Dtpm=false -Dqrencode=false
  -Dquotacheck=false -Duserdb=false -Dutmp=false -Dvconsole=false -Dwheel-group=false
  -Dxdg-autostart=false -Dxkbcommon=false -Dxz=false -Dzlib=false -Dzstd=false
- -Dblkid=false -Dkernel-install=false
- -Dsbat-distro=void -Dsbat-distro-summary=Void
- -Dsbat-distro-url='https://github.com/void-linux/void-packages/issues'
  -Dtests=false"
 # most of these aren't needed for what we're building but it's easier than patching
-hostmakedepends="pkg-config gperf python3-Jinja2"
+hostmakedepends="pkg-config gperf python3-Jinja2 libxslt docbook-xsl"
 makedepends="gnu-efi-libs libcap-devel libmount-devel"
-short_desc="Linux UEFI stub from systemd-boot"
+depends="${pkgname}-efistub>=${version}_${revision}"
+short_desc="UEFI boot manager from systemd"
 maintainer="classabbyamp <void@placeviolette.net>"
 license="LGPL-2.1-or-later"
-homepage="https://systemd.io"
+homepage="https://www.freedesktop.org/wiki/Software/systemd/systemd-boot/"
 distfiles="https://github.com/systemd/systemd/archive/refs/tags/v${version}.tar.gz"
 checksum=acbd86d42ebc2b443722cb469ad215a140f504689c7a9133ecf91b235275a491
 make_check=no  # missing printf.h
@@ -45,8 +46,38 @@ case "${XBPS_TARGET_MACHINE}" in
 	riscv64*) _efi_arch="riscv64" ;;
 	*) broken="unknown efi architecture" ;;
 esac
-make_build_target="src/boot/efi/linux${_efi_arch}.efi.stub"
+_bins=(bootctl kernel-install ukify)
+_mans=(man/bootctl.1 man/ukify.1 man/loader.conf.5 man/systemd-boot.7 man/systemd-stub.7 man/kernel-install.8)
+_efis=("src/boot/efi/linux${_efi_arch}.efi.stub" "src/boot/efi/systemd-boot${_efi_arch}.efi")
+make_build_target="${_bins[*]} ${_mans[*]} ${_efis[*]} 90-loaderentry.install"
 
 do_install() {
-	vinstall build/src/boot/efi/linux${_efi_arch}.efi.stub 644 usr/lib/systemd/boot/efi
+	for b in "${_bins[@]}"; do
+		vbin "build/$b"
+	done
+	for m in build/man/*.[0-9]; do
+		vman "$m"
+	done
+	for c in bootctl kernel-install; do
+		vcompletion "shell-completion/bash/$c" bash "${c%*/}"
+		vcompletion "shell-completion/zsh/_$c" zsh "${c%*/_}"
+	done
+	for e in "${_efis[@]}"; do
+		vinstall "build/$e" 644 usr/lib/systemd/boot/efi
+	done
+	for f in build/90-loaderentry.install src/kernel-install/50-depmod.install src/kernel-install/90-uki-copy.install; do
+		vinstall "$f" 755 usr/lib/kernel/install.d
+	done
+
+	vinstall "${FILESDIR}/systemd-boot.post-install" 744 etc/kernel.d/post-install 50-systemd-boot
+	vinstall "${FILESDIR}/systemd-boot.post-remove" 744 etc/kernel.d/post-remove 50-systemd-boot
+	vinstall "${FILESDIR}/systemd-boot.confd" 644 etc/default systemd-boot
+}
+
+systemd-boot-efistub_package() {
+	short_desc+=" - UEFI stub loader"
+	pkg_install() {
+		vmove "usr/lib/systemd/boot/efi/*.efi.stub"
+		vmove "usr/share/man/man7/*stub.7"
+	}
 }

  parent reply	other threads:[~2023-03-17  1:07 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09  0:25 [PR PATCH] " classabbyamp
2023-03-09  0:28 ` [PR PATCH] [Updated] " classabbyamp
2023-03-09  0:29 ` classabbyamp
2023-03-09  0:40 ` classabbyamp
2023-03-09  0:46 ` classabbyamp
2023-03-09  0:58 ` classabbyamp
2023-03-11  8:38 ` classabbyamp
2023-03-11 19:26 ` classabbyamp
2023-03-11 19:38 ` classabbyamp
2023-03-11 20:14 ` classabbyamp
2023-03-13  1:48 ` prez
2023-03-13  2:12 ` classabbyamp
2023-03-13  6:44 ` sonnysighedup
2023-03-13  6:45 ` sonnysighedup
2023-03-13 11:24 ` NymanMatthias
2023-03-14 22:18 ` prez
2023-03-14 22:23 ` prez
2023-03-15  4:32 ` 0x5c
2023-03-15  4:41 ` classabbyamp
2023-03-15 12:04 ` prez
2023-03-17  1:07 ` classabbyamp [this message]
2023-03-17  1:43 ` 0x5c
2023-03-30 12:31 ` [PR REVIEW] " prez
2023-03-30 12:31 ` prez
2023-04-02 19:48 ` prez
2023-04-02 20:00 ` classabbyamp
2023-04-25 11:57 ` junkmanner
2023-04-25 14:04 ` classabbyamp
2023-04-25 14:04 ` classabbyamp
2023-04-25 14:04 ` classabbyamp
2023-07-25  2:01 ` github-actions
2023-09-08  8:03 ` [PR PATCH] [Updated] " classabbyamp
2023-09-08  8:04 ` classabbyamp
2023-09-08  8:06 ` New package: systemd-boot-254.2 classabbyamp
2023-09-08  8:27 ` [PR PATCH] [Updated] " classabbyamp
2023-09-08  8:29 ` classabbyamp
2023-10-05 11:31 ` MeganerdNL
2023-10-05 11:32 ` MeganerdNL
2023-10-05 11:42 ` MeganerdNL
2023-10-05 12:18 ` classabbyamp
2023-10-05 12:43 ` MeganerdNL
2024-01-04  1:46 ` github-actions
2024-02-01 20:53 ` dkwo
2024-02-01 20:53 ` dkwo
2024-02-01 21:26 ` dkwo
2024-02-02 18:56 ` [PR PATCH] [Updated] " classabbyamp
2024-02-02 22:34 ` [PR PATCH] [Updated] New package: systemd-boot-efistub-255.3 classabbyamp
2024-02-02 22:50 ` [PR PATCH] [Merged]: " classabbyamp

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=20230317010726.FHciXSO3NhzYsd7m0tLMXt6mbjSGU5790YkFINcCmB8@z \
    --to=classabbyamp@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).