clearfog: Prepare data for flashing via USB to eMMC
At first, I tried to use just one `genimage` configuration file for this
purpose, but I wasn't able to come up with any method to either leverage
the sparseness of the sdcard.img file, or to make `genimage` compress
it. It would be quite wasteful to create huge image files, after all.
However, I wasn't able to find any proper way for doing that just with
`genimage`. I tried:
- The `tar` and `cpio` backends which implement compression. This didn't
work because it seems that one cannot redefine their actual *content*.
- Using `exec_pre` and `exec_post` to force a command. That didn't work
either because genimage checks for file availability prior to running
them.
In the end, this extra shell script simply compresses the SD card image
and calls `genimage` once more. I chose `mksquashfs` because it was much
faster with sparse input than both `gzip` and `bzip2`.
Change-Id: Ia80443108e879fe89b0815e45e5338c5eebf33f3
diff --git a/board/czechlight/clearfog/usb-genimage.cfg b/board/czechlight/clearfog/usb-genimage.cfg
new file mode 100644
index 0000000..5f0820a
--- /dev/null
+++ b/board/czechlight/clearfog/usb-genimage.cfg
@@ -0,0 +1,24 @@
+image usb-flash.vfat {
+ vfat {
+ file "boot.scr" { image = "usb-boot.scr" }
+ files = {
+ "zImage",
+ "czechlight-clearfog.dtb",
+ "rootfs.cpio.uboot",
+ "u-boot-spl.kwb",
+ "sdcard.img.squashfs"
+ }
+ }
+ size = 128M
+}
+
+image usb-flash.img {
+ hdimage {
+ }
+
+ partition boot {
+ partition-type = 0xc
+ bootable = true
+ image = "usb-flash.vfat"
+ }
+}