diff options
| -rwxr-xr-x | scripts/runqemu | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index 054037312b..ec6188ba4a 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
| @@ -118,39 +118,6 @@ def check_tun(): | |||
| 118 | if not os.access(dev_tun, os.W_OK): | 118 | if not os.access(dev_tun, os.W_OK): |
| 119 | raise RunQemuError("TUN control device %s is not writable, please fix (e.g. sudo chmod 666 %s)" % (dev_tun, dev_tun)) | 119 | raise RunQemuError("TUN control device %s is not writable, please fix (e.g. sudo chmod 666 %s)" % (dev_tun, dev_tun)) |
| 120 | 120 | ||
| 121 | def check_libgl(qemu_bin): | ||
| 122 | cmd = ('ldd', qemu_bin) | ||
| 123 | logger.debug('Running %s...' % str(cmd)) | ||
| 124 | need_gl = subprocess.check_output(cmd).decode('utf-8') | ||
| 125 | if re.search('libGLU', need_gl): | ||
| 126 | # We can't run without a libGL.so | ||
| 127 | libgl = False | ||
| 128 | check_files = (('/usr/lib/libGL.so', '/usr/lib/libGLU.so'), \ | ||
| 129 | ('/usr/lib64/libGL.so', '/usr/lib64/libGLU.so'), \ | ||
| 130 | ('/usr/lib/*-linux-gnu/libGL.so', '/usr/lib/*-linux-gnu/libGLU.so')) | ||
| 131 | |||
| 132 | for (f1, f2) in check_files: | ||
| 133 | if re.search('\*', f1): | ||
| 134 | for g1 in glob.glob(f1): | ||
| 135 | if libgl: | ||
| 136 | break | ||
| 137 | if os.path.exists(g1): | ||
| 138 | for g2 in glob.glob(f2): | ||
| 139 | if os.path.exists(g2): | ||
| 140 | libgl = True | ||
| 141 | break | ||
| 142 | if libgl: | ||
| 143 | break | ||
| 144 | else: | ||
| 145 | if os.path.exists(f1) and os.path.exists(f2): | ||
| 146 | libgl = True | ||
| 147 | break | ||
| 148 | if not libgl: | ||
| 149 | logger.error("You need libGL.so and libGLU.so to exist in your library path to run the QEMU emulator.") | ||
| 150 | logger.error("Ubuntu package names are: libgl1-mesa-dev and libglu1-mesa-dev.") | ||
| 151 | logger.error("Fedora package names are: mesa-libGL-devel mesa-libGLU-devel.") | ||
| 152 | raise RunQemuError('%s requires libGLU, but not found' % qemu_bin) | ||
| 153 | |||
| 154 | def get_first_file(cmds): | 121 | def get_first_file(cmds): |
| 155 | """Return first file found in wildcard cmds""" | 122 | """Return first file found in wildcard cmds""" |
| 156 | for cmd in cmds: | 123 | for cmd in cmds: |
| @@ -1194,8 +1161,6 @@ class BaseConfig(object): | |||
| 1194 | if not os.access(qemu_bin, os.X_OK): | 1161 | if not os.access(qemu_bin, os.X_OK): |
| 1195 | raise OEPathError("No QEMU binary '%s' could be found" % qemu_bin) | 1162 | raise OEPathError("No QEMU binary '%s' could be found" % qemu_bin) |
| 1196 | 1163 | ||
| 1197 | check_libgl(qemu_bin) | ||
| 1198 | |||
| 1199 | self.qemu_opt = "%s %s %s %s" % (qemu_bin, self.get('NETWORK_CMD'), self.get('ROOTFS_OPTIONS'), self.get('QB_OPT_APPEND')) | 1164 | self.qemu_opt = "%s %s %s %s" % (qemu_bin, self.get('NETWORK_CMD'), self.get('ROOTFS_OPTIONS'), self.get('QB_OPT_APPEND')) |
| 1200 | 1165 | ||
| 1201 | for ovmf in self.ovmf_bios: | 1166 | for ovmf in self.ovmf_bios: |
