[elbe-devel] [PATCH 2/2] debianize: add support for multiple barebox configurations

yegorslists at googlemail.com yegorslists at googlemail.com
Tue Mar 24 12:40:37 CET 2020


From: Yegor Yefremov <yegorslists at googlemail.com>

Some architectures like am335x need two images. Allow to
specify two space-separated images and defonfigs.

Signed-off-by: Yegor Yefremov <yegorslists at googlemail.com>
---
 .../makofiles/debianize/barebox/rules.mako    | 42 ++++++++++++++++---
 1 file changed, 36 insertions(+), 6 deletions(-)

diff --git a/elbepack/makofiles/debianize/barebox/rules.mako b/elbepack/makofiles/debianize/barebox/rules.mako
index 9c055f2ea..58444e7a7 100755
--- a/elbepack/makofiles/debianize/barebox/rules.mako
+++ b/elbepack/makofiles/debianize/barebox/rules.mako
@@ -6,33 +6,63 @@
 ##
 #!/usr/bin/make -f
 
+<%
+items = imgname.split(' ')
+img_name_aux = ''
+img_name = items[0]
+if len(items) > 1:
+    img_name_aux = items[1]
+	
+
+items = defconfig.split(' ')
+def_config_aux = ''
+def_config = items[0]
+if len(items) > 1:
+    def_config_aux = items[1]
+%>
+
 BOOT_PATH=`pwd`/debian/tmp/boot
 
 MAKE_OPTS= \
 ARCH=${k_arch} \
-CROSS_COMPILE=${cross_compile} \
-O=debian/build
+CROSS_COMPILE=${cross_compile}
 
 #export DH_VERBOSE=1
 export LDFLAGS=
 
 override_dh_auto_clean:
 	mkdir -p debian/build
+% if def_config_aux:
+	mkdir -p debian/build-aux
+% endif
 	rm -f debian/files
 	rm -rf debian/tmp
-	make $(MAKE_OPTS) clean
+	make $(MAKE_OPTS) O=debian/build clean
+% if def_config_aux:
+	make $(MAKE_OPTS) O=debian/build-aux clean
+% endif
 
 override_dh_auto_configure:
 	mkdir -p debian/build
-	make $(MAKE_OPTS) ${defconfig}
+	make $(MAKE_OPTS) O=debian/build ${def_config}
+% if def_config_aux:
+	mkdir -p debian/build-aux
+	make $(MAKE_OPTS) O=debian/build-aux ${def_config_aux}
+% endif
 
 override_dh_auto_build:
 	rm -rf include/config
-	make -j`nproc` $(MAKE_OPTS)
+	make -j`nproc` $(MAKE_OPTS) O=debian/build
+% if def_config_aux:
+	make -j`nproc` $(MAKE_OPTS) O=debian/build-aux
+% endif
 
 override_dh_auto_install:
 	mkdir -p $(BOOT_PATH)
-	cp debian/build/images/${imgname} $(BOOT_PATH)
+	cp debian/build/images/${img_name} $(BOOT_PATH)
+% if img_name_aux:
+	cp debian/build-aux/images/${img_name_aux} $(BOOT_PATH)
+% endif
 
 %%:
 	dh $@
-- 
2.17.0




More information about the elbe-devel mailing list