diff options
author | Leonidas P | 2022-02-18 03:53:29 +0200 |
---|---|---|
committer | Leonidas P | 2022-02-18 03:53:29 +0200 |
commit | 32cd5957a063b1d87ae8c09989b9116c39773569 (patch) | |
tree | a1df08120fad6b7c93ad0a4caf833051e41a3750 | |
parent | be899e329766f883972335729c709da2c0dbb8ab (diff) | |
download | aur-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
-rw-r--r-- | .SRCINFO | 11 | ||||
-rw-r--r-- | .gitignore | 11 | ||||
-rw-r--r-- | 60-dracut-remove.hook | 2 | ||||
-rw-r--r-- | 90-dracut-install.hook | 4 | ||||
-rw-r--r-- | PKGBUILD | 32 | ||||
-rwxr-xr-x | dracut-install | 46 | ||||
-rwxr-xr-x | dracut-remove | 2 |
7 files changed, 51 insertions, 57 deletions
@@ -1,6 +1,6 @@ pkgbase = dracut-hook pkgdesc = Install/remove hooks for dracut - pkgver = 0.4.2 + pkgver = 0.5 pkgrel = 1 url = https://dracut.wiki.kernel.org/index.php/Main_Page arch = any @@ -10,10 +10,9 @@ pkgbase = dracut-hook source = dracut-remove source = 90-dracut-install.hook source = 60-dracut-remove.hook - sha256sums = 5110714a574eb14e1bace89a6526fc07d98a82969c1b4cb95c46aa183a750ab8 - sha256sums = 25409770cdf9607eb05addcbc0f89f45a91385c25b8a307425d4b3f4b7c2a9ef - sha256sums = 492d51df1234b75a32e7dff63c86ee104a7d844a408070e1c4da5dc8ab53be6f - sha256sums = 054dac9f1d55029a922ff05c3064e54d25790c7a18d2b598edc58ef3d295cba1 + sha256sums = d33766c96859372ab72187b198e9cadf3ec5d95b30076d573d8f918f664a701c + sha256sums = 6230afb921dbf532b57f5f933fa38658a22c5262bdaf1951a6b431ea3dfeee84 + sha256sums = de09e8e65837b189aec0a8c9a067143880faff14467a5573949f772f39c053b3 + sha256sums = e79f8e9572c5d1af6052104eac7ff956754f7a191b52b16adf12b65a38e9b4ed pkgname = dracut-hook - diff --git a/.gitignore b/.gitignore index 6748987a3d9d..05c6d4d4c97b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,4 @@ -pkg -src -*.tar.gz -*.zip -*.tar.xz -*.patch -*.dat.bz2
\ No newline at end of file +* +!.gitignore +!.SRCINFO +!PKGBUILD diff --git a/60-dracut-remove.hook b/60-dracut-remove.hook index 80a9c1e4985e..6dd5722f627c 100644 --- a/60-dracut-remove.hook +++ b/60-dracut-remove.hook @@ -4,7 +4,7 @@ Operation = Remove Target = usr/lib/modules/*/pkgbase [Action] -Description = Removing linux initcpios... +Description = Removing initramfs... When = PreTransaction Exec = /usr/share/libalpm/scripts/dracut-remove NeedsTargets diff --git a/90-dracut-install.hook b/90-dracut-install.hook index d00ed2fdb4b5..89737c886b8e 100644 --- a/90-dracut-install.hook +++ b/90-dracut-install.hook @@ -2,12 +2,12 @@ Type = Path Operation = Install Operation = Upgrade -Target = usr/lib/modules/*/pkgbase +Target = usr/lib/modules/*/vmlinuz Target = usr/lib/dracut/* Target = usr/lib/systemd/systemd [Action] -Description = Updating linux initcpios... +Description = Updating initramfs... When = PostTransaction Exec = /usr/share/libalpm/scripts/dracut-install NeedsTargets @@ -1,29 +1,29 @@ -# Maintainer: Franklyn Tackitt <franklyn@tackitt.net> -# Maintainer: Kevin Del Castillo <quebin31@gmail.com> +# Maintainer: Leonidas P. <jpegxguy at outlook dot com> +# Contributor: Franklyn Tackitt <franklyn@tackitt.net> +# Contributor: Kevin Del Castillo <quebin31@gmail.com> pkgname=dracut-hook -pkgver=0.4.2 +pkgver=0.5 pkgrel=1 pkgdesc="Install/remove hooks for dracut" url=https://dracut.wiki.kernel.org/index.php/Main_Page arch=('any') license=('BSD') depends=('dracut') -noextract=() source=( - "dracut-install" - "dracut-remove" - "90-dracut-install.hook" - "60-dracut-remove.hook" + "dracut-install" + "dracut-remove" + "90-dracut-install.hook" + "60-dracut-remove.hook" ) -sha256sums=('5110714a574eb14e1bace89a6526fc07d98a82969c1b4cb95c46aa183a750ab8' - '25409770cdf9607eb05addcbc0f89f45a91385c25b8a307425d4b3f4b7c2a9ef' - '492d51df1234b75a32e7dff63c86ee104a7d844a408070e1c4da5dc8ab53be6f' - '054dac9f1d55029a922ff05c3064e54d25790c7a18d2b598edc58ef3d295cba1') +sha256sums=('d33766c96859372ab72187b198e9cadf3ec5d95b30076d573d8f918f664a701c' + '6230afb921dbf532b57f5f933fa38658a22c5262bdaf1951a6b431ea3dfeee84' + 'de09e8e65837b189aec0a8c9a067143880faff14467a5573949f772f39c053b3' + 'e79f8e9572c5d1af6052104eac7ff956754f7a191b52b16adf12b65a38e9b4ed') package() { - install -Dm644 "${srcdir}/90-dracut-install.hook" "${pkgdir}/usr/share/libalpm/hooks/90-dracut-install.hook" - install -Dm644 "${srcdir}/60-dracut-remove.hook" "${pkgdir}/usr/share/libalpm/hooks/60-dracut-remove.hook" - install -Dm755 "${srcdir}/dracut-install" "${pkgdir}/usr/share/libalpm/scripts/dracut-install" - install -Dm755 "${srcdir}/dracut-remove" "${pkgdir}/usr/share/libalpm/scripts/dracut-remove" + install -Dm644 "${srcdir}/90-dracut-install.hook" "${pkgdir}/usr/share/libalpm/hooks/90-dracut-install.hook" + install -Dm644 "${srcdir}/60-dracut-remove.hook" "${pkgdir}/usr/share/libalpm/hooks/60-dracut-remove.hook" + install -Dm755 "${srcdir}/dracut-install" "${pkgdir}/usr/share/libalpm/scripts/dracut-install" + install -Dm755 "${srcdir}/dracut-remove" "${pkgdir}/usr/share/libalpm/scripts/dracut-remove" } 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 diff --git a/dracut-remove b/dracut-remove index af350c7f6df6..6b1a4bd4997e 100755 --- a/dracut-remove +++ b/dracut-remove @@ -1,7 +1,7 @@ #!/bin/bash -e while read -r line; do - if [[ "$line" == 'usr/lib/modules/'+([^/])'/pkgbase' ]]; then + if [[ $line == */pkgbase ]]; then read -r pkgbase < "/${line}" rm -f "/boot/vmlinuz-${pkgbase}" "/boot/initramfs-${pkgbase}.img" "/boot/initramfs-${pkgbase}-fallback.img" fi |