diff --git a/debian/changelog b/debian/changelog index 80ac97620..6ff438c78 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,7 @@ grub2 (1.99~rc1-2) UNRELEASED; urgency=low Uggla). * Handle empty dir passed to grub_find_root_device_from_mountinfo; fixes grub-mkrelpath on btrfs subvolumes (LP: #712029). + * Add rootflags=subvol= if / is on a btrfs subvolume (LP: #712029). -- Colin Watson Tue, 18 Jan 2011 11:44:48 +0000 diff --git a/debian/patches/btrfs_rootflags.patch b/debian/patches/btrfs_rootflags.patch new file mode 100644 index 000000000..49d949dae --- /dev/null +++ b/debian/patches/btrfs_rootflags.patch @@ -0,0 +1,27 @@ +Description: Add rootflags=subvol= if / is on a btrfs subvolume + Not yet forwarded upstream because rootflags= is distribution-specific. + It's not clear how to do this portably. +Author: Colin Watson +Forwarded: no +Bug-Ubuntu: https://bugs.launchpad.net/bugs/712029 +Last-Update: 2011-02-04 + +Index: b/util/grub.d/10_linux.in +=================================================================== +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -51,6 +51,14 @@ + 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" diff --git a/debian/patches/series b/debian/patches/series index e11ae5c48..58892af46 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -16,3 +16,4 @@ branch_squash.patch branch_longlinuxcmd.patch branch_parse-color.patch branch_embed-sectors.patch +btrfs_rootflags.patch