Skip to content

Commit

Permalink
feat: Switch to dnf5 for container builds
Browse files Browse the repository at this point in the history
feat: Use Terra repos
  • Loading branch information
KyleGospo committed Jan 12, 2025
1 parent 8797658 commit 38d6914
Show file tree
Hide file tree
Showing 10 changed files with 387 additions and 573 deletions.
845 changes: 281 additions & 564 deletions Containerfile

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ else
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 --zstd -v --add ostree -f "/lib/modules/$QUALIFIED_KERNEL/initramfs.img"
/usr/bin/dracut --no-hostonly --kver "$QUALIFIED_KERNEL" --reproducible --zstd -v --add ostree -f "/lib/modules/$QUALIFIED_KERNEL/initramfs.img"

chmod 0600 /lib/modules/$QUALIFIED_KERNEL/initramfs.img
7 changes: 7 additions & 0 deletions build_files/cleanup
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/bash

set -oue pipefail

dnf5 clean all
rm -rf /tmp/* || true
ostree container commit
14 changes: 14 additions & 0 deletions build_files/finalize
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/bash

set -oue pipefail

dnf5 clean all
rm -rf /tmp/* || true
mv /var/lib/alternatives /staged-alternatives
find /var/* -maxdepth 0 -type d \! -name cache -exec rm -fr {} \;
find /var/cache/* -maxdepth 0 -type d \! -name libdnf5 \! -name rpm-ostree -exec rm -fr {} \;
mkdir -p /var/lib
mv /staged-alternatives /var/lib/alternatives
mkdir -p /var/tmp
chmod -R 1777 /var/tmp
ostree container commit
File renamed without changes.
19 changes: 19 additions & 0 deletions build_files/install-akmods
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/bash

dnf5 -y install \
/tmp/akmods-rpms/kmods/*kvmfr*.rpm \
/tmp/akmods-rpms/kmods/*xone*.rpm \
/tmp/akmods-rpms/kmods/*openrazer*.rpm \
/tmp/akmods-rpms/kmods/*v4l2loopback*.rpm \
/tmp/akmods-rpms/kmods/*wl*.rpm \
/tmp/akmods-rpms/kmods/*framework-laptop*.rpm \
/tmp/akmods-extra-rpms/kmods/*gcadapter_oc*.rpm \
/tmp/akmods-extra-rpms/kmods/*nct6687*.rpm \
/tmp/akmods-extra-rpms/kmods/*zenergy*.rpm \
/tmp/akmods-extra-rpms/kmods/*vhba*.rpm \
/tmp/akmods-extra-rpms/kmods/*gpd-fan*.rpm \
/tmp/akmods-extra-rpms/kmods/*ayaneo-platform*.rpm \
/tmp/akmods-extra-rpms/kmods/*ayn-platform*.rpm \
/tmp/akmods-extra-rpms/kmods/*bmi260*.rpm \
/tmp/akmods-extra-rpms/kmods/*ryzen-smu*.rpm \
/tmp/akmods-extra-rpms/kmods/*evdi*.rpm
38 changes: 38 additions & 0 deletions build_files/install-firmware
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/bash

mkdir -p /tmp/linux-firmware-neptune
curl -Lo /tmp/linux-firmware-neptune/cs35l41-dsp1-spk-cali.bin https://gitlab.com/evlaV/linux-firmware-neptune/-/raw/"${JUPITER_FIRMWARE_VERSION}"/cs35l41-dsp1-spk-cali.bin
curl -Lo /tmp/linux-firmware-neptune/cs35l41-dsp1-spk-cali.wmfw https://gitlab.com/evlaV/linux-firmware-neptune/-/raw/"${JUPITER_FIRMWARE_VERSION}"/cs35l41-dsp1-spk-cali.wmfw
curl -Lo /tmp/linux-firmware-neptune/cs35l41-dsp1-spk-prot.bin https://gitlab.com/evlaV/linux-firmware-neptune/-/raw/"${JUPITER_FIRMWARE_VERSION}"/cs35l41-dsp1-spk-prot.bin
curl -Lo /tmp/linux-firmware-neptune/cs35l41-dsp1-spk-prot.wmfw https://gitlab.com/evlaV/linux-firmware-neptune/-/raw/"${JUPITER_FIRMWARE_VERSION}"/cs35l41-dsp1-spk-prot.wmfw
curl -Lo /tmp/linux-firmware-neptune/rtl8822cu_fw.bin https://gitlab.com/evlaV/linux-firmware-neptune/-/raw/"${JUPITER_FIRMWARE_VERSION}"/rtl_bt/rtl8822cu_fw.bin
xz --check=crc32 /tmp/linux-firmware-neptune/*
mv -vf /tmp/linux-firmware-neptune/rtl8822cu_fw.bin.xz /usr/lib/firmware/rtl_bt/rtl8822cu_fw.bin.xz
mv -vf /tmp/linux-firmware-neptune/* /usr/lib/firmware/cirrus/
rm -rf /tmp/linux-firmware-neptune
mkdir -p /tmp/linux-firmware-galileo
curl https://gitlab.com/evlaV/linux-firmware-neptune/-/archive/"${JUPITER_FIRMWARE_VERSION}"/linux-firmware-neptune-"${JUPITER_FIRMWARE_VERSION}".tar.gz?path=ath11k/QCA206X -o /tmp/linux-firmware-galileo/ath11k.tar.gz
tar --strip-components 1 --no-same-owner --no-same-permissions --no-overwrite-dir -xvf /tmp/linux-firmware-galileo/ath11k.tar.gz -C /tmp/linux-firmware-galileo
xz --check=crc32 /tmp/linux-firmware-galileo/ath11k/QCA206X/hw2.1/*
rm -f /usr/lib/firmware/ath11k/QCA206X/*
rm -rf /usr/lib/firmware/ath11k/QCA2066
mv -vf /tmp/linux-firmware-galileo/ath11k/QCA206X /usr/lib/firmware/ath11k/QCA206X
rm -rf /tmp/linux-firmware-galileo/ath11k
rm -rf /tmp/linux-firmware-galileo/ath11k.tar.gz
ln -s QCA206X /usr/lib/firmware/ath11k/QCA2066
curl -Lo /tmp/linux-firmware-galileo/hpbtfw21.tlv https://gitlab.com/evlaV/linux-firmware-neptune/-/raw/"${JUPITER_FIRMWARE_VERSION}"/qca/hpbtfw21.tlv
curl -Lo /tmp/linux-firmware-galileo/hpnv21.309 https://gitlab.com/evlaV/linux-firmware-neptune/-/raw/"${JUPITER_FIRMWARE_VERSION}"/qca/hpnv21.309
curl -Lo /tmp/linux-firmware-galileo/hpnv21.bin https://gitlab.com/evlaV/linux-firmware-neptune/-/raw/"${JUPITER_FIRMWARE_VERSION}"/qca/hpnv21.bin
curl -Lo /tmp/linux-firmware-galileo/hpnv21g.309 https://gitlab.com/evlaV/linux-firmware-neptune/-/raw/"${JUPITER_FIRMWARE_VERSION}"/qca/hpnv21g.309
curl -Lo /tmp/linux-firmware-galileo/hpnv21g.bin https://gitlab.com/evlaV/linux-firmware-neptune/-/raw/"${JUPITER_FIRMWARE_VERSION}"/qca/hpnv21g.bin
xz --check=crc32 /tmp/linux-firmware-galileo/*
mv -vf /tmp/linux-firmware-galileo/* /usr/lib/firmware/qca/
rm -rf /tmp/linux-firmware-galileo
rm -rf /usr/share/alsa/ucm2/conf.d/acp5x/Valve-Jupiter-1.conf
ln -s /usr/local/firmware/aw87xxx_acf.bin /usr/lib/firmware/aw87xxx_acf.bin
ln -s /usr/local/firmware/aw87xxx_acf_air1s.bin /usr/lib/firmware/aw87xxx_acf_air1s.bin
ln -s /usr/local/firmware/aw87xxx_acf_kun.bin /usr/lib/firmware/aw87xxx_acf_kun.bin
ln -s /usr/local/firmware/aw87xxx_acf_minipro.bin /usr/lib/firmware/aw87xxx_acf_minipro.bin
ln -s /usr/local/firmware/aw87xxx_acf_orangepi.bin /usr/lib/firmware/aw87xxx_acf_orangepi.bin
ln -s /usr/local/firmware/aw87xxx_acf_airplus.bin /usr/lib/firmware/aw87xxx_acf_airplus.bin
ln -s /usr/local/firmware/aw87xxx_acf_flip.bin /usr/lib/firmware/aw87xxx_acf_flip.bin
11 changes: 11 additions & 0 deletions build_files/install-kernel
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/bash

for pkg in kernel kernel-core kernel-modules kernel-modules-core kernel-modules-extra
do
rpm --erase "$pkg" --nodeps
done

dnf5 -y install \
/tmp/kernel-rpms/kernel-[0-9]*.rpm \
/tmp/kernel-rpms/kernel-core-*.rpm \
/tmp/kernel-rpms/kernel-modules-*.rpm
16 changes: 16 additions & 0 deletions build_files/unwrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/bash

set -oue pipefail

# there is no 'rpm-ostree cliwrap uninstall-from-root', but this is close enough. See:
# https://github.com/coreos/rpm-ostree/blob/6d2548ddb2bfa8f4e9bafe5c6e717cf9531d8001/rust/src/cliwrap.rs#L25-L32
if [ -d /usr/libexec/rpm-ostree/wrapped ]; then
# binaries which could be created if they did not exist thus may not be in wrapped dir
rm -f \
/usr/bin/yum \
/usr/bin/dnf \
/usr/bin/kernel-install
# binaries which were wrapped
mv -f /usr/libexec/rpm-ostree/wrapped/* /usr/bin
rm -fr /usr/libexec/rpm-ostree
fi

This file was deleted.

0 comments on commit 38d6914

Please sign in to comment.