summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO8
-rw-r--r--PKGBUILD20
-rwxr-xr-xgrub-initrd-generation-fix39
-rw-r--r--grub-initrd-generation-fix.hook13
4 files changed, 75 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index d54a5548772..d3b31f2cbfc 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = os-prober-btrfs
pkgdesc = Utility to detect other OSes on a set of drives (with additional patches to detect btrfs systems and other systems)
pkgver = 1.79
- pkgrel = 3
+ pkgrel = 4
url = http://joey.kitenet.net/code/os-prober/
arch = x86_64
license = GPL3
@@ -25,6 +25,8 @@ pkgbase = os-prober-btrfs
source = os-prober-grepfix.patch
source = os-prober-gentoo-fix.patch
source = fix-blkid-path.patch
+ source = grub-initrd-generation-fix
+ source = grub-initrd-generation-fix.hook
md5sums = 08d3bfff00f1f7c068ce509656728eba
md5sums = 2ae284a2fc6cafb6ec4af0f44d3c3e48
md5sums = fa2c878cbb8af6b6dc57b6cd966520ec
@@ -39,6 +41,8 @@ pkgbase = os-prober-btrfs
md5sums = ed3242f992b525a4af0a9df9af51e334
md5sums = ec05aaa35c83ab669291e8895c252cc8
md5sums = 20dc42ef9b69f79b920380cd95191ed3
+ md5sums = e1d73db25562d357b7371a936843488b
+ md5sums = 344d6a6a08c3adae84ea2c8ad84712da
sha256sums = abe6317d078c4e51e322e62036b6df4a698bfe80c5be110a08894841179810ee
sha256sums = 9a6c22c91ea5955d665bc20d85d899f6721875a6216862d59a1b7f3f4241fd02
sha256sums = 092b0caef6fff45560531c0735e9449cb05a677e2296d72b5a0b4fb568fa4476
@@ -53,5 +57,7 @@ pkgbase = os-prober-btrfs
sha256sums = a9331117892dd9876b346d941969f70da96d54ce122d7a5ff40d9efe36aded42
sha256sums = 02741e0edbc46327501be5d74977ff2bffa5ddaffe6a55a689e38ce4b8372444
sha256sums = 87bbb0f69ebb47f5136291d6851967fba791db4f27d8883b35fc5be1653ff7a6
+ sha256sums = cae7e02a2d21fe176525fe8270cd01f4ae4395d5178b45d7e681bb611a33ea05
+ sha256sums = 44b5a25152ebad786d8d7225fae207294e5d6c12eaf8273e8d2d244f28c471da
pkgname = os-prober-btrfs
diff --git a/PKGBUILD b/PKGBUILD
index 20ef8ac7308..7e340da325f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,7 +5,7 @@
pkgname=os-prober-btrfs
_pkgname=os-prober
pkgver=1.79
-pkgrel=3
+pkgrel=4
pkgdesc="Utility to detect other OSes on a set of drives (with additional patches to detect btrfs systems and other systems)"
url="http://joey.kitenet.net/code/os-prober/"
arch=('x86_64')
@@ -27,7 +27,9 @@ source=(http://http.debian.net/debian/pool/main/o/${_pkgname}/${_pkgname}_${pkgv
os-prober-grub2-multiple-images.patch
os-prober-grepfix.patch
os-prober-gentoo-fix.patch
- fix-blkid-path.patch)
+ fix-blkid-path.patch
+ grub-initrd-generation-fix
+ grub-initrd-generation-fix.hook)
md5sums=('08d3bfff00f1f7c068ce509656728eba'
'2ae284a2fc6cafb6ec4af0f44d3c3e48'
'fa2c878cbb8af6b6dc57b6cd966520ec'
@@ -41,7 +43,9 @@ md5sums=('08d3bfff00f1f7c068ce509656728eba'
'2ac73c1c9f3ff32c4c5670f5fbda9f0d'
'ed3242f992b525a4af0a9df9af51e334'
'ec05aaa35c83ab669291e8895c252cc8'
- '20dc42ef9b69f79b920380cd95191ed3')
+ '20dc42ef9b69f79b920380cd95191ed3'
+ 'e1d73db25562d357b7371a936843488b'
+ '344d6a6a08c3adae84ea2c8ad84712da')
sha256sums=('abe6317d078c4e51e322e62036b6df4a698bfe80c5be110a08894841179810ee'
'9a6c22c91ea5955d665bc20d85d899f6721875a6216862d59a1b7f3f4241fd02'
'092b0caef6fff45560531c0735e9449cb05a677e2296d72b5a0b4fb568fa4476'
@@ -55,7 +59,9 @@ sha256sums=('abe6317d078c4e51e322e62036b6df4a698bfe80c5be110a08894841179810ee'
'07b919c7559ce6c5a8d8907d752366fc97ccf40b7ad54cbb2de904a9dd373efd'
'a9331117892dd9876b346d941969f70da96d54ce122d7a5ff40d9efe36aded42'
'02741e0edbc46327501be5d74977ff2bffa5ddaffe6a55a689e38ce4b8372444'
- '87bbb0f69ebb47f5136291d6851967fba791db4f27d8883b35fc5be1653ff7a6')
+ '87bbb0f69ebb47f5136291d6851967fba791db4f27d8883b35fc5be1653ff7a6'
+ 'cae7e02a2d21fe176525fe8270cd01f4ae4395d5178b45d7e681bb611a33ea05'
+ '44b5a25152ebad786d8d7225fae207294e5d6c12eaf8273e8d2d244f28c471da')
prepare() {
cd ${_pkgname}
@@ -99,4 +105,10 @@ package() {
install -Dm 755 os-probes/mounted/powerpc/20macosx "${pkgdir}"/usr/lib/os-probes/mounted/20macosx
install -dm 755 "${pkgdir}"/var/lib/os-prober
+
+ install -d $pkgdir/usr/share/libalpm/hooks
+ install -Dm644 grub-initrd-generation-fix.hook $pkgdir/usr/share/libalpm/hooks/grub-initrd-generation-fix.hook
+
+ install -d $pkgdir/usr/share/libalpm/scripts
+ install -Dm755 grub-initrd-generation-fix $pkgdir/usr/share/libalpm/scripts/grub-initrd-generation-fix
}
diff --git a/grub-initrd-generation-fix b/grub-initrd-generation-fix
new file mode 100755
index 00000000000..b2898a31842
--- /dev/null
+++ b/grub-initrd-generation-fix
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+30_os-prober() {
+ local file=/etc/grub.d/30_os-prober # from package 'grub'
+
+ sed -i $file \
+ -e "s|\(echo \${LINUX} \| cut -d ':' -f 5\)\`|\1 \| tr '^' ' '\`|" \
+ -e 's|LINITRD="${LINITRD#/boot}"$|LINITRD=$(echo "$LINITRD" \| sed -e "s\|/boot/\|/\|g")|' # remove /boot
+}
+
+40grub2() {
+ local file=/usr/lib/linux-boot-probes/mounted/40grub2 # from package 'os-prober'
+
+ # use all (but first) parameters:
+ local c1='s|initrd="$(echo "$2"|shift; initrd="$(echo "$@"|'
+
+ # add prefix /boot:
+ local c2='s|initrd="/boot$initrd"|initrd=$(echo "$initrd" \| sed -e "s\|^/\|/boot/\|" -e "s\| /\| /boot/\|g")|'
+
+ sed -i $file -e "$c1" -e "$c2"
+
+
+}
+
+Main()
+{
+ local hookname="$1"
+
+ case "$hookname" in
+ 30_os-prober) 30_os-prober ;;
+ 40grub2) 40grub2 ;;
+ "") 30_os-prober
+ 40grub2
+ ;;
+ esac
+}
+
+Main "$@"
+
diff --git a/grub-initrd-generation-fix.hook b/grub-initrd-generation-fix.hook
new file mode 100644
index 00000000000..f8bbd9d3604
--- /dev/null
+++ b/grub-initrd-generation-fix.hook
@@ -0,0 +1,13 @@
+[Trigger]
+Operation = Install
+Operation = Upgrade
+Type = Package
+Target = grub
+Target = grub-silent
+Target = os-prober
+Target = os-prober-btrfs
+
+[Action]
+Description = Fix 'grub' and 'os-prober' after upgrading either of them....
+When = PostTransaction
+Exec = /usr/share/libalpm/scripts/grub-initrd-generation-fix