From afcc901fc15a454ec2034e1eb5556eae3eb13d51 Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Wed, 15 Apr 2026 17:35:53 -0700 Subject: [PATCH] systemd/systemd: re-enable -Dbootloader Turns out, a few useful things are gated by this flag that I want to use in Duranium: 1) bootctl automatically configuring EFI boot entry variables 2) systemd-boot-update.service installation Let's just re-enable this and strip out the sd-boot stuff already packaged in Alpine aports, rather than continue to fight the build system with more patches in pmaports. Signed-off-by: Clayton Craft Part-of: --- extra-repos/systemd/systemd/APKBUILD | 18 +++-- extra-repos/systemd/systemd/bless-boot.patch | 78 -------------------- 2 files changed, 13 insertions(+), 83 deletions(-) delete mode 100644 extra-repos/systemd/systemd/bless-boot.patch diff --git a/extra-repos/systemd/systemd/APKBUILD b/extra-repos/systemd/systemd/APKBUILD index 8f22a25ac..506e62ff4 100644 --- a/extra-repos/systemd/systemd/APKBUILD +++ b/extra-repos/systemd/systemd/APKBUILD @@ -9,7 +9,7 @@ maintainer="Clayton Craft " pkgname=systemd pkgver=260.1 _pkgver="${pkgver/_/-}" -pkgrel=5 +pkgrel=6 pkgdesc="System and service manager" url="https://github.com/systemd/systemd" # armhf: no linux-stable @@ -69,6 +69,7 @@ makedepends=" pcre2-dev perl pkgconf + py3-elftools py3-jinja2 py3-lxml python3-dev @@ -156,14 +157,12 @@ subpackages=" source="$pkgname-$pkgver.tar.gz::https://github.com/systemd/systemd/archive/refs/tags/v$_pkgver.tar.gz wired.network - bless-boot.patch 41416.patch 41418.patch 41419.patch 41483.patch " -builddir="$srcdir/systemd-$_pkgver" _bashcomp="usr/share/bash-completion/completions" _zshcomp="usr/share/zsh/site-functions" @@ -187,6 +186,13 @@ _default_zshcomp() { } build() { + local bootloader="enabled" + case "$CARCH" in + # ppc64le s390x: no EFI support + # armv7 x86: build broken for 32-bit + armv7|ppc64le|s390x|x86) bootloader="disabled" ;; + esac + # TODO: after usr-merge completion: remove hardcoded "-D*-path" options abuild-meson \ -Dlibc=musl \ @@ -215,7 +221,7 @@ build() { -Dsysupdated=enabled \ -Dimportd=enabled \ \ - -Dbootloader=disabled \ + -Dbootloader="$bootloader" \ -Dinitrd=true \ -Dhibernate=false \ -Dselinux=disabled \ @@ -286,6 +292,9 @@ package() { # initramfs hardcodes /sbin/init mkdir -p "$pkgdir"/sbin ln -sf "../usr/lib/systemd/systemd" "$pkgdir"/sbin/init + + # this stuff is packaged in Alpine aports under "systemd-boot" + rm -rf "$pkgdir"/usr/lib/systemd/boot } udevd() { @@ -524,7 +533,6 @@ _resolve_packages() { sha512sums=" 9f975dce6861853a817a7ceab18a24449a85d1bda6939b3a5173430c02a4d8a9a2b34ebb8cce1c51db9b0ff9078fcc65da7b0f44e3bdcbbe013b9e04bb6f0ff9 systemd-260.1.tar.gz 81c897fed8a3fbfb67ec591b2398a5d65e4af1b3ef379376c157c98d71f085b707f8ebc896d5571a94f99f8fc84fd6b43e3b879ca9b0d57fc6c4596034c7a777 wired.network -8b0360acd46f8918ccaf4bcfbf8b2e60ba0d1d6ea6c575fa51668e129b421edc3e7503db7790b6abce8d926b6c8493c02893f70eb481e3fdd935c7b90f442474 bless-boot.patch c33c552c6b8c74d3c15f339ec0ebc6d179022f18ba13d8524ce22e9311deb4bbba369a3a737222c9954817398c44998f3169f7f55122d6ee7b96f7d3fd6bcc78 41416.patch ca2f3a1326b3367aef0c1961c6dbbce0659b81ef39a0a546db69129b2edeba2f5141a663ae0d926bca96d7a9d1d09c7d840c63165f317f778a489b44f9b431c6 41418.patch 394fb47e88f5ae766ffcb226bd55df25771e45099ba3cbed6b034e9a36a77a13029d24b2e2f27ef6624f6dfb87f1165da4654d4043fe8b88bcd34d81f786f902 41419.patch diff --git a/extra-repos/systemd/systemd/bless-boot.patch b/extra-repos/systemd/systemd/bless-boot.patch deleted file mode 100644 index c1b2c9e0b..000000000 --- a/extra-repos/systemd/systemd/bless-boot.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 92d7efca25415462fae8c20eafde1f826c017bb5 Mon Sep 17 00:00:00 2001 -From: Clayton Craft -Date: Thu, 24 Jul 2025 18:26:37 -0700 -Subject: [PATCH] Enable bless-boot generator - -This does a hack to removing the need to build the stuff in src/boot for -enabling bless-boot. Previously I tried to enable bless-boot by adding --Dbootloader=enable, which would be required without this hack, but -cross-compiling systemd/src/boot failed on 32-bit archs and it seemed -unnecessary to go down that rabbit hole to debug/fix. - -Why? Because: - -1) It's not actually needed for building the stuff I care about enabling -in this MR (systemd-bless-boot and its generator). These things build -and work just fine without building stuff in src/boot. - -2) Even if it worked, we would have to remove the artifacts made -from src/boot and not package them here. They would conflict with the -systemd-boot package in Alpine. - -So it seems pointless to waste time fixing some weird cross-compiling -issue for some components that don't actually need to be built to enable -the extra features I want and would be discarded anyways in package() - -Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6840 - ---- - -The "bless boot" is built conditionally on -Dbootloader=enabled, but it -doesn't seem to actually depend on anything in src/systemd/boot. There's a lot -of stuff that gets enabled with that flag, and we don't actually want any of -it (it's packaged separately as 'systemd-boot' in Alpine aports). By removing -the condition, we can build/package the bless boot stuff without having to -unnecessarily build the bootloader. - -Signed-off-by: Achill Gilgenast ---- - src/bless-boot/meson.build | 2 -- - units/meson.build | 2 +- - 2 files changed, 1 insertion(+), 3 deletions(-) - -diff --git a/src/bless-boot/meson.build b/src/bless-boot/meson.build -index ae814f1b29d1..a8815f288712 100644 ---- a/src/bless-boot/meson.build -+++ b/src/bless-boot/meson.build -@@ -15,7 +15,6 @@ executables += [ - 'public' : true, - 'conditions' : [ - 'HAVE_BLKID', -- 'ENABLE_BOOTLOADER', - ], - 'sources' : files('bless-boot.c'), - 'link_with' : boot_link_with, -@@ -24,7 +23,6 @@ executables += [ - 'name' : 'systemd-bless-boot-generator', - 'conditions' : [ - 'HAVE_BLKID', -- 'ENABLE_BOOTLOADER', - ], - 'sources' : files('bless-boot-generator.c'), - 'link_with' : boot_link_with, -diff --git a/units/meson.build b/units/meson.build -index 113a935c90b0..2d0444c0b10a 100644 ---- a/units/meson.build -+++ b/units/meson.build -@@ -277,7 +277,7 @@ units = [ - }, - { - 'file' : 'systemd-bless-boot.service.in', -- 'conditions' : ['ENABLE_BOOTLOADER', 'HAVE_BLKID'], -+ 'conditions' : ['HAVE_BLKID'], - }, - { 'file' : 'systemd-boot-check-no-failures.service.in' }, - { --- -2.53.0 -