SOURCES: anaconda-vserver-proc.patch (NEW) - don't make missing /p...
glen
glen at pld-linux.org
Wed May 17 22:58:40 CEST 2006
Author: glen Date: Wed May 17 20:58:40 2006 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- don't make missing /proc/cmdline fatal; for testing inside vserver
---- Files affected:
SOURCES:
anaconda-vserver-proc.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/anaconda-vserver-proc.patch
diff -u /dev/null SOURCES/anaconda-vserver-proc.patch:1.1
--- /dev/null Wed May 17 22:58:40 2006
+++ SOURCES/anaconda-vserver-proc.patch Wed May 17 22:58:35 2006
@@ -0,0 +1,86 @@
+--- anaconda-11.0.5/constants.py 2006-03-07 18:45:05.000000000 +0200
++++ /usr/lib/anaconda/constants.py 2006-05-17 23:50:54.459319784 +0300
+@@ -21,9 +21,12 @@
+
+ SELINUX_DEFAULT = 1
+
+-cmdline = open("/proc/cmdline", "r").read()
+-if cmdline.find("debug") != -1:
+- DEBUG = 1
++try:
++ cmdline = open("/proc/cmdline", "r").read()
++ if cmdline.find("debug") != -1:
++ DEBUG = 1
++except:
++ pass
+
+ DISPATCH_BACK = -1
+ DISPATCH_FORWARD = 1
+--- anaconda-11.0.5/flags.py 2006-02-09 20:43:41.000000000 +0200
++++ /usr/lib/anaconda/flags.py 2006-05-17 23:54:11.513723977 +0300
+@@ -49,22 +49,25 @@
+ self.__dict__['flags']['virtpconsole'] = None
+
+
+- # determine if selinux is enabled or not
+- f = open("/proc/cmdline", "r")
+- line = f.readline()
+- f.close()
++ try:
++ # determine if selinux is enabled or not
++ f = open("/proc/cmdline", "r")
++ line = f.readline()
++ f.close()
+
+- tokens = line.split()
+- for tok in tokens:
+- if tok == "selinux":
+- self.__dict__['flags']['selinux'] = 1
+- elif tok == "selinux=0":
+- self.__dict__['flags']['selinux'] = 0
+- elif tok == "selinux=1":
+- self.__dict__['flags']['selinux'] = 1
++ tokens = line.split()
++ for tok in tokens:
++ if tok == "selinux":
++ self.__dict__['flags']['selinux'] = 1
++ elif tok == "selinux=0":
++ self.__dict__['flags']['selinux'] = 0
++ elif tok == "selinux=1":
++ self.__dict__['flags']['selinux'] = 1
+
+- if not os.path.exists("/selinux/load"):
+- self.__dict__['flags']['selinux'] = 0
++ if not os.path.exists("/selinux/load"):
++ self.__dict__['flags']['selinux'] = 0
++ except:
++ pass
+
+
+ global flags
+--- anaconda-11.0.5/iutil.py 2006-02-06 23:06:46.000000000 +0200
++++ /usr/lib/anaconda/iutil.py 2006-05-17 23:55:32.015524290 +0300
+@@ -641,13 +641,16 @@
+ myarch = rhpl.arch.canonArch
+
+ # now allow an override with rpmarch=i586 on the command line (#101971)
+- f = open("/proc/cmdline", "r")
+- buf = f.read()
+- f.close()
+- args = buf.split()
+- for arg in args:
+- if arg.startswith("rpmarch="):
+- myarch = arg[8:]
++ try:
++ f = open("/proc/cmdline", "r")
++ buf = f.read()
++ f.close()
++ args = buf.split()
++ for arg in args:
++ if arg.startswith("rpmarch="):
++ myarch = arg[8:]
++ except:
++ pass
+
+ # now make the current install believe it, too
+ rhpl.arch.canonArch = myarch
================================================================
More information about the pld-cvs-commit
mailing list