-#!/usr/bin/env python
+#!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: set et ts=4:
# 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
v = self.data[k]
if isinstance(v, list):
v = '" "'.join(v)
+ elif not isinstance(v, basestring): # int, others
+ v = str(v)
elif '-' in v: # sync range
pass
else:
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
(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)
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()