home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2000 July / CD 3 / redhat-6.2.iso / RedHat / instimage / usr / lib / anaconda / pcmcia.py < prev    next >
Encoding:
Python Source  |  2000-03-08  |  643 b   |  34 lines

  1. #!/usr/bin/python
  2.  
  3. import iutil, string
  4.  
  5. def pcicType(test = 0):
  6.     if (test):
  7.     loc = "/sbin/probe"
  8.     else:
  9.     loc = "/usr/sbin/probe"
  10.  
  11.     result = iutil.execWithCapture(loc, [ loc ])
  12.  
  13.     if (string.find(result, "TCIC-2 probe: not found") != -1):
  14.     return None
  15.     elif (string.find(result, "TCIC-2") != -1):
  16.     return "tcic"
  17.  
  18.     return "i82365"
  19.  
  20. def createPcmciaConfig(path, test = 0):
  21.     f = open(path, "w")
  22.     pcic = pcicType(test = test)
  23.     if (pcic):
  24.     f.write("PCMCIA=yes\n")
  25.     f.write("PCIC=%s\n" % (pcic,))
  26.     else:
  27.     f.write("PCMCIA=no\n")
  28.     f.write("PCIC=\n")
  29.  
  30.     f.write("PCIC_OPTS=\n")
  31.     f.write("CORE_OPTS=\n")
  32.  
  33.     f.close()
  34.