diff --git a/bash/fs.sh b/bash/fs.sh index e13a498..71db3a7 100644 --- a/bash/fs.sh +++ b/bash/fs.sh @@ -18,6 +18,24 @@ fs_make_btrfs() { 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() { local device="${1}" local name="${2}"