summaryrefslogtreecommitdiff
path: root/build_files
diff options
context:
space:
mode:
authortranch <tranch.xiao@gmail.com>2026-07-12 23:35:37 +0800
committertranch <tranch.xiao@gmail.com>2026-07-12 23:35:37 +0800
commit84df0042ca51743e2ef228d25a664a139ce8f9b3 (patch)
treeaf265b0f82ad61bb0a71c70e25b2365b90316183 /build_files
parent42a6ff3286804854c1c21a7e62158f09e19a9b09 (diff)
downloadAeroCore-OS-84df0042ca51743e2ef228d25a664a139ce8f9b3.tar.gz
AeroCore-OS-84df0042ca51743e2ef228d25a664a139ce8f9b3.zip
Rebuild initramfs with custom branding
Regenerate initramfs after applying AeroCore image metadata and assets.
Diffstat (limited to 'build_files')
-rwxr-xr-xbuild_files/build-initramfs17
1 files changed, 17 insertions, 0 deletions
diff --git a/build_files/build-initramfs b/build_files/build-initramfs
new file mode 100755
index 0000000..9eec951
--- /dev/null
+++ b/build_files/build-initramfs
@@ -0,0 +1,17 @@
+#!/usr/bin/bash
+
+set -eoux pipefail
+
+echo "::group::Executing build-initramfs"
+trap 'echo "::endgroup::"' EXIT
+
+if [[ "${KERNEL_FLAVOR:-}" == "surface" ]]; then
+ KERNEL_SUFFIX="surface"
+else
+ KERNEL_SUFFIX=""
+fi
+
+QUALIFIED_KERNEL="$(dnf5 repoquery --installed --queryformat='%{evr}.%{arch}' "kernel${KERNEL_SUFFIX:+-${KERNEL_SUFFIX}}")"
+/usr/bin/dracut --no-hostonly --kver "$QUALIFIED_KERNEL" --reproducible --zstd -v --add ostree --add fido2 -f "/usr/lib/modules/$QUALIFIED_KERNEL/initramfs.img"
+
+chmod 0600 /usr/lib/modules/"$QUALIFIED_KERNEL"/initramfs.img