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

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