From 95977fa6f5fa64a235f5aec7300cd3351104a23f Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Fri, 14 Jun 2019 20:29:07 +0200 Subject: [PATCH] [Build script] Reverting image creation improvement due to (random?) failing. truncate sometimes resoult in fs corruption or is not possible to clearly unmount loop device. Need deeper inspection or simply reverting to previous working solution Signed-off-by: Igor Pecovnik --- lib/debootstrap-ng.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/debootstrap-ng.sh b/lib/debootstrap-ng.sh index ec38645526..4f5b3aae5b 100644 --- a/lib/debootstrap-ng.sh +++ b/lib/debootstrap-ng.sh @@ -387,7 +387,8 @@ prepare_partitions() # stage: create blank image display_alert "Creating blank image for rootfs" "$sdsize MiB" "info" - truncate --size=${sdsize}M ${SDCARD}.raw + # truncate --size=${sdsize}M ${SDCARD}.raw # sometimes results in fs corruption, revert to previous know to work solution + dd if=/dev/zero bs=1M status=none count=$sdsize | pv -p -b -r -s $(( $sdsize * 1024 * 1024 )) | dd status=none of=${SDCARD}.raw # stage: calculate boot partition size local bootstart=$(($OFFSET * 2048))