* util/grub.d/10_linux.in: Add rootflags=subvol=<name> if / is on a

btrfs subvolume.
* util/grub.d/20_linux_xen.in: Likewise.
This commit is contained in:
Colin Watson 2011-04-13 12:57:26 +01:00
parent 78fa584f67
commit e74c31125d
3 changed files with 22 additions and 0 deletions

View file

@ -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

View 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"

View 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"