[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH V4 2/3] Add SD-card image build support for hd-media builds on armhf



---
 build/boot/README.concatenateable_images | 20 ++++++++++++++++++++
 build/config/armhf/hd-media.cfg          | 25 ++++++++++++++++++++++++-
 debian/changelog                         |  1 +
 3 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 build/boot/README.concatenateable_images

diff --git a/build/boot/README.concatenateable_images b/build/boot/README.concatenateable_images
new file mode 100644
index 0000000..5749577
--- /dev/null
+++ b/build/boot/README.concatenateable_images
@@ -0,0 +1,20 @@
+This directory provides installer images in the form of a device-specific
+part (containing the partition table and the system firmware) and a
+device-independent part (containing the actual installer), which can be
+unpacked and concatenated together to build a complete installer image.
+
+The device-specific part is named firmware.<board_name>.img.gz
+and the device-independent part is named partition.img.gz.
+
+To create a complete image from the two parts on Linux systems, you can
+use zcat as follows:
+
+  zcat firmware.<board_name>.img.gz partition.img.gz > complete_image.img
+
+On Windows systems, you have to first decompress the two parts separately,
+which can be done e.g. by using 7-Zip, and then concatenate the decompressed
+parts together by running the command
+
+  copy /b firmware.<board_name>.img + partition.img complete_image.img
+
+in a Windows CMD.exe window.
diff --git a/build/config/armhf/hd-media.cfg b/build/config/armhf/hd-media.cfg
index ec119df..ce3852f 100644
--- a/build/config/armhf/hd-media.cfg
+++ b/build/config/armhf/hd-media.cfg
@@ -1,9 +1,12 @@
 FLAVOUR_SUPPORTED = ""
+FLOPPY_SIZE = 40000
 
 GZIPPED = .gz
 EXTRANAME = hd-media/
 
-TARGET = $(KERNEL) $(INITRD) hd-media_bootscript hd-media_tarball
+CONCATENATEABLE_SUFFIX =
+
+TARGET = $(KERNEL) $(INITRD) hd-media_bootscript hd-media_tarball hd-media_images_concatenateable
 
 MANIFEST-INITRD = "Initrd for use on USB memory sticks"
 MANIFEST-KERNEL = "Kernel for use on USB memory sticks"
@@ -24,3 +27,23 @@ hd-media_tarball: $(KERNEL) $(INITRD) $(TEMP_DTBS) hd-media_bootscript
 	cp boot/README.device-tree $(TEMP)/hd-media/dtbs/README
 	tar -C $(TEMP)/hd-media -zcf $(TEMP)/hd-media.tar.gz boot.scr initrd.gz vmlinuz dtbs/
 	mv  $(TEMP)/hd-media.tar.gz $(SOME_DEST)/$(EXTRANAME)
+
+.PHONY: hd-media_images_concatenateable
+hd-media_images_concatenateable: $(KERNEL) $(INITRD) $(TEMP_DTBS) hd-media_bootscript
+	-rm -rf $(TEMP)/hd-media_images_concatenateable
+	mkdir $(TEMP)/hd-media_images_concatenateable
+	cp $(KERNEL) $(TEMP)/hd-media_images_concatenateable/vmlinuz
+	cp $(INITRD) $(TEMP)/hd-media_images_concatenateable/initrd.gz
+	cp $(SOME_DEST)/$(EXTRANAME)boot.scr $(TEMP)/hd-media_images_concatenateable/boot.scr
+	cp -r $(TEMP_DTBS) $(TEMP)/hd-media_images_concatenateable/dtbs/
+	cp boot/README.device-tree $(TEMP)/hd-media_images_concatenateable/dtbs/README
+	mkdir -p $(SOME_DEST)/$(EXTRANAME)/SD-card-images/$(CONCATENATEABLE_SUFFIX)
+	while read LINE; \
+	do \
+	  if [ -n "$${LINE}" ] && ! echo $${LINE}|grep -q -e "^#"; then \
+	    set -- $${LINE} ;\
+	    gen-hd-image -v -z -b firmware -s "$(FLOPPY_SIZE)" -o "$(SOME_DEST)/$(EXTRANAME)/SD-card-images/$(CONCATENATEABLE_SUFFIX)/firmware.$${1}.img" "$$2" "$$3" "$$4" "$$5" ;\
+	  fi ;\
+	done < boot/arm/u-boot-image-config
+	gen-hd-image -v -z -b partition -s "$(FLOPPY_SIZE)" -i "$(TEMP)/hd-media_images_concatenateable" -o "$(SOME_DEST)/$(EXTRANAME)/SD-card-images/$(CONCATENATEABLE_SUFFIX)/partition.img"
+	cp boot/README.concatenateable_images "$(SOME_DEST)/$(EXTRANAME)/SD-card-images/$(CONCATENATEABLE_SUFFIX)/"
diff --git a/debian/changelog b/debian/changelog
index ac4be4d..78c12a4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -18,6 +18,7 @@ debian-installer (20150108) UNRELEASED; urgency=medium
     systems in boot/arm/bootscr.mainline_common.
   * Add util/gen-hd-image (a script to create partitioned harddisk images
     from a directory and optionally install a bootloader into the image).
+  * Add SD-card image build support for hd-media builds on armhf.
 
   [ Helge Deller ]
   * alpha: Switch to KERNELVERSION
-- 
2.1.4


Reply to: