From 57bb4e48f0c2a5be3796779affe88111dd895557 Mon Sep 17 00:00:00 2001 From: qoijjj <129108030+qoijjj@users.noreply.github.com> Date: Mon, 28 Oct 2024 19:16:03 -0700 Subject: [PATCH] refactor initramfs regeneration to be at the end of each build --- files/scripts/regenerateinitramfs.sh | 11 +++++++++++ files/scripts/setearlyloading.sh | 6 ------ recipes/common/common-modules.yml | 1 - recipes/common/final-modules.yml | 5 +++++ recipes/common/nvidia-modules.yml | 1 - recipes/common/nvidia-open-modules.yml | 1 - recipes/recipe-hyprland-gdm.yml | 1 + recipes/recipe-hyprland-nvidia-gdm.yml | 1 + recipes/recipe-hyprland-nvidia-open-gdm.yml | 1 + recipes/recipe-hyprland-nvidia-open.yml | 1 + recipes/recipe-hyprland-nvidia.yml | 1 + recipes/recipe-hyprland.yml | 1 + recipes/recipe-river-gdm.yml | 1 + recipes/recipe-river-nvidia-gdm.yml | 1 + recipes/recipe-river-nvidia-open-gdm.yml | 1 + recipes/recipe-river-nvidia-open.yml | 1 + recipes/recipe-river-nvidia.yml | 1 + recipes/recipe-river.yml | 1 + recipes/recipe-sway-gdm.yml | 1 + recipes/recipe-sway-nvidia-gdm.yml | 3 ++- recipes/recipe-sway-nvidia-open-gdm.yml | 3 ++- recipes/recipe-sway-nvidia-open.yml | 3 ++- recipes/recipe-sway-nvidia.yml | 3 ++- recipes/recipe-sway.yml | 1 + recipes/recipe-wayfire-gdm.yml | 1 + recipes/recipe-wayfire-nvidia-gdm.yml | 1 + recipes/recipe-wayfire-nvidia-open-gdm.yml | 1 + recipes/recipe-wayfire-nvidia-open.yml | 1 + recipes/recipe-wayfire-nvidia.yml | 1 + recipes/recipe-wayfire.yml | 1 + 30 files changed, 44 insertions(+), 13 deletions(-) create mode 100644 files/scripts/regenerateinitramfs.sh create mode 100644 recipes/common/final-modules.yml diff --git a/files/scripts/regenerateinitramfs.sh b/files/scripts/regenerateinitramfs.sh new file mode 100644 index 0000000..493804a --- /dev/null +++ b/files/scripts/regenerateinitramfs.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +# Tell build process to exit if there are any errors. +set -oue pipefail + + +rpm-ostree cliwrap install-to-root / + +QUALIFIED_KERNEL="$(rpm -qa | grep -P 'kernel-(\d+\.\d+\.\d+)' | sed -E 's/kernel-//')" +/usr/libexec/rpm-ostree/wrapped/dracut --no-hostonly --kver "$QUALIFIED_KERNEL" --reproducible -v --add ostree -f "/lib/modules/$QUALIFIED_KERNEL/initramfs.img" +chmod 0600 "/lib/modules/$QUALIFIED_KERNEL/initramfs.img" \ No newline at end of file diff --git a/files/scripts/setearlyloading.sh b/files/scripts/setearlyloading.sh index ff7c577..19ec951 100644 --- a/files/scripts/setearlyloading.sh +++ b/files/scripts/setearlyloading.sh @@ -5,9 +5,3 @@ set -oue pipefail sed -i 's@omit_drivers@force_drivers@g' /usr/lib/dracut/dracut.conf.d/99-nvidia.conf sed -i 's@ nvidia @ i915 amdgpu nvidia @g' /usr/lib/dracut/dracut.conf.d/99-nvidia.conf - -rpm-ostree cliwrap install-to-root / - -QUALIFIED_KERNEL="$(rpm -qa | grep -P 'kernel-(\d+\.\d+\.\d+)' | sed -E 's/kernel-//')" -/usr/libexec/rpm-ostree/wrapped/dracut --no-hostonly --kver "$QUALIFIED_KERNEL" --reproducible -v --add ostree -f "/lib/modules/$QUALIFIED_KERNEL/initramfs.img" -chmod 0600 "/lib/modules/$QUALIFIED_KERNEL/initramfs.img" \ No newline at end of file diff --git a/recipes/common/common-modules.yml b/recipes/common/common-modules.yml index 387aeab..de1a268 100644 --- a/recipes/common/common-modules.yml +++ b/recipes/common/common-modules.yml @@ -10,7 +10,6 @@ modules: - type: script scripts: - installsignedkernel.sh - - removeunusedrepos.sh - type: containerfile snippets: diff --git a/recipes/common/final-modules.yml b/recipes/common/final-modules.yml new file mode 100644 index 0000000..36918fb --- /dev/null +++ b/recipes/common/final-modules.yml @@ -0,0 +1,5 @@ +modules: + - type: script + scripts: + - removeunusedrepos.sh + - regenerateinitramfs.sh \ No newline at end of file diff --git a/recipes/common/nvidia-modules.yml b/recipes/common/nvidia-modules.yml index 7ec9620..ef7103c 100644 --- a/recipes/common/nvidia-modules.yml +++ b/recipes/common/nvidia-modules.yml @@ -10,6 +10,5 @@ modules: - type: script scripts: - installnvidiatoolkitpolicy.sh - - removeunusedrepos.sh - setearlyloading.sh - setdrmvariables.sh diff --git a/recipes/common/nvidia-open-modules.yml b/recipes/common/nvidia-open-modules.yml index 74a6430..7440de7 100644 --- a/recipes/common/nvidia-open-modules.yml +++ b/recipes/common/nvidia-open-modules.yml @@ -10,6 +10,5 @@ modules: - type: script scripts: - installnvidiatoolkitpolicy.sh - - removeunusedrepos.sh - setearlyloading.sh - setdrmvariables.sh \ No newline at end of file diff --git a/recipes/recipe-hyprland-gdm.yml b/recipes/recipe-hyprland-gdm.yml index 245ce5c..8bd0c28 100644 --- a/recipes/recipe-hyprland-gdm.yml +++ b/recipes/recipe-hyprland-gdm.yml @@ -10,3 +10,4 @@ modules: - from-file: common/common-modules.yml - from-file: common/gdm-modules.yml - from-file: common/hyprland-modules.yml + - from-file: common/final-modules.yml diff --git a/recipes/recipe-hyprland-nvidia-gdm.yml b/recipes/recipe-hyprland-nvidia-gdm.yml index 21aef6f..cc0bc57 100644 --- a/recipes/recipe-hyprland-nvidia-gdm.yml +++ b/recipes/recipe-hyprland-nvidia-gdm.yml @@ -11,3 +11,4 @@ modules: - from-file: common/nvidia-modules.yml - from-file: common/gdm-modules.yml - from-file: common/hyprland-modules.yml + - from-file: common/final-modules.yml diff --git a/recipes/recipe-hyprland-nvidia-open-gdm.yml b/recipes/recipe-hyprland-nvidia-open-gdm.yml index 20da904..dae225b 100644 --- a/recipes/recipe-hyprland-nvidia-open-gdm.yml +++ b/recipes/recipe-hyprland-nvidia-open-gdm.yml @@ -11,3 +11,4 @@ modules: - from-file: common/nvidia-open-modules.yml - from-file: common/gdm-modules.yml - from-file: common/hyprland-modules.yml + - from-file: common/final-modules.yml diff --git a/recipes/recipe-hyprland-nvidia-open.yml b/recipes/recipe-hyprland-nvidia-open.yml index aee3324..1e08a27 100644 --- a/recipes/recipe-hyprland-nvidia-open.yml +++ b/recipes/recipe-hyprland-nvidia-open.yml @@ -11,3 +11,4 @@ modules: - from-file: common/common-modules.yml - from-file: common/nvidia-open-modules.yml - from-file: common/hyprland-modules.yml + - from-file: common/final-modules.yml diff --git a/recipes/recipe-hyprland-nvidia.yml b/recipes/recipe-hyprland-nvidia.yml index 50e2e18..a1866ba 100644 --- a/recipes/recipe-hyprland-nvidia.yml +++ b/recipes/recipe-hyprland-nvidia.yml @@ -11,3 +11,4 @@ modules: - from-file: common/common-modules.yml - from-file: common/nvidia-modules.yml - from-file: common/hyprland-modules.yml + - from-file: common/final-modules.yml diff --git a/recipes/recipe-hyprland.yml b/recipes/recipe-hyprland.yml index e2931bc..82767ad 100644 --- a/recipes/recipe-hyprland.yml +++ b/recipes/recipe-hyprland.yml @@ -10,3 +10,4 @@ modules: - from-file: common/sddm-modules.yml - from-file: common/common-modules.yml - from-file: common/hyprland-modules.yml + - from-file: common/final-modules.yml diff --git a/recipes/recipe-river-gdm.yml b/recipes/recipe-river-gdm.yml index 5938f91..c328504 100644 --- a/recipes/recipe-river-gdm.yml +++ b/recipes/recipe-river-gdm.yml @@ -10,3 +10,4 @@ modules: - from-file: common/common-modules.yml - from-file: common/gdm-modules.yml - from-file: common/river-modules.yml + - from-file: common/final-modules.yml diff --git a/recipes/recipe-river-nvidia-gdm.yml b/recipes/recipe-river-nvidia-gdm.yml index 799c32d..f3a6172 100644 --- a/recipes/recipe-river-nvidia-gdm.yml +++ b/recipes/recipe-river-nvidia-gdm.yml @@ -11,3 +11,4 @@ modules: - from-file: common/nvidia-modules.yml - from-file: common/gdm-modules.yml - from-file: common/river-modules.yml + - from-file: common/final-modules.yml diff --git a/recipes/recipe-river-nvidia-open-gdm.yml b/recipes/recipe-river-nvidia-open-gdm.yml index ae0801f..f74c5a6 100644 --- a/recipes/recipe-river-nvidia-open-gdm.yml +++ b/recipes/recipe-river-nvidia-open-gdm.yml @@ -11,3 +11,4 @@ modules: - from-file: common/nvidia-open-modules.yml - from-file: common/gdm-modules.yml - from-file: common/river-modules.yml + - from-file: common/final-modules.yml diff --git a/recipes/recipe-river-nvidia-open.yml b/recipes/recipe-river-nvidia-open.yml index f7a7caf..df61fb7 100644 --- a/recipes/recipe-river-nvidia-open.yml +++ b/recipes/recipe-river-nvidia-open.yml @@ -11,3 +11,4 @@ modules: - from-file: common/common-modules.yml - from-file: common/nvidia-open-modules.yml - from-file: common/river-modules.yml + - from-file: common/final-modules.yml diff --git a/recipes/recipe-river-nvidia.yml b/recipes/recipe-river-nvidia.yml index 66d73cc..de65150 100644 --- a/recipes/recipe-river-nvidia.yml +++ b/recipes/recipe-river-nvidia.yml @@ -11,3 +11,4 @@ modules: - from-file: common/common-modules.yml - from-file: common/nvidia-modules.yml - from-file: common/river-modules.yml + - from-file: common/final-modules.yml diff --git a/recipes/recipe-river.yml b/recipes/recipe-river.yml index 7622ccd..d03b5bb 100644 --- a/recipes/recipe-river.yml +++ b/recipes/recipe-river.yml @@ -10,3 +10,4 @@ modules: - from-file: common/sddm-modules.yml - from-file: common/common-modules.yml - from-file: common/river-modules.yml + - from-file: common/final-modules.yml diff --git a/recipes/recipe-sway-gdm.yml b/recipes/recipe-sway-gdm.yml index 5a9b682..65aeb49 100644 --- a/recipes/recipe-sway-gdm.yml +++ b/recipes/recipe-sway-gdm.yml @@ -11,3 +11,4 @@ modules: - from-file: common/common-modules.yml - from-file: common/gdm-modules.yml - from-file: common/sway-modules.yml + - from-file: common/final-modules.yml diff --git a/recipes/recipe-sway-nvidia-gdm.yml b/recipes/recipe-sway-nvidia-gdm.yml index 9850185..4493f9a 100644 --- a/recipes/recipe-sway-nvidia-gdm.yml +++ b/recipes/recipe-sway-nvidia-gdm.yml @@ -14,4 +14,5 @@ modules: - from-file: common/sway-modules.yml - type: script scripts: - - setswaynvidiaenvironment.sh \ No newline at end of file + - setswaynvidiaenvironment.sh + - from-file: common/final-modules.yml \ No newline at end of file diff --git a/recipes/recipe-sway-nvidia-open-gdm.yml b/recipes/recipe-sway-nvidia-open-gdm.yml index b00c079..17cf93f 100644 --- a/recipes/recipe-sway-nvidia-open-gdm.yml +++ b/recipes/recipe-sway-nvidia-open-gdm.yml @@ -14,4 +14,5 @@ modules: - from-file: common/sway-modules.yml - type: script scripts: - - setswaynvidiaenvironment.sh \ No newline at end of file + - setswaynvidiaenvironment.sh + - from-file: common/final-modules.yml \ No newline at end of file diff --git a/recipes/recipe-sway-nvidia-open.yml b/recipes/recipe-sway-nvidia-open.yml index 3840950..e5f4443 100644 --- a/recipes/recipe-sway-nvidia-open.yml +++ b/recipes/recipe-sway-nvidia-open.yml @@ -13,4 +13,5 @@ modules: - from-file: common/sway-modules.yml - type: script scripts: - - setswaynvidiaenvironment.sh \ No newline at end of file + - setswaynvidiaenvironment.sh + - from-file: common/final-modules.yml \ No newline at end of file diff --git a/recipes/recipe-sway-nvidia.yml b/recipes/recipe-sway-nvidia.yml index 3054759..ae3c947 100644 --- a/recipes/recipe-sway-nvidia.yml +++ b/recipes/recipe-sway-nvidia.yml @@ -13,4 +13,5 @@ modules: - from-file: common/sway-modules.yml - type: script scripts: - - setswaynvidiaenvironment.sh \ No newline at end of file + - setswaynvidiaenvironment.sh + - from-file: common/final-modules.yml \ No newline at end of file diff --git a/recipes/recipe-sway.yml b/recipes/recipe-sway.yml index a6799c8..ff52aec 100644 --- a/recipes/recipe-sway.yml +++ b/recipes/recipe-sway.yml @@ -10,3 +10,4 @@ modules: - from-file: common/sddm-modules.yml - from-file: common/common-modules.yml - from-file: common/sway-modules.yml + - from-file: common/final-modules.yml diff --git a/recipes/recipe-wayfire-gdm.yml b/recipes/recipe-wayfire-gdm.yml index 0fa9299..a9ec311 100644 --- a/recipes/recipe-wayfire-gdm.yml +++ b/recipes/recipe-wayfire-gdm.yml @@ -10,4 +10,5 @@ modules: - from-file: common/common-modules.yml - from-file: common/gdm-modules.yml - from-file: common/wayfire-modules.yml + - from-file: common/final-modules.yml diff --git a/recipes/recipe-wayfire-nvidia-gdm.yml b/recipes/recipe-wayfire-nvidia-gdm.yml index 0de5d26..f435953 100644 --- a/recipes/recipe-wayfire-nvidia-gdm.yml +++ b/recipes/recipe-wayfire-nvidia-gdm.yml @@ -11,3 +11,4 @@ modules: - from-file: common/nvidia-modules.yml - from-file: common/gdm-modules.yml - from-file: common/wayfire-modules.yml + - from-file: common/final-modules.yml diff --git a/recipes/recipe-wayfire-nvidia-open-gdm.yml b/recipes/recipe-wayfire-nvidia-open-gdm.yml index 9d5b12a..4944338 100644 --- a/recipes/recipe-wayfire-nvidia-open-gdm.yml +++ b/recipes/recipe-wayfire-nvidia-open-gdm.yml @@ -11,3 +11,4 @@ modules: - from-file: common/nvidia-open-modules.yml - from-file: common/gdm-modules.yml - from-file: common/wayfire-modules.yml + - from-file: common/final-modules.yml diff --git a/recipes/recipe-wayfire-nvidia-open.yml b/recipes/recipe-wayfire-nvidia-open.yml index 3385eb8..93c9bfb 100644 --- a/recipes/recipe-wayfire-nvidia-open.yml +++ b/recipes/recipe-wayfire-nvidia-open.yml @@ -11,3 +11,4 @@ modules: - from-file: common/common-modules.yml - from-file: common/nvidia-open-modules.yml - from-file: common/wayfire-modules.yml + - from-file: common/final-modules.yml diff --git a/recipes/recipe-wayfire-nvidia.yml b/recipes/recipe-wayfire-nvidia.yml index 365b0d6..67657cc 100644 --- a/recipes/recipe-wayfire-nvidia.yml +++ b/recipes/recipe-wayfire-nvidia.yml @@ -11,3 +11,4 @@ modules: - from-file: common/common-modules.yml - from-file: common/nvidia-modules.yml - from-file: common/wayfire-modules.yml + - from-file: common/final-modules.yml diff --git a/recipes/recipe-wayfire.yml b/recipes/recipe-wayfire.yml index a6986b8..31db523 100644 --- a/recipes/recipe-wayfire.yml +++ b/recipes/recipe-wayfire.yml @@ -10,3 +10,4 @@ modules: - from-file: common/sddm-modules.yml - from-file: common/common-modules.yml - from-file: common/wayfire-modules.yml + - from-file: common/final-modules.yml