Skip to content

Commit

Permalink
Merge pull request #22 from framps/master
Browse files Browse the repository at this point in the history
Make cmdline.txt dir discovery regex more robust and use mount instead of /etc/fstab contents
  • Loading branch information
geerlingguy authored Apr 10, 2024
2 parents 11a38f8 + 307a33a commit cebc9d9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rpi-clone
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,12 @@ then
exit 1
fi

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

if ((convert_to_partuuid))
then
Expand Down

0 comments on commit cebc9d9

Please sign in to comment.