]> git.pld-linux.org Git - packages/anaconda.git/commitdiff
- don't make missing /proc/cmdline fatal; for testing inside vserver
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 17 May 2006 20:58:35 +0000 (20:58 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    anaconda-vserver-proc.patch -> 1.1

anaconda-vserver-proc.patch [new file with mode: 0644]

diff --git a/anaconda-vserver-proc.patch b/anaconda-vserver-proc.patch
new file mode 100644 (file)
index 0000000..feb846a
--- /dev/null
@@ -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            
This page took 0.101761 seconds and 4 git commands to generate.