From 32a66fc719110928560f49efa1846b1da396c137 Mon Sep 17 00:00:00 2001 From: renner <80410025+renner0e@users.noreply.github.com> Date: Wed, 17 Dec 2025 18:46:51 +0100 Subject: [PATCH] feat: move back image specific files/hacks/tech debt (#1472) * feat: move back rpm-ostreed.conf This is tech debt only for this repo and is not an "asset" shared between multiple aurora variants. * feat: add bootc install config CentOS Stream doesn't support BTRFS out of the box * feat: add dracut/modprobe configs module enablement is not an asset and should not be shared between variants * feat: add stuff for preinstall bazaar flatpak back we don't need this on LTS as we start fresh there, this is not an "asset" * feat: add SDDM stuff Plasma Login Manager is the future and we shouldn't introduce workarounds on other Aurora variants when there is a fix in sight. * feat: add flatpak-nuke-fedora.service We only have to deal with this problem on Fedora bases * fix: actually COPY system_files * Update system_files/shared/etc/rpm-ostreed.conf Co-authored-by: Adam Fidel * chore: remove dracut zstd compression * chore: move dracut config to command --------- Co-authored-by: Adam Fidel --- Containerfile | 3 +++ build_files/base/19-initramfs.sh | 2 +- system_files/shared/etc/rpm-ostreed.conf | 17 ++++++++++++++++ .../usr/lib/bootc/install/20-aurora.toml | 2 ++ .../shared/usr/lib/modprobe.d/amd-legacy.conf | 6 ++++++ .../system/flatpak-nuke-fedora.service | 20 +++++++++++++++++++ .../systemd/system/flatpak-preinstall.service | 19 ++++++++++++++++++ .../system/usr-share-sddm-themes.mount | 20 +++++++++++++++++++ .../lib/tmpfiles.d/usr-share-sddm-themes.conf | 6 ++++++ .../flatpak/preinstall.d/bazaar.preinstall | 3 +++ 10 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 system_files/shared/etc/rpm-ostreed.conf create mode 100644 system_files/shared/usr/lib/bootc/install/20-aurora.toml create mode 100644 system_files/shared/usr/lib/modprobe.d/amd-legacy.conf create mode 100644 system_files/shared/usr/lib/systemd/system/flatpak-nuke-fedora.service create mode 100644 system_files/shared/usr/lib/systemd/system/flatpak-preinstall.service create mode 100644 system_files/shared/usr/lib/systemd/system/usr-share-sddm-themes.mount create mode 100644 system_files/shared/usr/lib/tmpfiles.d/usr-share-sddm-themes.conf create mode 100644 system_files/shared/usr/share/flatpak/preinstall.d/bazaar.preinstall diff --git a/Containerfile b/Containerfile index cc4434b1..372a47e0 100644 --- a/Containerfile +++ b/Containerfile @@ -17,6 +17,9 @@ COPY --from=common /logos /logos COPY --from=common /system_files /system_files COPY --from=common /wallpapers /system_files/shared +# Overwrite files from common if necessary +COPY /system_files /system_files + ## aurora image section FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS base diff --git a/build_files/base/19-initramfs.sh b/build_files/base/19-initramfs.sh index a3a400b0..498a5aaa 100755 --- a/build_files/base/19-initramfs.sh +++ b/build_files/base/19-initramfs.sh @@ -8,7 +8,7 @@ KERNEL_VERSION=$(rpm -q --queryformat="%{evr}.%{arch}" kernel-core) # Ensure Initramfs is generated export DRACUT_NO_XATTR=1 -/usr/bin/dracut --no-hostonly --kver "${KERNEL_VERSION}" --reproducible -v --add ostree -f "/lib/modules/${KERNEL_VERSION}/initramfs.img" +/usr/bin/dracut --no-hostonly --kver "${KERNEL_VERSION}" --reproducible -v --add "ostree fido2 tpm2-tss pkcs11 pcsc" -f "/lib/modules/${KERNEL_VERSION}/initramfs.img" chmod 0600 "/lib/modules/${KERNEL_VERSION}/initramfs.img" echo "::endgroup::" diff --git a/system_files/shared/etc/rpm-ostreed.conf b/system_files/shared/etc/rpm-ostreed.conf new file mode 100644 index 00000000..7e0edf88 --- /dev/null +++ b/system_files/shared/etc/rpm-ostreed.conf @@ -0,0 +1,17 @@ +# Entries in this file show the compile time defaults. +# You can change settings by editing this file. +# For option meanings, see rpm-ostreed.conf(5). + +[Daemon] +AutomaticUpdatePolicy=stage + +########## +# NOTE: There are plans to set to true by default in the future +# +# Set this to false to enable local layering with dnf +# This is an unsupported configuration that can lead to upgrade isses +# Be careful when setting this to true +# +# See [future link] for more information +########## +# LockLayering=false diff --git a/system_files/shared/usr/lib/bootc/install/20-aurora.toml b/system_files/shared/usr/lib/bootc/install/20-aurora.toml new file mode 100644 index 00000000..55cc5088 --- /dev/null +++ b/system_files/shared/usr/lib/bootc/install/20-aurora.toml @@ -0,0 +1,2 @@ +[install] +root-fs-type = "btrfs" diff --git a/system_files/shared/usr/lib/modprobe.d/amd-legacy.conf b/system_files/shared/usr/lib/modprobe.d/amd-legacy.conf new file mode 100644 index 00000000..8f659aa5 --- /dev/null +++ b/system_files/shared/usr/lib/modprobe.d/amd-legacy.conf @@ -0,0 +1,6 @@ +# Enable Legacy AMD hardware support +options amdgpu si_support=1 +options amdgpu cik_support=1 + +options radeon si_support=0 +options radeon cik_support=0 diff --git a/system_files/shared/usr/lib/systemd/system/flatpak-nuke-fedora.service b/system_files/shared/usr/lib/systemd/system/flatpak-nuke-fedora.service new file mode 100644 index 00000000..5f3def8d --- /dev/null +++ b/system_files/shared/usr/lib/systemd/system/flatpak-nuke-fedora.service @@ -0,0 +1,20 @@ +[Unit] +Description=Remove Fedora flatpak repositories +Before=flatpak-preinstall.service +Before=flatpak-system-helper.service +# Make sure we run before the Fedora service if it exists +Before=flatpak-add-fedora-repos.service + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/flatpak remote-delete --system fedora +ExecStart=/usr/bin/flatpak remote-delete --system fedora-testing +# Make sure even if flatpak-add-fedora-repos.service exists, it +# won't run. +ExecStart=/usr/bin/touch /var/lib/flatpak/.fedora-initialized +# Flatpak will fail if the remote doesn't exist, but we don't mind +SuccessExitStatus=1 + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/system_files/shared/usr/lib/systemd/system/flatpak-preinstall.service b/system_files/shared/usr/lib/systemd/system/flatpak-preinstall.service new file mode 100644 index 00000000..0eee2f24 --- /dev/null +++ b/system_files/shared/usr/lib/systemd/system/flatpak-preinstall.service @@ -0,0 +1,19 @@ +[Unit] +Description=Preinstall Flatpaks +After=network-online.target +Wants=network-online.target +ConditionPathExists=/usr/bin/flatpak +Documentation=man:flatpak-preinstall(1) + +[Service] +Type=oneshot +ExecStart=/usr/bin/flatpak preinstall -y +RemainAfterExit=true +Restart=on-failure +RestartSec=30 + +StartLimitIntervalSec=600 +StartLimitBurst=3 + +[Install] +WantedBy=multi-user.target diff --git a/system_files/shared/usr/lib/systemd/system/usr-share-sddm-themes.mount b/system_files/shared/usr/lib/systemd/system/usr-share-sddm-themes.mount new file mode 100644 index 00000000..af5f3e7d --- /dev/null +++ b/system_files/shared/usr/lib/systemd/system/usr-share-sddm-themes.mount @@ -0,0 +1,20 @@ +# Workaround to allow KDE Discover to install sddm themes +# TODO: Remove this whenever sddm allows installing themes other than in /usr/share. +# See https://github.com/sddm/sddm/issues/1561 + +[Unit] +Description=KDE writable sddm workaround +RequiresMountsFor=/usr /var +ConditionPathExists=/usr/share/sddm +ConditionPathExists=/var/sddm_themes/themes +ConditionPathExists=/var/sddm_themes/themes.work +PartOf=aurora-kde-themes-workaround.target + +[Mount] +Type=overlay +What=overlay +Where=/usr/share/sddm/themes +Options=lowerdir=/usr/share/sddm/themes,upperdir=/var/sddm_themes/themes,workdir=/var/sddm_themes/themes.work + +[Install] +WantedBy=multi-user.target diff --git a/system_files/shared/usr/lib/tmpfiles.d/usr-share-sddm-themes.conf b/system_files/shared/usr/lib/tmpfiles.d/usr-share-sddm-themes.conf new file mode 100644 index 00000000..2048af8d --- /dev/null +++ b/system_files/shared/usr/lib/tmpfiles.d/usr-share-sddm-themes.conf @@ -0,0 +1,6 @@ +# Workaround to allow KDE Discover to install sddm themes +# TODO: Remove this whenever sddm allows installing themes other than in /usr/share. +# See https://github.com/sddm/sddm/issues/1561 + +d /var/sddm_themes/themes 0755 - - - +d /var/sddm_themes/themes.work 0755 - - - diff --git a/system_files/shared/usr/share/flatpak/preinstall.d/bazaar.preinstall b/system_files/shared/usr/share/flatpak/preinstall.d/bazaar.preinstall new file mode 100644 index 00000000..ff69b073 --- /dev/null +++ b/system_files/shared/usr/share/flatpak/preinstall.d/bazaar.preinstall @@ -0,0 +1,3 @@ +[Flatpak Preinstall io.github.kolunmi.Bazaar] +Branch=stable +IsRuntime=false