don't crash with multiple = per option in /proc/cmdline
[grml-x.git] / grml-x
diff --git a/grml-x b/grml-x
index 995b4c4..5e325e1 100755 (executable)
--- a/grml-x
+++ b/grml-x
@@ -24,6 +24,8 @@ class Section(object):
             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:
@@ -70,7 +72,7 @@ def build_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
@@ -142,7 +144,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)