Skip to content

feat(config): allow byte-based storage watermark#254

Merged
detsch merged 2 commits into
mainfrom
detsch-bytes-watermark-v2
Jun 22, 2026
Merged

feat(config): allow byte-based storage watermark#254
detsch merged 2 commits into
mainfrom
detsch-bytes-watermark-v2

Conversation

@detsch

@detsch detsch commented Jun 17, 2026

Copy link
Copy Markdown
Member

pacman.storage_watermark only accepted a percentage of total storage, which is a clumsy way to reserve a fixed amount of free space on large data partitions. A bare integer still means a percentage; a value with a size suffix (e.g. "2GiB") now reserves that absolute amount, parsed with go-units and forwarded to composeapp's GetUsageInfo via the new watermark-in-bytes flag.

Assisted-by: Claude Code:claude-opus-4-8


Depends on foundriesio/composeapp#141

@detsch detsch requested a review from mike-sul June 17, 2026 20:13
@detsch detsch force-pushed the detsch-bytes-watermark-v2 branch from f9dc05b to bd16dd3 Compare June 18, 2026 18:33
Comment thread pkg/config/config.go Outdated
@detsch detsch force-pushed the detsch-bytes-watermark-v2 branch 3 times, most recently from 2a60a48 to 365d132 Compare June 19, 2026 21:38
pacman.storage_watermark only accepted a percentage of total storage,
a clumsy way to reserve a fixed amount of free space on large data
partitions. Rather than overloading that key, add a separate
pacman.reserved_storage option that takes an absolute size (e.g.
"2GiB"), parsed with go-units, so the two meanings stay unambiguous.

reserved_storage takes precedence: when both keys are set the
percentage watermark is ignored and a warning is logged. The value is
forwarded to composeapp's GetUsageInfo via the watermark-in-bytes
flag, which is unchanged.

Signed-off-by: Andre Detsch <andre.detsch@foundries.io>
Assisted-by: Claude Code:claude-opus-4-8
@detsch detsch force-pushed the detsch-bytes-watermark-v2 branch from 365d132 to a924b39 Compare June 19, 2026 21:40
@mike-sul

Copy link
Copy Markdown
Collaborator

I would probably extend the doc with info about configuring storage usage, I think a new section (Configure Storage Usage) just after this https://github.com/foundriesio/fioup/blob/main/docs/update-device.md#configure-image-pruning-mode would be OK.

@mike-sul mike-sul left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, probably worth adding a new section into the doc about the storage usage configuration.

fioup gates updates on available storage via pacman.storage_watermark
and pacman.reserved_storage, but neither option was described in the
user-facing update guide. Document both, the binary/decimal byte
suffixes accepted by reserved_storage, and the precedence rule when
both keys are set.

Signed-off-by: Andre Detsch <andre.detsch@foundries.io>
Assisted-by: Claude Code:claude-opus-4-8
@detsch detsch merged commit 90cfa72 into main Jun 22, 2026
10 checks passed
@detsch detsch deleted the detsch-bytes-watermark-v2 branch June 22, 2026 15:32
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

Successfully merging this pull request may close these issues.

2 participants