grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] 10_linux: Add devicetree command, if a dtb is present.


From: Dimitri John Ledkov
Subject: [PATCH] 10_linux: Add devicetree command, if a dtb is present.
Date: Thu, 23 May 2019 22:31:13 +0100

Specifically support dtb paths as created by flash-kernel package on
Debian/Ubuntu systems, and a generic one. Possibly this needs to be
extended to support other devicetree blob paths as installed on other
distributions (similar to how multiple initrd paths are
supported).

This is particularly useful during new platforms bring up, which may
not yet be fully supported by Linux kernel. Currently I have tested
this patch, on top of Debian grub2 packaging/distro-patches to
successfully boot Asus Novago TP3700QL. Similarly other laptops would
find this useful, like Lenovo Mixx 630, Lenovo Yoga C630, and HP Envy
X2.

Signed-off-by: Dimitri John Ledkov <address@hidden>
---
 util/grub.d/10_linux.in | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 4532266be..bb6c8912f 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -153,6 +153,13 @@ EOF
     sed "s/^/$submenu_indentation/" << EOF
        echo    '$(echo "$message" | grub_quote)'
        initrd  $(echo $initrd_path)
+EOF
+  fi
+  if test -n "${dtb}" ; then
+    message="$(gettext_printf "Loading device tree blob...")"
+    sed "s/^/$submenu_indentation/" << EOF
+       echo    '$(echo "$message" | grub_quote)'
+       devicetree  ${rel_dirname}/${dtb}
 EOF
   fi
   sed "s/^/$submenu_indentation/" << EOF
@@ -236,6 +243,14 @@ while [ "x$list" != "x" ] ; do
     gettext_printf "Found initrd image: %s\n" "$(echo $initrd_display)" >&2
   fi
 
+  dtb=
+  for i in "dtb-${version}" "dtb-${alt_version}" "dtb"; do
+    if test -e "${dirname}/${i}" ; then
+      dtb="$i"
+      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
-- 
2.20.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]