aboutsummaryrefslogtreecommitdiffstats
path: root/sys-boot/grub/files/grub-2.06-011-support-loading-device-trees.patch
diff options
context:
space:
mode:
authorPA4WDH2021-08-25 12:02:32 +0200
committerPA4WDH2021-08-25 12:02:32 +0200
commit38be1b3221b1e85cac1af8a67c733752265425d7 (patch)
tree62805f905167039e00378ede54f5dd41203bc577 /sys-boot/grub/files/grub-2.06-011-support-loading-device-trees.patch
parentAdd patch to sys-boot/u-boot-2021.07 to make it work (diff)
downloadunmatched-patchwork-38be1b3221b1e85cac1af8a67c733752265425d7.tar.gz
unmatched-patchwork-38be1b3221b1e85cac1af8a67c733752265425d7.tar.bz2
unmatched-patchwork-38be1b3221b1e85cac1af8a67c733752265425d7.zip
Add sys-boot/grub-2.06-r1
Diffstat (limited to 'sys-boot/grub/files/grub-2.06-011-support-loading-device-trees.patch')
-rw-r--r--sys-boot/grub/files/grub-2.06-011-support-loading-device-trees.patch73
1 files changed, 73 insertions, 0 deletions
diff --git a/sys-boot/grub/files/grub-2.06-011-support-loading-device-trees.patch b/sys-boot/grub/files/grub-2.06-011-support-loading-device-trees.patch
new file mode 100644
index 0000000..f892376
--- /dev/null
+++ b/sys-boot/grub/files/grub-2.06-011-support-loading-device-trees.patch
@@ -0,0 +1,73 @@
+diff --git a/docs/grub.texi b/docs/grub.texi
+index eeac9b2ce..64cf95e6f 100644
+--- a/docs/grub.texi
++++ b/docs/grub.texi
+@@ -1560,6 +1560,12 @@ This option may be set to a list of GRUB module names separated by spaces.
+ Each module will be loaded as early as possible, at the start of
+ @file{grub.cfg}.
+
++@item GRUB_LOAD_DEVICE_TREE
++If this option is set to @samp{true}, a devicetree command will be added
++to the Linux menu entries in @file{grub.cfg}. Device-trees require fix-ups
++by the firmware. You should use this option only if your firmware supports
++the EFI Device Tree Fixup Protocol.
++
+ @end table
+
+ The following options are still accepted for compatibility with existing
+diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
+index d3e879b8e..3d7fd54f3 100644
+--- a/util/grub-mkconfig.in
++++ b/util/grub-mkconfig.in
+@@ -230,6 +230,7 @@ export GRUB_DEFAULT \
+ GRUB_CMDLINE_GNUMACH \
+ GRUB_EARLY_INITRD_LINUX_CUSTOM \
+ GRUB_EARLY_INITRD_LINUX_STOCK \
++ GRUB_LOAD_DEVICETREE \
+ GRUB_TERMINAL_INPUT \
+ GRUB_TERMINAL_OUTPUT \
+ GRUB_SERIAL_COMMAND \
+diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
+index e8b01c0d0..15bc26ba8 100644
+--- a/util/grub.d/10_linux.in
++++ b/util/grub.d/10_linux.in
+@@ -143,6 +143,15 @@ linux_entry ()
+ echo '$(echo "$message" | grub_quote)'
+ linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
+ EOF
++ if [ "x${GRUB_LOAD_DEVICETREE}" = "xtrue" ]; then
++ if test -n "${dtb}" ; then
++ message="$(gettext_printf "Loading device tree ...")"
++ sed "s/^/$submenu_indentation/" << EOF
++ echo '$(echo "$message" | grub_quote)'
++ devicetree ${rel_dirname}/${dtb}
++EOF
++ fi
++ fi
+ if test -n "${initrd}" ; then
+ # TRANSLATORS: ramdisk isn't identifier. Should be translated.
+ message="$(gettext_printf "Loading initial ramdisk ...")"
+@@ -244,6 +253,20 @@ while [ "x$list" != "x" ] ; do
+ fi
+ done
+
++ if [ "x${GRUB_LOAD_DEVICETREE}" = "xtrue" ]; then
++ dtb=
++ for i in "dtb-${version}" "dtb" ; do
++ if test -e "${dirname}/${i}" ; then
++ dtb="${i}"
++ break
++ fi
++ done
++
++ if test -n "${dtb}" ; then
++ gettext_printf "Found dtb: %s\n" "${dirname}/${dtb}" >&2
++ fi
++ fi
++
+ initramfs=
+ if test -n "${config}" ; then
+ initramfs=`grep CONFIG_INITRAMFS_SOURCE= "${config}" | cut -f2 -d= | tr
+-d \"`
+--
+2.30.0