This commit is contained in:
Marc Beninca 2024-11-12 20:13:32 +01:00
parent dfe3be4f1c
commit 3b2df8f8a0
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -17,3 +17,24 @@ fs_make_fat() {
mkfs.fat "${@}" "${device}"
fi
}
fs_wipe() {
local device="${1}"
local buffer="${2}"
local count="${3}"
if [ -b "${device}" ]; then
set -- \
status="progress" \
if="/dev/zero" \
of="${device}"
if [ -n "${buffer}" ]; then
set -- "${@}" \
bs="${buffer}"
fi
if [ -n "${count}" ]; then
set -- "${@}" \
count=${count}
fi
dd "${@}"
fi
}