Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed vfat mkfs using uuid from layout if possible #2546

Merged
merged 1 commit into from
Jan 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,27 @@ function create_fs () {
label2="$(echo $label | sed -e 's/\\b/ /g')" # replace \b with a " "
label="$label2"
fi
echo "mkfs.vfat -n \"$label\" $device" >> "$LAYOUT_CODE"
# Create FS with UUID if possible
if [ -n "$uuid" ]; then
( echo "#Try to create with old uuid but when -i is not available fallback to a newly created one."
echo "if ! mkfs.vfat -n "$label" -i "$(echo $uuid | sed s/-//)" $device >&2 ; then"
echo " mkfs.vfat -n "$label" $device >&2"
echo "fi"
) >> "$LAYOUT_CODE"
else
echo "mkfs.vfat -n \"$label\" $device" >> "$LAYOUT_CODE"
fi
else
echo "mkfs.vfat $device" >> "$LAYOUT_CODE"
# Create FS with UUID if possible
if [ -n "$uuid" ]; then
( echo "#Try to create with old uuid but when -i is not available fallback to a newly created one."
echo "if ! mkfs.vfat -i "$(echo $uuid | sed s/-//)" $device >&2 ; then"
echo " mkfs.vfat $device >&2"
echo "fi"
) >> "$LAYOUT_CODE"
else
echo "mkfs.vfat $device" >> "$LAYOUT_CODE"
fi
fi
# Set the UUID:
if [ -n "$uuid" ]; then
Expand Down