-
Notifications
You must be signed in to change notification settings - Fork 154
initramfs: Mount /sysroot readonly for composefs by default #1769
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
Conversation
There was a problem hiding this 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 introduces readonly mounting for /sysroot in composefs systems, aligning its behavior with ostree systems. This is a good improvement for consistency and enables previously skipped readonly tests. The implementation correctly uses a libc::syscall wrapper for mount_setattr as it's not yet available in rustix. My review includes suggestions for refactoring to reduce code duplication and for consistency in using constants from dependencies. I also found a minor redundancy in one of the test scripts.
8ad41da to
00e3739
Compare
|
We would need to update this for |
We should now be consistently remounting |
Yep! This is covered by c0b9cde |
00e3739 to
e4acafd
Compare
|
Hmm... I still get a |
|
We don't really remount |
This implements readonly mounting of /sysroot for composefs systems, matching the behavior that ostree systems already have. Previously, composefs left /sysroot mounted read-write, which was inconsistent and meant the readonly tests had to be skipped for composefs. The implementation uses a direct `libc::syscall` wrapper for `mount_setattr` since rustix doesn't yet provide this API. The `MOUNT_ATTR_RDONLY` flag is applied to three mount points during initramfs setup: - The composefs rootfs image mount (becomes `/` after switch-root) - The test root filesystem mount (used in testing scenarios) - The sysroot clone mount (becomes `/sysroot` in the booted system) With this change, the readonly /sysroot tests in test-status.nu now run for both ostree and composefs systems without conditional checks. Assisted-by: Claude Code (Sonnet 4.5) Co-authored-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com> Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com> Signed-off-by: Colin Walters <walters@verbum.org>
6e1e11f to
5248715
Compare
This implements readonly mounting of /sysroot for composefs systems, matching the behavior that ostree systems already have. Previously, composefs left /sysroot mounted read-write, which was inconsistent and meant the readonly tests had to be skipped for composefs.
The implementation uses a direct
libc::syscallwrapper formount_setattrsince rustix doesn't yet provide this API. TheMOUNT_ATTR_RDONLYflag is applied recursively to three mount points during initramfs setup:/after switch-root)/sysrootin the booted system)With this change, the readonly /sysroot tests in test-status.nu now run for both ostree and composefs systems without conditional checks.
Assisted-by: Claude Code (Sonnet 4.5)