Prepare automatically FS.sqfs unless it existsa already.
authorRalph Ronnquist <rrq@rrq.au>
Thu, 8 Feb 2024 12:09:33 +0000 (23:09 +1100)
committerRalph Ronnquist <rrq@rrq.au>
Thu, 8 Feb 2024 12:09:33 +0000 (23:09 +1100)
minbase-strap-mkimg.sh

index 8d77f5a822696082fceacd0fd9a04b9a0c4f8711..1e72b9ae10fa5a475a4e83046eb977095b519759 100644 (file)
@@ -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)