Blame SOURCES/0123-Make-10_linux-work-with-our-changes-for-linux16-and-.patch

6b3c76
From b437c2152d9b21a519fa7354f11618c65e6088e8 Mon Sep 17 00:00:00 2001
a85e8e
From: Peter Jones <pjones@redhat.com>
a85e8e
Date: Tue, 14 Jan 2014 13:12:23 -0500
6b3c76
Subject: [PATCH 123/261] Make 10_linux work with our changes for linux16 and
6b3c76
 linuxefi on aarch64
a85e8e
a85e8e
Signed-off-by: Peter Jones <pjones@redhat.com>
a85e8e
---
a85e8e
 util/grub.d/10_linux.in | 31 ++++++++++++++++++++++++++++---
a85e8e
 1 file changed, 28 insertions(+), 3 deletions(-)
a85e8e
a85e8e
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
6b3c76
index c943a1e40..2b8c561ff 100644
a85e8e
--- a/util/grub.d/10_linux.in
a85e8e
+++ b/util/grub.d/10_linux.in
a85e8e
@@ -75,8 +75,18 @@ linux_entry ()
a85e8e
   args="$4"
a85e8e
 
a85e8e
   sixteenbit=""
a85e8e
+  linuxefi="linux"
a85e8e
+  initrdefi="initrd"
a85e8e
   case "$machine" in
a85e8e
-    i?86|x86_64) sixteenbit="16" ;;
a85e8e
+    i?86|x86_64)
a85e8e
+	sixteenbit="16"
a85e8e
+	linuxefi="linuxefi"
a85e8e
+	initrdefi="initrdefi"
a85e8e
+	;;
a85e8e
+    aarch64)
a85e8e
+	linuxefi="linux"
a85e8e
+	initrdefi="initrd"
a85e8e
+	;;
a85e8e
   esac
a85e8e
 
a85e8e
   if [ -z "$boot_device_id" ]; then
a85e8e
@@ -133,7 +143,7 @@ linux_entry ()
a85e8e
   fi
a85e8e
   if [ -d /sys/firmware/efi ]; then
a85e8e
     sed "s/^/$submenu_indentation/" << EOF
a85e8e
-	linuxefi ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
a85e8e
+	${linuxefi} ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
a85e8e
 EOF
a85e8e
   else
a85e8e
     sed "s/^/$submenu_indentation/" << EOF
a85e8e
@@ -143,7 +153,7 @@ EOF
a85e8e
   if test -n "${initrd}" ; then
a85e8e
     if [ -d /sys/firmware/efi ]; then
a85e8e
       sed "s/^/$submenu_indentation/" << EOF
a85e8e
-	initrdefi ${rel_dirname}/${initrd}
a85e8e
+	${initrdefi} ${rel_dirname}/${initrd}
a85e8e
 EOF
a85e8e
     else
a85e8e
       sed "s/^/$submenu_indentation/" << EOF
a85e8e
@@ -151,6 +161,13 @@ EOF
a85e8e
 EOF
a85e8e
     fi
a85e8e
   fi
a85e8e
+  if test -n "${fdt}" ; then
a85e8e
+    message="$(gettext_printf "Loading fdt ...")"
a85e8e
+    sed "s/^/$submenu_indentation/" << EOF
a85e8e
+	echo	'$(echo "$message" | grub_quote)'
a85e8e
+	devicetree	${rel_dirname}/${fdt}
a85e8e
+EOF
a85e8e
+  fi
a85e8e
   sed "s/^/$submenu_indentation/" << EOF
a85e8e
 }
a85e8e
 EOF
a85e8e
@@ -211,6 +228,14 @@ while [ "x$list" != "x" ] ; do
a85e8e
     fi
a85e8e
   done
a85e8e
 
a85e8e
+  fdt=
a85e8e
+  for i in "dtb-${version}" "dtb-${alt_version}"; do
a85e8e
+    if test -e "${dirname}/${i}/foundation-v8.dtb" ; then
a85e8e
+      fdt="${i}/foundation-v8.dtb"
a85e8e
+      break
a85e8e
+    fi
a85e8e
+  done
a85e8e
+
a85e8e
   config=
a85e8e
   for i in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do
a85e8e
     if test -e "${i}" ; then
6b3c76
-- 
6b3c76
2.13.5
6b3c76