summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehoon Chung <jh80.chung@samsung.com>2021-10-15 08:11:37 +0900
committerMarek Szyprowski <m.szyprowski@samsung.com>2021-11-15 15:18:27 +0100
commit3e9e033ada92ceb826b851192282ea4fbe624497 (patch)
tree041f6d1918b430f36446e74de0bdc631a0e71419
parent7bf45c92d0a2cb6e63a5aabce00a763cf6110ccb (diff)
downloadu-boot-sandbox/mszyprowski/dev/tizen-next-prepare-3.tar.gz
u-boot-sandbox/mszyprowski/dev/tizen-next-prepare-3.tar.bz2
u-boot-sandbox/mszyprowski/dev/tizen-next-prepare-3.zip
scripts: tizen: sd_fusing_rpi3: update the rpi3 scriptsandbox/mszyprowski/dev/tizen-next-prepare-3
To prevent wrong operation, check the result whether format is succeed or not. If it's failed, exit this script. And if there is already "mnt_tmp" directory, remove it to clear the previous status. It's changed the location to remove a partition table with dd command with count is changed from 16 to 32. Because it seems that partition table doesn't clear. Change-Id: Id3eb739d5add8784d0f41eca8a7e4360a8a0dbfd Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
-rwxr-xr-xscripts/tizen/sd_fusing_rpi3.sh18
1 files changed, 11 insertions, 7 deletions
diff --git a/scripts/tizen/sd_fusing_rpi3.sh b/scripts/tizen/sd_fusing_rpi3.sh
index 0bd2bee891..f38f40d561 100755
--- a/scripts/tizen/sd_fusing_rpi3.sh
+++ b/scripts/tizen/sd_fusing_rpi3.sh
@@ -236,13 +236,12 @@ function mkpart_3 () {
umount $mnt
done
+ echo "Remove partition table..."
+ dd if=/dev/zero of=$DISK bs=512 count=32 conv=notrunc
if [ $sfdisk_new == 1 ]; then
- echo "Remove partition table..."
if [ $support_delete == 1 ]; then
sfdisk --delete $DISK
- else
- dd if=/dev/zero of=$DISK bs=512 count=16 conv=notrunc
fi
sfdisk $DISK <<-__EOF__
@@ -259,9 +258,6 @@ function mkpart_3 () {
,${RESERVED2_SZ}MiB,,-
__EOF__
else
- echo "Remove partition table..."
- dd if=/dev/zero of=$DISK bs=512 count=16 conv=notrunc
-
# calculate start positions for alignment for extended partitions
let "USER_START = 4 + $BOOT_SZ + $ROOTFS_SZ + $DATA_SZ + 1"
let "MODULE_START = $USER_START + $USER_SZ + 1"
@@ -290,6 +286,10 @@ function mkpart_3 () {
local PART=/dev/`lsblk ${DISK} -o TYPE,KNAME | grep part | awk '{ print $2 }' | grep -G "[a-z]${PART_TABLE[$idx * ${PART_TABLE_COL} + 1]}\$"`
if [ "${PART_TABLE[$idx * ${PART_TABLE_COL} + 4]}" == "vfat" ]; then
mkfs.vfat -F 16 ${PART} -n ${PART_TABLE[$idx * ${PART_TABLE_COL} + 3]}
+ if [ $? -eq 1 ]; then
+ echo "Failed to format as FAT filesystem"
+ exit -1
+ fi
elif [ "${PART_TABLE[$idx * ${PART_TABLE_COL} + 4]}" == "ext4" ]; then
mkfs.ext4 -q ${PART} -L ${PART_TABLE[$idx * ${PART_TABLE_COL} + 3]} -F
else
@@ -302,6 +302,10 @@ function mkpart_3 () {
# create "reboot-param.bin" file in inform partition for passing reboot parameter
# It should be done only once upon partition format.
+ if [ -d mnt_tmp ]; then
+ echo "Remove the existing mnt_tmp directory!!"
+ rm -rf mnt_tmp
+ fi
mkdir mnt_tmp
mount -t ext4 ${PART9} ./mnt_tmp
touch ./mnt_tmp/reboot-param.bin
@@ -394,7 +398,7 @@ function check_device () {
function print_logo () {
echo ""
- echo "Raspberry Pi downloader, version 2.1.1"
+ echo "Raspberry Pi downloader, version 2.2.1"
echo ""
}