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