Skip to content

Commit 2510a6e

Browse files
committed
qemu: Add support for G5 with compat userspace
Make the compat userspace support generic and add a G5 wrapper script to invoke it.
1 parent af1f6fa commit 2510a6e

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

lib/qemu.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def __init__(self, machine):
2727
self.interactive = False
2828
self.drive = None
2929
self.initrd = None
30+
self.compat_rootfs = False
3031
self.shutdown = None
3132
self.extra_args = []
3233
self.qemu_path = None
@@ -45,6 +46,7 @@ def configure_from_env(self):
4546
self.mem = get_env_var('QEMU_MEM_SIZE', self.mem)
4647
self.cloud_image = get_env_var('CLOUD_IMAGE', self.cloud_image)
4748
self.host_mount = get_env_var('QEMU_HOST_MOUNT', self.host_mount)
49+
self.compat_rootfs = get_env_var('COMPAT_USERSPACE', self.compat_rootfs)
4850
self.cmdline += get_env_var('LINUX_CMDLINE', '') + ' '
4951
self.pexpect_timeout = int(get_env_var('QEMU_PEXPECT_TIMEOUT', self.pexpect_timeout))
5052
self.logpath = get_env_var('QEMU_CONSOLE_LOG', self.logpath)
@@ -131,7 +133,7 @@ def apply_defaults(self):
131133
self.prompt = '\[root@fedora ~\]#'
132134

133135
if self.initrd is None and self.drive is None and self.cloud_image is None:
134-
if self.qemu_path.endswith('qemu-system-ppc'):
136+
if self.compat_rootfs or self.qemu_path.endswith('qemu-system-ppc'):
135137
subarch = 'ppc'
136138
elif get_endian(self.vmlinux) == 'little':
137139
subarch = 'ppc64le'

scripts/boot/qemu-g5+compat

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
export COMPAT_USERSPACE=1
4+
5+
exec "$(dirname "$0")"/qemu-g5 $@

scripts/boot/qemu-ppc64e

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ def main():
4444
qconf.smp = 1
4545
qconf.cpu = 'e5500'
4646

47-
if os.environ.get('COMPAT_USERSPACE', False):
48-
qconf.initrd = 'ppc-rootfs.cpio.gz'
49-
5047
qconf.apply_defaults()
5148

5249
return qemu_main(qconf)

0 commit comments

Comments
 (0)