Skip to content
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

virtme-ng: export real /tmp to guest #114

Merged
merged 1 commit into from
May 24, 2024
Merged
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
5 changes: 0 additions & 5 deletions virtme/commands/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,6 @@ def find_kernel_and_mods(arch, args) -> Kernel:
# the modules, just rely on /lib/modules in the target rootfs.
if root_dir == "/" or args.root != '/':
kernel.use_root_mods = True
elif root_dir.startswith("/tmp"):
sys.stderr.write(
"\nWarning: /tmp is hidden inside the guest, "
+ "kernel modules won't be supported at runtime unless you move them somewhere else.\n\n"
)
kernel.moddir = f"{root_dir}/lib/modules/{kver}"
if not os.path.exists(kernel.moddir):
kernel.modfiles = []
Expand Down
5 changes: 2 additions & 3 deletions virtme/guest/virtme-init
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@ mount -t proc -o nosuid,noexec,nodev proc /proc/
mount -t sysfs -o nosuid,noexec,nodev sys /sys/

# Mount tmpfs dirs
mount -t tmpfs tmpfs /tmp/
mount -t tmpfs run /run/

# Setup rw filesystem overlays
for tag in "${!virtme_rw_overlay@}"; do
dir="${!tag}"
upperdir="/tmp/$tag/upper"
workdir="/tmp/$tag/work"
upperdir="/run/tmp/$tag/upper"
workdir="/run/tmp/$tag/work"
mkdir -p "$upperdir" "$workdir"
mnt_opts="xino=off,lowerdir=$dir,upperdir=$upperdir,workdir=$workdir"
mount -t overlay -o "${mnt_opts}" "${tag}" "${dir}" &
Expand Down
2 changes: 1 addition & 1 deletion virtme_ng/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ def _get_virtme_overlay_rwdir(self, args):
else:
self.virtme_param["overlay_rwdir"] = " ".join(
f"--overlay-rwdir {d}"
for d in ("/etc", "/lib", "/home", "/opt", "/srv", "/usr", "/var")
for d in ("/etc", "/lib", "/home", "/opt", "/srv", "/usr", "/var", "/tmp")
)
# Add user-specified overlays.
for item in args.overlay_rwdir:
Expand Down
Loading