summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xcommand-stubs/rescue-startx-stub23
1 files changed, 23 insertions, 0 deletions
diff --git a/command-stubs/rescue-startx-stub b/command-stubs/rescue-startx-stub
new file mode 100755
index 000000000..479be99f2
--- /dev/null
+++ b/command-stubs/rescue-startx-stub
@@ -0,0 +1,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("twm&")
+os.system("xterm")