From c6a4bf0b986f1bc1bb25ed5286bc508294961ad5 Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Mon, 25 Sep 2017 17:56:21 +0000 Subject: [PATCH] Better script --- mkimg.sh | 56 ++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/mkimg.sh b/mkimg.sh index 3549baa..fcd9f8a 100644 --- a/mkimg.sh +++ b/mkimg.sh @@ -65,27 +65,59 @@ rm -f "$IMG_FILE" BOOT_SIZE=$(du --apparent-size -s "$ROOTFS_DIR/boot" --block-size=1 | cut -f 1) TOTAL_SIZE=$(du --apparent-size -s "$ROOTFS_DIR" --block-size=1 | cut -f 1) -IMG_SIZE=$((BOOT_SIZE + TOTAL_SIZE + (800 * 1024 * 1024))) +ROOT_SIZE=$((TOTAL_SIZE - BOOT_SIZE)) -truncate -s $IMG_SIZE "$IMG_FILE" +BOOT_SIZE=$((BOOT_SIZE * 2)) +ROOT_SIZE=$((ROOT_SIZE + 800 * 1024 * 1024)) -fdisk -H 255 -S 63 "$IMG_FILE" < /dev/null <