#!/bin/sh

test -f /swap/swapfile && exit 0

set -xe

truncate -s 0 /swap/swapfile

chattr +C /swap/swapfile
btrfs property set /swap/swapfile compression none

dd if=/dev/zero of=/swap/swapfile bs=100M count=200 status=progress

chmod 600 /swap/swapfile
mkswap /swap/swapfile
swapon /swap/swapfile
dotfiles/scripts/_create-swapfile
