summaryrefslogtreecommitdiffstats
path: root/pcmcia.py
blob: 3805f95c5d79832e6152d6d45413e5db3b9a6aeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/python

import iutil, string, os

def pcicType(test = 0):
    loc = "/sbin/probe"
    if not os.access(loc, os.X_OK):
	loc = "/usr/sbin/probe"

    result = iutil.execWithCapture(loc, [ loc ])

    if (string.find(result, "TCIC-2 probe: not found") != -1):
	return None
    elif (string.find(result, "TCIC-2") != -1):
	return "tcic"

    return "i82365"

def createPcmciaConfig(path, test = 0):
    f = open(path, "w")
    pcic = pcicType(test = test)
    if (pcic):
	f.write("PCMCIA=yes\n")
	f.write("PCIC=%s\n" % (pcic,))
    else:
	f.write("PCMCIA=no\n")
	f.write("PCIC=\n")

    f.write("PCIC_OPTS=\n")
    f.write("CORE_OPTS=\n")

    f.close()