Skip to content

Add usroverlay --readonly#2046

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

Add usroverlay --readonly#2046
evan-goode wants to merge 4 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>
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
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

1 participant