9d15b4
From 5fa65416bae89efb88015e72cb21c28fe3833fc8 Mon Sep 17 00:00:00 2001
f4c76c
From: Peter Jones <pjones@redhat.com>
f4c76c
Date: Tue, 14 Jan 2014 13:12:23 -0500
1b23a2
Subject: [PATCH 43/90] Make 10_linux work with our changes for linux16 and
f4c76c
 linuxefi on aarch64
f4c76c
f4c76c
Signed-off-by: Peter Jones <pjones@redhat.com>
f4c76c
---
f4c76c
 util/grub.d/10_linux.in | 31 ++++++++++++++++++++++++++++---
f4c76c
 1 file changed, 28 insertions(+), 3 deletions(-)
f4c76c
f4c76c
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
0ac23e
index ef52cf3..191aebe 100644
f4c76c
--- a/util/grub.d/10_linux.in
f4c76c
+++ b/util/grub.d/10_linux.in
b9efc5
@@ -77,8 +77,18 @@ linux_entry ()
f4c76c
   args="$4"
f4c76c
 
f4c76c
   sixteenbit=""
f4c76c
+  linuxefi="linux"
f4c76c
+  initrdefi="initrd"
f4c76c
   case "$machine" in
f4c76c
-    i?86|x86_64) sixteenbit="16" ;;
f4c76c
+    i?86|x86_64)
f4c76c
+	sixteenbit="16"
f4c76c
+	linuxefi="linuxefi"
f4c76c
+	initrdefi="initrdefi"
f4c76c
+	;;
f4c76c
+    aarch64)
f4c76c
+	linuxefi="linux"
f4c76c
+	initrdefi="initrd"
f4c76c
+	;;
f4c76c
   esac
f4c76c
 
f4c76c
   if [ -z "$boot_device_id" ]; then
b9efc5
@@ -135,7 +145,7 @@ linux_entry ()
f4c76c
   fi
f4c76c
   if [ -d /sys/firmware/efi ]; then
f4c76c
     sed "s/^/$submenu_indentation/" << EOF
f4c76c
-	linuxefi ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
f4c76c
+	${linuxefi} ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
f4c76c
 EOF
f4c76c
   else
f4c76c
     sed "s/^/$submenu_indentation/" << EOF
b9efc5
@@ -145,7 +155,7 @@ EOF
f4c76c
   if test -n "${initrd}" ; then
f4c76c
     if [ -d /sys/firmware/efi ]; then
f4c76c
       sed "s/^/$submenu_indentation/" << EOF
f4c76c
-	initrdefi ${rel_dirname}/${initrd}
f4c76c
+	${initrdefi} ${rel_dirname}/${initrd}
f4c76c
 EOF
f4c76c
     else
f4c76c
       sed "s/^/$submenu_indentation/" << EOF
b9efc5
@@ -153,6 +163,13 @@ EOF
f4c76c
 EOF
f4c76c
     fi
f4c76c
   fi
f4c76c
+  if test -n "${fdt}" ; then
f4c76c
+    message="$(gettext_printf "Loading fdt ...")"
f4c76c
+    sed "s/^/$submenu_indentation/" << EOF
f4c76c
+	echo	'$(echo "$message" | grub_quote)'
f4c76c
+	devicetree	${rel_dirname}/${fdt}
f4c76c
+EOF
f4c76c
+  fi
f4c76c
   sed "s/^/$submenu_indentation/" << EOF
f4c76c
 }
f4c76c
 EOF
b9efc5
@@ -215,6 +232,14 @@ while [ "x$list" != "x" ] ; do
f4c76c
     fi
f4c76c
   done
f4c76c
 
f4c76c
+  fdt=
f4c76c
+  for i in "dtb-${version}" "dtb-${alt_version}"; do
f4c76c
+    if test -e "${dirname}/${i}/foundation-v8.dtb" ; then
f4c76c
+      fdt="${i}/foundation-v8.dtb"
f4c76c
+      break
f4c76c
+    fi
f4c76c
+  done
f4c76c
+
f4c76c
   config=
f4c76c
   for i in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do
f4c76c
     if test -e "${i}" ; then
f4c76c
-- 
7ec92f
2.9.3
f4c76c