[PATCH V3 2/6] Provide u-boot binaries for armhf systems without u-boot in flash
---
build/config/armhf.cfg | 2 +-
build/config/armhf/u-boot.cfg | 27 +++++++++++++++++++++++++++
debian/changelog | 1 +
3 files changed, 29 insertions(+), 1 deletion(-)
create mode 100644 build/config/armhf/u-boot.cfg
diff --git a/build/config/armhf.cfg b/build/config/armhf.cfg
index 1332c3a..73cdf39 100644
--- a/build/config/armhf.cfg
+++ b/build/config/armhf.cfg
@@ -1,4 +1,4 @@
-MEDIUM_SUPPORTED = hd-media netboot network-console netboot-gtk device-tree
+MEDIUM_SUPPORTED = hd-media netboot network-console netboot-gtk device-tree u-boot
MKLIBS = mklibs --ldlib=/lib/ld-linux-armhf.so.3
diff --git a/build/config/armhf/u-boot.cfg b/build/config/armhf/u-boot.cfg
new file mode 100644
index 0000000..f8bcd2c
--- /dev/null
+++ b/build/config/armhf/u-boot.cfg
@@ -0,0 +1,27 @@
+MEDIA_TYPE = u-boot binaries
+
+TARGET = u-boot-binaries
+EXTRANAME = $(MEDIUM)/
+
+.PHONY: u-boot-binaries
+u-boot-binaries:
+ mkdir -p $(SOME_DEST)/$(EXTRANAME)/
+ while read LINE; \
+ do \
+ if [ -n "$${LINE}" ] && ! echo $${LINE}|grep -q -e "^#"; then \
+ set -- $${LINE}; \
+ mkdir -p "$(SOME_DEST)/$(EXTRANAME)/$$1"; \
+ if [ -n "$$2" ]; then \
+ echo "Providing u-boot binaries for $$1 ..."; \
+ cp "$$2" "$(SOME_DEST)/$(EXTRANAME)/$$1/"; \
+ dd 2>/dev/null if="$$2" of="$(SOME_DEST)/$(EXTRANAME)/$$1/$$1.sdcard.img" bs=512 seek="$$3"; \
+ gzip -9 "$(SOME_DEST)/$(EXTRANAME)/$$1/$$(basename $$2)"; \
+ fi; \
+ if [ -n "$$4" ]; then \
+ cp "$$4" "$(SOME_DEST)/$(EXTRANAME)/$$1/"; \
+ dd 2>/dev/null if="$$4" of="$(SOME_DEST)/$(EXTRANAME)/$$1/$$1.sdcard.img" bs=512 seek="$$5" conv=notrunc; \
+ gzip -9 "$(SOME_DEST)/$(EXTRANAME)/$$1/$$(basename $$4)"; \
+ fi; \
+ gzip -9 "$(SOME_DEST)/$(EXTRANAME)/$$1/$$1.sdcard.img"; \
+ fi ;\
+ done < boot/arm/u-boot-image-config
diff --git a/debian/changelog b/debian/changelog
index df06645..d81210a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,7 @@ debian-installer (201410XX) UNRELEASED; urgency=medium
* Add hd-media support for the armhf platform.
* Add boot/arm/u-boot-image-config (a list of u-boot components and their
offsets on disk, needed to create bootable images for arm-based systems).
+ * Provide u-boot binaries for armhf systems without u-boot in flash.
[ Aurelien Jarno ]
* Add scsi-modules to the cdrom flavour on ppc64el to be able to access
--
2.1.4
Reply to: