24 Commits
Author SHA1 Message Date
kevinveenbirkenbach 8094d41e56 Release version 1.0.1 2026-10-23 10:40:37 +02:00
kevinveenbirkenbachandClaude Opus 5.5 91e1eff8a6 fix(btrfs): allocate the swapfile with fallocate instead of dd
On a btrfs root the swapfile was written with dd from /dev/zero, so a
swapfile the size of the RAM cost tens of GiB of writes and stalled
every other writer on the filesystem. A caller that bounds the run, such
as an async Ansible task, killed dd halfway, and the next run found the
wrong size and started over. btrfs accepts a preallocated NOCOW
swapfile and the swap directory already carries +C, so every filesystem
now allocates with fallocate.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-23 10:36:04 +02:00
kevinveenbirkenbach 43cdce5fba Merge branch 'main' of github.com:kevinveenbirkenbach/swap-forge 2026-10-23 10:15:39 +02:00
kevinveenbirkenbach 1f757a1570 Release version 1.0.0 2026-08-14 14:28:33 +02:00
kevinveenbirkenbachandClaude Opus 5 02760e5864 feat: package as pip-installable distribution
Turns the loose main.py into the 'swap-forge' distribution with a src layout, shipping both the swap-forge and the older swafo command.

A failing swap command no longer produces a traceback: CalledProcessError is caught and reported as "'mkswap' failed with exit code 1" at exit 1, a missing binary as exit 127. Required binaries are declared per filesystem path so an ext4 host is never asked for btrfs tooling.

The fstab entry is still written last, after swapon, so a failed activation leaves /etc/fstab untouched. The e2e suite proves that byte for byte across a create, a same-size rerun and a resize cycle, with real fallocate, chmod and file sizes.

Adds unit, integration and container-based e2e tests, ruff and markdown/mermaid linting, CodeQL and Dependabot, and pins the core metadata to 2.4 so twine accepts the artifacts.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 14:28:08 +02:00
kevinveenbirkenbach e1eef73ae7 lint 2026-07-16 11:21:01 +02:00
kevinveenbirkenbach 6bd568e873 Merge branch 'main' of github.com:kevinveenbirkenbach/swap-forge 2026-05-12 21:27:26 +02:00
kevinveenbirkenbach 09b63505af Made executable 2026-05-12 21:27:20 +02:00
kevinveenbirkenbach fca1249033 Changed execution rights for main.py 2026-01-16 10:50:56 +01:00
kevinveenbirkenbach 8a41ce8e25 Replace Bash swapfile script with Python implementation using argparse
- Added btrfs-safe handling (/var/swap/swapfile)
- Automatically recreates swapfile if size differs
- Removed legacy main.sh
Conversation: https://chatgpt.com/share/68d2c38b-84dc-800f-9ca4-dffa158c8e80
2025-09-23 17:58:25 +02:00
kevinveenbirkenbach e8c511d294 Added Funding 2025-03-12 20:52:47 +01:00
kevinveenbirkenbach 96a1dc58ae Merge branch 'main' of github.com:kevinveenbirkenbach/swap-forge 2025-03-12 11:14:39 +01:00
kevinveenbirkenbach b633d908cb Update README.md 2025-03-12 10:49:37 +01:00
kevinveenbirkenbach 0af1e6ea42 Update README.md 2025-03-04 20:59:22 +01:00
kevinveenbirkenbach 71e34a32c7 Update README.md 2025-03-04 20:59:03 +01:00
kevinveenbirkenbach 10dee63d57 Update README.md 2025-03-04 20:58:29 +01:00
kevinveenbirkenbach 7c05c59cc5 Delete LICENSE 2025-03-04 20:58:09 +01:00
kevinveenbirkenbach 181bed3df7 Update README.md 2025-03-04 20:56:32 +01:00
kevinveenbirkenbach 0a363d227d Rename create-linux-swapfile.sh to main.sh 2025-03-04 20:56:00 +01:00
kevinveenbirkenbach d68cc2c18e Update create-linux-swapfile.sh
Added size parameter
2022-08-18 18:00:44 +02:00
kevinveenbirkenbach 2133eaa94d Rename create-linux-swap-file.sh to create-linux-swapfile.sh 2022-08-18 17:32:52 +02:00
kevinveenbirkenbach 90fd46ccb2 Update README.md 2022-08-18 17:32:26 +02:00
kevinveenbirkenbach 2e2c4b4711 Create create-linux-swap-file.sh 2022-08-18 17:31:26 +02:00
kevinveenbirkenbach 5f9b70ea6a Initial commit 2022-08-18 17:30:19 +02:00