summaryrefslogtreecommitdiff
path: root/libre/grub/1000-am335x_bone--10_linux-20_linux_xen-detect-devicetree-file.patch
diff options
context:
space:
mode:
Diffstat (limited to 'libre/grub/1000-am335x_bone--10_linux-20_linux_xen-detect-devicetree-file.patch')
-rw-r--r--libre/grub/1000-am335x_bone--10_linux-20_linux_xen-detect-devicetree-file.patch90
1 files changed, 90 insertions, 0 deletions
diff --git a/libre/grub/1000-am335x_bone--10_linux-20_linux_xen-detect-devicetree-file.patch b/libre/grub/1000-am335x_bone--10_linux-20_linux_xen-detect-devicetree-file.patch
new file mode 100644
index 000000000..eac637d5b
--- /dev/null
+++ b/libre/grub/1000-am335x_bone--10_linux-20_linux_xen-detect-devicetree-file.patch
@@ -0,0 +1,90 @@
+--- a/util/grub.d/10_linux.in 2021-06-17 03:06:45.912081000 -0500
++++ b/util/grub.d/10_linux.in 2021-06-18 02:16:38.219592837 -0500
+@@ -155,6 +155,25 @@
+ initrd $(echo $initrd_path)
+ EOF
+ fi
++ if [ "$(cat /sys/devices/platform/bone_capemgr/baseboard/board-name)" = 'A335BONE' ]; then
++ if test -f "${rel_dirname}/dtbs/${version}/am335x-bone.dtb" ; then
++ # TRANSLATORS: Device tree path isn't identifier. Should be translated.
++ message="$(gettext_printf "Loading devices tree file ...")"
++ sed "s/^/$submenu_indentation/" << EOF
++ echo '$(echo "$message" | grub_quote)'
++ devicetree ${rel_dirname}/dtbs/${version}/am335x-bone.dtb
++EOF
++ fi
++ elif [ "$(cat /sys/devices/platform/bone_capemgr/baseboard/board-name)" = 'A335BNLT' ]; then
++ if test -f "${rel_dirname}/dtbs/${version}/am335x-boneblack.dtb" ; then
++ # TRANSLATORS: Device tree path isn't identifier. Should be translated.
++ message="$(gettext_printf "Loading devices tree file ...")"
++ sed "s/^/$submenu_indentation/" << EOF
++ echo '$(echo "$message" | grub_quote)'
++ devicetree ${rel_dirname}/dtbs/${version}/am335x-boneblack.dtb
++EOF
++ fi
++ fi
+ sed "s/^/$submenu_indentation/" << EOF
+ }
+ EOF
+@@ -261,6 +280,16 @@
+ fi
+ fi
+
++ if [ "$(cat /sys/devices/platform/bone_capemgr/baseboard/board-name)" = 'A335BONE' ]; then
++ if test -f "${dirname}/dtbs/${version}/am335x-bone.dtb" ; then
++ gettext_printf "Found device tree file: %s\n" "${dirname}/dtbs/${version}/am335x-bone.dtb" >&2
++ fi
++ elif [ "$(cat /sys/devices/platform/bone_capemgr/baseboard/board-name)" = 'A335BNLT' ]; then
++ if test -f "${dirname}/dtbs/${version}/am335x-boneblack.dtb" ; then
++ gettext_printf "Found device tree file: %s\n" "${dirname}/dtbs/${version}/am335x-boneblack.dtb" >&2
++ fi
++ fi
++
+ # The GRUB_DISABLE_SUBMENU option used to be different than others since it was
+ # mentioned in the documentation that has to be set to 'y' instead of 'true' to
+ # enable it. This caused a lot of confusion to users that set the option to 'y',
+--- a/util/grub.d/20_linux_xen.in 2021-06-17 03:06:56.202081000 -0500
++++ b/util/grub.d/20_linux_xen.in 2021-06-18 02:23:54.679591971 -0500
+@@ -172,6 +172,25 @@
+ ${module_loader} ${rel_dirname}/${xenpolicy}
+ EOF
+ fi
++ if [ "$(cat /sys/devices/platform/bone_capemgr/baseboard/board-name)" = 'A335BONE' ]; then
++ if test -f "${rel_dirname}/dtbs/${version}/am335x-bone.dtb" ; then
++ # TRANSLATORS: Device tree path isn't identifier. Should be translated.
++ message="$(gettext_printf "Loading devices tree file ...")"
++ sed "s/^/$submenu_indentation/" << EOF
++ echo '$(echo "$message" | grub_quote)'
++ devicetree ${rel_dirname}/dtbs/${version}/am335x-bone.dtb
++EOF
++ fi
++ elif [ "$(cat /sys/devices/platform/bone_capemgr/baseboard/board-name)" = 'A335BNLT' ]; then
++ if test -f "${rel_dirname}/dtbs/${version}/am335x-boneblack.dtb" ; then
++ # TRANSLATORS: Device tree path isn't identifier. Should be translated.
++ message="$(gettext_printf "Loading devices tree file ...")"
++ sed "s/^/$submenu_indentation/" << EOF
++ echo '$(echo "$message" | grub_quote)'
++ devicetree ${rel_dirname}/dtbs/${version}/am335x-boneblack.dtb
++EOF
++ fi
++ fi
+ sed "s/^/$submenu_indentation/" << EOF
+ }
+ EOF
+@@ -316,6 +335,16 @@
+ fi
+ fi
+
++ if [ "$(cat /sys/devices/platform/bone_capemgr/baseboard/board-name)" = 'A335BONE' ]; then
++ if test -f "${dirname}/dtbs/${version}/am335x-bone.dtb" ; then
++ gettext_printf "Found device tree file: %s\n" "${dirname}/dtbs/${version}/am335x-bone.dtb" >&2
++ fi
++ elif [ "$(cat /sys/devices/platform/bone_capemgr/baseboard/board-name)" = 'A335BNLT' ]; then
++ if test -f "${dirname}/dtbs/${version}/am335x-boneblack.dtb" ; then
++ gettext_printf "Found device tree file: %s\n" "${dirname}/dtbs/${version}/am335x-boneblack.dtb" >&2
++ fi
++ fi
++
+ # The GRUB_DISABLE_SUBMENU option used to be different than others since it was
+ # mentioned in the documentation that has to be set to 'y' instead of 'true' to
+ # enable it. This caused a lot of confusion to users that set the option to 'y',