diff options
author | Leonidas P | 2022-02-19 04:02:25 +0200 |
---|---|---|
committer | Leonidas P | 2022-02-19 04:02:25 +0200 |
commit | 85aa43e06832607b3c1b210915ce51ac01c01b1d (patch) | |
tree | a2171f958fa1f37676520b8e229dab95787b4143 /dracut-install | |
parent | 32cd5957a063b1d87ae8c09989b9116c39773569 (diff) | |
download | aur-85aa43e06832607b3c1b210915ce51ac01c01b1d.tar.gz |
ignore non-pacman kernels
Diffstat (limited to 'dracut-install')
-rwxr-xr-x | dracut-install | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/dracut-install b/dracut-install index dc2ab57ded10..681461a02bbd 100755 --- a/dracut-install +++ b/dracut-install @@ -4,31 +4,34 @@ all=0 lines=() while read -r line; do - if [[ $line != */vmlinuz ]]; then + if [[ "${line}" != */vmlinuz ]]; then # triggers when it's a change to dracut files all=1 continue fi - pkgbase="$(<${line%/vmlinuz}/pkgbase)" - install -Dm644 "${line}" "/boot/vmlinuz-${pkgbase}" + lines+=("${line%/vmlinuz}") - lines+=(${line}) + pkgbase="$(<"${lines[-1]}/pkgbase")" + install -Dm644 "${line}" "/boot/vmlinuz-${pkgbase}" done if (( all )); then - lines=(/usr/lib/modules/*/vmlinuz) + lines=(/usr/lib/modules/*) fi for line in "${lines[@]}"; do - folder="${line%/vmlinuz}" + if ! pacman -Qqo "${line}/pkgbase" &> /dev/null; then + # if pkgbase does not belong to any package then skip this kernel + continue + fi - pkgbase="$(<${folder}/pkgbase)" - kver="${folder##*/}" + pkgbase="$(<"${line}/pkgbase")" + kver="${line##*/}" - echo ":: Building initramfs for $pkgbase ($kver)" - dracut --force --hostonly "/boot/initramfs-${pkgbase}.img" "${kver}" + echo ":: Building initramfs for ${pkgbase} (${kver})" + dracut --force --hostonly --no-hostonly-cmdline "/boot/initramfs-${pkgbase}.img" "${kver}" - echo ":: Building fallback initramfs for $pkgbase ($kver)" + echo ":: Building fallback initramfs for ${pkgbase} (${kver})" dracut --force --no-hostonly "/boot/initramfs-${pkgbase}-fallback.img" "${kver}" done |