Add fedora-rm-old-kernels, list-iommu-groups

This commit is contained in:
Jeffrey Serio 2024-04-23 10:41:43 -05:00
parent 9c7b124846
commit 94cc7edaf4
2 changed files with 28 additions and 0 deletions

17
fedora-rm-old-kernels Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Source: https://docs.fedoraproject.org/en-US/quick-docs/upgrading-fedora-offline/
old_kernels=($(dnf repoquery --installonly --latest-limit=-1 -q))
if [ "${#old_kernels[@]}" -eq 0 ]; then
echo "No old kernels found"
exit 0
fi
if ! sudo dnf remove "${old_kernels[@]}"; then
echo "Failed to remove old kernels"
exit 1
fi
echo "Removed old kernels"
exit 0

11
list-iommu-groups Executable file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
# https://drakeor.com/2022/02/16/kvm-gpu-passthrough-tutorial/
shopt -s nullglob
for g in /sys/kernel/iommu_groups/*; do
echo "IOMMU Group ${g##*/}:"
for d in $g/devices/*; do
echo -e "\t$(lspci -nns ${d##*/})"
done;
done