dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

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