From ec3245ac2cbdef04dd6899df5b4bd3d38b297f96 Mon Sep 17 00:00:00 2001 From: Zoltan HERPAI Date: Tue, 16 Oct 2018 16:25:55 +0200 Subject: [PATCH] riscv64: sdcard: fix p2 (rootfs) generation Signed-off-by: Zoltan HERPAI --- target/linux/riscv64/image/gen_riscv64_sdcard_img.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/target/linux/riscv64/image/gen_riscv64_sdcard_img.sh b/target/linux/riscv64/image/gen_riscv64_sdcard_img.sh index 374d78e813..d4b5f68889 100755 --- a/target/linux/riscv64/image/gen_riscv64_sdcard_img.sh +++ b/target/linux/riscv64/image/gen_riscv64_sdcard_img.sh @@ -24,15 +24,19 @@ ROOTFSSIZE="$5" #UBOOT="$6" -FULLSIZE="$(($BOOTFSSIZE+$ROOTFSSIZE+1))" +FULLSIZE="$(($BOOTFSSIZE+$ROOTFSSIZE+2))" echo "Full size is: ${FULLSIZE}M" -ROOTFSOFFSET="$(($BOOTFSSIZE*1048576 / 512 + 2048))" +ROOTFSOFFSET="$(($BOOTFSSIZE*1048576 / 512 + 2048))" #8187 +#ROOTFSOFFSET="$(($BOOTFSSIZE*1048576 / 512 + 4096))" + + echo "Rootfs offset is: $ROOTFSOFFSET" dd if=/dev/zero of=$OUTPUT bs=1M count=$FULLSIZE -sgdisk --clear \ +#sgdisk --clear \ +/u/owrt2/sink-201810/staging_dir/host/bin/sgdisk --clear \ --new=1:2048:${BOOTFSSIZE}M --change-name=1:bootloader --typecode=1:${BBL_UUID} \ --new=2:${ROOTFSOFFSET}: --change-name=2:root --typecode=2:${LINUX_UUID} $OUTPUT -- 2.30.2