nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

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

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