[PATCH olpc-os-builder 08/14] sd_card_image: add support for skipping .zd/.zsp image creation

Sascha Silbe silbe at activitycentral.com
Thu Mar 17 11:21:22 EDT 2011


Only OFW supports these file formats and creating them takes a lot of time.

Use case: local testing with external SD cards.

Signed-off-by: Sascha Silbe <silbe at activitycentral.com>
---
 modules/sd_card_image/README                 |    3 ++-
 modules/sd_card_image/defaults.ini           |    1 +
 modules/sd_card_image/postimage.50.makezd.sh |   15 +++++++++------
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/modules/sd_card_image/README b/modules/sd_card_image/README
index 3647057..0deda30 100644
--- a/modules/sd_card_image/README
+++ b/modules/sd_card_image/README
@@ -2,7 +2,8 @@ This module creates ext4 SD card images from the build output. These
 images contain partition tables and 2 partitions.
 
 These images are in the "ZD" format, suitable for flashing via OpenFirmware's
-fs-update command. Corresponding .zsp files are produced too.
+fs-update command. Corresponding .zsp files are produced too. To disable
+.zd/.zsp creation, set the make_zd option to 0 (default is 1).
 
 The SD card sizes must be specified, in bytes. This module can create
 filesystems for multiple SD card capacities. Simply provide a list of
diff --git a/modules/sd_card_image/defaults.ini b/modules/sd_card_image/defaults.ini
index 6489d26..75f39f6 100644
--- a/modules/sd_card_image/defaults.ini
+++ b/modules/sd_card_image/defaults.ini
@@ -1,4 +1,5 @@
 [sd_card_image]
 keep_disk_image=0
 compress_disk_image=1
+make_zd=1
 
diff --git a/modules/sd_card_image/postimage.50.makezd.sh b/modules/sd_card_image/postimage.50.makezd.sh
index f9d510e..a7338d2 100644
--- a/modules/sd_card_image/postimage.50.makezd.sh
+++ b/modules/sd_card_image/postimage.50.makezd.sh
@@ -4,6 +4,7 @@
 . $OOB__shlib
 compress=$(read_config sd_card_image compress_disk_image)
 keep_img=$(read_config sd_card_image keep_disk_image)
+make_zd=$(read_config sd_card_image make_zd)
 
 oIFS=$IFS
 IFS=$'\n'
@@ -19,13 +20,15 @@ for line in $(env); do
 	diskimg=$intermediatesdir/$output_name.disk.img
 	output=$outputdir/$output_name
 
-	echo "Making ZD image for $output_name..."
-	$bindir/zhashfs 0x20000 sha256 $diskimg $output.zsp $output
+	if [[ "$make_zd" == 1 ]]; then
+		echo "Making ZD image for $output_name..."
+		$bindir/zhashfs 0x20000 sha256 $diskimg $output.zsp $output
 
-	echo "Creating MD5sum of $output_name..."
-	pushd $outputdir >/dev/null
-	md5sum $output_name > $output_name.md5
-	popd >/dev/null
+		echo "Creating MD5sum of $output_name..."
+		pushd $outputdir >/dev/null
+		md5sum $output_name > $output_name.md5
+		popd >/dev/null
+	fi
 
 	if [[ "$keep_img" == "1" ]]; then
 		if [[ "$compress" == "1" ]]; then
-- 
1.7.4.1




More information about the Devel mailing list