aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@kernel.org>2015-10-30 16:31:51 -0700
committerAndy Lutomirski <luto@kernel.org>2015-10-30 16:31:51 -0700
commit4a17ea308cd14355dc8ff56f2fb7e4d5fb54d10e (patch)
tree083564ccfdc3f8594cd4260ca2e448e4dba401d2
parentef159e986b900aea49b73889ab12345bc3142c61 (diff)
downloadvirtme-4a17ea308cd14355dc8ff56f2fb7e4d5fb54d10e.tar.gz
run: Add --rw to export and mount the rootfs read-write
This also fixes a silly bug in which the rootfs had a useless "ro" string option. Signed-off-by: Andy Lutomirski <luto@kernel.org>
-rw-r--r--virtme/commands/run.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/virtme/commands/run.py b/virtme/commands/run.py
index 7d269ff..4e73603 100644
--- a/virtme/commands/run.py
+++ b/virtme/commands/run.py
@@ -48,6 +48,8 @@ def make_parser():
g = parser.add_argument_group(title='Common guest options')
g.add_argument('--root', action='store', default='/',
help='Local path to use as guest root')
+ g.add_argument('--rw', action='store_true',
+ help='Give the guest read-write access to its root filesystem')
g.add_argument('--graphics', action='store_true',
help='Show graphical output instead of using a console.')
g.add_argument('--net', action='store_true',
@@ -183,7 +185,7 @@ def main():
kernelargs = []
# Set up virtfs
- export_virtfs(qemu, arch, qemuargs, args.root, '/dev/root')
+ export_virtfs(qemu, arch, qemuargs, args.root, '/dev/root', readonly=(not args.rw))
guest_tools_in_guest, guest_tools_path = \
guest_tools.find_best_guest_tools(args.root)
@@ -385,8 +387,9 @@ def main():
# Sigh.
kernelargs.extend([
'rootfstype=9p',
- 'rootflags=ro,version=9p2000.L,trans=virtio,access=any',
+ 'rootflags=version=9p2000.L,trans=virtio,access=any',
'raid=noautodetect',
+ 'rw' if args.rw else 'ro',
])
initrdpath = None