Fix fdisk detection on BusyBox systems (#3614)
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 18:26:25 +08:00
committed by GitHub
parent ddc8e53156
commit 40895a09f6
+1 -1
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."