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

Use exfatprogs instead of exfat-utils to handle exFAT filesystem operations #2635

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions INSTALL/tool/VentoyWorker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,10 @@ if [ "$MODE" = "install" -a -z "$NONDESTRUCTIVE" ]; then
wait_and_create_part ${PART1} ${PART2}
if [ -b ${PART1} ]; then
vtinfo "Format partition 1 ${PART1} ..."
mkexfatfs -n "$VTNEW_LABEL" -s $cluster_sectors ${PART1}
$mkexfatfs "$VTNEW_LABEL" "$cluster_sectors" ${PART1}
if [ $? -ne 0 ]; then
echo "mkexfatfs failed, now retry..."
mkexfatfs -n "$VTNEW_LABEL" -s $cluster_sectors ${PART1}
$mkexfatfs "$VTNEW_LABEL" "$cluster_sectors" ${PART1}
if [ $? -ne 0 ]; then
echo "######### mkexfatfs failed, exit ########"
exit 1
Expand Down
28 changes: 27 additions & 1 deletion INSTALL/tool/ventoy_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,32 @@ vtoy_gen_uuid() {
fi
}

# Use exfatprogs instead of exfat-utils to handle exFAT filesystem operations
# https://github.com/storaged-project/udisks/issues/903
# Kernel 5.7 and above: Install the exfatprogs package
# https://wiki.gentoo.org/wiki/ExFAT
# exfatprogs and exfat-utils packages conflict
# https://forums.fedoraforum.org/showthread.php?325580-exfatprogs-and-exfat-utils-packages-conflict&p=1844223
mkfs_exfat_() {
local label=$1
local sectors=$2 # sectors per block
shift 2
mkfs.exfat -L "$label" -c "$(expr "$sectors" / 2)K" "$@"
}
mkexfatfs_() {
local label=$1
local sectors=$2 # sectors per block
shift 2
# mkexfatfs -n "$VTNEW_LABEL" -s $cluster_sectors ${PART1}
mkexfatfs -n "$label" -s "$sectors" "$@"
}
mkexfatfs=
if [ ! -z "$(command -v mkfs.exfat)" ]; then
mkexfatfs=mkfs_exfat_
elif [ ! -z "$(command -v mkexfatfs)" ]; then
mkexfatfs=mkexfatfs_
fi

check_tool_work_ok() {

if echo 1 | hexdump > /dev/null; then
Expand All @@ -60,7 +86,7 @@ check_tool_work_ok() {
return
fi

if mkexfatfs -V > /dev/null; then
if [ ! -z "$mkexfatfs" ]; then
vtdebug "mkexfatfs test ok ..."
else
vtdebug "mkexfatfs test fail ..."
Expand Down