From 55bcf3feab11042eaf786e5e1234c315b75aabc9 Mon Sep 17 00:00:00 2001 From: Ralph Ronnquist Date: Thu, 8 Feb 2024 23:09:33 +1100 Subject: [PATCH] Prepare automatically FS.sqfs unless it existsa already. --- minbase-strap-mkimg.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/minbase-strap-mkimg.sh b/minbase-strap-mkimg.sh index 8d77f5a..1e72b9a 100644 --- a/minbase-strap-mkimg.sh +++ b/minbase-strap-mkimg.sh @@ -9,6 +9,9 @@ rm -f "$IMG" # First partition sectors (round up to a Mb number DUM1=$(( ( $(du -sB1 $TMP | sed 's/\s.*//') / 1048576 + 2 ) )) + +# Second partition is a squashfs packing of $FS +[ -r FS.sqfs ] || ( cd $FS && mksquashfs * ../FS.sqfs ) DUM2=$(( $(stat -c %s FS.sqfs) / 1048576 + 2 )) # Estimate the required disk image size in Mib @@ -24,7 +27,6 @@ label: dos - - 0x83 EOF PART=( $(fdisk -l -ostart,sectors $IMG | tail -n 2) ) -echo "${PART[*]}" # First sector is 2048 by default, which is byte address 1048576 TMPIMG=$(mktemp XXXX) -- 2.39.2