diff options
Diffstat (limited to 'poky/scripts/runqemu')
| -rwxr-xr-x | poky/scripts/runqemu | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/poky/scripts/runqemu b/poky/scripts/runqemu index 69cd44864e..14eb939b3e 100755 --- a/poky/scripts/runqemu +++ b/poky/scripts/runqemu @@ -1192,19 +1192,22 @@ to your build configuration. raise RunQemuError("a new one with sudo.") gid = os.getgid() - uid = os.getuid() logger.info("Setting up tap interface under sudo") cmd = ('sudo', self.qemuifup, str(gid)) - try: - tap = subprocess.check_output(cmd).decode('utf-8').strip() - except subprocess.CalledProcessError as e: - logger.error('Setting up tap device failed:\n%s\nRun runqemu-gen-tapdevs to manually create one.' % str(e)) - sys.exit(1) - lockfile = os.path.join(lockdir, tap) - self.taplock = lockfile + '.lock' - self.acquire_taplock() - self.cleantap = True - logger.debug('Created tap: %s' % tap) + for _ in range(5): + try: + tap = subprocess.check_output(cmd).decode('utf-8').strip() + except subprocess.CalledProcessError as e: + logger.error('Setting up tap device failed:\n%s\nRun runqemu-gen-tapdevs to manually create one.' % str(e)) + sys.exit(1) + lockfile = os.path.join(lockdir, tap) + self.taplock = lockfile + '.lock' + if self.acquire_taplock(): + self.cleantap = True + logger.debug('Created tap: %s' % tap) + break + else: + tap = None if not tap: logger.error("Failed to setup tap device. Run runqemu-gen-tapdevs to manually create.") @@ -1295,6 +1298,10 @@ to your build configuration. elif drive_type.startswith("/dev/hd"): logger.info('Using ide drive') vm_drive = "-drive file=%s,format=%s" % (self.rootfs, rootfs_format) + elif drive_type.startswith("/dev/mmcblk"): + logger.info('Using sdcard drive') + vm_drive = '-drive id=sdcard0,if=none,file=%s,format=%s -device sdhci-pci -device sd-card,drive=sdcard0' \ + % (self.rootfs, rootfs_format) elif drive_type.startswith("/dev/vdb"): logger.info('Using block virtio drive'); vm_drive = '-drive id=disk0,file=%s,if=none,format=%s -device virtio-blk-device,drive=disk0%s' \ @@ -1483,7 +1490,7 @@ to your build configuration. # If no serial or serialtcp options were specified, only ttyS0 is created # and sysvinit shows an error trying to enable ttyS1: # INIT: Id "S1" respawning too fast: disabled for 5 minutes - serial_num = len(re.findall("-serial", self.qemu_opt)) + serial_num = len(re.findall("(^| )-serial ", self.qemu_opt)) # Assume if the user passed serial options, they know what they want # and pad to two devices @@ -1503,7 +1510,7 @@ to your build configuration. self.qemu_opt += " %s" % self.get("QB_SERIAL_OPT") - serial_num = len(re.findall("-serial", self.qemu_opt)) + serial_num = len(re.findall("(^| )-serial ", self.qemu_opt)) if serial_num < 2: self.qemu_opt += " -serial null" |
