snap: don't abort on swapon failures

This is needed when building snap on LXD containers.

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
This commit is contained in:
Simon Deziel 2025-06-18 15:01:38 -04:00
parent 310932be8e
commit 34f582c81c
No known key found for this signature in database

View file

@ -47,7 +47,10 @@ parts:
fallocate -l 2G /tmp/swap
chmod 0600 /tmp/swap
mkswap /tmp/swap
swapon /tmp/swap
if ! swapon /tmp/swap; then
echo "Could not enable swap file, continuing anyway"
rm /tmp/swap
fi
cabal update
cabal install -j