--- util/grub-mkconfig.in | 3 ++- util/grub-mkconfig_lib.in | 4 ++++ util/grub.d/00_header.in | 23 ++++++++++++++++++++++- util/grub.d/10_linux.in | 11 ++++++++++- util/grub.d/20_linux_xen.in | 4 ++++ 5 files changed, 42 insertions(+), 3 deletions(-) Index: grub-2.02~beta2/util/grub-mkconfig_lib.in =================================================================== --- grub-2.02~beta2.orig/util/grub-mkconfig_lib.in +++ grub-2.02~beta2/util/grub-mkconfig_lib.in @@ -49,7 +49,11 @@ grub_warn () make_system_path_relative_to_its_root () { + if [ "x${SUSE_BTRFS_SNAPSHOT_BOOTING}" = "xtrue" ] ; then + "${grub_mkrelpath}" -r "$1" + else "${grub_mkrelpath}" "$1" + fi } is_path_readable_by_grub () Index: grub-2.02~beta2/util/grub.d/00_header.in =================================================================== --- grub-2.02~beta2.orig/util/grub.d/00_header.in +++ grub-2.02~beta2/util/grub.d/00_header.in @@ -27,6 +27,14 @@ export TEXTDOMAINDIR="@localedir@" . "@datadir@/@PACKAGE@/grub-mkconfig_lib" +if [ "x${SUSE_BTRFS_SNAPSHOT_BOOTING}" = "xtrue" ] && + [ "x${GRUB_FS}" = "xbtrfs" ] ; then + cat </dev/null || true` Index: grub-2.02~beta2/util/grub.d/20_linux_xen.in =================================================================== --- grub-2.02~beta2.orig/util/grub.d/20_linux_xen.in +++ grub-2.02~beta2/util/grub.d/20_linux_xen.in @@ -67,10 +67,14 @@ fi case x"$GRUB_FS" in xbtrfs) + if [ "x${SUSE_BTRFS_SNAPSHOT_BOOTING}" = "xtrue" ]; then + GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX} \${extra_cmdline}" + else 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;; xzfs) rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true`