Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Erico Nunes <nunes.erico@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 5/5] grub2: introduce BR2_TARGET_GRUB2_CFG
Date: Tue, 13 Sep 2016 06:15:48 +0200	[thread overview]
Message-ID: <20160913041548.10290-6-nunes.erico@gmail.com> (raw)
In-Reply-To: <20160913041548.10290-1-nunes.erico@gmail.com>

This configuration can be used to provide a custom Grub 2 configuration
file containing menu entries. In the previous implementation, this had
to be always done by an external script, overwriting the defualt image.
This should be backwards compatible as the default value is the previous
hardcoded value.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
---
 boot/grub2/Config.in | 7 +++++++
 boot/grub2/grub2.mk  | 5 +++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/boot/grub2/Config.in b/boot/grub2/Config.in
index 527ff37..94862a6 100644
--- a/boot/grub2/Config.in
+++ b/boot/grub2/Config.in
@@ -196,4 +196,11 @@ config BR2_TARGET_GRUB2_BUILTIN_CONFIG
 	  device and other configuration parameters, but however menu
 	  entries cannot be described in this embedded configuration.
 
+config BR2_TARGET_GRUB2_CFG
+	string "grub2 menu entries config"
+	default "boot/grub2/grub.cfg"
+	help
+	  Path to a Grub 2 configuration file containing the grub2 menu
+	  entries.
+
 endif # BR2_TARGET_GRUB2
diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
index 910967e..7a64b60 100644
--- a/boot/grub2/grub2.mk
+++ b/boot/grub2/grub2.mk
@@ -110,8 +110,9 @@ define GRUB2_INSTALL_IMAGES_CMDS
 		-p "$(GRUB2_PREFIX)" \
 		$(if $(GRUB2_BUILTIN_CONFIG),-c $(GRUB2_BUILTIN_CONFIG)) \
 		$(GRUB2_BUILTIN_MODULES)
-	mkdir -p $(dir $(GRUB2_CFG))
-	$(INSTALL) -D -m 0644 boot/grub2/grub.cfg $(GRUB2_CFG)
+	$(if $(BR2_TARGET_GRUB2_CFG), \
+		mkdir -p $(dir $(GRUB2_CFG)) && \
+		$(INSTALL) -D -m 0644 $(BR2_TARGET_GRUB2_CFG) $(GRUB2_CFG))
 	$(GRUB2_IMAGE_INSTALL_ELTORITO)
 endef
 
-- 
2.9.3

  parent reply	other threads:[~2016-09-13  4:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-13  4:15 [Buildroot] [PATCH 0/5] grub2: add support for arm and aarch64 Erico Nunes
2016-09-13  4:15 ` [Buildroot] [PATCH 1/5] grub2: bump up version Erico Nunes
2016-09-14  0:25   ` Arnout Vandecappelle
2016-09-15 21:29     ` Erico Nunes
2016-09-15 21:50       ` Yann E. MORIN
2016-09-13  4:15 ` [Buildroot] [PATCH 2/5] grub2-tools: new package Erico Nunes
2016-09-13  4:15 ` [Buildroot] [PATCH 3/5] grub2: use grub2-tools as a host package Erico Nunes
2016-09-13  4:15 ` [Buildroot] [PATCH 4/5] grub2: enable support for arm and aarch64 targets Erico Nunes
2016-09-14  0:39   ` Arnout Vandecappelle
2016-09-15 21:43     ` Erico Nunes
2016-09-17 14:24     ` Thomas Petazzoni
2016-09-13  4:15 ` Erico Nunes [this message]
2016-09-14  0:15 ` [Buildroot] [PATCH 0/5] grub2: add support for arm and aarch64 Arnout Vandecappelle
2016-09-15 21:48   ` Erico Nunes
2016-09-17 14:27 ` Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160913041548.10290-6-nunes.erico@gmail.com \
    --to=nunes.erico@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox