]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* util/grub.d/10_linux.in: Add rootflags=subvol=<name> if / is on a
authorColin Watson <cjwatson@ubuntu.com>
Wed, 13 Apr 2011 11:57:26 +0000 (12:57 +0100)
committerColin Watson <cjwatson@ubuntu.com>
Wed, 13 Apr 2011 11:57:26 +0000 (12:57 +0100)
btrfs subvolume.
* util/grub.d/20_linux_xen.in: Likewise.

ChangeLog
util/grub.d/10_linux.in
util/grub.d/20_linux_xen.in

index d0269c9052d9266a024a72b7f8ab68c32af0e6dd..47935890d21a7a6382d671a74841f4f020e35006 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-04-13  Colin Watson  <cjwatson@ubuntu.com>
+
+       * util/grub.d/10_linux.in: Add rootflags=subvol=<name> if / is on a
+       btrfs subvolume.
+       * util/grub.d/20_linux_xen.in: Likewise.
+
 2011-04-13  Colin Watson  <cjwatson@ubuntu.com>
 
        Rewrite /proc/self/mountinfo handling to cope with bind-mounts and
index 930ce06ef9655d964a94fd48866e2b95ccd88cf1..1dbcad90c2afba35cba644677d5a437b88dedbe9 100644 (file)
@@ -51,6 +51,14 @@ else
   LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
 fi
 
+if [ "x`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`" = xbtrfs ]; then
+  rootsubvol="`make_system_path_relative_to_its_root /`"
+  rootsubvol="${rootsubvol#/}"
+  if [ "x${rootsubvol}" != x ]; then
+    GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}"
+  fi
+fi
+
 linux_entry ()
 {
   os="$1"
index 858627aa3cc053ecc103c7811082ba95d5cdbcdc..a9007603deeb69466c41a7aced158edc643cea22 100644 (file)
@@ -51,6 +51,14 @@ else
   LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
 fi
 
+if [ "x`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`" = xbtrfs ]; then
+  rootsubvol="`make_system_path_relative_to_its_root /`"
+  rootsubvol="${rootsubvol#/}"
+  if [ "x${rootsubvol}" != x ]; then
+    GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}"
+  fi
+fi
+
 linux_entry ()
 {
   os="$1"