disks: rewrite usb mount

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-09-24 23:41:57 +02:00
parent 7a2e2e2258
commit dcf39e1daf

View File

@ -314,6 +314,7 @@ function dtModel() {
function nondtModel() { function nondtModel() {
MAXDISKS=0 MAXDISKS=0
MAXINTDISKS=0
USBPORTCFG=0 USBPORTCFG=0
ESATAPORTCFG=0 ESATAPORTCFG=0
INTERNALPORTCFG=0 INTERNALPORTCFG=0
@ -329,6 +330,8 @@ function nondtModel() {
([ ${IDX} -lt ${USBMINIDX} ] || [ "${hasUSB}" = "false" ]) && USBMINIDX=${IDX} ([ ${IDX} -lt ${USBMINIDX} ] || [ "${hasUSB}" = "false" ]) && USBMINIDX=${IDX}
([ ${IDX} -gt ${USBMAXIDX} ] || [ "${hasUSB}" = "false" ]) && USBMAXIDX=${IDX} ([ ${IDX} -gt ${USBMAXIDX} ] || [ "${hasUSB}" = "false" ]) && USBMAXIDX=${IDX}
hasUSB=true hasUSB=true
else
[ $((${IDX} + 1)) -ge ${MAXINTDISKS} ] && MAXINTDISKS=$((${IDX} + 1))
fi fi
done done
# Define 6 is the minimum number of USB disks # Define 6 is the minimum number of USB disks
@ -339,7 +342,7 @@ function nondtModel() {
[ $((${USBMAXIDX} - ${USBMINIDX})) -lt 6 ] && USBMAXIDX=$((${USBMINIDX} + 6)) [ $((${USBMAXIDX} - ${USBMINIDX})) -lt 6 ] && USBMAXIDX=$((${USBMINIDX} + 6))
fi fi
if [ "${2}" = "external" ]; then if [ "${2}" = "external" ]; then
MAXDISKS=$((${MAXDISKS} - ${USBMINIDX})) MAXDISKS=${MAXINTDISKS}
else else
[ $((${USBMAXIDX} + 1)) -gt ${MAXDISKS} ] && MAXDISKS=$((${USBMAXIDX} + 1)) [ $((${USBMAXIDX} + 1)) -gt ${MAXDISKS} ] && MAXDISKS=$((${USBMAXIDX} + 1))
fi fi