fs_make_btrfs

This commit is contained in:
Marc Beninca 2024-11-12 22:38:38 +01:00
parent 378e0e530f
commit fdffd7fb08
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -1,3 +1,23 @@
fs_make_btrfs() {
local device="${1}"
local label="${2}"
local uuid="${3}"
if [ -b "${device}" ]; then
set -- \
--force \
--checksum "sha256"
if [ -n "${label}" ]; then
set -- "${@}" \
--label "${label}"
fi
if [ -n "${uuid}" ]; then
set -- "${@}" \
--uuid "${uuid}"
fi
mkfs.btrfs "${@}" "${device}"
fi
}
fs_make_fat() {
local device="${1}"
local name="${2}"