All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 2/2] Add option to copy config file to rootfs
@ 2014-07-31 13:46 Nathaniel Roach
  2014-07-31 15:05 ` Thomas De Schampheleire
  0 siblings, 1 reply; 2+ messages in thread
From: Nathaniel Roach @ 2014-07-31 13:46 UTC (permalink / raw)
  To: buildroot

BR2_CONFIG_COPY copies the config file to /etc/buildroot.config
as 0600 during target-finalize after overlay copy, but before
post-build script install.

Signed-off-by: Nathaniel Roach <nroach44@gmail.com>
---
 Makefile         |  4 ++++
 system/Config.in | 11 +++++++++++
 2 files changed, 15 insertions(+)

diff --git a/Makefile b/Makefile
index 022beea..cc49291 100644
--- a/Makefile
+++ b/Makefile
@@ -614,6 +614,10 @@ endif
 			--chmod=Du+w --exclude .empty --exclude '*~' \
 			$(d)/ $(TARGET_DIR)$(sep))
 
+ifeq ($(BR2_CONFIG_COPY),y)
+	$(INSTALL) -m 0600 .config $(TARGET_DIR)/etc/buildroot.config
+endif
+
 	@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
 		$(call MESSAGE,"Executing post-build script $(s)"); \
 		$(EXTRA_ENV) $(s) $(TARGET_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep))
diff --git a/system/Config.in b/system/Config.in
index e7e146a..94fb744 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -328,6 +328,17 @@ config BR2_ROOTFS_USERS_TABLES
 
 	  See manual for details on the usage and syntax of these files.
 
+config BR2_CONFIG_COPY
+	bool "Copy buildroot .config file to rootfs"
+	help
+	  Copies the .config file used to build the rootfs into the
+	  rootfs. This may be useful for debugging.
+
+	  It will be put in /etc/buildroot.config with a mode of 0600
+
+	  However, be wary that it will contain the root password
+	  (if set) and other possibly sensitive data.
+
 config BR2_ROOTFS_OVERLAY
 	string "Root filesystem overlay directories"
 	default ""
-- 
2.0.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [PATCH 2/2] Add option to copy config file to rootfs
  2014-07-31 13:46 [Buildroot] [PATCH 2/2] Add option to copy config file to rootfs Nathaniel Roach
@ 2014-07-31 15:05 ` Thomas De Schampheleire
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas De Schampheleire @ 2014-07-31 15:05 UTC (permalink / raw)
  To: buildroot

Hi Nathaniel,

On Thu, Jul 31, 2014 at 3:46 PM, Nathaniel Roach <nroach44@gmail.com> wrote:
> BR2_CONFIG_COPY copies the config file to /etc/buildroot.config
> as 0600 during target-finalize after overlay copy, but before
> post-build script install.
>
> Signed-off-by: Nathaniel Roach <nroach44@gmail.com>

Your subject says 2/2 but I only see 1 patch?

> ---
>  Makefile         |  4 ++++
>  system/Config.in | 11 +++++++++++
>  2 files changed, 15 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index 022beea..cc49291 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -614,6 +614,10 @@ endif
>                         --chmod=Du+w --exclude .empty --exclude '*~' \
>                         $(d)/ $(TARGET_DIR)$(sep))
>
> +ifeq ($(BR2_CONFIG_COPY),y)
> +       $(INSTALL) -m 0600 .config $(TARGET_DIR)/etc/buildroot.config
> +endif
> +
>         @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
>                 $(call MESSAGE,"Executing post-build script $(s)"); \
>                 $(EXTRA_ENV) $(s) $(TARGET_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep))
> diff --git a/system/Config.in b/system/Config.in
> index e7e146a..94fb744 100644
> --- a/system/Config.in
> +++ b/system/Config.in
> @@ -328,6 +328,17 @@ config BR2_ROOTFS_USERS_TABLES
>
>           See manual for details on the usage and syntax of these files.
>
> +config BR2_CONFIG_COPY
> +       bool "Copy buildroot .config file to rootfs"
> +       help
> +         Copies the .config file used to build the rootfs into the

'to build the rootfs' is not fully accurate as it was also used to
build the kernel, bootloader and what not.
So maybe 'to build the system' or simply 'Copies the buildroot .config
file into ...'

> +         rootfs. This may be useful for debugging.
> +
> +         It will be put in /etc/buildroot.config with a mode of 0600
> +
> +         However, be wary that it will contain the root password
> +         (if set) and other possibly sensitive data.
> +
>  config BR2_ROOTFS_OVERLAY
>         string "Root filesystem overlay directories"
>         default ""


Best regards,
Thomas

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-31 15:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-31 13:46 [Buildroot] [PATCH 2/2] Add option to copy config file to rootfs Nathaniel Roach
2014-07-31 15:05 ` Thomas De Schampheleire

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.