diff options
Diffstat (limited to 'meta/lib/oeqa/utils/commands.py')
-rw-r--r-- | meta/lib/oeqa/utils/commands.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py index 82c5908e9c..6528a98427 100644 --- a/meta/lib/oeqa/utils/commands.py +++ b/meta/lib/oeqa/utils/commands.py | |||
@@ -218,7 +218,10 @@ def create_temp_layer(templayerdir, templayername, priority=999, recipepathspec= | |||
218 | 218 | ||
219 | 219 | ||
220 | @contextlib.contextmanager | 220 | @contextlib.contextmanager |
221 | def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None): | 221 | def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None): |
222 | """ | ||
223 | launch_cmd means directly run the command, don't need set rootfs or env vars. | ||
224 | """ | ||
222 | 225 | ||
223 | import bb.tinfoil | 226 | import bb.tinfoil |
224 | import bb.build | 227 | import bb.build |
@@ -230,6 +233,12 @@ def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None): | |||
230 | import oeqa.targetcontrol | 233 | import oeqa.targetcontrol |
231 | tinfoil.config_data.setVar("TEST_LOG_DIR", "${WORKDIR}/testimage") | 234 | tinfoil.config_data.setVar("TEST_LOG_DIR", "${WORKDIR}/testimage") |
232 | tinfoil.config_data.setVar("TEST_QEMUBOOT_TIMEOUT", "1000") | 235 | tinfoil.config_data.setVar("TEST_QEMUBOOT_TIMEOUT", "1000") |
236 | # Tell QemuTarget() whether need find rootfs/kernel or not | ||
237 | if launch_cmd: | ||
238 | tinfoil.config_data.setVar("FIND_ROOTFS", '0') | ||
239 | else: | ||
240 | tinfoil.config_data.setVar("FIND_ROOTFS", '1') | ||
241 | |||
233 | recipedata = tinfoil.parse_recipe(pn) | 242 | recipedata = tinfoil.parse_recipe(pn) |
234 | 243 | ||
235 | # The QemuRunner log is saved out, but we need to ensure it is at the right | 244 | # The QemuRunner log is saved out, but we need to ensure it is at the right |
@@ -260,7 +269,7 @@ def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None): | |||
260 | try: | 269 | try: |
261 | qemu.deploy() | 270 | qemu.deploy() |
262 | try: | 271 | try: |
263 | qemu.start(ssh=ssh, runqemuparams=runqemuparams) | 272 | qemu.start(ssh=ssh, runqemuparams=runqemuparams, launch_cmd=launch_cmd) |
264 | except bb.build.FuncFailed: | 273 | except bb.build.FuncFailed: |
265 | raise Exception('Failed to start QEMU - see the logs in %s' % logdir) | 274 | raise Exception('Failed to start QEMU - see the logs in %s' % logdir) |
266 | 275 | ||