mirror of
https://codeberg.org/hyperreal/bin
synced 2024-11-01 16:43:08 +01:00
Add fedora-rm-old-kernels, list-iommu-groups
This commit is contained in:
parent
9c7b124846
commit
94cc7edaf4
17
fedora-rm-old-kernels
Executable file
17
fedora-rm-old-kernels
Executable 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
11
list-iommu-groups
Executable 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
|
Loading…
Reference in New Issue
Block a user