Skip to contentSkip to conversation

barebox: Allow to build an environment image

PATCH Superseded Maxime Ripard 2 participants 2 messages Jan 22, 2013 – Jan 23, 2013

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 barebox: Allow to build an environment image

---
 boot/barebox/Config.in  |   11 +++++++++++
 boot/barebox/barebox.mk |   14 ++++++++++++++
 2 files changed, 25 insertions(+)
boot/barebox/Config.in +11 -0
index b9e03b3..24fcb38 100644
@@ -99,4 +99,15 @@ config BR2_TARGET_BAREBOX_BAREBOXENV
 	help
 	  Install bareboxenv tool in target.
 
+config BR2_TARGET_BAREBOX_CUSTOM_ENV
+	bool "Generate an environment image"
+	help
+	  Generate a custom environment image.
+
+config BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH
+	string "Environment path"
+	depends on BR2_TARGET_BAREBOX_CUSTOM_ENV
+	help
+	  Path to the custom barebox environment
+
 endif
boot/barebox/barebox.mk +14 -0
index 143338e..5ec47f6 100644
@@ -67,9 +67,22 @@ define BAREBOX_BUILD_BAREBOXENV_CMDS
 endef
 endif
 
+ifeq ($(BR2_TARGET_BAREBOX_CUSTOM_ENV),y)
+BAREBOX_ENV_NAME = $(notdir $(call qstrip, $(BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH)))
+define BAREBOX_BUILD_CUSTOM_ENV
+	$(@D)/scripts/bareboxenv -s \
+		$(call qstrip, $(BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH)) \
+		$(@D)/$(BAREBOX_ENV_NAME)
+endef
+define BAREBOX_INSTALL_CUSTOM_ENV
+	cp $(@D)/$(BAREBOX_ENV_NAME) $(BINARIES_DIR)
+endef
+endif
+
 define BAREBOX_BUILD_CMDS
 	$(BAREBOX_BUILD_BAREBOXENV_CMDS)
 	$(TARGET_MAKE_ENV) $(MAKE) $(BAREBOX_MAKE_FLAGS) -C $(@D)
+	$(BAREBOX_BUILD_CUSTOM_ENV)
 endef
 
 define BAREBOX_INSTALL_IMAGES_CMDS
@@ -78,6 +91,7 @@ define BAREBOX_INSTALL_IMAGES_CMDS
 	else \
 		cp $(@D)/barebox.bin $(BINARIES_DIR);\
 	fi
+	$(BAREBOX_INSTALL_CUSTOM_ENV)
 endef
 
 ifeq ($(BR2_TARGET_BAREBOX_BAREBOXENV),y)
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/1 barebox: Allow to build an environment image

Dear Maxime Ripard,

boot/barebox/Config.in config BR2_TARGET_BAREBOX_BAREBOXENV · line 111

Quoted 10 lines · Maxime Ripard
boot/barebox/Config.in +10 -0
+config BR2_TARGET_BAREBOX_CUSTOM_ENV
+	bool "Generate an environment image"
+	help
+	  Generate a custom environment image.
+
+config BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH
+	string "Environment path"
+	depends on BR2_TARGET_BAREBOX_CUSTOM_ENV
+	help
+	  Path to the custom barebox environment

In general I'm fine, but I'd like to see more details in the help text here. At least explaining what is an environment image, that it gets generated from a text file in such or such format (possibly with a pointer into the Barebox documentation). Make it clear that BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH is the path to the source environment, and where the image will be generated, with what name, etc.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com