diff options
| author | Joshua Watt <JPEWhacker@gmail.com> | 2023-03-23 10:37:59 -0500 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-03-25 09:39:28 +0000 |
| commit | 7def843a5544e97fa4f7b885feeb01b1cc269950 (patch) | |
| tree | 37d15d67c2f6a794e9640c98d3fa8e2adf0574fd | |
| parent | 41de1ecadd6f5db9549356d875af1a05f5f0036f (diff) | |
| download | poky-7def843a5544e97fa4f7b885feeb01b1cc269950.tar.gz | |
runqemu: Fix TypeError when command fails
The commands passed to subprocess are tuples which when passed to a %
format are treated as multiple format arguments instead of a single
argument to be coerced by "%s". This results in a TypeError being
raised with python claiming that not all arguments were consumed.
Fix this by wrapping the command tuple in a str() call, as is done for
the logging strings
[YOCTO #15078]
(From OE-Core rev: 3e5d04d9ebbee4e11fb39bf353b6d4c3133e166a)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rwxr-xr-x | scripts/runqemu | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index fee6b25b97..61a7f1820a 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
| @@ -1042,7 +1042,7 @@ to your build configuration. | |||
| 1042 | cmd = ('runqemu-extract-sdk', src, dest) | 1042 | cmd = ('runqemu-extract-sdk', src, dest) |
| 1043 | logger.info('Running %s...' % str(cmd)) | 1043 | logger.info('Running %s...' % str(cmd)) |
| 1044 | if subprocess.call(cmd) != 0: | 1044 | if subprocess.call(cmd) != 0: |
| 1045 | raise RunQemuError('Failed to run %s' % cmd) | 1045 | raise RunQemuError('Failed to run %s' % str(cmd)) |
| 1046 | self.rootfs = dest | 1046 | self.rootfs = dest |
| 1047 | self.cleanup_files.append(self.rootfs) | 1047 | self.cleanup_files.append(self.rootfs) |
| 1048 | self.cleanup_files.append('%s.pseudo_state' % self.rootfs) | 1048 | self.cleanup_files.append('%s.pseudo_state' % self.rootfs) |
| @@ -1051,7 +1051,7 @@ to your build configuration. | |||
| 1051 | cmd = ('runqemu-export-rootfs', 'start', self.rootfs) | 1051 | cmd = ('runqemu-export-rootfs', 'start', self.rootfs) |
| 1052 | logger.info('Running %s...' % str(cmd)) | 1052 | logger.info('Running %s...' % str(cmd)) |
| 1053 | if subprocess.call(cmd) != 0: | 1053 | if subprocess.call(cmd) != 0: |
| 1054 | raise RunQemuError('Failed to run %s' % cmd) | 1054 | raise RunQemuError('Failed to run %s' % str(cmd)) |
| 1055 | 1055 | ||
| 1056 | self.nfs_running = True | 1056 | self.nfs_running = True |
| 1057 | 1057 | ||
| @@ -1060,7 +1060,7 @@ to your build configuration. | |||
| 1060 | if cmd != '': | 1060 | if cmd != '': |
| 1061 | logger.info('Running setup command %s' % str(cmd)) | 1061 | logger.info('Running setup command %s' % str(cmd)) |
| 1062 | if subprocess.call(cmd, shell=True) != 0: | 1062 | if subprocess.call(cmd, shell=True) != 0: |
| 1063 | raise RunQemuError('Failed to run %s' % cmd) | 1063 | raise RunQemuError('Failed to run %s' % str(cmd)) |
| 1064 | 1064 | ||
| 1065 | def setup_net_bridge(self): | 1065 | def setup_net_bridge(self): |
| 1066 | self.set('NETWORK_CMD', '-netdev bridge,br=%s,id=net0,helper=%s -device virtio-net-pci,netdev=net0 ' % ( | 1066 | self.set('NETWORK_CMD', '-netdev bridge,br=%s,id=net0,helper=%s -device virtio-net-pci,netdev=net0 ' % ( |
| @@ -1554,7 +1554,7 @@ to your build configuration. | |||
| 1554 | if cmd != '': | 1554 | if cmd != '': |
| 1555 | logger.info('Running cleanup command %s' % str(cmd)) | 1555 | logger.info('Running cleanup command %s' % str(cmd)) |
| 1556 | if subprocess.call(cmd, shell=True) != 0: | 1556 | if subprocess.call(cmd, shell=True) != 0: |
| 1557 | raise RunQemuError('Failed to run %s' % cmd) | 1557 | raise RunQemuError('Failed to run %s' % str(cmd)) |
| 1558 | 1558 | ||
| 1559 | def cleanup(self): | 1559 | def cleanup(self): |
| 1560 | if self.cleaned: | 1560 | if self.cleaned: |
| @@ -1663,7 +1663,7 @@ to your build configuration. | |||
| 1663 | return result | 1663 | return result |
| 1664 | raise RunQemuError("Native sysroot directory %s doesn't exist" % result) | 1664 | raise RunQemuError("Native sysroot directory %s doesn't exist" % result) |
| 1665 | else: | 1665 | else: |
| 1666 | raise RunQemuError("Can't find STAGING_BINDIR_NATIVE in '%s' output" % cmd) | 1666 | raise RunQemuError("Can't find STAGING_BINDIR_NATIVE in '%s' output" % str(cmd)) |
| 1667 | 1667 | ||
| 1668 | 1668 | ||
| 1669 | def main(): | 1669 | def main(): |
