Received: from list by lists.gnu.org with archive (Exim 4.71) id 1hTvJ7-0006xM-1w for mharc-grub-devel@gnu.org; Thu, 23 May 2019 17:31:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTvJ4-0006v3-M0 for grub-devel@gnu.org; Thu, 23 May 2019 17:31:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTvJ2-0006Bf-Md for grub-devel@gnu.org; Thu, 23 May 2019 17:31:22 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:37786) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTvIz-00066Y-WD for grub-devel@gnu.org; Thu, 23 May 2019 17:31:19 -0400 Received: by mail-wr1-x42f.google.com with SMTP id e15so7815569wrs.4 for ; Thu, 23 May 2019 14:31:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=surgut.co.uk; s=google; h=sender:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=Csj4GjnptqjnFJS/awEmzi7GZcfTOHtqcvP1HmYqFOo=; b=ZGlH52qPVQTO/WMAkAPdouQZb3vTirhmoYuOhHKcowYrSODuZ6EKFVYmnYNw3MLY6l PYSU60XwIt/m+r3SZRYsS9N3Igh8Dte49osDbdGMmBgrCrG25hpLbaEcZ9Kis8XEdEfe yeRR6/TJ4NDslmnX7XyKHZ1Ys07jmeHt+ICZk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :mime-version:content-transfer-encoding; bh=Csj4GjnptqjnFJS/awEmzi7GZcfTOHtqcvP1HmYqFOo=; b=f7uMiuJosLP1+G/5tRTMRr7ZuPpTuTfdJA0dY1VIJ8APMbYLGPXwLBJjd1JzeQLh1L 74A7ZIXE8NjdR0kIJvdyT1Zm1jG3Y3hCRnJN2s74IW4QKVu5VE59Hn+BeMxMGTTO9iQ8 d/he4Pd0eDwGXwnwsE4q+m9UDjNlnaoRB+3NViwMxeU79a6vevcjl5NEAsinjrdrHyEh keXicmfgbR7wIStsP9YaCU3H6IH9T1wH5JE1uXHAQtlzDuT5oaCjpJmllYeh8E3UaDPs 79DyIhZqtWOMIyOiOsFHAGShaPr+4WT8lA74KqUQOj0kjqLNl1fY0lMk0b7Mha+FJzCg Zj5g== X-Gm-Message-State: APjAAAWtSYC88ZQt6UcmFJbfZV5sXOJoWVxcrwhjIS8TDw4VYJq2Xcpw IOKtA+uPqJqRdF/j6b4S9+S51CYWGhQ= X-Google-Smtp-Source: APXvYqyNBqfHBcxe9xDkG8aBNOLIAT48wmJdOMBsm+wezT3aej+krWjCrNuvZJfSUhXOmsBu0wKTag== X-Received: by 2002:adf:c807:: with SMTP id d7mr33376802wrh.112.1558647074452; Thu, 23 May 2019 14:31:14 -0700 (PDT) Received: from localhost (9.a.8.f.7.f.e.f.f.f.2.3.f.4.a.1.1.4.e.1.c.6.e.d.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:de6c:1e41:1a4f:32ff:fef7:f8a9]) by smtp.gmail.com with ESMTPSA id t13sm812801wra.81.2019.05.23.14.31.13 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 14:31:13 -0700 (PDT) Sender: Dimitri John Ledkov From: Dimitri John Ledkov To: grub-devel@gnu.org Subject: [PATCH] 10_linux: Add devicetree command, if a dtb is present. Date: Thu, 23 May 2019 22:31:13 +0100 Message-Id: <20190523213113.1457-1-xnox@ubuntu.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42f X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 21:31:23 -0000 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 --- 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