From 1039c8eba4d90bf85a3a934f1706f9cc06b78504 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sat, 10 Mar 2012 15:21:25 +0100 Subject: [PATCH] * util/grub.d/10_linux.in: Use stat if grub-probe on root fails. * util/grub.d/20_linux_xen.in: Likewise. Based on Debian patch. --- ChangeLog | 6 ++++++ util/grub.d/10_linux.in | 4 ++++ util/grub.d/20_linux_xen.in | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index fc1645562..1c26fbb24 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-03-10 Vladimir Serbinenko + + * util/grub.d/10_linux.in: Use stat if grub-probe on root fails. + * util/grub.d/20_linux_xen.in: Likewise. + Based on Debian patch. + 2012-03-10 Vladimir Serbinenko * util/grub.d/10_linux.in: Fix syntax error resulting in diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 5fc521855..8c75fab29 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -53,6 +53,10 @@ fi GRUBFS="`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`" +if [ x"$GRUBFS" = x ]; then + GRUBFS="$(stat -f --printf=%T / || true)" +fi + case x"$GRUBFS" in xbtrfs) rootsubvol="`make_system_path_relative_to_its_root /`" diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in index b839d0d03..8bdc4dceb 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -61,6 +61,10 @@ fi GRUBFS="`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`" +if [ x"$GRUBFS" = x ]; then + GRUBFS="$(stat -f --printf=%T /)" +fi + case x"$GRUBFS" in xbtrfs) rootsubvol="`make_system_path_relative_to_its_root /`"