diff options
-rw-r--r-- | meta/classes/qemuboot.bbclass | 2 | ||||
-rwxr-xr-x | scripts/runqemu | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/meta/classes/qemuboot.bbclass b/meta/classes/qemuboot.bbclass index bf529e9aa4..8cdb544a94 100644 --- a/meta/classes/qemuboot.bbclass +++ b/meta/classes/qemuboot.bbclass | |||
@@ -36,6 +36,8 @@ | |||
36 | # in system mode, where system is experiencing entropy starvation | 36 | # in system mode, where system is experiencing entropy starvation |
37 | # | 37 | # |
38 | # QB_KERNEL_ROOT: kernel's root, e.g., /dev/vda | 38 | # QB_KERNEL_ROOT: kernel's root, e.g., /dev/vda |
39 | # By default "/dev/vda rw" gets passed to the kernel. | ||
40 | # To mount the rootfs read-only QB_KERNEL_ROOT can be set to e.g. "/dev/vda ro". | ||
39 | # | 41 | # |
40 | # QB_NETWORK_DEVICE: network device, e.g., "-device virtio-net-pci,netdev=net0,mac=@MAC@", | 42 | # QB_NETWORK_DEVICE: network device, e.g., "-device virtio-net-pci,netdev=net0,mac=@MAC@", |
41 | # it needs work with QB_TAP_OPT and QB_SLIRP_OPT. | 43 | # it needs work with QB_TAP_OPT and QB_SLIRP_OPT. |
diff --git a/scripts/runqemu b/scripts/runqemu index d4f0888f8d..efb98ab9e0 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
@@ -1266,7 +1266,13 @@ class BaseConfig(object): | |||
1266 | self.rootfs_options = vm_drive | 1266 | self.rootfs_options = vm_drive |
1267 | if not self.fstype in self.vmtypes: | 1267 | if not self.fstype in self.vmtypes: |
1268 | self.rootfs_options += ' -no-reboot' | 1268 | self.rootfs_options += ' -no-reboot' |
1269 | self.kernel_cmdline = 'root=%s rw' % (self.get('QB_KERNEL_ROOT')) | 1269 | |
1270 | # By default, ' rw' is appended to QB_KERNEL_ROOT unless either ro or rw is explicitly passed. | ||
1271 | qb_kernel_root = self.get('QB_KERNEL_ROOT') | ||
1272 | qb_kernel_root_l = qb_kernel_root.split() | ||
1273 | if not ('ro' in qb_kernel_root_l or 'rw' in qb_kernel_root_l): | ||
1274 | qb_kernel_root += ' rw' | ||
1275 | self.kernel_cmdline = 'root=%s' % qb_kernel_root | ||
1270 | 1276 | ||
1271 | if self.fstype == 'nfs': | 1277 | if self.fstype == 'nfs': |
1272 | self.rootfs_options = '' | 1278 | self.rootfs_options = '' |