* [Buildroot] [PATCH] grub2: add configuration options for grub config files
@ 2014-04-04 8:32 Dima Zavin
2014-04-11 4:12 ` Dima Zavin
2014-04-20 15:51 ` Thomas Petazzoni
0 siblings, 2 replies; 4+ messages in thread
From: Dima Zavin @ 2014-04-04 8:32 UTC (permalink / raw)
To: buildroot
Add an option for embedding a config file directly in grub as
well as an option to provide a custom grub.cfg file through
a defconfig.
Signed-off-by: Dima Zavin <dmitriyz@google.com>
---
boot/grub2/Config.in | 12 ++++++++++++
boot/grub2/grub2.mk | 8 +++++++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/boot/grub2/Config.in b/boot/grub2/Config.in
index e59626a..4adc9db 100644
--- a/boot/grub2/Config.in
+++ b/boot/grub2/Config.in
@@ -117,4 +117,16 @@ config BR2_TARGET_GRUB2_BUILTIN_MODULES
default "boot linux ext2 fat part_msdos part_gpt normal efi_gop" \
if BR2_TARGET_GRUB2_I386_EFI || BR2_TARGET_GRUB2_X86_64_EFI
+config BR2_TARGET_GRUB2_CONFIG
+ string "config file"
+ help
+ This config file will be installed into the target boot filesystem.
+
+config BR2_TARGET_GRUB2_BUILTIN_CONFIG
+ string "bultin config"
+ help
+ This config file will be embedded into the grub image itself. This
+ allows one to seet the root device, etc.
+ Note that one cannot have menu entries in the embedded config.
+
endif # BR2_TARGET_GRUB2
diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
index 72fc7f4..67b5eaa 100644
--- a/boot/grub2/grub2.mk
+++ b/boot/grub2/grub2.mk
@@ -36,6 +36,11 @@ GRUB2_PLATFORM = efi
endif
GRUB2_BUILTIN_MODULES = $(call qstrip,$(BR2_TARGET_GRUB2_BUILTIN_MODULES))
+GRUB2_BUILTIN_CONFIG = $(call qstrip,$(BR2_TARGET_GRUB2_BUILTIN_CONFIG))
+
+GRUB2_CFG_SRC = $(if $(call qstrip,$(BR2_TARGET_GRUB2_CONFIG)),\
+ $(call qstrip,$(BR2_TARGET_GRUB2_CONFIG)),\
+ boot/grub2/grub.cfg)
# Grub2 is kind of special: it considers CC, LD and so on to be the
# tools to build the native tools (i.e to be executed on the build
@@ -73,9 +78,10 @@ define GRUB2_IMAGE_INSTALLATION
-O $(GRUB2_TUPLE) \
-o $(GRUB2_IMAGE) \
$(if $(GRUB2_PREFIX),-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)
+ $(INSTALL) -D -m 0644 $(GRUB2_CFG_SRC) $(GRUB2_CFG)
endef
GRUB2_POST_INSTALL_TARGET_HOOKS += GRUB2_IMAGE_INSTALLATION
--
1.9.1.423.g4596e3a
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] grub2: add configuration options for grub config files
2014-04-04 8:32 [Buildroot] [PATCH] grub2: add configuration options for grub config files Dima Zavin
@ 2014-04-11 4:12 ` Dima Zavin
2014-04-20 15:51 ` Thomas Petazzoni
1 sibling, 0 replies; 4+ messages in thread
From: Dima Zavin @ 2014-04-11 4:12 UTC (permalink / raw)
To: buildroot
Thomas,
Did you get a chance to peek at this proposed patch?
--Dima
On Fri, Apr 4, 2014 at 1:32 AM, Dima Zavin <dmitriyz@google.com> wrote:
> Add an option for embedding a config file directly in grub as
> well as an option to provide a custom grub.cfg file through
> a defconfig.
>
> Signed-off-by: Dima Zavin <dmitriyz@google.com>
> ---
> boot/grub2/Config.in | 12 ++++++++++++
> boot/grub2/grub2.mk | 8 +++++++-
> 2 files changed, 19 insertions(+), 1 deletion(-)
>
> diff --git a/boot/grub2/Config.in b/boot/grub2/Config.in
> index e59626a..4adc9db 100644
> --- a/boot/grub2/Config.in
> +++ b/boot/grub2/Config.in
> @@ -117,4 +117,16 @@ config BR2_TARGET_GRUB2_BUILTIN_MODULES
> default "boot linux ext2 fat part_msdos part_gpt normal efi_gop" \
> if BR2_TARGET_GRUB2_I386_EFI || BR2_TARGET_GRUB2_X86_64_EFI
>
> +config BR2_TARGET_GRUB2_CONFIG
> + string "config file"
> + help
> + This config file will be installed into the target boot filesystem.
> +
> +config BR2_TARGET_GRUB2_BUILTIN_CONFIG
> + string "bultin config"
> + help
> + This config file will be embedded into the grub image itself. This
> + allows one to seet the root device, etc.
> + Note that one cannot have menu entries in the embedded config.
> +
> endif # BR2_TARGET_GRUB2
> diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
> index 72fc7f4..67b5eaa 100644
> --- a/boot/grub2/grub2.mk
> +++ b/boot/grub2/grub2.mk
> @@ -36,6 +36,11 @@ GRUB2_PLATFORM = efi
> endif
>
> GRUB2_BUILTIN_MODULES = $(call qstrip,$(BR2_TARGET_GRUB2_BUILTIN_MODULES))
> +GRUB2_BUILTIN_CONFIG = $(call qstrip,$(BR2_TARGET_GRUB2_BUILTIN_CONFIG))
> +
> +GRUB2_CFG_SRC = $(if $(call qstrip,$(BR2_TARGET_GRUB2_CONFIG)),\
> + $(call qstrip,$(BR2_TARGET_GRUB2_CONFIG)),\
> + boot/grub2/grub.cfg)
>
> # Grub2 is kind of special: it considers CC, LD and so on to be the
> # tools to build the native tools (i.e to be executed on the build
> @@ -73,9 +78,10 @@ define GRUB2_IMAGE_INSTALLATION
> -O $(GRUB2_TUPLE) \
> -o $(GRUB2_IMAGE) \
> $(if $(GRUB2_PREFIX),-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)
> + $(INSTALL) -D -m 0644 $(GRUB2_CFG_SRC) $(GRUB2_CFG)
> endef
> GRUB2_POST_INSTALL_TARGET_HOOKS += GRUB2_IMAGE_INSTALLATION
>
> --
> 1.9.1.423.g4596e3a
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] grub2: add configuration options for grub config files
2014-04-04 8:32 [Buildroot] [PATCH] grub2: add configuration options for grub config files Dima Zavin
2014-04-11 4:12 ` Dima Zavin
@ 2014-04-20 15:51 ` Thomas Petazzoni
2014-04-20 16:05 ` Dima Zavin
1 sibling, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2014-04-20 15:51 UTC (permalink / raw)
To: buildroot
Dear Dima Zavin,
On Fri, 4 Apr 2014 01:32:17 -0700, Dima Zavin wrote:
> Add an option for embedding a config file directly in grub as
> well as an option to provide a custom grub.cfg file through
> a defconfig.
>
> Signed-off-by: Dima Zavin <dmitriyz@google.com>
> ---
> boot/grub2/Config.in | 12 ++++++++++++
> boot/grub2/grub2.mk | 8 +++++++-
> 2 files changed, 19 insertions(+), 1 deletion(-)
I've applied your patch, but:
* I've removed the BR2_TARGET_GRUB2_CONFIG option, because the same
thing can be achieved using a post-build script or a rootfs overlay.
We don't have options in each and every package that can use a
custom configuration, so I don't really see a reason to have this
for Grub2 specifically.
* I've reworded the Config.in help for the built-in configuration file
option.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] grub2: add configuration options for grub config files
2014-04-20 15:51 ` Thomas Petazzoni
@ 2014-04-20 16:05 ` Dima Zavin
0 siblings, 0 replies; 4+ messages in thread
From: Dima Zavin @ 2014-04-20 16:05 UTC (permalink / raw)
To: buildroot
Sounds great, thanks!
--Dima
On Apr 20, 2014 8:52 AM, "Thomas Petazzoni" <
thomas.petazzoni@free-electrons.com> wrote:
> Dear Dima Zavin,
>
> On Fri, 4 Apr 2014 01:32:17 -0700, Dima Zavin wrote:
> > Add an option for embedding a config file directly in grub as
> > well as an option to provide a custom grub.cfg file through
> > a defconfig.
> >
> > Signed-off-by: Dima Zavin <dmitriyz@google.com>
> > ---
> > boot/grub2/Config.in | 12 ++++++++++++
> > boot/grub2/grub2.mk | 8 +++++++-
> > 2 files changed, 19 insertions(+), 1 deletion(-)
>
> I've applied your patch, but:
>
> * I've removed the BR2_TARGET_GRUB2_CONFIG option, because the same
> thing can be achieved using a post-build script or a rootfs overlay.
> We don't have options in each and every package that can use a
> custom configuration, so I don't really see a reason to have this
> for Grub2 specifically.
>
> * I've reworded the Config.in help for the built-in configuration file
> option.
>
> Thanks!
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20140420/5b3510c8/attachment.html>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-04-20 16:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-04 8:32 [Buildroot] [PATCH] grub2: add configuration options for grub config files Dima Zavin
2014-04-11 4:12 ` Dima Zavin
2014-04-20 15:51 ` Thomas Petazzoni
2014-04-20 16:05 ` Dima Zavin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.