diff options
author | Erik Troan <ewt@redhat.com> | 1999-04-25 22:33:07 +0000 |
---|---|---|
committer | Erik Troan <ewt@redhat.com> | 1999-04-25 22:33:07 +0000 |
commit | 034d2960a3f8a33071f8f810f48ec88e10920452 (patch) | |
tree | 27cfd11c08b94feebc88ab01c694e1fc0684bf63 /anaconda | |
parent | 2ac2d7aa20b1b78f4a97a5a28ca186c0782af331 (diff) | |
download | anaconda-034d2960a3f8a33071f8f810f48ec88e10920452.tar.gz anaconda-034d2960a3f8a33071f8f810f48ec88e10920452.tar.xz anaconda-034d2960a3f8a33071f8f810f48ec88e10920452.zip |
start up fbcon for graphics mode, if possible
Diffstat (limited to 'anaconda')
-rwxr-xr-x | anaconda | 25 |
1 files changed, 23 insertions, 2 deletions
@@ -2,10 +2,11 @@ import sys, getopt, os -(args, extra) = getopt.getopt(sys.argv[1:], 'gTt', [ 'gui', 'text', 'test' ]) +(args, extra) = getopt.getopt(sys.argv[1:], 'gTt', [ 'gui', 'text', 'test', 'force' ]) mode = None test = 0 +force = 0 for n in args: (str, arg) = n @@ -15,13 +16,33 @@ for n in args: mode = 't' elif (str == '-t' or str == '--test'): test = 1 + elif (str == '--force'): + force = 1 -if (not test and os.getpid() > 10): +if (not test and os.getpid() > 10 and not force): print "you're running me on a live system! that's incredibly stupid." sys.exit(1) if (test): sys.path.append('balkan') +elif (mode == None): + try: + f = open('/dev/fb0', 'r') + f.close() + mode = 'g' + except: + mode = 't' + +if (mode == 'g' and not os.environ.has_key('DISPLAY')): + os.environ['DISPLAY'] = ':0' + server = os.fork() + if (not server): + os.execv('/usr/X11R6/bin/XF86_FBDev', ['/usr/X11R6/bin/XF86_FBDev']) + child = os.fork() + if (child): + os.waitpid(child, 0) + os.kill(server, 15) + sys.exit(0) if (mode == 'g'): import gui |