Fix fdisk detection on BusyBox systems (#3614)
Some checks failed
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled

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
if parted -v > /dev/null 2>&1; then
PARTTOOL='parted'
elif fdisk -v >/dev/null 2>&1; then
elif command -v fdisk > /dev/null 2>&1; then
PARTTOOL='fdisk'
else
vterr "Both parted and fdisk are not found in the system, Ventoy can't create new partitions."