Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
swapon: use a loopback device
Browse files Browse the repository at this point in the history
btrfs does not support swapfile. With a loopback device, we bypass the
limitation.
  • Loading branch information
goneri committed Dec 14, 2021
1 parent 1e0559d commit bed72df
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/test-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ set -euxo pipefail

sudo dd if=/dev/zero of=/swap.img bs=1024 count=1048576
sudo chmod 600 /swap.img
sudo mkswap /swap.img
sudo swapon /swap.img
sudo losetup -f /swap.img
sudo mkswap $(sudo losetup --associated /swap.img|sed 's,:.*,,')
sudo swapon $(sudo losetup --associated /swap.img|sed 's,:.*,,')

# Platforms coverage:
# Fedora 30 : has vagrant-libvirt no compilation needed
Expand Down

0 comments on commit bed72df

Please sign in to comment.