Skip to content

Commit 63765e8

Browse files
committed
Enabled rpi-clone to handle the symlink removal from /boot/cmdline.txt to
/cmdline/firmware/cmdline.txt
1 parent cc684c0 commit 63765e8

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

rpi-clone

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
# the rpi-clone github source repository:
88
# https://github.com/billw2/rpi-clone
99

10+
# This updated code is located in a fork of Bill Willsons git repository
11+
# at https://github.com/framps/rpi-clone
1012

11-
version=2.0.22
13+
version=2.0.23
1214

1315
# setup trusted paths for dependancies (like rsync, grub, fdisk, etc)
1416
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
@@ -746,7 +748,6 @@ do
746748
fi
747749
done
748750

749-
750751
# command line
751752
#
752753
setup_args=""
@@ -939,6 +940,8 @@ then
939940
exit 1
940941
fi
941942

943+
cmdlinedir=$(awk '$1 !~ "^#" && $2 ~ "^/boot" && $3 == "vfat" { print substr($2, 2); exit }' /etc/fstab)
944+
942945
if ((convert_to_partuuid))
943946
then
944947
unattended=0
@@ -968,7 +971,7 @@ then
968971
cp $fstab_tmp $fstab
969972
printf "Your original fstab is backed up to $fstab_save\n"
970973

971-
cmdline_txt=$(realpath /boot/cmdline.txt)
974+
cmdline_txt=/${cmdlinedir}/cmdline.txt
972975
cmdline_save=$cmdline_txt.${PGM}-save
973976
if [ -f $cmdline_txt ] && grep -q "$src_root_dev" $cmdline_txt
974977
then
@@ -1727,15 +1730,15 @@ qecho ""
17271730
# Fix PARTUUID or device name references in cmdline.txt and fstab
17281731
#
17291732
fstab=${clone}/etc/fstab
1730-
cmdline_txt=${clone}$(realpath /boot/cmdline.txt)
1733+
cmdline_txt=${clone}/${cmdlinedir}/cmdline.txt
17311734

17321735
if [ -f $cmdline_txt ]
17331736
then
17341737
if ((leave_sd_usb_boot && SD_slot_dst))
17351738
then
17361739
qecho "Leaving SD to USB boot alone."
1737-
cp $cmdline_txt ${clone}/boot/cmdline.boot
1738-
cmdline_txt=${clone}/boot/cmdline.boot
1740+
cp $cmdline_txt ${clone}/${cmdlinedir}/cmdline.boot
1741+
cmdline_txt=${clone}/${cmdlinedir}/cmdline.boot
17391742
fi
17401743
if grep -q $src_disk_ID $cmdline_txt
17411744
then
@@ -1749,8 +1752,8 @@ then
17491752
if ((leave_sd_usb_boot && SD_slot_boot))
17501753
then
17511754
qecho "Copying USB cmdline.txt to SD card to set up USB boot."
1752-
cp /boot/cmdline.txt /boot/cmdline.boot
1753-
cp $cmdline_txt /boot/cmdline.txt
1755+
cp /${cmdlinedir}/cmdline.txt /${cmdlinedir}/cmdline.boot
1756+
cp $cmdline_txt /${cmdlinedir}/cmdline.txt
17541757
fi
17551758
fi
17561759

@@ -1764,7 +1767,6 @@ then
17641767
sed -i "s/${src_part_base}/${edit_fstab_name}/" "$fstab"
17651768
fi
17661769

1767-
17681770
rm -f $clone/etc/udev/rules.d/70-persistent-net.rules
17691771

17701772
dst_root_vol_name=`e2label $dst_root_dev`

0 commit comments

Comments
 (0)