-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathreceipt
74 lines (68 loc) · 2.2 KB
/
receipt
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# SliTaz package receipt.
PACKAGE="hardware-ibm-6272"
VERSION="1.0"
CATEGORY="meta"
GROUP="system"
MAINTAINER="devel@slitaz.org"
LICENSE="BSD"
SHORT_DESC="IBM 300GL 6272/6282 (P75-233 ISA/PCI/USB/ETH desktop) hardware support"
WEB_SITE="http://www.slitaz.org/"
DEPENDS="isapnptools module-cs89x0"
SUGGESTED="module-serial module-lp module-floppy module-ide module-usb-storage module-usblp"
# Post message when installing.
post_install()
{
[ -s $1/etc/init.d/pnp.sh ] || cat > $1/etc/init.d/pnp.sh <<EOT
#!/bin/sh
. /etc/init.d/rc.functions
EOT
chmod +x $1/etc/init.d/pnp.sh
cat >> $1/etc/init.d/pnp.sh <<EOT
dmesg | grep -qs CS8920 &&
echo -n "Switching on cs89x0 isa pnp ethernet card " &&
pnpdump > /etc/isapnp.conf.base
for io in \$(seq 360 -10 250); do for irq in IRQ_CS89X0_LIST; do
awk "BEGIN {s=0} \\
/CONFIGURE CSC6040/ {s=1} { \\
if (s==0) print; \\
else if (/INT 0/) print \\"(INT 0 (IRQ \$irq (MODE +E)))\\"; \\
else if (/IO 0/) print \\"(IO 0 (SIZE 16) (BASE 0x0\$io) (CHECK))\\"; \\
else if (/ACT Y/) { s=0; print \\"(ACT Y)\\"} \\
else print \\
}" < /etc/isapnp.conf.base > /etc/isapnp.conf
grep CSC6040 /etc/isapnp.conf || break 2
if isapnp /etc/isapnp.conf ; then
modprobe cs89x0 io=0x\$io irq=\$irq
break 2
fi
done ; done > /dev/null 2>&1 && rm -f /etc/isapnp.conf.base
status
EOT
grep -q '^# CONFIG_PRINTK is not set' $1/boot/config &&
sed -i '/Switching on/d' $1/etc/init.d/pnp.sh
grep pnp.sh $1/etc/rcS.conf ||
sed -i 's/EARLY_RUN_SCRIPTS="/&pnp.sh /' $1/etc/rcS.conf
list=""
for i in $IRQ_CS89X0_LIST ; do
case " 15 12 11 10 9 7 6 5 4 3 " in
*\ $i\ *) list="$list $i"
esac
done
sed -i "s/ IRQ_CS89X0_LIST/${list:- 15 12 11 10}/" $1/etc/init.d/pnp.sh
sed -i 's/cs89x0[^ "]* //' $1/etc/rcS.conf
sed -i '/rm -f .sbin.*pnp/d' $1/etc/init.d/pnp.sh
[ "$CS89X0_WIPEPNP" = "on" ] &&
echo 'rm -f /sbin/pnpdump /sbin/isapnp /etc/isapnp.conf' >> $1/etc/init.d/pnp.sh
}
config_form()
{
cat <<EOT
<table>
<tr>
<td>Allowed IRQ for the Ethernet driver cs89x0</td>
<td><input type="text" name="IRQ_CS89X0_LIST" value="${IRQ_CS89X0_LIST:-15 12 11 10 9 7 6 5 4 3}" /></td>
</tr>
</table>
<input type="checkbox" name="CS89X0_WIPEPNP" ${CS89X0_WIPEPNP:+checked="checked" }/>Remove PNP binaries after use<br>
EOT
}