]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/misc-binary-only/prism2-firmware-update_1.7.4.bb
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / misc-binary-only / prism2-firmware-update_1.7.4.bb
1 DESCRIPTION = "one-time install package to upgrade the firmware of all installed prism2 based cards."
2 RDEPENDS = "hostap-modules-pci hostap-utils"
3 SECTION = "base"
4 PRIORITY = "optional"
5 MAINTAINER = "Bruno Randolf <bruno.randolf@4g-systems.biz>"
6 LICENSE = "unknown"
7
8 SRC_URI = "http://www.red-bean.com/~proski/firmware/${PV}.tar.bz2"
9
10 INHIBIT_PACKAGE_STRIP = "1"
11
12 do_install() {
13         install -d ${D}tmp
14         install ${WORKDIR}/${PV}/pk010101.hex ${D}tmp
15         install ${WORKDIR}/${PV}/sf010704.hex ${D}tmp
16 }
17
18 pkg_postinst() {
19 if test "x$D" != "x"; then
20         exit 1
21 else
22         FW_VERSION="v${PV}";
23         
24         fw_upgrade() {
25                 IF=$1;
26                 echo "firmware upgrade on $IF"
27                 if [ ! `iwconfig $IF | grep "No such device"` ]; then
28                         echo -n "  - current firmware version: ";
29                         echo `hostap_diag $IF | grep STAID | awk '{print $3}'`;
30                         if [[ `hostap_diag $IF | grep STAID | awk '{print $3}'` < $FW_VERSION ]]; then
31                                 echo "  - upgrading to version $FW_VERSION"
32                                 prism2_srec -f $IF /tmp/sf010704.hex /tmp/pk010101.hex
33                         else 
34                                 echo "  - upgrade not necessary"
35                         fi
36                 fi
37                 echo "done".
38         }
39         
40         for i in `ls /proc/net/hostap`; do
41                 fw_upgrade $i;
42         done;
43 fi
44 }
45
46 FILES_${PN} += "/tmp"