All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] grub.d: Use linuxefi and initrdefi commands if platform is efi
@ 2020-03-23 11:53 Tianjia Zhang
  2020-03-23 17:22 ` Paul Menzel
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Tianjia Zhang @ 2020-03-23 11:53 UTC (permalink / raw)
  To: grub-devel

When the platform is EFI platform, use 'linuxefi' and 'initrdefi'
commands instead of 'linux' and 'initrd'.

Signed-off-by: Jia Zhang <zhang.jia@linux.alibaba.com>
Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
---
 util/grub.d/10_linux.in | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index e8b01c0d0..8c5c3dab7 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -138,10 +138,17 @@ linux_entry ()
     fi
     printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
   fi
+  if [ "@GRUB_PLATFORM@" != "efi" ] ; then
+    linux_cmd="linux"
+    initrd_cmd="initrd"
+  else
+    linux_cmd="linuxefi"
+    initrd_cmd="initrdefi"
+  fi
   message="$(gettext_printf "Loading Linux %s ..." ${version})"
   sed "s/^/$submenu_indentation/" << EOF
 	echo	'$(echo "$message" | grub_quote)'
-	linux	${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
+	${linux_cmd}	${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
 EOF
   if test -n "${initrd}" ; then
     # TRANSLATORS: ramdisk isn't identifier. Should be translated.
@@ -152,7 +159,7 @@ EOF
     done
     sed "s/^/$submenu_indentation/" << EOF
 	echo	'$(echo "$message" | grub_quote)'
-	initrd	$(echo $initrd_path)
+	${initrd_cmd}	$(echo $initrd_path)
 EOF
   fi
   sed "s/^/$submenu_indentation/" << EOF
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-03-27 15:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-23 11:53 [PATCH] grub.d: Use linuxefi and initrdefi commands if platform is efi Tianjia Zhang
2020-03-23 17:22 ` Paul Menzel
2020-03-23 18:26 ` Javier Martinez Canillas
2020-03-23 18:31   ` Julian Andres Klode
2020-03-23 18:50     ` Javier Martinez Canillas
2020-03-25 17:38 ` Daniel Kiper
2020-03-26  2:22   ` Tianjia Zhang
2020-03-27 14:44   ` Konrad Rzeszutek Wilk
2020-03-27 15:58     ` Daniel Kiper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.