Fix fdisk detection on BusyBox systems (#3614)
Some checks are pending
Ventoy CI / build (push) Waiting to run
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Waiting to run

On BusyBox, fdisk -v exists but returns a non-zero exit code,
causing the script to incorrectly conclude fdisk is not available.
Use POSIX command -v instead to reliably check for fdisk.
This commit is contained in:
Tiago Augusto Pimenta
2026-07-24 10:26:25 +00:00
committed by GitHub
parent ddc8e53156
commit 40895a09f6

View File

@@ -186,7 +186,7 @@ if [ "$MODE" = "install" -a -z "$NONDESTRUCTIVE" ]; then
else else
if parted -v > /dev/null 2>&1; then if parted -v > /dev/null 2>&1; then
PARTTOOL='parted' PARTTOOL='parted'
elif fdisk -v >/dev/null 2>&1; then elif command -v fdisk > /dev/null 2>&1; then
PARTTOOL='fdisk' PARTTOOL='fdisk'
else else
vterr "Both parted and fdisk are not found in the system, Ventoy can't create new partitions." vterr "Both parted and fdisk are not found in the system, Ventoy can't create new partitions."