check for exfatprogs

This commit is contained in:
shamilbi 2023-10-27 15:26:04 +02:00
parent 39703cabb7
commit de51e80a0a
2 changed files with 29 additions and 3 deletions

View file

@ -314,10 +314,10 @@ if [ "$MODE" = "install" -a -z "$NONDESTRUCTIVE" ]; then
wait_and_create_part ${PART1} ${PART2} wait_and_create_part ${PART1} ${PART2}
if [ -b ${PART1} ]; then if [ -b ${PART1} ]; then
vtinfo "Format partition 1 ${PART1} ..." vtinfo "Format partition 1 ${PART1} ..."
mkexfatfs -n "$VTNEW_LABEL" -s $cluster_sectors ${PART1} $mkexfatfs "$VTNEW_LABEL" "$cluster_sectors" ${PART1}
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "mkexfatfs failed, now retry..." echo "mkexfatfs failed, now retry..."
mkexfatfs -n "$VTNEW_LABEL" -s $cluster_sectors ${PART1} $mkexfatfs "$VTNEW_LABEL" "$cluster_sectors" ${PART1}
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "######### mkexfatfs failed, exit ########" echo "######### mkexfatfs failed, exit ########"
exit 1 exit 1

View file

@ -50,6 +50,32 @@ vtoy_gen_uuid() {
fi 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 "$(comand -v mkfs.exfat)" ]; then
mkexfatfs=mkfs_exfat_
elif [ ! -z "$(comand -v mkexfatfs)" ]; then
mkexfatfs=mkexfatfs_
fi
check_tool_work_ok() { check_tool_work_ok() {
if echo 1 | hexdump > /dev/null; then if echo 1 | hexdump > /dev/null; then
@ -60,7 +86,7 @@ check_tool_work_ok() {
return return
fi fi
if mkexfatfs -V > /dev/null; then if [ ! -z "$mkexfatfs" ]; then
vtdebug "mkexfatfs test ok ..." vtdebug "mkexfatfs test ok ..."
else else
vtdebug "mkexfatfs test fail ..." vtdebug "mkexfatfs test fail ..."