Skip to content

Commit 2b4bacd

Browse files
committed
Fix --convert-fstab-to-partuuid. Add grub-install run if grub found.
1 parent 927ec68 commit 2b4bacd

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

rpi-clone

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

3-
version=2.0.5
3+
version=2.0.6
4+
5+
# auto run grub-install if grub detected
6+
grub_auto=1
47

58
PGM=`basename $0`
69
setup_command="$PGM-setup"
@@ -778,7 +781,7 @@ then
778781
if grep -q "^/dev/${src_partition[p]}" $fstab_tmp
779782
then
780783
partuuid=$(lsblk -n -o PARTUUID /dev/${src_partition[p]})
781-
sed -i "s/\/dev\/${src_partition[p]}/$partuuid/" $fstab_tmp
784+
sed -i "s/\/dev\/${src_partition[p]}/PARTUUID=$partuuid/" $fstab_tmp
782785
printf " Editing $fstab, changing /dev/${src_partition[p]} to $partuuid\n"
783786
((++count))
784787
fi
@@ -1341,7 +1344,7 @@ else
13411344
printf "\nAborting!\n"
13421345
if ((!space_ok))
13431346
then
1344-
printf " Use -F to override used > space fail.\n"
1347+
printf " Use -F to override used > space fail or -m to select mounts to clone.\n"
13451348
fi
13461349
if ((!all_sync_mount_ok))
13471350
then
@@ -1475,6 +1478,11 @@ then
14751478
dst_root_vol_name="no label"
14761479
fi
14771480

1481+
if [ -d /boot/grub ] && ((grub_auto))
1482+
then
1483+
echo "grub-install --root-directory=$clone /dev/$dst_disk"
1484+
grub-install --root-directory=$clone /dev/$dst_disk
1485+
fi
14781486

14791487
if [ "$setup_args" != "" ]
14801488
then

0 commit comments

Comments
 (0)