Skip to content

Commit 82b833c

Browse files
committed
If no destination partitions, set n_dst_partitions to zero.
1 parent fe7a646 commit 82b833c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

rpi-clone

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
version=2.0.19
3+
version=2.0.20
44

55
# auto run grub-install if grub detected
66
grub_auto=1
@@ -961,6 +961,11 @@ fi
961961

962962
dst_partition_table=$(parted -m "/dev/$dst_disk" unit s print | tr -d ';')
963963
n_dst_parts=$(echo "$dst_partition_table" | tail -n 1 | cut -d ":" -f 1)
964+
if [ "$n_dst_parts" == "/dev/$dst_disk" ]
965+
then
966+
n_dst_parts=0
967+
fi
968+
964969
dst_disk_size=$(echo "$dst_partition_table" \
965970
| grep "^/dev/$dst_disk" | cut -d ":" -f 2 | tr -d 's')
966971
dst_root_dev=/dev/${dst_part_base}${root_part_num}

0 commit comments

Comments
 (0)