nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone
8e15ce
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
8e15ce
From: Peter Jones <pjones@redhat.com>
8e15ce
Date: Tue, 14 Jan 2014 13:12:23 -0500
8e15ce
Subject: [PATCH] Add devicetree loading
8e15ce
8e15ce
Signed-off-by: Peter Jones <pjones@redhat.com>
8e15ce
8e15ce
Switch to use APM Mustang device tree, for hardware testing.
8e15ce
8e15ce
Signed-off-by: David A. Marlin <d.marlin@redhat.com>
8e15ce
8e15ce
Use the default device tree from the grub default file
8e15ce
8e15ce
instead of hardcoding a value.
8e15ce
8e15ce
Signed-off-by: David A. Marlin <dmarlin@redhat.com>
8e15ce
---
8e15ce
 util/grub-mkconfig.in   |  3 ++-
8e15ce
 util/grub.d/10_linux.in | 15 +++++++++++++++
8e15ce
 2 files changed, 17 insertions(+), 1 deletion(-)
8e15ce
8e15ce
diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
8e15ce
index d3e879b8e5c..8ea2315ebc2 100644
8e15ce
--- a/util/grub-mkconfig.in
8e15ce
+++ b/util/grub-mkconfig.in
8e15ce
@@ -248,7 +248,8 @@ export GRUB_DEFAULT \
8e15ce
   GRUB_ENABLE_CRYPTODISK \
8e15ce
   GRUB_BADRAM \
8e15ce
   GRUB_OS_PROBER_SKIP_LIST \
8e15ce
-  GRUB_DISABLE_SUBMENU
8e15ce
+  GRUB_DISABLE_SUBMENU \
8e15ce
+  GRUB_DEFAULT_DTB
8e15ce
 
8e15ce
 if test "x${grub_cfg}" != "x"; then
8e15ce
   rm -f "${grub_cfg}.new"
8e15ce
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
8e15ce
index e8b01c0d0c7..dc75a1c30bf 100644
8e15ce
--- a/util/grub.d/10_linux.in
8e15ce
+++ b/util/grub.d/10_linux.in
8e15ce
@@ -153,6 +153,13 @@ EOF
8e15ce
     sed "s/^/$submenu_indentation/" << EOF
8e15ce
 	echo	'$(echo "$message" | grub_quote)'
8e15ce
 	initrd	$(echo $initrd_path)
8e15ce
+EOF
8e15ce
+  fi
8e15ce
+  if test -n "${fdt}" ; then
8e15ce
+    message="$(gettext_printf "Loading fdt ...")"
8e15ce
+    sed "s/^/$submenu_indentation/" << EOF
8e15ce
+	echo	'$(echo "$message" | grub_quote)'
8e15ce
+	devicetree	${rel_dirname}/${fdt}
8e15ce
 EOF
8e15ce
   fi
8e15ce
   sed "s/^/$submenu_indentation/" << EOF
8e15ce
@@ -236,6 +243,14 @@ while [ "x$list" != "x" ] ; do
8e15ce
     gettext_printf "Found initrd image: %s\n" "$(echo $initrd_display)" >&2
8e15ce
   fi
8e15ce
 
8e15ce
+  fdt=
8e15ce
+  for i in "dtb-${version}" "dtb-${alt_version}"; do
8e15ce
+    if test -f "${dirname}/${i}/${GRUB_DEFAULT_DTB}" ; then
8e15ce
+      fdt="${i}/${GRUB_DEFAULT_DTB}"
8e15ce
+      break
8e15ce
+    fi
8e15ce
+  done
8e15ce
+
8e15ce
   config=
8e15ce
   for i in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do
8e15ce
     if test -e "${i}" ; then