Changeset 20374 for packages


Ignore:
Timestamp:
2010-03-23T00:17:07+01:00 (6 years ago)
Author:
linus
Message:

[packages] ap51-flash: update ap51-flash and add loop option

The newer ap51-flash version and updated scripts will fix a
problem on big-endian machines and uses a lot less memory
(libpcap is not required anymore, no more image-buffering).

A loop-script per ap51-flash instance will take care of
restarting the app if selected in uci-config file.

Location:
packages/utils/ap51-flash
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • packages/utils/ap51-flash/Makefile

    r19360 r20374  
    88 
    99PKG_NAME:=ap51-flash 
    10 PKG_REV:=195 
     10PKG_REV:=232 
    1111PKG_VERSION:=r$(PKG_REV) 
    1212PKG_RELEASE:=1 
     
    2020include $(INCLUDE_DIR)/package.mk 
    2121 
     22ifeq ($(CONFIG_BIG_ENDIAN),y) 
     23  STAMP_BUILT:=$(STAMP_BUILT)_big 
     24endif 
     25 
    2226define Package/ap51-flash 
    2327  SECTION:=utils 
     
    2529  TITLE:=A tool for flashing (nearly) all ap51/ap61 based routers 
    2630  URL:=http://dev.open-mesh.com/wiki/ap51-flash-station 
    27   DEPENDS:=+libpcap 
    2831endef 
     32 
     33TARGET_EXTRA_CFLAGS:=-DFLASH_FROM_FILE -DNO_LIBPCAP 
     34ifeq ($(CONFIG_BIG_ENDIAN),y) 
     35        TARGET_EXTRA_CFLAGS:=$(TARGET_EXTRA_CFLAGS) -DUIP_CONF_BYTE_ORDER=1234 
     36endif 
    2937 
    3038# pass optimization flags 
    3139MAKE_FLAGS += \ 
    3240        OFLAGS="$(TARGET_CFLAGS)" \ 
     41        EXTRA_CFLAGS="$(TARGET_EXTRA_CFLAGS)" \ 
     42        REVISION="$(PKG_VERSION)" \ 
    3343 
    3444define Package/ap51-flash/install 
    35         $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d $(1)/usr/sbin 
     45        $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d $(1)/usr/sbin \ 
     46                $(1)/usr/lib/ap51-flash 
    3647        $(INSTALL_BIN) $(PKG_BUILD_DIR)/ap51-flash $(1)/usr/sbin/ 
    3748        $(INSTALL_BIN) ./files/ap51-flash.init $(1)/etc/init.d/ap51-flash 
     49        $(INSTALL_BIN) ./files/ap51-flash.sh $(1)/usr/lib/ap51-flash/ap51-flash.sh 
    3850        $(INSTALL_DATA) ./files/ap51-flash.conf $(1)/etc/config/ap51-flash 
    3951endef 
  • packages/utils/ap51-flash/files/ap51-flash.conf

    r19360 r20374  
    33#       option rootfs   /tmp/images/openwrt-atheros-root.squashfs 
    44#       option kernel   /tmp/images/openwrt-atheros-vmlinux.lzma 
    5 ##      option ubnt     /tmp/images/openwrt-atheros-ubnt5-squashfs.bin 
     5#       option ubnt     /tmp/images/openwrt-atheros-ubnt5-squashfs.bin 
     6##      option loop     '1' 
  • packages/utils/ap51-flash/files/ap51-flash.init

    r19360 r20374  
    11#!/bin/sh /etc/rc.common 
    2 # Copyright (C) 2007 OpenWrt.org 
     2# Copyright (C) 2010 OpenWrt.org 
    33 
    44START=20 
     
    99        local cfg="$1" 
    1010 
     11        config_get_bool loop "$cfg" loop 
    1112        config_get ifname "$cfg" ifname 
    1213        config_get rootfs "$cfg" rootfs 
    1314        config_get kernel "$cfg" kernel 
    14         config_get ubntimg "$cfg" ubntimg 
    15         if [ -n "$ifname" -a -n "$rootfs" -a -n "$kernel" ]; then 
    16                 [ -n "`ls /var/run/$NAME-$ifname.pid 2> /dev/null`" ] && { 
     15        config_get ubnt "$cfg" ubnt 
     16        [ "$loop" != "1" ] && loop=0 
     17        if [ -n "$ifname" -a -n "$rootfs" -a -n "$kernel" ] || \ 
     18           [ -n "$ifname" -a -n "$ubnt" ]; then 
     19                PID="`cat /var/run/$NAME.sh-$ifname.pid 2> /dev/null`" 
     20                [ -z "`ps | grep "^.[ ]*$PID "`" ] && \ 
     21                        rm /var/run/$NAME.sh-$ifname.pid 
     22                [ -n "`ls /var/run/$NAME.sh-$ifname.pid 2> /dev/null`" ] && { 
    1723                        echo "Can't start more than one ap51-flash for interface $ifname!" 
    1824                        return 0 
    1925                } 
    20                 start-stop-daemon -S -b -m -p /var/run/$NAME-$ifname.pid -n $NAME -x /usr/sbin/$NAME -- $ifname $rootfs $kernel 
    21         elif [ -n "$ifname" -a -n "$ubntimg" ]; then 
    22                 [ -n "`ls /var/run/$NAME-$ifname-ubnt.pid 2> /dev/null`" ] && { 
    23                         echo "Can't start more than one ap51-flash (ubnt) for interface $ifname!" 
    24                         return 0 
    25                 } 
    26                 start-stop-daemon -S -b -m -p /var/run/$NAME-$ifname-ubnt.pid -n $NAME -x /usr/sbin/$NAME -- $ifname $ubntimg 
     26                start-stop-daemon -S -b -m -p /var/run/$NAME.sh-$ifname.pid -n $NAME.sh \ 
     27                        -x /usr/lib/ap51-flash/$NAME.sh -- "$loop" "$ifname" "$rootfs" "$kernel" "$ubnt" 
    2728        fi 
    2829} 
     
    3940        sleep 10 
    4041        local pidfile 
     42        for pidfile in `ls /var/run/${NAME}.sh-*.pid 2> /dev/null`; do 
     43                start-stop-daemon -K -s TERM -p "${pidfile}" -n "${NAME}.sh" >/dev/null 
     44                rm -f "${pidfile}" 
     45        done 
    4146        for pidfile in `ls /var/run/${NAME}-*.pid 2> /dev/null`; do 
    4247                start-stop-daemon -K -s TERM -p "${pidfile}" -n "${NAME}" >/dev/null 
Note: See TracChangeset for help on using the changeset viewer.