summarylogtreecommitdiffstats
path: root/dracut-install
diff options
context:
space:
mode:
authorLeonidas P2022-02-18 03:53:29 +0200
committerLeonidas P2022-02-18 03:53:29 +0200
commit32cd5957a063b1d87ae8c09989b9116c39773569 (patch)
treea1df08120fad6b7c93ad0a4caf833051e41a3750 /dracut-install
parentbe899e329766f883972335729c709da2c0dbb8ab (diff)
downloadaur-32cd5957a063b1d87ae8c09989b9116c39773569.tar.gz
Use vmlinuz as target for install
Fixes issues with kernel-modules-hook. mkinitcpio uses vmlinuz instead of pkgbase as well. Also, simplify some scripts
Diffstat (limited to 'dracut-install')
-rwxr-xr-xdracut-install46
1 files changed, 22 insertions, 24 deletions
diff --git a/dracut-install b/dracut-install
index b0ed1491d5f3..dc2ab57ded10 100755
--- a/dracut-install
+++ b/dracut-install
@@ -1,36 +1,34 @@
#!/bin/bash -e
-kernels=()
-dracut_update=0
+all=0
+lines=()
while read -r line; do
- if [[ $line != 'usr/lib/modules/'+([^/])'/pkgbase' ]]; then
- dracut_update=1 # Dracut files have been updated
- continue
- fi
+ if [[ $line != */vmlinuz ]]; then
+ # triggers when it's a change to dracut files
+ all=1
+ continue
+ fi
- read -r pkgbase < "/${line}"
- kernels+=("${pkgbase}")
+ pkgbase="$(<${line%/vmlinuz}/pkgbase)"
+ install -Dm644 "${line}" "/boot/vmlinuz-${pkgbase}"
+
+ lines+=(${line})
done
-if (( dracut_update )); then
- kernels=()
- for file in /lib/modules/*/pkgbase; do
- if read -r pkgbase &> /dev/null < "$file"; then
- kernels+=("${pkgbase}")
- fi
- done
+if (( all )); then
+ lines=(/usr/lib/modules/*/vmlinuz)
fi
-for kernel in "${kernels[@]}"; do
- path="$(grep -lE "^${kernel}\$" /usr/lib/modules/*/pkgbase)"
- version=$(basename "${path%/pkgbase}")
- read -r pkgbase < "$path"
+for line in "${lines[@]}"; do
+ folder="${line%/vmlinuz}"
+
+ pkgbase="$(<${folder}/pkgbase)"
+ kver="${folder##*/}"
- install -Dm0644 "/${path%'/pkgbase'}/vmlinuz" "/boot/vmlinuz-${pkgbase}"
+ echo ":: Building initramfs for $pkgbase ($kver)"
+ dracut --force --hostonly "/boot/initramfs-${pkgbase}.img" "${kver}"
- echo ":: Building initramfs for $kernel-$version"
- dracut -f --no-hostonly-cmdline "/boot/initramfs-${kernel}.img" --kver "${version}"
- echo ":: Building fallback initramfs for $kernel-$version"
- dracut -f -N "/boot/initramfs-${kernel}-fallback.img" --kver "${version}"
+ echo ":: Building fallback initramfs for $pkgbase ($kver)"
+ dracut --force --no-hostonly "/boot/initramfs-${pkgbase}-fallback.img" "${kver}"
done