Skip to content

Commit

Permalink
fix: Disable btrfs compression to make swapon work (#944)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenx-dust committed May 12, 2024
1 parent d85f7a2 commit 70a0589
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rootfs/usr/bin/mkswapfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ usage() { echo >&2 "Usage: $(basename $0) FILE SIZE"; exit 1; }

[ -e "$SWAPFILE" ] && fail "File '$SWAPFILE' already exists"

touch "$SWAPFILE"
chattr +C "$SWAPFILE"
btrfs property set "$SWAPFILE" compression none
dd if=/dev/zero of="$SWAPFILE" bs=1M count="$SWAPSIZE"
chmod 600 "$SWAPFILE"
mkswap "$SWAPFILE"

0 comments on commit 70a0589

Please sign in to comment.