hst: conditionally skip root remount

This enables the writable root overlay use case.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-04-05 14:00:52 +09:00
parent d58f5c7590
commit 33a0e6c01b
4 changed files with 25 additions and 4 deletions

View File

@@ -290,7 +290,9 @@ func (s *spFilesystemOp) toContainer(state *outcomeStateParams) error {
if state.Container.Flags&hst.FDevice == 0 {
state.params.Remount(fhs.AbsDev, syscall.MS_RDONLY)
}
state.params.Remount(fhs.AbsRoot, syscall.MS_RDONLY)
if !state.as.NoRemountRoot {
state.params.Remount(fhs.AbsRoot, syscall.MS_RDONLY)
}
state.params.Env = make([]string, 0, len(state.env))
for key, value := range state.env {