All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Determine the linux loader command at runtime
@ 2014-01-30  8:24 Lubomir Rintel
  2014-01-31 10:22 ` Colin Watson
  0 siblings, 1 reply; 2+ messages in thread
From: Lubomir Rintel @ 2014-01-30  8:24 UTC (permalink / raw)
  To: grub-devel; +Cc: Lubomir Rintel

There are numerous ways to load Linux kernel depending on the platform customs.
Pick the correct one at runtime, so that legacy platform interfaces don't break
and newer platforms use their native ways of bootstrapping Linux.

Originally from Vladimir Serbinenko <phcoder@gmail.com>, slightly modified.
---
 ChangeLog               |  5 +++++
 util/grub.d/10_linux.in | 17 +++++++++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 10abfe2..4f1ee02 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-01-20  Lubomir Rintel  <lkundrak@v3.sk>
+
+	* util/grub.d/10_linux.in: Determine the loader command by platform.
+	(linux_entry): Use the command appropriate for given platform.
+
 2014-01-19  Colin Watson  <cjwatson@ubuntu.com>
 
 	* grub-core/osdep/freebsd/hostdisk.c (grub_util_fd_open): Ignore
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 00d1931..d980d9a 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -129,14 +129,14 @@ linux_entry ()
   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	${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
 EOF
   if test -n "${initrd}" ; then
     # TRANSLATORS: ramdisk isn't identifier. Should be translated.
     message="$(gettext_printf "Loading initial ramdisk ...")"
     sed "s/^/$submenu_indentation/" << EOF
 	echo	'$(echo "$message" | grub_quote)'
-	initrd	${rel_dirname}/${initrd}
+	\$initrd	${rel_dirname}/${initrd}
 EOF
   fi
   sed "s/^/$submenu_indentation/" << EOF
@@ -169,6 +169,19 @@ prepare_root_cache=
 boot_device_id=
 title_correction_code=
 
+# Pick a correct kernel load command. Use real mode entry point on legacy PC
+# platform (so that EDD and APM keep being available) and native entry point
+# on everything else.
+cat <<EOF
+if [ x\$grub_platform = xpc ]; then
+	linux=linux16
+	initrd=initrd16
+else
+	linux=linux
+	initrd=initrd
+fi
+EOF
+
 # Extra indentation to add to menu entries in a submenu. We're not in a submenu
 # yet, so it's empty. In a submenu it will be equal to '\t' (one tab).
 submenu_indentation=""
-- 
1.8.5.3



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

* Re: [PATCH] Determine the linux loader command at runtime
  2014-01-30  8:24 [PATCH] Determine the linux loader command at runtime Lubomir Rintel
@ 2014-01-31 10:22 ` Colin Watson
  0 siblings, 0 replies; 2+ messages in thread
From: Colin Watson @ 2014-01-31 10:22 UTC (permalink / raw)
  To: grub-devel

On Thu, Jan 30, 2014 at 09:24:42AM +0100, Lubomir Rintel wrote:
> There are numerous ways to load Linux kernel depending on the platform customs.
> Pick the correct one at runtime, so that legacy platform interfaces don't break
> and newer platforms use their native ways of bootstrapping Linux.

We (Ubuntu) have been using the 32-bit entry point on i386-pc for quite
some time, and I'm fairly sure we rely on it to make gfxpayload work for
flicker-free boot.  It looks like this will break that; please don't.

-- 
Colin Watson                                       [cjwatson@ubuntu.com]


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

end of thread, other threads:[~2014-01-31 10:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-30  8:24 [PATCH] Determine the linux loader command at runtime Lubomir Rintel
2014-01-31 10:22 ` Colin Watson

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.