Fix non-kernel triggers
This commit is contained in:
parent
b553a85099
commit
85eb991993
2 changed files with 18 additions and 4 deletions
|
@ -2,7 +2,7 @@
|
||||||
Type = Path
|
Type = Path
|
||||||
Operation = Install
|
Operation = Install
|
||||||
Operation = Upgrade
|
Operation = Upgrade
|
||||||
Target = usr/lib/modules/*/vmlinuz
|
Operation = Remove
|
||||||
Target = usr/lib/initcpio/*
|
Target = usr/lib/initcpio/*
|
||||||
Target = usr/lib/firmware/*
|
Target = usr/lib/firmware/*
|
||||||
Target = usr/src/*/dkms.conf
|
Target = usr/src/*/dkms.conf
|
||||||
|
@ -15,6 +15,12 @@ Operation = Remove
|
||||||
Target = amd-ucode
|
Target = amd-ucode
|
||||||
Target = intel-ucode
|
Target = intel-ucode
|
||||||
|
|
||||||
|
[Trigger]
|
||||||
|
Type = Path
|
||||||
|
Operation = Install
|
||||||
|
Operation = Upgrade
|
||||||
|
Target = usr/lib/modules/*/vmlinuz
|
||||||
|
|
||||||
[Action]
|
[Action]
|
||||||
Description = Installing kernel...
|
Description = Installing kernel...
|
||||||
When = PostTransaction
|
When = PostTransaction
|
||||||
|
|
|
@ -6,14 +6,22 @@ while read -r line; do
|
||||||
echo ":: kernel-install removing kernel $version"
|
echo ":: kernel-install removing kernel $version"
|
||||||
kernel-install remove "${version}"
|
kernel-install remove "${version}"
|
||||||
elif [[ $1 == "add" ]]; then
|
elif [[ $1 == "add" ]]; then
|
||||||
echo ":: kernel-install installing kernel $version"
|
if [[ line =~ ".*vmlinuz$" ]]; then
|
||||||
kernel-install add "${version}" "${line}"
|
echo ":: kernel-install installing kernel $version"
|
||||||
|
kernel-install add "${version}" "${line}"
|
||||||
|
else
|
||||||
|
install_all=1
|
||||||
|
break
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo ":: Invalid option passed to kernel-install script"
|
echo ":: Invalid option passed to kernel-install script"
|
||||||
fi
|
fi
|
||||||
version=$(basename "${line%/vmlinuz}")
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [[ $install_all == 1 ]]; then
|
||||||
|
reinstall-kernels
|
||||||
|
fi
|
||||||
|
|
||||||
# first check if we are running in a chroot
|
# first check if we are running in a chroot
|
||||||
if [ "$(stat -c %d:%i /)" != "$(stat -c %d:%i /proc/1/root/.)" ]; then
|
if [ "$(stat -c %d:%i /)" != "$(stat -c %d:%i /proc/1/root/.)" ]; then
|
||||||
echo 'Running in a chroot, skipping cmdline generation'
|
echo 'Running in a chroot, skipping cmdline generation'
|
||||||
|
|
Loading…
Add table
Reference in a new issue