fs_make_btrfs_swap

This commit is contained in:
Marc Beninca 2024-11-12 22:52:21 +01:00
parent 7611ee6103
commit 4590c5cda6
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -18,6 +18,24 @@ fs_make_btrfs() {
fi fi
} }
fs_make_btrfs_swap() {
local path="${1}"
local size="${2}"
local uuid="${3}"
if [ -n "${path}" ]; then
set filesystem mkswapfile
if [ -n "${size}" ]; then
set -- "${@}" \
--size "${size}"
fi
if [ -n "${uuid}" ]; then
set -- "${@}" \
--uuid "${uuid}"
fi
btrfs "${@}" "${path}"
fi
}
fs_make_fat() { fs_make_fat() {
local device="${1}" local device="${1}"
local name="${2}" local name="${2}"