Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snap building fails: swapon: /tmp/swap: swapon failed: Operation not permitted #3143

Open
xypron opened this issue Feb 11, 2025 · 1 comment

Comments

@xypron
Copy link

xypron commented Feb 11, 2025

I tried to build the snap from source on Ubuntu 25.04 riscv64 and saw this error:

+ mkswap /tmp/swap
mkswap: /tmp/swap: insecure permissions 0644, 0600 suggested.
Setting up swapspace version 1, size = 2 GiB (2097147904 bytes)
no label, UUID=aeb5e8db-442f-4b92-be51-2c6d9ed2bdf0
+ swapon /tmp/swap
swapon: /tmp/swap: insecure permissions 0644, 0600 suggested.
swapon: /tmp/swap: swapon failed: Operation not permitted
Failed to run 'override-build': Exit code was 255.
@xypron
Copy link
Author

xypron commented Feb 11, 2025

/tmp may reside in memory mounted as tmpfs. So putting swap into /tmp isn't a good choice. We should put it into /root.

Instead of using dd use truncate -s to create the file. So if swap is not used, nothing is written to disk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant