From eb6c25a72ae456a7f0ca8a04ae5274a60bb96572 Mon Sep 17 00:00:00 2001 From: Hadi Chokr Date: Thu, 16 Apr 2026 19:36:28 +0200 Subject: [PATCH] REVERT WHEN SYSTEMD RELEASES. --- build.sh | 49 +++++++++++++++++++++++++++++++++++++++++++ mkosi.postinst.chroot | 49 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) diff --git a/build.sh b/build.sh index e87588f..6ecb51d 100755 --- a/build.sh +++ b/build.sh @@ -10,6 +10,55 @@ set -ex +#------------------------------------------------------------------------------------------------------------------------------------ +# --- Configuration --- +BUILDER_USER="aurbuilder" +AUR_PACKAGE="systemd-git" +WORK_DIR="/tmp/aur_build" + +# 1. Install build dependencies +pacman -Syu --noconfirm --needed base-devel git sudo + +# 2. Create temporary builder user with sudo (NOPASSWD) +if id "$BUILDER_USER" &>/dev/null; then + userdel -r -f "$BUILDER_USER" 2>/dev/null || true +fi +useradd -m -G wheel "$BUILDER_USER" +echo "%wheel ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/99-builder +chmod 440 /etc/sudoers.d/99-builder + +# 3. Prepare work directory +rm -rf "$WORK_DIR" +mkdir -p "$WORK_DIR" +chown "$BUILDER_USER:$BUILDER_USER" "$WORK_DIR" + +# 4. Build packages (but do NOT install yet) +su - "$BUILDER_USER" </dev/null || true + +# 6. Install the newly built packages +echo ":: Installing systemd-git packages..." +pacman -U --noconfirm "$WORK_DIR"/systemd-git/*.pkg.tar.zst + +# 7. Cleanup +userdel -r -f "$BUILDER_USER" 2>/dev/null || true +rm -f /etc/sudoers.d/99-builder +rm -rf "$WORK_DIR" + +echo ":: systemd-git installation completed successfully." +systemd-repart --version +systemd-repart --help | grep --color=always el-torito || echo "WARNING: --el-torito option not found!" +#--------------------------------------------------------------------------------------------------------------------------------- + # Creates an archive containing the data from just the kde-linux-debug repository packages, # essentially the debug symbols for KDE apps, to be used as a sysext. make_debug_archive () { diff --git a/mkosi.postinst.chroot b/mkosi.postinst.chroot index b9b4b29..faa5522 100755 --- a/mkosi.postinst.chroot +++ b/mkosi.postinst.chroot @@ -141,6 +141,55 @@ for theme in $(plymouth-set-default-theme --list); do fi done +#------------------------------------------------------------------------------------------------------------------------------------ +# --- Configuration --- +BUILDER_USER="aurbuilder" +AUR_PACKAGE="systemd-git" +WORK_DIR="/tmp/aur_build" + +# 1. Install build dependencies +pacman -Syu --noconfirm --needed base-devel git sudo + +# 2. Create temporary builder user with sudo (NOPASSWD) +if id "$BUILDER_USER" &>/dev/null; then + userdel -r -f "$BUILDER_USER" 2>/dev/null || true +fi +useradd -m -G wheel "$BUILDER_USER" +echo "%wheel ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/99-builder +chmod 440 /etc/sudoers.d/99-builder + +# 3. Prepare work directory +rm -rf "$WORK_DIR" +mkdir -p "$WORK_DIR" +chown "$BUILDER_USER:$BUILDER_USER" "$WORK_DIR" + +# 4. Build packages (but do NOT install yet) +su - "$BUILDER_USER" </dev/null || true + +# 6. Install the newly built packages +echo ":: Installing systemd-git packages..." +pacman -U --noconfirm "$WORK_DIR"/systemd-git/*.pkg.tar.zst + +# 7. Cleanup +userdel -r -f "$BUILDER_USER" 2>/dev/null || true +rm -f /etc/sudoers.d/99-builder +rm -rf "$WORK_DIR" + +echo ":: systemd-git installation completed successfully." +systemd-repart --version +systemd-repart --help | grep --color=always el-torito || echo "WARNING: --el-torito option not found!" +#--------------------------------------------------------------------------------------------------------------------------------- + cd /tmp /usr/lib/rebuild-efi mv -v ./*.efi /