chore: cleanup unnecessary packages and workarounds + add bootc-image-builder

Signed-off-by: Tulip Blossom <tulilirockz@proton.me>
This commit is contained in:
Tulip Blossom
2025-08-16 21:39:52 -03:00
parent 9225ea321c
commit b2e96e1409
5 changed files with 56 additions and 107 deletions
+21 -45
View File
@@ -2,16 +2,18 @@
set -xeuo pipefail
systemctl enable sshd
dnf -y remove \
adcli \
libdnf-plugin-subscription-manager \
python3-subscription-manager-rhsm \
subscription-manager \
subscription-manager-rhsm-certificates
subscription-manager-rhsm-certificates \
toolbox \
yggdrasil
dnf -y install --setopt=install_weak_deps=False \
atheros-firmware \
audit \
brcmfmac-firmware \
cockpit-machines \
cockpit-networkmanager \
cockpit-podman \
@@ -20,79 +22,53 @@ dnf -y install --setopt=install_weak_deps=False \
cockpit-system \
firewalld \
git-core \
hdparm \
ipcalc \
iwlegacy-firmware \
iwlwifi-dvm-firmware \
iwlwifi-mvm-firmware \
libvirt-client \
libvirt-daemon \
libvirt-daemon-kvm \
man-db \
man-pages \
mt7xxx-firmware \
NetworkManager-wifi \
nxpwireless-firmware \
open-vm-tools \
pcp-zeroconf \
qemu-guest-agent \
realtek-firmware \
rsync \
systemd-container \
tiwilink-firmware \
usbutils \
systemd-resolved \
udisks2-lvm2 \
virt-install \
wireguard-tools \
xdg-dbus-proxy \
xdg-user-dirs \
udisks2-lvm2
xdg-user-dirs
dnf config-manager --add-repo https://pkgs.tailscale.com/stable/centos/"$(rpm -E %centos)"/tailscale.repo
systemctl enable firewalld
dnf config-manager --add-repo "https://pkgs.tailscale.com/stable/centos/$(rpm -E %centos)/tailscale.repo"
dnf config-manager --set-disabled tailscale-stable
dnf -y install --enablerepo='tailscale-stable' tailscale
systemctl enable tailscaled
dnf -y copr enable ublue-os/packages
dnf -y copr disable ublue-os/packages
dnf -y install --enablerepo="copr:copr.fedorainfracloud.org:ublue-os:packages" --setopt=install_weak_deps=False \
ublue-os-libvirt-workarounds
dnf -y install epel-release
dnf config-manager --set-disabled epel
dnf -y install --enablerepo="epel" just
install -Dpm0644 -t /usr/lib/systemd /tmp/files/usr/lib/systemd/zram-generator.conf
install -Dpm0644 -t /usr/lib/systemd/system /tmp/files/usr/lib/systemd/system/cockpit.service
sed -i 's|^ExecStart=.*|ExecStart=/usr/bin/bootc update --quiet|' /usr/lib/systemd/system/bootc-fetch-apply-updates.service
sed -i 's|^OnUnitInactiveSec=.*|OnUnitInactiveSec=7d\nPersistent=true|' /usr/lib/systemd/system/bootc-fetch-apply-updates.timer
sed -i 's|#AutomaticUpdatePolicy.*|AutomaticUpdatePolicy=stage|' /etc/rpm-ostreed.conf
sed -i 's|#LockLayering.*|LockLayering=true|' /etc/rpm-ostreed.conf
systemctl enable firewalld
cat >/usr/lib/systemd/system-preset/91-resolved-default.preset <<'EOF'
enable systemd-resolved.service
EOF
cat >/usr/lib/tmpfiles.d/resolved-default.conf <<'EOF'
L /etc/resolv.conf - - - - ../run/systemd/resolve/stub-resolv.conf
EOF
systemctl preset systemd-resolved.service
systemctl enable tailscaled
KERNEL_VERSION="$(rpm -q --queryformat="%{EVR}.%{ARCH}" kernel-core)"
KERNEL_VERSION="$(find "/usr/lib/modules" -maxdepth 1 -type d ! -path "/usr/lib/modules" -exec basename '{}' ';' | sort | tail -n 1)"
export DRACUT_NO_XATTR=1
/usr/bin/dracut --no-hostonly --kver "$KERNEL_VERSION" --reproducible --zstd -v --add ostree -f "/lib/modules/$KERNEL_VERSION/initramfs.img"
chmod 0600 /lib/modules/"$KERNEL_VERSION"/initramfs.img
KERNEL_VERSION="$(rpm -q kernel-core --queryformat '%{EVR}.%{ARCH}')"
dracut --no-hostonly --kver "$KERNEL_VERSION" --reproducible --zstd -v --add ostree -f "/usr/lib/modules/$KERNEL_VERSION/initramfs.img"
chmod 0600 "/usr/lib/modules/${KERNEL_VERSION}/initramfs.img"
kernel_dirs=("$(ls -1 /usr/lib/modules)")
if [[ ${#kernel_dirs[@]} -gt 1 ]]; then
for kernel_dir in "${kernel_dirs[@]}"; do
echo "$kernel_dir"
if [[ "$kernel_dir" != "$KERNEL_VERSION" ]]; then
echo "Removing $kernel_dir"
rm -rf "/usr/lib/modules/$kernel_dir"
fi
done
fi
rm -rf /var/*
bootc container lint