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