summaryrefslogtreecommitdiffstats
path: root/command-stubs/rescue-startx-stub
blob: 0403ba14bfa9a62e626bf8e39ea8df7e62966ba3 (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/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")