Received: from list by lists.gnu.org with archive (Exim 4.71) id 1W8mvz-0003kh-7X for mharc-grub-devel@gnu.org; Thu, 30 Jan 2014 03:25:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54604) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8mvs-0003ix-1p for grub-devel@gnu.org; Thu, 30 Jan 2014 03:25:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W8mvm-0006jR-Q9 for grub-devel@gnu.org; Thu, 30 Jan 2014 03:25:07 -0500 Received: from shell.v3.sk ([195.168.3.45]:42969) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8mvm-0006fa-JA for grub-devel@gnu.org; Thu, 30 Jan 2014 03:25:02 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 066F442609 for ; Thu, 30 Jan 2014 09:25:00 +0100 (CET) Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id MDJA41mR6Gf8; Thu, 30 Jan 2014 09:24:57 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 35C314260F; Thu, 30 Jan 2014 09:24:57 +0100 (CET) X-Virus-Scanned: amavisd-new at zimbra.v3.sk Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id NI9em0irSe_4; Thu, 30 Jan 2014 09:24:56 +0100 (CET) Received: from odvarok.lan (ip-94-113-108-82.net.upcbroadband.cz [94.113.108.82]) by zimbra.v3.sk (Postfix) with ESMTPSA id 9586F42609; Thu, 30 Jan 2014 09:24:56 +0100 (CET) From: Lubomir Rintel To: grub-devel@gnu.org Subject: [PATCH] Determine the linux loader command at runtime Date: Thu, 30 Jan 2014 09:24:42 +0100 Message-Id: <1391070282-4841-1-git-send-email-lkundrak@v3.sk> X-Mailer: git-send-email 1.8.5.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.168.3.45 Cc: Lubomir Rintel X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2014 08:25:13 -0000 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 , 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 + + * 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 * 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 <