Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,12 @@ setup_overlay_root() {
if [ "${OPENSHELL_VM_INIT_MODE:-sandbox}" = "image-prep" ]; then
prepare_guest_image_rootfs
sync
if mount -o remount,ro /overlay 2>/dev/null; then
:
else
umount /overlay
fi
sync
ts "image-prep complete"
exit 0
fi
Expand All @@ -252,7 +258,7 @@ setup_overlay_root() {

local lower_root="/lower"
if [ -b /dev/vdc ]; then
mount -t ext4 -o ro /dev/vdc /image-cache
mount -t ext4 -o ro,noload /dev/vdc /image-cache
if [ -d /image-cache/image-rootfs ]; then
lower_root="/image-cache/image-rootfs"
ts "using prepared image rootfs lowerdir"
Expand Down
7 changes: 6 additions & 1 deletion crates/openshell-driver-vm/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,12 @@ impl VmContext {
self.ctx_id,
image_block_id_c.as_ptr(),
image_disk_c.as_ptr(),
true,
// Attach as writable at the hypervisor level so the
// kernel can replay the ext4 journal if the image-prep
// VM did not unmount cleanly. The guest still mounts
// the filesystem with -o ro, so guest processes cannot
// write to it. See: openshell-vm-sandbox-init.sh
false,
)
},
"krun_add_disk",
Expand Down
Loading