local -r -i part_idx=$?
if [ $part_idx -ne $PART_TABLE_COL ];then
- local -r device=$DEVICE${PART_TABLE[${part_idx} * ${PART_TABLE_ROW} + 1]}
+ local -r num=${PART_TABLE[${part_idx} * ${PART_TABLE_ROW} + 1]}
+ local -r device=/dev/`lsblk ${DEVICE} -o KNAME | grep -G "[a-z]${num}\$"`
local -r bs=${PART_TABLE[${part_idx} * ${PART_TABLE_ROW} + 2]}
else
echo "Not supported binary: $fusing_img"
__EOF__
fi
- mkfs.vfat -F 16 ${DISK}1 -n $BOOT
- mkfs.ext4 -q ${DISK}2 -L $ROOTFS -F
- mkfs.ext4 -q ${DISK}3 -L $SYSTEMDATA -F
- mkfs.ext4 -q ${DISK}5 -L $USER -F
- mkfs.ext4 -q ${DISK}6 -L $MODULE -F
- mkfs.ext4 -q ${DISK}7 -L $RAMDISK -F
- mkfs.ext4 -q ${DISK}8 -L $RAMDISK_RECOVERY -F
- mkfs.ext4 -q ${DISK}9 -L $INFORM -F
+ local -r PART1=/dev/`lsblk ${DISK} -o KNAME | grep -G "[a-z]1\$"`
+ mkfs.vfat -F 16 ${PART1} -n $BOOT
+
+ local -r PART2=/dev/`lsblk ${DISK} -o KNAME | grep -G "[a-z]2\$"`
+ mkfs.ext4 -q ${PART2} -L $ROOTFS -F
+
+ local -r PART3=/dev/`lsblk ${DISK} -o KNAME | grep -G "[a-z]3\$"`
+ mkfs.ext4 -q ${PART3} -L $SYSTEMDATA -F
+
+ local -r PART5=/dev/`lsblk ${DISK} -o KNAME | grep -G "[a-z]5\$"`
+ mkfs.ext4 -q ${PART5} -L $USER -F
+
+ local -r PART6=/dev/`lsblk ${DISK} -o KNAME | grep -G "[a-z]6\$"`
+ mkfs.ext4 -q ${PART6} -L $MODULE -F
+
+ local -r PART7=/dev/`lsblk ${DISK} -o KNAME | grep -G "[a-z]7\$"`
+ mkfs.ext4 -q ${PART7} -L $RAMDISK -F
+
+ local -r PART8=/dev/`lsblk ${DISK} -o KNAME | grep -G "[a-z]8\$"`
+ mkfs.ext4 -q ${PART8} -L $RAMDISK_RECOVERY -F
+
+ local -r PART9=/dev/`lsblk ${DISK} -o KNAME | grep -G "[a-z]9\$"`
+ mkfs.ext4 -q ${PART9} -L $INFORM -F
# create "reboot-param.bin" file in inform partition for passing reboot parameter
# It should be done only once upon partition format.
- umount ${DISK}9
+ umount ${PART9}
mkdir mnt_tmp
- mount -t ext4 ${DISK}9 ./mnt_tmp
+ mount -t ext4 ${PART9} ./mnt_tmp
touch ./mnt_tmp/reboot-param.bin
sync
umount ./mnt_tmp
function print_logo () {
echo ""
- echo "Raspberry Pi3 downloader, version 1.3.1"
+ echo "Raspberry Pi3 downloader, version 1.4.0"
echo ""
}