wok-tiny view hardware-ibm-6272/receipt @ rev 126

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