diff options
| author | Simon McVittie <smcv@debian.org> | 2021-04-24 23:20:12 +0100 |
|---|---|---|
| committer | Simon McVittie <smcv@debian.org> | 2021-04-25 11:22:59 +0100 |
| commit | e6defffb2355300e7fd8b9e6c79d9383a53b77f2 (patch) | |
| tree | acfa336df148180781c0840f744f2c686d713db1 | |
| parent | 09805aa49bba104b329ad3ee4a60c6c00f27b611 (diff) | |
Makefile: Optionally generate a bmaptool map file
bmaptool(1), from the bmap-tools package, can write the used blocks
in a sparse disk image to media, while saving time and I/O by not writing
zeroes to the unused blocks. Typical use:
make raspi2_bullseye.img.bmap raspi2_bullseye.img.xz
... upload those two files ...
... download those two files ...
bmaptool copy raspi2_bullseye.img.xz /dev/disk/by-id/usb-Generic-_SD_MMC_*-0:0
Signed-off-by: Simon McVittie <smcv@debian.org>
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | Makefile | 7 |
2 files changed, 7 insertions, 1 deletions
@@ -1,4 +1,5 @@ # suggested build result and log filenames +raspi*.bmap raspi*.img raspi*.img.xz raspi*.log @@ -119,6 +119,9 @@ raspi_4_bullseye.yaml: raspi_base_bullseye.yaml %.img.xz: %.img xz -f -k -z -9 $(@:.xz=) +%.img.bmap: %.img + bmaptool create -o $@ $< + %.img: %.yaml touch $(@:.img=.log) time nice vmdb2 --verbose --rootfs-tarball=$(subst .img,.tar.gz,$@) --output=$@ $(subst .img,.yaml,$@) --log $(subst .img,.log,$@) @@ -133,12 +136,14 @@ _clean_images: rm -f $(addsuffix .img,$(platforms)) _clean_xzimages: rm -f $(addsuffix .img.xz,$(platforms)) +_clean_bmaps: + rm -f $(addsuffix .img.bmap,$(platforms)) _clean_shasums: rm -f $(addsuffix .sha256,$(platforms)) $(addsuffix .xz.sha256,$(platforms)) _clean_logs: rm -f $(addsuffix .log,$(platforms)) _clean_tarballs: rm -f $(addsuffix .tar.gz,$(platforms)) -clean: _clean_xzimages _clean_images _clean_shasums _clean_yaml _clean_tarballs _clean_logs +clean: _clean_xzimages _clean_images _clean_shasums _clean_yaml _clean_tarballs _clean_logs _clean_bmaps .PHONY: _ck_root _build_img clean _clean_images _clean_yaml _clean_tarballs _clean_logs |
