From 596799472c99d8bf18bebc6a1a33257b1c78dedd Mon Sep 17 00:00:00 2001 From: Wouter R Date: Fri, 26 Jul 2013 01:12:00 +0200 Subject: [PATCH] Change package-directory script to include ultifi package; several fixes to package installation; rename wifibox init script. --- Makefile | 9 +++++---- extra/create-packages-dir.sh | 3 ++- post-install.sh | 10 ++++++++-- post-remove.sh | 1 - pre-remove.sh | 2 +- opkg.conf => src/opkg.conf | 0 6 files changed, 16 insertions(+), 9 deletions(-) rename opkg.conf => src/opkg.conf (100%) diff --git a/Makefile b/Makefile index c5ff15b..bc192a2 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ define Package/wifibox # DEFAULT:=y TITLE:=Doodle3D WifiBox firmware URL:=http://www.doodle3d.com/wifibox - DEPENDS:=+lua +libuci-lua +libiwinfo-lua +uhttpd +kmod-usb-acm +kmod-usb-serial-ftdi + DEPENDS:=+lua +libuci-lua +libiwinfo-lua +uhttpd +kmod-usb-acm +kmod-usb-serial-ftdi +ultifi endef define Package/wifibox/description @@ -91,14 +91,15 @@ define Package/wifibox/install ### create all files in /usr/share/lua/autowifi (autowifi) + $(CP) $(WIFIBOX_BASE_DIR)/opkg.conf $(1)/$(TGT_LUA_DIR_SUFFIX)/ $(CP) $(WIFIBOX_BASE_DIR)/*.lua $(1)/$(TGT_LUA_DIR_SUFFIX)/ $(CP) $(WIFIBOX_BASE_DIR)/network/*.lua $(1)/$(TGT_LUA_DIR_SUFFIX)/network/ $(CP) $(WIFIBOX_BASE_DIR)/rest/*.lua $(1)/$(TGT_LUA_DIR_SUFFIX)/rest/ $(CP) $(WIFIBOX_BASE_DIR)/rest/api/*.lua $(1)/$(TGT_LUA_DIR_SUFFIX)/rest/api/ $(CP) $(WIFIBOX_BASE_DIR)/util/*.lua $(1)/$(TGT_LUA_DIR_SUFFIX)/util/ - $(CP) $(WIFIBOX_BASE_DIR)/script/wifibox_init $(1)/$(TGT_LUA_DIR_SUFFIX)/script - $(CP) $(WIFIBOX_BASE_DIR)/script/d3dapi $(1)/$(TGT_LUA_DIR_SUFFIX)/script + $(INSTALL_BIN) $(WIFIBOX_BASE_DIR)/script/wifibox_init $(1)/$(TGT_LUA_DIR_SUFFIX)/script + $(INSTALL_BIN) $(WIFIBOX_BASE_DIR)/script/d3dapi $(1)/$(TGT_LUA_DIR_SUFFIX)/script # $(CP) $(WIFIBOX_BASE_DIR)/www/* $(1)/$(TGT_LUA_DIR_SUFFIX)/www/ $(CP) $(WIFIBOX_BASE_DIR)/www/* $(1)/www/ #copy www files directly to /www @@ -116,7 +117,7 @@ endif ### create links elsewhere in the system (autowifi) $(LN) -s /$(TGT_LUA_DIR_SUFFIX)/script/d3dapi $(1)/www/cgi-bin - $(LN) -s /$(TGT_LUA_DIR_SUFFIX)/script/wifibox_init $(1)/etc/init.d/wifibox_init + $(LN) -s /$(TGT_LUA_DIR_SUFFIX)/script/wifibox_init $(1)/etc/init.d/wifibox ### install gpx utility $(INSTALL_DIR) $(1)/usr/bin diff --git a/extra/create-packages-dir.sh b/extra/create-packages-dir.sh index 1e45166..0ae04ee 100755 --- a/extra/create-packages-dir.sh +++ b/extra/create-packages-dir.sh @@ -8,13 +8,14 @@ INDEX_FILE=Packages INDEX_GZ_FILE=Packages.gz if [ "x$1" == "x-h" ]; then - echo "This script creates a directory with wifibox ipk files found in the openWrt build environment." + echo "This script creates a directory with wifibox and ultifi ipk files found in the openWrt build environment." echo "If specified, the -z option also compresses the result." exit fi if [ ! -d $PKG_DEST_DIR ]; then mkdir $PKG_DEST_DIR; fi cp $PKG_SRC_DIR/wifibox*.ipk $PKG_DEST_DIR +cp $PKG_SRC_DIR/ultifi*.ipk $PKG_DEST_DIR cd $PKG_DEST_DIR rm -f $INDEX_FILE rm -f $INDEX_GZ_FILE diff --git a/post-install.sh b/post-install.sh index 6882371..13603ae 100644 --- a/post-install.sh +++ b/post-install.sh @@ -49,7 +49,11 @@ EOM fi ### Add some convenience functionality to root's profile -grep '^# DO NOT MODIFY.*wifibox package.$' /root/.profile >/dev/null 2>&1 +ROOT_PROFILE=/root/.profile +if [ ! -f $ROOT_PROFILE ]; then + touch $ROOT_PROFILE +fi +grep '^# DO NOT MODIFY.*wifibox package.$' $ROOT_PROFILE >/dev/null 2>&1 if [ $? -eq 1 ]; then cat <<-EOM >> /root/.profile @@ -70,9 +74,11 @@ if [ -z "$IPKG_INSTROOT" ]; then echo "Adding network interface 'wlan'..." uci set network.wlan=interface; uci commit network; /etc/init.d/network reload - /etc/init.d/wifibox_init enable + /etc/init.d/wifibox enable else + ADDR_LINE=`cat $IPKG_INSTROOT/etc/config/network | grep ipaddr` echo "WARNING: WiFiBox network configuration can only be prepared when installing on real device" + echo "network config address line:" fi exit 0 diff --git a/post-remove.sh b/post-remove.sh index aa5820e..e68350a 100644 --- a/post-remove.sh +++ b/post-remove.sh @@ -12,7 +12,6 @@ rmdir /usr/share/lua/wifibox/script rmdir /usr/share/lua/wifibox/util rmdir /usr/share/lua/wifibox rmdir /usr/share/lua -rm /www/wifibox echo "The wifibox banner has been removed. Changes to the root profile however, have" echo "not been reverted, as haven't the wlan firewall zone and the radio0 device state." diff --git a/pre-remove.sh b/pre-remove.sh index d4a35ff..652d333 100644 --- a/pre-remove.sh +++ b/pre-remove.sh @@ -1,7 +1,7 @@ #!/bin/sh if [ -z "$$IPKG_INSTROOT" ]; then - /etc/init.d/wifibox_init disable + /etc/init.d/wifibox disable fi exit 0 diff --git a/opkg.conf b/src/opkg.conf similarity index 100% rename from opkg.conf rename to src/opkg.conf