Skip to content

Commit cebc9d9

Browse files
authored
Merge pull request #22 from framps/master
Make cmdline.txt dir discovery regex more robust and use mount instead of /etc/fstab contents
2 parents 11a38f8 + 307a33a commit cebc9d9

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
@@ -940,7 +940,12 @@ then
940940
exit 1
941941
fi
942942

943-
cmdlinedir=$(awk '$1 !~ "^#" && $2 ~ "^/boot" && $3 == "vfat" { print substr($2, 2); exit }' /etc/fstab)
943+
# Starting with bookworm /boot/firmware/cmdline.txt is used. All previous RaspbianOS releases use /boot/cmdline.txt
944+
cmdlinedir=$(mount | awk '$3 ~ "^/boot(/firmware)?$" && $5 == "vfat" { print substr($3, 2); exit }' )
945+
if [[ -z "$cmdlinedir" ]]; then
946+
echo "Unable to locate boot device"
947+
exit 1
948+
fi
944949

945950
if ((convert_to_partuuid))
946951
then

0 commit comments

Comments
 (0)