File nfs-root.patch of Package grub2

Index: grub-2.02/util/grub-mkconfig.in
===================================================================
--- grub-2.02.orig/util/grub-mkconfig.in
+++ grub-2.02/util/grub-mkconfig.in
@@ -267,6 +267,7 @@ export GRUB_DEFAULT \
   GRUB_DISABLE_SUBMENU \
   GRUB_CMDLINE_LINUX_RECOVERY \
   GRUB_USE_LINUXEFI \
+  SUSE_NFS_SNAPSHOT_BOOTING \
   SUSE_BTRFS_SNAPSHOT_BOOTING \
   SUSE_CMDLINE_XENEFI \
   SUSE_REMOVE_LINUX_ROOT_PARAM
Index: grub-2.02/util/grub-mkconfig_lib.in
===================================================================
--- grub-2.02.orig/util/grub-mkconfig_lib.in
+++ grub-2.02/util/grub-mkconfig_lib.in
@@ -49,7 +49,9 @@ grub_warn ()
 
 make_system_path_relative_to_its_root ()
 {
-  if [ "x${SUSE_BTRFS_SNAPSHOT_BOOTING}" = "xtrue" ] ; then
+  if [ "x${SUSE_NFS_SNAPSHOT_BOOTING}" = "xtrue" ] ; then
+  echo "\${root_path}\${snapshot_root}$("${grub_mkrelpath}" -r "$1")"
+  elif [ "x${SUSE_BTRFS_SNAPSHOT_BOOTING}" = "xtrue" ] ; then
   "${grub_mkrelpath}" -r "$1"
   else
   "${grub_mkrelpath}" "$1"
Index: grub-2.02/util/grub.d/10_linux.in
===================================================================
--- grub-2.02.orig/util/grub.d/10_linux.in
+++ grub-2.02/util/grub.d/10_linux.in
@@ -75,6 +75,11 @@ case x"$GRUB_FS" in
 	;;
 esac
 
+if [ "x$SUSE_NFS_SNAPSHOT_BOOTING" = "xtrue" ]; then
+  GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX} \${extra_cmdline}"
+  LINUX_ROOT_DEVICE="nfs::\${root_path}\${snapshot_root}"
+fi
+
 if [ "x$SUSE_REMOVE_LINUX_ROOT_PARAM" = "xtrue" ]; then
   LINUX_ROOT_DEVICE=""
 fi
openSUSE Build Service is sponsored by