main/systemd-boot: remove
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6506
This commit is contained in:
parent
f80528b498
commit
6cad7cea9b
4 changed files with 0 additions and 293 deletions
|
|
@ -1,67 +0,0 @@
|
|||
From f214e955b853d87aa1a34dfbb44b5d8edff3962c Mon Sep 17 00:00:00 2001
|
||||
From: Clayton Craft <clayton@craftyguy.net>
|
||||
Date: Tue, 7 Jan 2025 20:19:51 -0800
|
||||
Subject: [PATCH 1/2] meson: minimal configure for building systemd-boot
|
||||
|
||||
Notes:
|
||||
- toggling all ENABLED_* things off saves a ton of configure
|
||||
time
|
||||
- Removing capability.h, so that cross compiling doesn't fail
|
||||
because that header isn't installed
|
||||
- Set libcap and libmount to required=false, they aren't needed for
|
||||
building the bootloader, and they complicate cross compilation
|
||||
---
|
||||
meson.build | 16 +++++++++++-----
|
||||
1 file changed, 11 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/meson.build b/meson.build
|
||||
index bffda86845..b5a27de305 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -766,9 +766,6 @@ conf.set('GPERF_LEN_TYPE', gperf_len_type,
|
||||
|
||||
#####################################################################
|
||||
|
||||
-if not cc.has_header('sys/capability.h')
|
||||
- error('POSIX caps headers not found')
|
||||
-endif
|
||||
foreach header : ['crypt.h',
|
||||
'linux/ioprio.h',
|
||||
'linux/memfd.h',
|
||||
@@ -1052,7 +1049,7 @@ if not libcrypt.found()
|
||||
# fallback to use find_library() if libcrypt is provided by glibc, e.g. for LibreELEC.
|
||||
libcrypt = cc.find_library('crypt')
|
||||
endif
|
||||
-libcap = dependency('libcap')
|
||||
+libcap = dependency('libcap', required : false)
|
||||
|
||||
# On some architectures, libatomic is required. But on some installations,
|
||||
# it is found, but actual linking fails. So let's try to use it opportunistically.
|
||||
@@ -1164,7 +1161,7 @@ else
|
||||
endif
|
||||
|
||||
libmount = dependency('mount',
|
||||
- version : fuzzer_build ? '>= 0' : '>= 2.30')
|
||||
+ version : fuzzer_build ? '>= 0' : '>= 2.30', required : false)
|
||||
|
||||
libfdisk = dependency('fdisk',
|
||||
version : '>= 2.32',
|
||||
@@ -1931,6 +1928,15 @@ pefile = pymod.find_installation('python3', required: false, modules : ['pefile'
|
||||
want_ukify = get_option('ukify').require(python_39 and (want_tests != 'true' or pefile.found()), error_message : 'Python >= 3.9 and pefile required').allowed()
|
||||
conf.set10('ENABLE_UKIFY', want_ukify)
|
||||
|
||||
+foreach key : conf.keys()
|
||||
+ if key.startswith('ENABLE_')
|
||||
+ conf.set10(key, false)
|
||||
+ endif
|
||||
+endforeach
|
||||
+
|
||||
+conf.set10('ENABLE_EFI', true)
|
||||
+conf.set10('ENABLE_BOOTLOADER', true)
|
||||
+
|
||||
#####################################################################
|
||||
|
||||
check_efi_alignment_py = find_program('tools/check-efi-alignment.py')
|
||||
--
|
||||
2.47.1
|
||||
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
From 32f9f6919206f7385a66d711f9644aaacf533181 Mon Sep 17 00:00:00 2001
|
||||
From: Clayton Craft <clayton@craftyguy.net>
|
||||
Date: Tue, 7 Jan 2025 20:21:29 -0800
|
||||
Subject: [PATCH 2/2] fix wchar for compiling on musl
|
||||
|
||||
---
|
||||
src/boot/efi-string.c | 10 +++++-----
|
||||
src/boot/efi.h | 5 +----
|
||||
2 files changed, 6 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/src/boot/efi-string.c b/src/boot/efi-string.c
|
||||
index aee98a81e1..314d14d3e5 100644
|
||||
--- a/src/boot/efi-string.c
|
||||
+++ b/src/boot/efi-string.c
|
||||
@@ -570,7 +570,7 @@ typedef struct {
|
||||
bool have_field_width;
|
||||
|
||||
const char *str;
|
||||
- const wchar_t *wstr;
|
||||
+ const uint16_t *wstr;
|
||||
|
||||
/* For numbers. */
|
||||
bool is_signed;
|
||||
@@ -631,7 +631,7 @@ static bool push_str(FormatContext *ctx, SpecifierContext *sp) {
|
||||
push_padding(ctx, ' ', sp->padded_len);
|
||||
|
||||
/* In userspace unit tests we cannot just memcpy() the wide string. */
|
||||
- if (sp->wstr && sizeof(wchar_t) == sizeof(char16_t)) {
|
||||
+ if (sp->wstr && sizeof(uint16_t) == sizeof(char16_t)) {
|
||||
memcpy(ctx->buf + ctx->n, sp->wstr, sp->len * sizeof(*sp->wstr));
|
||||
ctx->n += sp->len;
|
||||
} else {
|
||||
@@ -725,7 +725,7 @@ static bool handle_format_specifier(FormatContext *ctx, SpecifierContext *sp) {
|
||||
* int in vararg functions, which is why we fetch only ints for any such types. The compiler would
|
||||
* otherwise warn about fetching smaller types. */
|
||||
assert_cc(sizeof(int) == 4);
|
||||
- assert_cc(sizeof(wchar_t) <= sizeof(int));
|
||||
+ assert_cc(sizeof(uint16_t) <= sizeof(int));
|
||||
assert_cc(sizeof(intmax_t) <= sizeof(long long));
|
||||
|
||||
assert(ctx);
|
||||
@@ -820,13 +820,13 @@ static bool handle_format_specifier(FormatContext *ctx, SpecifierContext *sp) {
|
||||
return push_str(ctx, sp);
|
||||
|
||||
case 'c':
|
||||
- sp->wstr = &(wchar_t){ va_arg(ctx->ap, int) };
|
||||
+ sp->wstr = &(uint16_t){ va_arg(ctx->ap, int) };
|
||||
sp->len = 1;
|
||||
return push_str(ctx, sp);
|
||||
|
||||
case 's':
|
||||
if (sp->long_arg) {
|
||||
- sp->wstr = va_arg(ctx->ap, const wchar_t *) ?: L"(null)";
|
||||
+ sp->wstr = va_arg(ctx->ap, const uint16_t *) ?: L"(null)";
|
||||
sp->len = wcsnlen(sp->wstr, sp->len);
|
||||
} else {
|
||||
sp->str = va_arg(ctx->ap, const char *) ?: "(null)";
|
||||
diff --git a/src/boot/efi.h b/src/boot/efi.h
|
||||
index e1042635b9..1c191d49e7 100644
|
||||
--- a/src/boot/efi.h
|
||||
+++ b/src/boot/efi.h
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#if SD_BOOT
|
||||
/* uchar.h/wchar.h are not suitable for freestanding environments. */
|
||||
-typedef __WCHAR_TYPE__ wchar_t;
|
||||
+typedef __WCHAR_TYPE__ uint16_t;
|
||||
typedef __CHAR16_TYPE__ char16_t;
|
||||
typedef __CHAR32_TYPE__ char32_t;
|
||||
|
||||
@@ -22,7 +22,6 @@ assert_cc(sizeof(uint8_t) == 1);
|
||||
assert_cc(sizeof(uint16_t) == 2);
|
||||
assert_cc(sizeof(uint32_t) == 4);
|
||||
assert_cc(sizeof(uint64_t) == 8);
|
||||
-assert_cc(sizeof(wchar_t) == 2);
|
||||
assert_cc(sizeof(char16_t) == 2);
|
||||
assert_cc(sizeof(char32_t) == 4);
|
||||
assert_cc(sizeof(size_t) == sizeof(void *));
|
||||
@@ -32,7 +31,6 @@ assert_cc(alignof(uint8_t) == 1);
|
||||
assert_cc(alignof(uint16_t) == 2);
|
||||
assert_cc(alignof(uint32_t) == 4);
|
||||
assert_cc(alignof(uint64_t) == 8);
|
||||
-assert_cc(alignof(wchar_t) == 2);
|
||||
assert_cc(alignof(char16_t) == 2);
|
||||
assert_cc(alignof(char32_t) == 4);
|
||||
|
||||
@@ -41,7 +39,6 @@ assert_cc(alignof(char32_t) == 4);
|
||||
# endif
|
||||
#else
|
||||
# include <uchar.h>
|
||||
-# include <wchar.h>
|
||||
#endif
|
||||
|
||||
/* We use size_t/ssize_t to represent UEFI UINTN/INTN. */
|
||||
--
|
||||
2.47.1
|
||||
|
||||
|
|
@ -1,118 +0,0 @@
|
|||
# Contributor: Clayton Craft <clayton@craftyguy.net>
|
||||
# Maintainer: Clayton Craft <clayton@craftyguy.net>
|
||||
#
|
||||
# Notes:
|
||||
# - Builds / packages *only* the EFI boot manager and stub loader, and any
|
||||
# useful apps for managing those things.
|
||||
# - The goal with the systemd patch and this package is *NOT* to create the
|
||||
# fastest build possible (e.g. by hacking up meson a bunch).
|
||||
# - The goal is to create the smallest diff from upstream so that rebasing
|
||||
# this is as easy as possible.
|
||||
# - If you can figure out how to have both, great!!! Otherwise, installing
|
||||
# some extra build-time junk and waiting for a long meson configure step
|
||||
# is an acceptable price to pay for not having to rebase a bunch of stuff.
|
||||
#
|
||||
pkgname=systemd-boot
|
||||
pkgver=257.1
|
||||
pkgrel=0
|
||||
pkgdesc="systemd's EFI boot manager and stub"
|
||||
url="https://systemd.io/"
|
||||
# TODO:
|
||||
# armv7: untested
|
||||
# riscv64: untested
|
||||
# x86: untested (and unnecessary?)
|
||||
arch="aarch64 armv7 riscv64 x86_64"
|
||||
license="GPL-2.0-only"
|
||||
# Some of these are just to satisfy systemd's meson config, and aren't actually
|
||||
# used for building the boot manager or stub...
|
||||
makedepends="
|
||||
bash
|
||||
coreutils
|
||||
gperf
|
||||
meson
|
||||
py3-elftools
|
||||
py3-jinja2
|
||||
"
|
||||
source="
|
||||
systemd-$pkgver.tar.gz::https://github.com/systemd/systemd/archive/refs/tags/v$pkgver.tar.gz
|
||||
0001-meson-minimal-configure-for-building-systemd-boot.patch
|
||||
0002-fix-wchar-for-compiling-on-musl.patch
|
||||
cross-x86.meson
|
||||
"
|
||||
options="!check" # no tests
|
||||
subpackages="ukify"
|
||||
# TODO: cross-native fails on, e.g. aarch64, elf2efi gets an "unknown section
|
||||
# with name '' " ...
|
||||
# Maybe because meson thinks(?) the linker doesn't support norelro? It does
|
||||
# when building the default way!
|
||||
# Using meson cross files is a lot faster! But the whole thing is pretty small,
|
||||
# so, meh.
|
||||
# options="!check pmb:cross-native" # no tests
|
||||
builddir="$srcdir/systemd-$pkgver"
|
||||
|
||||
case "$CARCH" in
|
||||
# TODO: This doesn't work locally, pmboostrap's depends parser doesn't
|
||||
# evaluate/consider shell stuff...
|
||||
x86_64)
|
||||
makedepends="$makedepends gcc-x86 musl-dev-x86"
|
||||
;;
|
||||
esac
|
||||
|
||||
build() {
|
||||
abuild-meson \
|
||||
-Dsbat-distro="postmarketOS" \
|
||||
-Dsbat-distro-pkgname="$pkgname" \
|
||||
-Dsbat-distro-summary="postmarketOS" \
|
||||
-Dsbat-distro-url="postmarketos.org" \
|
||||
-Dsbat-distro-version="$pkgver" \
|
||||
. output
|
||||
meson compile -C output systemd-boot
|
||||
|
||||
# Some x86_64 systems have 32-bit EFI, so cross compile the bootloader for
|
||||
# 32-bit when building for this CARCH
|
||||
# TODO: this should use systemd/meson.build's ability to cross-compile
|
||||
# (setting meson "efi_arch_alt"). The check for that currently fails
|
||||
# because the linker can't find the i586/32-bit stuff. Setting
|
||||
# LIBRARY_PATH=/usr/lib/gcc/i586-alpine-linux-musl didn't work.
|
||||
if [ "$CARCH" == "x86_64" ]; then
|
||||
abuild-meson \
|
||||
-Dsbat-distro="postmarketOS" \
|
||||
-Dsbat-distro-pkgname="$pkgname" \
|
||||
-Dsbat-distro-summary="postmarketOS" \
|
||||
-Dsbat-distro-url="postmarketos.org" \
|
||||
-Dsbat-distro-version="$pkgver" \
|
||||
--cross-file "$srcdir"/cross-x86.meson \
|
||||
. output.32
|
||||
meson compile -C output.32 systemd-boot
|
||||
fi
|
||||
}
|
||||
|
||||
package() {
|
||||
mkdir -p "$pkgdir"/usr/lib/systemd/boot/efi
|
||||
|
||||
mv output/src/boot/linux*.efi.stub \
|
||||
"$pkgdir"/usr/lib/systemd/boot/efi/
|
||||
mv output/src/boot/systemd*.efi \
|
||||
"$pkgdir"/usr/lib/systemd/boot/efi/
|
||||
|
||||
if [ "$CARCH" == "x86_64" ]; then
|
||||
mv output.32/src/boot/linux*.efi.stub \
|
||||
"$pkgdir"/usr/lib/systemd/boot/efi/
|
||||
mv output.32/src/boot/systemd*.efi \
|
||||
"$pkgdir"/usr/lib/systemd/boot/efi/
|
||||
fi
|
||||
}
|
||||
|
||||
ukify() {
|
||||
depends="binutils py3-pefile"
|
||||
|
||||
install -Dm755 "$builddir"/src/ukify/ukify.py \
|
||||
"$subpkgdir"/usr/bin/ukify
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
dded7555077f85d0f8106b72cc46604fbe4249452be6b2d55800770b6deb2a3a122697c5a5f23b22dab416e8c050e53fc30d59dfd3bfd7c9fbbdab3162e8ebe5 systemd-257.1.tar.gz
|
||||
67ec8d16d678eb1358ccaa75a173b2fc9f91254b1a0b72912bdacc11da54ea6967dfc90ac852c776ce769b9d6b3fb0dbbf1aaab410a6ffca3d07b70c29419fef 0001-meson-minimal-configure-for-building-systemd-boot.patch
|
||||
b8ff5a93bb3e394605e81f40f4054e9e3be73e7b26f6aad4e2019da7254217dcf12a63082115041bb20fc528b52989db29f444d502d8f6962b2227d352641b47 0002-fix-wchar-for-compiling-on-musl.patch
|
||||
ad54e2c7e7a21bfa9b5f9e8db1b6af6a6d78a3e5dfe2dafcec77488f6224865ab4d4c8a8c8ee1c54c99d1741361e9fb3a51e5d36bcbc7a1c3fdcc4d0c1672132 cross-x86.meson
|
||||
"
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
[binaries]
|
||||
c = 'i586-alpine-linux-musl-gcc'
|
||||
ar = 'i586-alpine-linux-musl-ar'
|
||||
strip = 'i586-alpine-linux-musl-strip'
|
||||
ld = 'i586-alpine-linux-musl-ld'
|
||||
|
||||
[host_machine]
|
||||
system = 'linux'
|
||||
cpu_family = 'x86'
|
||||
cpu = 'i586'
|
||||
endian = 'little'
|
||||
Loading…
Add table
Add a link
Reference in a new issue