Skip to content

Commit

Permalink
feat: build initramfs for surface, asus and nvidia
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Mihalik committed Jun 28, 2024
1 parent cf77151 commit 3757897
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ COPY ${KERNEL_FLAVOR}/ /tmp/
RUN mkdir -p /var/lib/alternatives && \
IMAGE_FLAVOR=main /tmp/image-info.sh && \
/tmp/install.sh && \
if [ "${KERNEL_FLAVOR}" != "main" ]; then \
/tmp/build-initramfs.sh \
; fi && \
mv /var/lib/alternatives /staged-alternatives && \
rm -rf /tmp/* /var/* && \
ostree container commit && \
Expand All @@ -41,6 +44,7 @@ COPY *.sh /tmp/
RUN mkdir -p /var/lib/alternatives && \
IMAGE_FLAVOR=nvidia /tmp/image-info.sh && \
/tmp/nvidia-install.sh && \
/tmp/build-initramfs.sh \
mv /var/lib/alternatives /staged-alternatives && \
rm -rf /tmp/* /var/* && \
ostree container commit && \
Expand Down
15 changes: 15 additions & 0 deletions build-initramfs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/bash

set -oue pipefail

if [[ "${AKMODS_FLAVOR}" == "surface" ]]; then
KERNEL_SUFFIX="surface"
else
KERNEL_SUFFIX=""
fi

QUALIFIED_KERNEL="$(rpm -qa | grep -P 'kernel-(|'"$KERNEL_SUFFIX"'-)(\d+\.\d+\.\d+)' | sed -E 's/kernel-(|'"$KERNEL_SUFFIX"'-)//')"

/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"

0 comments on commit 3757897

Please sign in to comment.