X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=grml-x;h=89c853b71ee12be13702d5366751b860f2f6d806;hb=c49d25365ebcb71391432ca77b27e642ae4681d5;hp=9944737e392461e45a9bc53e3383b337a3b971e8;hpb=82e874ef2c1216599f951526527bd27ac9a344e5;p=grml-x.git diff --git a/grml-x b/grml-x index 9944737..89c853b 100755 --- a/grml-x +++ b/grml-x @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/python # -*- coding: utf-8 -*- # vim: set et ts=4: @@ -9,6 +9,8 @@ # License: This file is licensed under the GPL v2. ############################################################################### +# Requires python 2.6 or, possibly, a newer version of python 2.X. + import fileinput, os, subprocess, sys, tempfile, time, traceback from optparse import OptionParser @@ -67,12 +69,12 @@ def build_bootparams(): f = open('/proc/cmdline') lines.append(f.readline()) f.close() - walk_bootparams_path('/cdrom/bootparams') - walk_bootparams_path('/live/image/bootparams') + walk_bootparams_path('/lib/live/mount/medium/bootparams') + walk_bootparams_path('/run/live/medium/bootparams') params = {} for p in ' '.join(lines).split(' '): if '=' in p: - (k,v) = p.split('=', 2) + (k,v) = p.split('=', 1) params[k] = v else: params[p] = True @@ -144,7 +146,7 @@ def main(): (options, args) = parser.parse_args() bootparams = build_bootparams() - if os.getuid() == 0: + if os.getuid() == 0 and options.start_server: print "W: running as root is unsupported and may not work." time.sleep(1) @@ -196,7 +198,7 @@ def main(): f.close() f = open(xinitrc, 'w') for line in lines: - if line.startswith('exec '): line = wm_exec + if line.strip().startswith('exec '): line = wm_exec f.write(line) os.fchmod(f.fileno(), 0750) f.close()