particle-os-modules/modules/akmods/akmods.sh
fiftydinar 3c0fdee0db chore(akmods): Don't install kernel-devel packages
They are only needed when building the akmods, but not when shipping them.

This should considerably remove the bloat from the images without affecting the existing functionality.
2024-07-06 12:33:01 +02:00

31 lines
938 B
Bash

#!/usr/bin/env bash
set -euo pipefail
function ENABLE_MULTIMEDIA_REPO {
sed -i 's@enabled=0@enabled=1@g' /etc/yum.repos.d/_copr_ublue-os-akmods.repo
sed -i "0,/enabled/ s@enabled=0@enabled=1@g" /etc/yum.repos.d/negativo17-fedora-multimedia.repo
}
function DISABLE_MULTIMEDIA_REPO {
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/negativo17-fedora-multimedia.repo
}
function SET_HIGHER_PRIORITY_AKMODS_REPO {
echo "priority=90" >> /etc/yum.repos.d/_copr_ublue-os-akmods.repo
}
get_yaml_array INSTALL '.install[]' "$1"
INSTALL_PATH=("${INSTALL[@]/#/\/tmp/rpms/kmods/*}")
INSTALL_PATH=("${INSTALL_PATH[@]/%/*.rpm}")
INSTALL_STR=$(echo "${INSTALL_PATH[*]}" | tr -d '\n')
if [[ ${#INSTALL[@]} -gt 0 ]]; then
echo "Installing akmods"
echo "Installing: $(echo "${INSTALL[*]}" | tr -d '\n')"
SET_HIGHER_PRIORITY_AKMODS_REPO
ENABLE_MULTIMEDIA_REPO
rpm-ostree install $INSTALL_STR
DISABLE_MULTIMEDIA_REPO
fi
fi