Skip to content

Add usroverlay --readonly#2046

Open
evan-goode wants to merge 5 commits intobootc-dev:mainfrom
evan-goode:evan-goode/usr-overlay-readonly
Open

Add usroverlay --readonly#2046
evan-goode wants to merge 5 commits intobootc-dev:mainfrom
evan-goode:evan-goode/usr-overlay-readonly

Conversation

@evan-goode
Copy link
Contributor

Resolves #2034.

@github-actions github-actions bot added the area/documentation Updates to the documentation label Mar 4, 2026
@bootc-bot bootc-bot bot requested a review from gursewak1997 March 4, 2026 23:47
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a --readonly flag to the usroverlay command, allowing the creation of a read-only transient overlay on /usr. The changes are well-implemented across the CLI, the two backends (ostree and composefs), documentation, and tests. The code is clear and the new functionality is tested. I have one minor suggestion to improve code conciseness.

Comment on lines +1417 to +1422
let args = match access_mode {
// In this context, "--transient" means "read-only overlay"
FilesystemOverlayAccessMode::ReadOnly => ["admin", "unlock", "--transient"].as_slice(),

FilesystemOverlayAccessMode::ReadWrite => ["admin", "unlock"].as_slice(),
};
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This match statement can be simplified into an if/else expression to make it more concise.

Suggested change
let args = match access_mode {
// In this context, "--transient" means "read-only overlay"
FilesystemOverlayAccessMode::ReadOnly => ["admin", "unlock", "--transient"].as_slice(),
FilesystemOverlayAccessMode::ReadWrite => ["admin", "unlock"].as_slice(),
};
let args: &[&str] = if access_mode == FilesystemOverlayAccessMode::ReadOnly {
// In this context, "--transient" means "read-only overlay"
&["admin", "unlock", "--transient"]
} else {
&["admin", "unlock"]
};

Signed-off-by: Evan Goode <mail@evangoo.de>
Signed-off-by: Evan Goode <mail@evangoo.de>
@evan-goode evan-goode force-pushed the evan-goode/usr-overlay-readonly branch from 311143c to 331b8b9 Compare March 4, 2026 23:50
@cgwalters cgwalters requested a review from ckyrouac March 5, 2026 20:19

# SYNOPSIS

**bootc usr-overlay** \[*OPTIONS...*\]
Copy link
Collaborator

Choose a reason for hiding this comment

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

just update-generated should resync the new options

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in a separate commit

Signed-off-by: Evan Goode <mail@evangoo.de>
Signed-off-by: Evan Goode <mail@evangoo.de>
Signed-off-by: Evan Goode <mail@evangoo.de>
@evan-goode evan-goode force-pushed the evan-goode/usr-overlay-readonly branch from 331b8b9 to 0b759cb Compare March 5, 2026 21:32
test:
- /tmt/tests/tests/test-34-user-agent

/plan-35-upgrade-preflight-disk-check:
Copy link
Collaborator

Choose a reason for hiding this comment

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

not a huge deal but I think these tmt/* changes belong in the previous commit that adds the test code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Still want me to squash these? Maybe it's better to keep them separate if the latter commit has unrelated changes from update-generated.

discover:
how: fmf
test:
- /tmt/tests/tests/test-35-upgrade-preflight-disk-check
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this might have been a bad rebase? I believe this should point to the new test-usroverlay.nu file from the previous commit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, just tried just update-generated again over f8eef4a and got an identical diff. Maybe update-generated was not run after #2022 or #1995?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah we have #1891 to hopefully gate on update-generated so we don't continue getting into this state where things are out of date. Known problem unfortunately ☹️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/documentation Updates to the documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add bootc usr-overlay --read-only

4 participants