* [PR PATCH] grub: support loading devicetrees
@ 2024-05-05 17:00 classabbyamp
2024-05-12 18:27 ` [PR PATCH] [Merged]: " classabbyamp
0 siblings, 1 reply; 2+ messages in thread
From: classabbyamp @ 2024-05-05 17:00 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 479 bytes --]
There is a new pull request by classabbyamp against master on the void-packages repository
https://github.com/classabbyamp/void-packages grub-dtb
https://github.com/void-linux/void-packages/pull/50203
grub: support loading devicetrees
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
A patch file from https://github.com/void-linux/void-packages/pull/50203.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-grub-dtb-50203.patch --]
[-- Type: text/x-diff, Size: 2722 bytes --]
From 5cd329d53db3fb31ed62246c04eeb92c7c514939 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sun, 5 May 2024 10:06:58 -0400
Subject: [PATCH] grub: support loading devicetrees
---
srcpkgs/grub/patches/devicetree-loading.patch | 50 +++++++++++++++++++
srcpkgs/grub/template | 2 +-
2 files changed, 51 insertions(+), 1 deletion(-)
create mode 100644 srcpkgs/grub/patches/devicetree-loading.patch
diff --git a/srcpkgs/grub/patches/devicetree-loading.patch b/srcpkgs/grub/patches/devicetree-loading.patch
new file mode 100644
index 00000000000000..b2284bf0f35937
--- /dev/null
+++ b/srcpkgs/grub/patches/devicetree-loading.patch
@@ -0,0 +1,50 @@
+support loading a devicetree based on GRUB_DEFAULT_DTB in /etc/default/grub
+
+looks in /boot/dtbs/dtbs-${version}/${GRUB_DEFAULT_DTB}
+
+based on https://src.fedoraproject.org/rpms/grub2/blob/rawhide/f/0022-Add-devicetree-loading.patch
+
+--- a/util/grub-mkconfig.in
++++ b/util/grub-mkconfig.in
+@@ -255,7 +255,8 @@
+ GRUB_ENABLE_CRYPTODISK \
+ GRUB_BADRAM \
+ GRUB_OS_PROBER_SKIP_LIST \
+- GRUB_DISABLE_SUBMENU
++ GRUB_DISABLE_SUBMENU \
++ GRUB_DEFAULT_DTB
+
+ if test "x${grub_cfg}" != "x"; then
+ rm -f "${grub_cfg}.new"
+--- a/util/grub.d/10_linux.in
++++ b/util/grub.d/10_linux.in
+@@ -129,6 +129,14 @@
+
+ echo " insmod gzio" | sed "s/^/$submenu_indentation/"
+
++ if test -n "${dtb}" ; then
++ message="$(gettext_printf "Loading devicetree ...")"
++ sed "s/^/$submenu_indentation/" << EOF
++ echo '$(echo "$message" | grub_quote)'
++ devicetree ${rel_dirname}/${dtb}
++EOF
++ fi
++
+ if [ x$dirname = x/ ]; then
+ if [ -z "${prepare_root_cache}" ]; then
+ prepare_root_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE} | grub_add_tab)"
+@@ -250,6 +258,14 @@
+ gettext_printf "Found initrd image: %s\n" "$(echo $initrd_display)" >&2
+ fi
+
++ dtb=
++ for i in "dtbs-${version}" "dtbs-${alt_version}"; do
++ if test -f "${dirname}/dtbs/${i}/${GRUB_DEFAULT_DTB}" ; then
++ dtb="dtbs/${i}/${GRUB_DEFAULT_DTB}"
++ break
++ fi
++ done
++
+ config=
+ for i in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do
+ if test -e "${i}" ; then
diff --git a/srcpkgs/grub/template b/srcpkgs/grub/template
index 6f2dcb03684fdc..5bf8c1d7909f80 100644
--- a/srcpkgs/grub/template
+++ b/srcpkgs/grub/template
@@ -1,7 +1,7 @@
# Template file for 'grub'
pkgname=grub
version=2.12
-revision=1
+revision=2
hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man
automake gettext-devel-tools"
makedepends="libusb-compat-devel ncurses-devel freetype-devel liblzma-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PR PATCH] [Merged]: grub: support loading devicetrees
2024-05-05 17:00 [PR PATCH] grub: support loading devicetrees classabbyamp
@ 2024-05-12 18:27 ` classabbyamp
0 siblings, 0 replies; 2+ messages in thread
From: classabbyamp @ 2024-05-12 18:27 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 304 bytes --]
There's a merged pull request on the void-packages repository
grub: support loading devicetrees
https://github.com/void-linux/void-packages/pull/50203
Description:
useful for #49615 but generally applicable for arm uefi devices
#### Testing the changes
- I tested the changes in this PR: **YES**
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-05-12 18:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-05 17:00 [PR PATCH] grub: support loading devicetrees classabbyamp
2024-05-12 18:27 ` [PR PATCH] [Merged]: " classabbyamp
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).