summaryrefslogtreecommitdiffstats
path: root/command-stubs/rescue-startx-stub
blob: 808bce166568d6a78b171e3095bd9f350a393aa4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/python
#
#
# Stub to start X in rescue mode with twm and an xterm
#

import os, sys
import rhpl.xserver as xserver
import rhpl.keyboard as keyboard

# see if its even possible
if not os.access("/mnt/sysimage/usr/X11R6/bin/xterm", os.X_OK) or not os.access("/mnt/sysimage/usr/X11R6/bin/twm", os.X_OK):
    print "Must have mounted an existing installation in rescue mode to work."
    sys.exit(0)

if len(sys.argv) > 1:
    mode = sys.argv[1]
else:
    mode = '800x600'

xserver.probeHWandStartXServer(mode)
os.system("xterm&")
os.system("twm")