diff --git a/core/systemd/0003-PARTIAL-REVERT-commit-tree-wide-replace-strverscmp-and-str_verscmp-with-strverscmp_improved.patch b/core/systemd/0003-PARTIAL-REVERT-commit-tree-wide-replace-strverscmp-and-str_verscmp-with-strverscmp_improved.patch new file mode 100644 index 000000000..57b9e4dfc --- /dev/null +++ b/core/systemd/0003-PARTIAL-REVERT-commit-tree-wide-replace-strverscmp-and-str_verscmp-with-strverscmp_improved.patch @@ -0,0 +1,78 @@ +From 9021729667e019defea0d4c1bdf563d629d7d837 Mon Sep 17 00:00:00 2001 +From: Ernesto Castellotti +Date: Sat, 10 Apr 2021 18:59:14 +0200 +Subject: [PATCH] PARTIAL REVERT commit tree-wide: replace strverscmp() and + str_verscmp() with strverscmp_improved + +This is a workaround for the issue https://github.com/systemd/systemd/issues/19191 +--- + src/boot/efi/boot.c | 49 ++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 48 insertions(+), 1 deletion(-) + +diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c +index 35248db009bf..75c7e2c61d19 100644 +--- a/src/boot/efi/boot.c ++++ b/src/boot/efi/boot.c +@@ -914,6 +914,53 @@ static VOID config_entry_free(ConfigEntry *entry) { + FreePool(entry); + } + ++static BOOLEAN is_digit(CHAR16 c) { ++ return (c >= '0') && (c <= '9'); ++} ++static UINTN c_order(CHAR16 c) { ++ if (c == '\0') ++ return 0; ++ if (is_digit(c)) ++ return 0; ++ else if ((c >= 'a') && (c <= 'z')) ++ return c; ++ else ++ return c + 0x10000; ++} ++static INTN str_verscmp(CHAR16 *s1, CHAR16 *s2) { ++ CHAR16 *os1 = s1; ++ CHAR16 *os2 = s2; ++ while (*s1 || *s2) { ++ INTN first; ++ while ((*s1 && !is_digit(*s1)) || (*s2 && !is_digit(*s2))) { ++ INTN order; ++ order = c_order(*s1) - c_order(*s2); ++ if (order != 0) ++ return order; ++ s1++; ++ s2++; ++ } ++ while (*s1 == '0') ++ s1++; ++ while (*s2 == '0') ++ s2++; ++ first = 0; ++ while (is_digit(*s1) && is_digit(*s2)) { ++ if (first == 0) ++ first = *s1 - *s2; ++ s1++; ++ s2++; ++ } ++ if (is_digit(*s1)) ++ return 1; ++ if (is_digit(*s2)) ++ return -1; ++ if (first != 0) ++ return first; ++ } ++ return StrCmp(os1, os2); ++} ++ + static CHAR8 *line_get_key_value( + CHAR8 *content, + CHAR8 *sep, +@@ -1478,7 +1525,7 @@ static INTN config_entry_compare(ConfigEntry *a, ConfigEntry *b) { + if (a->tries_left == 0 && b->tries_left != 0) + return -1; + +- r = strverscmp_improved(a->id, b->id); ++ r = str_verscmp(a->id, b->id); + if (r != 0) + return r; + diff --git a/core/systemd/PKGBUILD b/core/systemd/PKGBUILD index 65a83c98c..84432452b 100644 --- a/core/systemd/PKGBUILD +++ b/core/systemd/PKGBUILD @@ -13,7 +13,7 @@ pkgname=('systemd' 'systemd-libs' 'systemd-resolvconf' 'systemd-sysvcompat') _tag='e13126bd95857eb9344e030edbb4c603aab63884' # git rev-parse v${_tag_name} _tag_name=248 pkgver="${_tag_name/-/}" -pkgrel=4 +pkgrel=5 arch=('x86_64') url='https://www.github.com/systemd/systemd' makedepends=('acl' 'cryptsetup' 'docbook-xsl' 'gperf' 'lz4' 'xz' 'pam' 'libelf' @@ -21,7 +21,7 @@ makedepends=('acl' 'cryptsetup' 'docbook-xsl' 'gperf' 'lz4' 'xz' 'pam' 'libelf' 'libmicrohttpd' 'libxcrypt' 'libxslt' 'util-linux' 'linux-api-headers' 'python-lxml' 'quota-tools' 'shadow' 'git' 'meson' 'libseccomp' 'pcre2' 'audit' 'kexec-tools' 'libxkbcommon' - 'bash-completion' 'p11-kit' 'systemd' 'libfido2' 'tpm2-tss') + 'bash-completion' 'p11-kit' 'systemd' 'libfido2' 'tpm2-tss' 'rsync') makedepends_aarch64=('gnu-efi-libs') options=('strip') validpgpkeys=('63CDA1E5D3FC22B998D20DD6327F26951A015CC4' # Lennart Poettering @@ -30,6 +30,7 @@ source=("git+https://github.com/systemd/systemd-stable#tag=${_tag}?signed" "git+https://github.com/systemd/systemd#tag=v${_tag_name%.*}?signed" '0001-Use-Arch-Linux-device-access-groups.patch' '0002-Disable-SYSTEMD_URLIFY-by-default.patch' + '0003-PARTIAL-REVERT-commit-tree-wide-replace-strverscmp-and-str_verscmp-with-strverscmp_improved.patch' '0001-link-test-random-util-with-libm.patch' 'initcpio-hook-udev' 'initcpio-install-systemd' @@ -52,6 +53,7 @@ sha512sums=('SKIP' 'SKIP' '882e486b6d88c8bafc50088845e41a49686e98981967f72ca1fb4ef07a01767400632f4b648fd31857d2a2a24a8fd65bcc2a8983284dd4fff2380732741d4c41' '313f3d6cc3d88f718509007e029213a82d84b196afdadc6ef560580acf70ab480aaecd7622f51726cc1af7d7841c6ec5390f72890b055a54fc74722341395651' + '34541f1967536524329867f9f341f8d9250d9d771c60dc3e6a22ccb82fc01f103cfd3f9903329777591ccbecd2446622a5d6b3804fa0411482b85c70593ee8ad' 'e190abdadffecc8539c25558845c1c5a5c04082f9caa2423df104bb01ca698bd41bcb7692e6aac5cdc2cd035fa2452bfccb1b5a35357a20e8cd57393bc25d18a' 'f0d933e8c6064ed830dec54049b0a01e27be87203208f6ae982f10fb4eddc7258cb2919d594cbfb9a33e74c3510cfd682f3416ba8e804387ab87d1a217eb4b73' 'f599e1a35cba2c4e83e37c2299fac23ae128d8f68081283e71e1729384975dee1c4b677787f31a17890aeb98c8d2fc90405a202644290708ef9c027315022b17' @@ -99,6 +101,10 @@ prepare() { # https://github.com/gwsw/less/issues/140 patch -Np1 -i ../0002-Disable-SYSTEMD_URLIFY-by-default.patch + # https://bugs.archlinux.org/task/70264 + # https://github.com/systemd/systemd/issues/19191 + patch -Np1 -i ../0003-PARTIAL-REVERT-commit-tree-wide-replace-strverscmp-and-str_verscmp-with-strverscmp_improved.patch + patch -Np1 -i ../0001-link-test-random-util-with-libm.patch }