mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
Moved the following packages to inteno-packages-openwrt:v3.5
and moved luci out of webgui. alljoyn block-mount-old dbus ddns-scripts glib2 haproxy hotplug2 libffi libipfix libmbim libmicroxml libpcre libqmi luci minidlna multiwan net-snmp samba2 samba3 shflags syslog-ng3 usb-modeswitch
This commit is contained in:
parent
a1e4de11f0
commit
e92bc0ea7d
246 changed files with 0 additions and 39453 deletions
|
|
@ -1,135 +0,0 @@
|
|||
AJ_SERVICE:=config
|
||||
AJ_SERVICE_NAME:=Config
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=alljoyn-$(AJ_SERVICE)
|
||||
PKG_BASE_VERSION:=14.12
|
||||
PKG_PATCHLEVEL:=.00
|
||||
PKG_RELEASE:=1
|
||||
PKG_MD5SUM:=389c2623619281e6849da25cee7e1bb7
|
||||
PKG_VERSION:=$(PKG_BASE_VERSION)$(PKG_PATCHLEVEL)
|
||||
PKG_TARBALL_VERSION:=$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/alljoyn-services-$(PKG_TARBALL_VERSION)-src
|
||||
PKG_SOURCE:=alljoyn-services-$(PKG_TARBALL_VERSION)-src.tar.gz
|
||||
PKG_SOURCE_URL:=https://allseenalliance.org/releases/alljoyn/$(PKG_BASE_VERSION)/
|
||||
|
||||
|
||||
# SCons supports parallel builds but does not support make's jobserver
|
||||
PKG_BUILD_PARALLEL:=$(if $(CONFIG_PKG_BUILD_USE_JOBSERVER),0,1)
|
||||
|
||||
PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)-samples
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifneq ($(CONFIG_CCACHE),)
|
||||
TARGET_CC=$(TARGET_CC_NOCACHE)
|
||||
TARGET_CXX=$(TARGET_CXX_NOCACHE)
|
||||
endif
|
||||
|
||||
ALLJOYN_BINDINGS:=cpp,
|
||||
ALLJOYN_BUILD_SERVICES_SAMPLES:=off
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
TITLE:=AllJoyn $(AJ_SERVICE_NAME) service library
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=alljoyn \
|
||||
+alljoyn-about
|
||||
URL:=http://www.allseenalliance.org
|
||||
MAINTAINER:=AllSeen Alliance <allseen-core@lists.allseenalliance.org>
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
AllJoyn $(AJ_SERVICE_NAME) service library.
|
||||
endef
|
||||
|
||||
|
||||
define Package/$(PKG_NAME)-samples
|
||||
$(call Package/$(PKG_NAME))
|
||||
TITLE+=- testing samples
|
||||
DEPENDS:=$(PKG_NAME) \
|
||||
+alljoyn-services_common
|
||||
MENU:=0
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)-samples/description
|
||||
Alljoyn $(AJ_SERVICE_NAME) service library samples. (This is primarily for testing.
|
||||
The contents of this package vary according which other alljoyn packages
|
||||
are selected.)
|
||||
endef
|
||||
|
||||
|
||||
ifeq ($(CONFIG_DEBUG),y)
|
||||
ALLJOYN_BUILD_VARIANT:=debug
|
||||
else
|
||||
ALLJOYN_BUILD_VARIANT:=release
|
||||
endif
|
||||
|
||||
|
||||
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/services/base/$(AJ_SERVICE)/build/openwrt/openwrt/$(ALLJOYN_BUILD_VARIANT)/dist/$(AJ_SERVICE)
|
||||
|
||||
TARGET_CFLAGS+=-fPIC
|
||||
TARGET_CPPFLAGS+=-fPIC
|
||||
|
||||
ifdef CONFIG_PACKAGE_$(PKG_NAME)-samples
|
||||
ifdef CONFIG_PACKAGE_alljoyn-about
|
||||
ALLJOYN_BUILD_SERVICES_SAMPLES:=on
|
||||
endif
|
||||
endif
|
||||
|
||||
define Build/Configure/Default
|
||||
# Override default to do nothing
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
scons -C $(PKG_BUILD_DIR)/services/base/$(AJ_SERVICE) \
|
||||
$(PKG_JOBS) \
|
||||
WS=off \
|
||||
CPU=openwrt \
|
||||
OS=openwrt \
|
||||
"BINDINGS=$(ALLJOYN_BINDINGS)" \
|
||||
"BUILD_SERVICES_SAMPLES=$(ALLJOYN_BUILD_SERVICES_SAMPLES)" \
|
||||
"VARIANT=$(ALLJOYN_BUILD_VARIANT)" \
|
||||
BR=off \
|
||||
BT=off \
|
||||
ICE=off \
|
||||
"TARGET_CC=$$(TARGET_CC)" \
|
||||
"TARGET_CXX=$$(TARGET_CXX)" \
|
||||
"TARGET_CFLAGS=$$(TARGET_CFLAGS)" \
|
||||
"TARGET_CPPFLAGS=$$(TARGET_CPPFLAGS)" \
|
||||
"TARGET_PATH=$$(TARGET_PATH)" \
|
||||
"TARGET_LINKFLAGS=$$(TARGET_LDFLAGS)" \
|
||||
"TARGET_LINK=$$(TARGET_CC)" \
|
||||
"TARGET_AR=$$(TARGET_AR)" \
|
||||
"TARGET_RANLIB=$$(TARGET_RANLIB)" \
|
||||
"STAGING_DIR=$$(STAGING_DIR)"
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/alljoyn/$(AJ_SERVICE)
|
||||
$(CP) $(PKG_INSTALL_DIR)/inc/alljoyn/$(AJ_SERVICE)/*.h $(1)/usr/include/alljoyn/$(AJ_SERVICE)
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/lib/liballjoyn_$(AJ_SERVICE).a $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/lib/liballjoyn_$(AJ_SERVICE).so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/lib/liballjoyn_$(AJ_SERVICE).so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
|
||||
define Package/$(PKG_NAME)-samples/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/* $(1)/usr/bin/
|
||||
$(INSTALL_DIR) $(1)/etc/alljoyn-config
|
||||
$(CP) $(PKG_BUILD_DIR)/services/base/config/cpp/samples/ConfigServiceSample/ConfigService.conf $(1)/etc/alljoyn-config/
|
||||
endef
|
||||
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)-samples))
|
||||
|
||||
|
|
@ -1,133 +0,0 @@
|
|||
AJ_SERVICE:=controlpanel
|
||||
AJ_SERVICE_NAME:=ControlPanel
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=alljoyn-$(AJ_SERVICE)
|
||||
PKG_BASE_VERSION:=14.12
|
||||
PKG_PATCHLEVEL:=.00
|
||||
PKG_RELEASE:=1
|
||||
PKG_MD5SUM:=389c2623619281e6849da25cee7e1bb7
|
||||
PKG_VERSION:=$(PKG_BASE_VERSION)$(PKG_PATCHLEVEL)
|
||||
PKG_TARBALL_VERSION:=$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/alljoyn-services-$(PKG_TARBALL_VERSION)-src
|
||||
PKG_SOURCE:=alljoyn-services-$(PKG_TARBALL_VERSION)-src.tar.gz
|
||||
PKG_SOURCE_URL:=https://allseenalliance.org/releases/alljoyn/$(PKG_BASE_VERSION)/
|
||||
|
||||
# SCons supports parallel builds but does not support make's jobserver
|
||||
PKG_BUILD_PARALLEL:=$(if $(CONFIG_PKG_BUILD_USE_JOBSERVER),0,1)
|
||||
|
||||
PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)-samples
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifneq ($(CONFIG_CCACHE),)
|
||||
TARGET_CC=$(TARGET_CC_NOCACHE)
|
||||
TARGET_CXX=$(TARGET_CXX_NOCACHE)
|
||||
endif
|
||||
|
||||
ALLJOYN_BINDINGS:=cpp,
|
||||
ALLJOYN_BUILD_SERVICES_SAMPLES:=off
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
TITLE:=AllJoyn $(AJ_SERVICE_NAME) service library
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=alljoyn
|
||||
URL:=http://www.allseenalliance.org
|
||||
MAINTAINER:=AllSeen Alliance <allseen-core@lists.allseenalliance.org>
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
AllJoyn $(AJ_SERVICE_NAME) service library.
|
||||
endef
|
||||
|
||||
|
||||
define Package/$(PKG_NAME)-samples
|
||||
$(call Package/$(PKG_NAME))
|
||||
TITLE+=- testing samples
|
||||
DEPENDS:=$(PKG_NAME) \
|
||||
+alljoyn-about \
|
||||
+alljoyn-notification \
|
||||
+alljoyn-services_common
|
||||
MENU:=0
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)-samples/description
|
||||
Alljoyn $(AJ_SERVICE_NAME) service library samples. (This is primarily for testing.
|
||||
The contents of this package vary according which other alljoyn packages
|
||||
are selected.)
|
||||
endef
|
||||
|
||||
|
||||
ifeq ($(CONFIG_DEBUG),y)
|
||||
ALLJOYN_BUILD_VARIANT:=debug
|
||||
else
|
||||
ALLJOYN_BUILD_VARIANT:=release
|
||||
endif
|
||||
|
||||
|
||||
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/services/base/$(AJ_SERVICE)/build/openwrt/openwrt/$(ALLJOYN_BUILD_VARIANT)/dist/$(AJ_SERVICE)
|
||||
|
||||
TARGET_CFLAGS+=-fPIC
|
||||
TARGET_CPPFLAGS+=-fPIC
|
||||
|
||||
ifdef CONFIG_PACKAGE_$(PKG_NAME)-samples
|
||||
ifdef CONFIG_PACKAGE_alljoyn-about
|
||||
ALLJOYN_BUILD_SERVICES_SAMPLES:=on
|
||||
endif
|
||||
endif
|
||||
|
||||
define Build/Configure/Default
|
||||
# Override default to do nothing
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
scons -C $(PKG_BUILD_DIR)/services/base/$(AJ_SERVICE) \
|
||||
$(PKG_JOBS) \
|
||||
WS=off \
|
||||
CPU=openwrt \
|
||||
OS=openwrt \
|
||||
"BINDINGS=$(ALLJOYN_BINDINGS)" \
|
||||
"BUILD_SERVICES_SAMPLES=$(ALLJOYN_BUILD_SERVICES_SAMPLES)" \
|
||||
"VARIANT=$(ALLJOYN_BUILD_VARIANT)" \
|
||||
BR=off \
|
||||
BT=off \
|
||||
ICE=off \
|
||||
"TARGET_CC=$$(TARGET_CC)" \
|
||||
"TARGET_CXX=$$(TARGET_CXX)" \
|
||||
"TARGET_CFLAGS=$$(TARGET_CFLAGS)" \
|
||||
"TARGET_CPPFLAGS=$$(TARGET_CPPFLAGS)" \
|
||||
"TARGET_PATH=$$(TARGET_PATH)" \
|
||||
"TARGET_LINKFLAGS=$$(TARGET_LDFLAGS)" \
|
||||
"TARGET_LINK=$$(TARGET_CC)" \
|
||||
"TARGET_AR=$$(TARGET_AR)" \
|
||||
"TARGET_RANLIB=$$(TARGET_RANLIB)" \
|
||||
"STAGING_DIR=$$(STAGING_DIR)"
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/alljoyn/$(AJ_SERVICE)
|
||||
$(CP) $(PKG_INSTALL_DIR)/inc/alljoyn/$(AJ_SERVICE)/*.h $(1)/usr/include/alljoyn/$(AJ_SERVICE)
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/lib/liballjoyn_$(AJ_SERVICE).a $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/lib/liballjoyn_$(AJ_SERVICE).so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/lib/liballjoyn_$(AJ_SERVICE).so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
|
||||
define Package/$(PKG_NAME)-samples/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/* $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)-samples))
|
||||
|
||||
|
|
@ -1,132 +0,0 @@
|
|||
AJ_SERVICE:=notification
|
||||
AJ_SERVICE_NAME:=Notification
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=alljoyn-$(AJ_SERVICE)
|
||||
PKG_BASE_VERSION:=14.12
|
||||
PKG_PATCHLEVEL:=.00
|
||||
PKG_RELEASE:=1
|
||||
PKG_MD5SUM:=389c2623619281e6849da25cee7e1bb7
|
||||
PKG_VERSION:=$(PKG_BASE_VERSION)$(PKG_PATCHLEVEL)
|
||||
PKG_TARBALL_VERSION:=$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/alljoyn-services-$(PKG_TARBALL_VERSION)-src
|
||||
PKG_SOURCE:=alljoyn-services-$(PKG_TARBALL_VERSION)-src.tar.gz
|
||||
PKG_SOURCE_URL:=https://allseenalliance.org/releases/alljoyn/$(PKG_BASE_VERSION)/
|
||||
|
||||
# SCons supports parallel builds but does not support make's jobserver
|
||||
PKG_BUILD_PARALLEL:=$(if $(CONFIG_PKG_BUILD_USE_JOBSERVER),0,1)
|
||||
|
||||
PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)-samples
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifneq ($(CONFIG_CCACHE),)
|
||||
TARGET_CC=$(TARGET_CC_NOCACHE)
|
||||
TARGET_CXX=$(TARGET_CXX_NOCACHE)
|
||||
endif
|
||||
|
||||
ALLJOYN_BINDINGS:=cpp,
|
||||
ALLJOYN_BUILD_SERVICES_SAMPLES:=off
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
TITLE:=AllJoyn $(AJ_SERVICE_NAME) service library
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=alljoyn \
|
||||
+alljoyn-about
|
||||
URL:=http://www.allseenalliance.org
|
||||
MAINTAINER:=AllSeen Alliance <allseen-core@lists.allseenalliance.org>
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
AllJoyn $(AJ_SERVICE_NAME) service library.
|
||||
endef
|
||||
|
||||
|
||||
define Package/$(PKG_NAME)-samples
|
||||
$(call Package/$(PKG_NAME))
|
||||
TITLE+=- testing samples
|
||||
DEPENDS:=$(PKG_NAME) \
|
||||
+alljoyn-services_common
|
||||
MENU:=0
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)-samples/description
|
||||
Alljoyn $(AJ_SERVICE_NAME) service library samples. (This is primarily for testing.
|
||||
The contents of this package vary according which other alljoyn packages
|
||||
are selected.)
|
||||
endef
|
||||
|
||||
|
||||
ifeq ($(CONFIG_DEBUG),y)
|
||||
ALLJOYN_BUILD_VARIANT:=debug
|
||||
else
|
||||
ALLJOYN_BUILD_VARIANT:=release
|
||||
endif
|
||||
|
||||
|
||||
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/services/base/$(AJ_SERVICE)/build/openwrt/openwrt/$(ALLJOYN_BUILD_VARIANT)/dist/$(AJ_SERVICE)
|
||||
|
||||
TARGET_CFLAGS+=-fPIC
|
||||
TARGET_CPPFLAGS+=-fPIC
|
||||
|
||||
ifdef CONFIG_PACKAGE_$(PKG_NAME)-samples
|
||||
ifdef CONFIG_PACKAGE_alljoyn-about
|
||||
ALLJOYN_BUILD_SERVICES_SAMPLES:=on
|
||||
endif
|
||||
endif
|
||||
|
||||
define Build/Configure/Default
|
||||
# Override default to do nothing
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
scons -C $(PKG_BUILD_DIR)/services/base/$(AJ_SERVICE) \
|
||||
$(PKG_JOBS) \
|
||||
WS=off \
|
||||
CPU=openwrt \
|
||||
OS=openwrt \
|
||||
"BINDINGS=$(ALLJOYN_BINDINGS)" \
|
||||
"BUILD_SERVICES_SAMPLES=$(ALLJOYN_BUILD_SERVICES_SAMPLES)" \
|
||||
"VARIANT=$(ALLJOYN_BUILD_VARIANT)" \
|
||||
BR=off \
|
||||
BT=off \
|
||||
ICE=off \
|
||||
"TARGET_CC=$$(TARGET_CC)" \
|
||||
"TARGET_CXX=$$(TARGET_CXX)" \
|
||||
"TARGET_CFLAGS=$$(TARGET_CFLAGS)" \
|
||||
"TARGET_CPPFLAGS=$$(TARGET_CPPFLAGS)" \
|
||||
"TARGET_PATH=$$(TARGET_PATH)" \
|
||||
"TARGET_LINKFLAGS=$$(TARGET_LDFLAGS)" \
|
||||
"TARGET_LINK=$$(TARGET_CC)" \
|
||||
"TARGET_AR=$$(TARGET_AR)" \
|
||||
"TARGET_RANLIB=$$(TARGET_RANLIB)" \
|
||||
"STAGING_DIR=$$(STAGING_DIR)"
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/alljoyn/$(AJ_SERVICE)
|
||||
$(CP) $(PKG_INSTALL_DIR)/inc/alljoyn/$(AJ_SERVICE)/*.h $(1)/usr/include/alljoyn/$(AJ_SERVICE)
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/lib/liballjoyn_$(AJ_SERVICE).a $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/lib/liballjoyn_$(AJ_SERVICE).so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/lib/liballjoyn_$(AJ_SERVICE).so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
|
||||
define Package/$(PKG_NAME)-samples/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/* $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)-samples))
|
||||
|
||||
|
|
@ -1,160 +0,0 @@
|
|||
AJ_SERVICE:=onboarding
|
||||
AJ_SERVICE_NAME:=onboarding
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=alljoyn-$(AJ_SERVICE)
|
||||
PKG_BASE_VERSION:=14.12
|
||||
PKG_PATCHLEVEL:=.00
|
||||
PKG_RELEASE:=1
|
||||
PKG_MD5SUM:=389c2623619281e6849da25cee7e1bb7
|
||||
PKG_VERSION:=$(PKG_BASE_VERSION)$(PKG_PATCHLEVEL)
|
||||
PKG_TARBALL_VERSION:=$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/alljoyn-services-$(PKG_TARBALL_VERSION)-src
|
||||
PKG_SOURCE:=alljoyn-services-$(PKG_TARBALL_VERSION)-src.tar.gz
|
||||
PKG_SOURCE_URL:=https://allseenalliance.org/releases/alljoyn/$(PKG_BASE_VERSION)/
|
||||
|
||||
# SCons supports parallel builds but does not support make's jobserver
|
||||
PKG_BUILD_PARALLEL:=$(if $(CONFIG_PKG_BUILD_USE_JOBSERVER),0,1)
|
||||
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifneq ($(CONFIG_CCACHE),)
|
||||
TARGET_CC=$(TARGET_CC_NOCACHE)
|
||||
TARGET_CXX=$(TARGET_CXX_NOCACHE)
|
||||
endif
|
||||
|
||||
ALLJOYN_BINDINGS:=cpp,
|
||||
|
||||
# Due to inherited dependencies (onboarding package depends on wpa-cli package and therefore inherits its dependencies)
|
||||
# the onboarding package will not be visible for selection unless the wpa-supplicant package is first selected
|
||||
define Package/$(PKG_NAME)
|
||||
TITLE:=AllJoyn $(AJ_SERVICE_NAME) service library
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=alljoyn \
|
||||
wpa-supplicant \
|
||||
+alljoyn-about \
|
||||
+alljoyn-config \
|
||||
+alljoyn-services_common \
|
||||
+hostapd \
|
||||
+wpa-cli
|
||||
URL:=http://www.allseenalliance.org
|
||||
MAINTAINER:=AllSeen Alliance <allseen-core@lists.allseenalliance.org>
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
AllJoyn $(AJ_SERVICE_NAME) service.
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_DEBUG),y)
|
||||
ALLJOYN_BUILD_VARIANT:=debug
|
||||
else
|
||||
ALLJOYN_BUILD_VARIANT:=release
|
||||
endif
|
||||
|
||||
|
||||
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/services/base/$(AJ_SERVICE)/build/openwrt/openwrt/$(ALLJOYN_BUILD_VARIANT)/dist/$(AJ_SERVICE)
|
||||
|
||||
TARGET_CFLAGS+=-fPIC
|
||||
TARGET_CPPFLAGS+=-fPIC
|
||||
TARGET_LDFLAGS+=-lpthread -lrt
|
||||
|
||||
define Build/Configure/Default
|
||||
# Override default to do nothing
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
scons -C $(PKG_BUILD_DIR)/services/base/$(AJ_SERVICE) \
|
||||
$(PKG_JOBS) \
|
||||
WS=off \
|
||||
CPU=openwrt \
|
||||
OS=openwrt \
|
||||
"BINDINGS=$(ALLJOYN_BINDINGS)" \
|
||||
"BUILD_SERVICES_SAMPLES=off" \
|
||||
"VARIANT=$(ALLJOYN_BUILD_VARIANT)" \
|
||||
BR=off \
|
||||
BT=off \
|
||||
ICE=off \
|
||||
"TARGET_CC=$$(TARGET_CC)" \
|
||||
"TARGET_CXX=$$(TARGET_CXX)" \
|
||||
"TARGET_CFLAGS=$$(TARGET_CFLAGS)" \
|
||||
"TARGET_CPPFLAGS=$$(TARGET_CPPFLAGS)" \
|
||||
"TARGET_PATH=$$(TARGET_PATH)" \
|
||||
"TARGET_LINKFLAGS=$$(TARGET_LDFLAGS)" \
|
||||
"TARGET_LINK=$$(TARGET_CC)" \
|
||||
"TARGET_AR=$$(TARGET_AR)" \
|
||||
"TARGET_RANLIB=$$(TARGET_RANLIB)" \
|
||||
"STAGING_DIR=$$(STAGING_DIR)"
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/alljoyn/$(AJ_SERVICE)
|
||||
$(CP) $(PKG_INSTALL_DIR)/inc/alljoyn/$(AJ_SERVICE)/*.h $(1)/usr/include/alljoyn/$(AJ_SERVICE)
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/lib/liballjoyn_$(AJ_SERVICE).a $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/lib/liballjoyn_$(AJ_SERVICE).so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/lib/liballjoyn_$(AJ_SERVICE).so $(1)/usr/lib/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/onboarding-daemon $(1)/usr/bin/
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/alljoyn-onboarding.init $(1)/etc/init.d/alljoyn-onboarding
|
||||
$(INSTALL_BIN) ./files/alljoyn-onboarding-reload.init $(1)/etc/init.d/alljoyn-onboarding-reload
|
||||
$(INSTALL_BIN) ./files/wifi_scan.init $(1)/etc/init.d/wifi_scan
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) ./files/alljoyn-onboarding.defaults $(1)/etc/uci-defaults/alljoyn-onboarding
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) ./files/alljoyn-onboarding.config $(1)/etc/config/alljoyn-onboarding
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) ./files/wifi_scan $(1)/usr/sbin/wifi_scan
|
||||
$(INSTALL_BIN) ./files/parse_iw_wifi_scan $(1)/usr/sbin/parse_iw_wifi_scan
|
||||
$(INSTALL_BIN) ./files/parse_iwlist_wifi_scan $(1)/usr/sbin/parse_iwlist_wifi_scan
|
||||
$(INSTALL_BIN) ./files/wifi_mgmt $(1)/usr/sbin/wifi_mgmt
|
||||
$(INSTALL_DIR) $(1)/etc/alljoyn-onboarding
|
||||
$(INSTALL_CONF) ./files/alljoyn-onboarding.state $(1)/etc/alljoyn-onboarding/alljoyn-onboarding-state
|
||||
$(CP) $(PKG_BUILD_DIR)/services/base/onboarding/cpp/src/OnboardingDaemon/OnboardingService.conf $(1)/etc/alljoyn-onboarding/
|
||||
$(CP) $(PKG_BUILD_DIR)/services/base/onboarding/cpp/src/OnboardingDaemon/FactoryOnboardingService.conf $(1)/etc/alljoyn-onboarding/
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/postinst
|
||||
#!/bin/sh
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
. /etc/uci-defaults/alljoyn-onboarding
|
||||
rm -f /etc/uci-defaults/alljoyn-onboarding
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/prerm
|
||||
#!/bin/sh
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
/etc/init.d/alljoyn-onboarding stop
|
||||
/etc/init.d/alljoyn-onboarding disable
|
||||
/etc/init.d/wifi_scan disable
|
||||
/etc/init.d/alljoyn-onboarding-reload disable
|
||||
crontab -l 2>/dev/null | sed '/\/etc\/init.d\/alljoyn-onboarding/d' | crontab -
|
||||
crontab -l 2>/dev/null | sed '/\/usr\/sbin\/wifi_scan/d' | crontab -
|
||||
local obswifiIndex=$(uci show /etc/config/firewall | grep obswifi | grep name | cut -d"[" -f2 | cut -c1)
|
||||
uci delete firewall.@zone[$(obswifiIndex)]
|
||||
uci commit firewall
|
||||
uci batch <<EOF
|
||||
del_list ucitrack.@alljoyn[-1].affects=alljoyn-onboarding
|
||||
delete ucitrack.@alljoyn-onboarding[-1]
|
||||
commit ucitrack
|
||||
EOF
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
||||
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
|
||||
# Copyright (c) 2013 - 2014, AllSeen Alliance. All rights reserved.
|
||||
#
|
||||
# Permission to use, copy, modify, and/or distribute this software for any
|
||||
# purpose with or without fee is hereby granted, provided that the above
|
||||
# copyright notice and this permission notice appear in all copies.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#
|
||||
|
||||
START=58
|
||||
|
||||
RADIO_24G=
|
||||
find_2_4_radio() {
|
||||
local cfg=$1
|
||||
|
||||
#list of known wireless protocols
|
||||
local validModes="11b 11g 11a 11ng 11na"
|
||||
|
||||
# get the current hwmode
|
||||
local hwmode
|
||||
config_get hwmode "$cfg" hwmode
|
||||
|
||||
# verify that the hwmode is one of the valid modes
|
||||
local hasMode=`echo "$validModes" | grep $hwmode`
|
||||
if [ -n "$hasMode" ]; then
|
||||
RADIO_24G=$cfg
|
||||
fi
|
||||
}
|
||||
|
||||
APVAP_24G=
|
||||
find_2_4_apvap() {
|
||||
local cfg=$1
|
||||
local radio=$2
|
||||
|
||||
local mode
|
||||
config_get mode "$cfg" mode
|
||||
local device
|
||||
config_get device "$cfg" device
|
||||
|
||||
[ "$mode" = "ap" -a "$device" = "$radio" ] && \
|
||||
APVAP_24G="$cfg"
|
||||
}
|
||||
|
||||
start() {
|
||||
config_load alljoyn-onboarding
|
||||
local state
|
||||
state=$(uci_get alljoyn-onboarding @onboarding[0] state)
|
||||
[ "${state}" = "3" ] && return 0
|
||||
|
||||
local iface=$(cat /proc/net/wireless | grep -m 1 : | sed -e 's/:.*//' | sed -e 's/ //g')
|
||||
local macaddr=$(cat /sys/class/net/$iface/address)
|
||||
|
||||
# save the ssid in case it gets overwritten and we need it again
|
||||
uci_set alljoyn-onboarding @onboarding[0] apssid "AJ_OpenWRT ${macaddr}"
|
||||
uci_commit alljoyn-onboarding
|
||||
|
||||
config_load wireless
|
||||
|
||||
config_foreach find_2_4_radio wifi-device
|
||||
[ -z "${RADIO_24G}" ] && {
|
||||
echo "Error: No 2.4GHz radio found"
|
||||
return 1
|
||||
}
|
||||
|
||||
config_foreach find_2_4_apvap wifi-iface ${RADIO_24G}
|
||||
[ -z "${APVAP_24G}" ] && {
|
||||
echo "Error: No 2.4GHz AP VAP found"
|
||||
return 1
|
||||
}
|
||||
|
||||
# Ok, now we start setting the configuration parameters
|
||||
uci_set wireless ${RADIO_24G} disabled 0
|
||||
uci_set wireless ${RADIO_24G} channel 6
|
||||
uci_set wireless ${APVAP_24G} ssid "AJ_OpenWRT ${macaddr}"
|
||||
uci_commit wireless
|
||||
wifi
|
||||
|
||||
# Add other appropriate tasks when device is not fully configured
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# Option Values:
|
||||
#
|
||||
# option apssid The access point name as seen by the onboarder application.
|
||||
# Note: In order for Alljoyn to detect the access point the name must start with prefix 'AJ_'
|
||||
# option apencryption The cypher mode
|
||||
# For the full list refer to http://wiki.openwrt.org/doc/uci/wireless#wpa.modes
|
||||
# Example - WPA2 would be: option apencryption 'psk2+tkip+ccmp'
|
||||
# option apkey Cypher key for connecting to the access point
|
||||
# option aphidden Determines whether the softAp will be hidden or broadcast. Default is 0 - not hidden
|
||||
|
||||
config onboarding
|
||||
option apssid 'AJ_OpenWRT'
|
||||
option apencryption 'none'
|
||||
option apkey ''
|
||||
option aphidden '0'
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
#! /bin/sh
|
||||
local hasOnboarding=$(uci get ucitrack.@alljoyn-onboarding[-1] 2> /dev/null)
|
||||
if [ -z "$hasOnboarding" ]; then
|
||||
uci batch <<EOF
|
||||
add ucitrack alljoyn-onboarding
|
||||
set ucitrack.@alljoyn-onboarding[-1].init=alljoyn-onboarding
|
||||
add_list ucitrack.@alljoyn[-1].affects=alljoyn-onboarding
|
||||
commit ucitrack
|
||||
EOF
|
||||
fi
|
||||
uci batch <<EOF
|
||||
set wireless.@wifi-device[-1].disabled=0
|
||||
set wireless.@wifi-iface[-1].disabled=0
|
||||
commit wireless
|
||||
EOF
|
||||
local hasObswifi=$(uci show /etc/config/firewall | grep obswifi)
|
||||
if [ -z "$hasObswifi" ]; then
|
||||
uci batch <<EOF
|
||||
add firewall zone
|
||||
set firewall.@zone[-1].name=obswifi
|
||||
add_list firewall.@zone[-1].network='obswifi'
|
||||
set firewall.@zone[-1].input=ACCEPT
|
||||
set firewall.@zone[-1].output=ACCEPT
|
||||
set firewall.@zone[-1].forward=ACCEPT
|
||||
commit firewall
|
||||
EOF
|
||||
fi
|
||||
/etc/init.d/alljoyn-onboarding enable
|
||||
/etc/init.d/wifi_scan enable
|
||||
/etc/init.d/alljoyn-onboarding-reload enable
|
||||
crontab -l 2>/dev/null | sed '/\/etc\/init.d\/alljoyn-onboarding/d' | echo '*/1 * * * * /etc/init.d/alljoyn-onboarding poll_connection' | crontab -
|
||||
/etc/init.d/cron enable
|
||||
exit 0
|
||||
|
|
@ -1,199 +0,0 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
|
||||
# Copyright (c) 2013 - 2014, AllSeen Alliance. All rights reserved.
|
||||
#
|
||||
# Permission to use, copy, modify, and/or distribute this software for any
|
||||
# purpose with or without fee is hereby granted, provided that the above
|
||||
# copyright notice and this permission notice appear in all copies.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#
|
||||
|
||||
. /usr/sbin/wifi_mgmt
|
||||
|
||||
START=66
|
||||
SERVICE_DAEMONIZE=1
|
||||
SERVICE_WRITE_PID=1
|
||||
CONFIGFILE=/etc/alljoyn-onboarding/OnboardingService.conf
|
||||
FACTORYCONFIGFILE=/etc/alljoyn-onboarding/FactoryOnboardingService.conf
|
||||
|
||||
EXTRA_COMMANDS="state error connect softap offboard configure validate reset retry poll_connection"
|
||||
EXTRA_HELP=<<EOF
|
||||
state Get onboarding state
|
||||
error Get onboarding error
|
||||
connect Connect to AP with provided configuration
|
||||
softap Disconnect from AP and enable soft AP
|
||||
offboard softap + wipe configuration
|
||||
configure Configure device with personal AP credentials
|
||||
validate Validate the provided configuration
|
||||
reset Reset the radio
|
||||
retry Enter SoftAP mode temporarily to allow reconfig
|
||||
poll_connection Poll the status of the connection
|
||||
EOF
|
||||
|
||||
STATE_NOTCONFIGURED=0
|
||||
STATE_CONFIGURED=1
|
||||
STATE_VALIDATING=2
|
||||
STATE_VALIDATED=3
|
||||
STATE_ERROR=4
|
||||
STATE_RETRY=5
|
||||
|
||||
boot() {
|
||||
local obswifi=$(uci get network.obswifi)
|
||||
if [ -z "$obswifi" ]; then
|
||||
uci set network.obswifi=interface
|
||||
uci set network.obswifi.proto=dhcp
|
||||
uci commit network
|
||||
/etc/init.d/network reload
|
||||
fi
|
||||
|
||||
start
|
||||
}
|
||||
|
||||
start() {
|
||||
cache_state
|
||||
cache_error
|
||||
connect
|
||||
service_start /usr/bin/onboarding-daemon --config-file=$CONFIGFILE --factory-config-file=$FACTORYCONFIGFILE
|
||||
}
|
||||
|
||||
stop() {
|
||||
service_stop /usr/bin/onboarding-daemon
|
||||
}
|
||||
|
||||
state() {
|
||||
return $(uci get -c /etc/alljoyn-onboarding alljoyn-onboarding-state.@onboarding[0].state)
|
||||
}
|
||||
|
||||
error() {
|
||||
return $(uci get -c /etc/alljoyn-onboarding alljoyn-onboarding-state.@onboarding[0].lasterrorcode)
|
||||
}
|
||||
|
||||
connect() {
|
||||
local state="$(uci get -c /etc/alljoyn-onboarding alljoyn-onboarding-state.@onboarding[0].state)"
|
||||
|
||||
if [ ${state} -eq $STATE_NOTCONFIGURED ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if [ ${state} -eq $STATE_CONFIGURED ] || [ ${state} -eq $STATE_ERROR ]; then
|
||||
validate
|
||||
return
|
||||
fi
|
||||
|
||||
if [ ${state} -eq $STATE_VALIDATING ]; then
|
||||
retries=2
|
||||
else
|
||||
retries=$(uci get -c /etc/alljoyn-onboarding alljoyn-onboarding-state.@onboarding[0].connect_retry_max)
|
||||
fi
|
||||
|
||||
local status=$ERROR_NONE
|
||||
while [ $retries -gt 0 ]; do
|
||||
wifi_connect
|
||||
sleep 2
|
||||
wifi_connect_status
|
||||
status=$?
|
||||
echo "status: $status"
|
||||
if [ ${status} -eq $ERROR_NONE ]; then
|
||||
set_state $STATE_VALIDATED
|
||||
return $status
|
||||
else
|
||||
retries=$((--retries))
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ${state} -eq $STATE_VALIDATED ] || [ ${state} -eq $STATE_RETRY ]; then
|
||||
if [ $(ps -w | grep "/etc/init.d/alljoyn-onboarding retry" | grep -v "grep" | wc -l) -eq 0 ]; then
|
||||
/etc/init.d/alljoyn-onboarding retry &
|
||||
status=$((status+8)) # set a bit saying we are in retry
|
||||
fi
|
||||
elif [ ${state} -eq ${STATE_VALIDATING} ]; then
|
||||
set_state $STATE_ERROR
|
||||
softap
|
||||
fi
|
||||
|
||||
return $status
|
||||
}
|
||||
|
||||
offboard() {
|
||||
set_state $STATE_NOTCONFIGURED
|
||||
softap
|
||||
uci delete alljoyn-onboarding.@onboarding[0].ssid
|
||||
uci delete alljoyn-onboarding.@onboarding[0].encryption
|
||||
uci delete alljoyn-onboarding.@onboarding[0].key
|
||||
uci commit alljoyn-onboarding
|
||||
set_error $ERROR_NONE "Unconfigured"
|
||||
}
|
||||
|
||||
softap() {
|
||||
wifi_softap
|
||||
}
|
||||
|
||||
reset() {
|
||||
wifi_reset
|
||||
}
|
||||
|
||||
retry() {
|
||||
echo "STATE_RETRY"
|
||||
set_state $STATE_RETRY
|
||||
local retry_duration="$(uci get -c /etc/alljoyn-onboarding alljoyn-onboarding-state.@onboarding[0].config_retry_duration)"
|
||||
softap
|
||||
sleep $retry_duration
|
||||
local state="$(uci get -c /etc/alljoyn-onboarding alljoyn-onboarding-state.@onboarding[0].state)"
|
||||
if [ ${state} -eq $STATE_RETRY ]; then
|
||||
/etc/init.d/alljoyn-onboarding connect &
|
||||
fi
|
||||
}
|
||||
|
||||
configure() {
|
||||
local codeoption="-p"
|
||||
if [ "$2" = "WEP" ]; then
|
||||
codeoption="-k"
|
||||
fi
|
||||
wifi_configure -s "$1" -a "$2" $codeoption "$3"
|
||||
set_state $STATE_CONFIGURED
|
||||
}
|
||||
|
||||
validate() {
|
||||
set_state $STATE_VALIDATING
|
||||
connect
|
||||
}
|
||||
|
||||
set_state() {
|
||||
uci set -c /etc/alljoyn-onboarding alljoyn-onboarding-state.@onboarding[0].state=$1
|
||||
uci commit -c /etc/alljoyn-onboarding alljoyn-onboarding-state
|
||||
cache_state $1
|
||||
}
|
||||
|
||||
cache_state(){
|
||||
local state="$(uci get -c /etc/alljoyn-onboarding alljoyn-onboarding-state.@onboarding[0].state)"
|
||||
printf '%d\n' "$state" > /tmp/state/alljoyn-onboarding
|
||||
}
|
||||
|
||||
cache_error() {
|
||||
local code=$(uci get -c /etc/alljoyn-onboarding alljoyn-onboarding-state.@onboarding[0].lasterrorcode)
|
||||
local msg=$(uci get -c /etc/alljoyn-onboarding alljoyn-onboarding-state.@onboarding[0].lasterrormsg)
|
||||
printf '%s\n%s' "$code" "$msg" > /tmp/state/alljoyn-onboarding-lasterror
|
||||
}
|
||||
|
||||
poll_connection() {
|
||||
local state="$(uci get -c /etc/alljoyn-onboarding alljoyn-onboarding-state.@onboarding[0].state)"
|
||||
if [ ${state} -eq $STATE_VALIDATED ]; then
|
||||
wifi_connect_status
|
||||
local status=$?
|
||||
if [ ${status} -ne $ERROR_NONE ]; then
|
||||
## check state again in case it changed since last get
|
||||
state="$(uci get -c /etc/alljoyn-onboarding alljoyn-onboarding-state.@onboarding[0].state)"
|
||||
if [ ${state} -ne $STATE_VALIDATED ]; then
|
||||
return
|
||||
fi
|
||||
/etc/init.d/alljoyn-onboarding connect &
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
config onboarding
|
||||
option state '0'
|
||||
option lasterrorcode '0'
|
||||
option lasterrormsg 'Unconfigured'
|
||||
option config_retry_duration '180'
|
||||
option connect_retry_max '2'
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Copyright (c) 2014, AllSeen Alliance. All rights reserved.
|
||||
#
|
||||
# Permission to use, copy, modify, and/or distribute this software for any
|
||||
# purpose with or without fee is hereby granted, provided that the above
|
||||
# copyright notice and this permission notice appear in all copies.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#
|
||||
|
||||
device=`iw dev | grep Interface | cut -f 2 -s -d" "`
|
||||
# Sometimes right after boot, the device is not ready yet
|
||||
if [ -n $device ]; then
|
||||
iw $device scan |
|
||||
grep -e "^BSS" -e "signal:" -e "SSID:" -e "capability:" -e "RSN:" -e "WPA:" -e "Pairwise ciphers" -e "Authentication suites" |
|
||||
{
|
||||
while read -r line; do
|
||||
case "$line" in
|
||||
BSS* )
|
||||
## Handling a new SSID. Print out previously processed SSID only if it is defined.
|
||||
## Note the different syntax based on WPA/WPA2 VS Open or WEP
|
||||
if [ "$enc" == "Open" ] || [ "$enc" == "WEP" ]; then
|
||||
printf "%s\t%s\t%s\n" "$quality" "$enc" "$ssid"
|
||||
elif [ -n "$ssid" ]; then
|
||||
printf "%s\t%s-%s-%s-%s\t%s\n" "$quality" "$enc" "$ccmp" "$tkip" "$psk" "$ssid"
|
||||
fi
|
||||
|
||||
## Initialize the variables
|
||||
ssid=""
|
||||
enc="Open"
|
||||
ccmp=""
|
||||
tkip=""
|
||||
psk=""
|
||||
quality=""
|
||||
;;
|
||||
SSID:* )
|
||||
## Set the ssid variable
|
||||
ssid=$(echo "$line" | sed s/"SSID: "//)
|
||||
;;
|
||||
signal:* )
|
||||
## Set signal quality variable
|
||||
quality=$(echo "$line" | sed s/"signal: "//)
|
||||
;;
|
||||
capability:* )
|
||||
## Encryption is on. We assume it's WEP by default, if we later find out it's WPA or WPA2 we override it
|
||||
if [ $(echo $line | grep "Privacy" | wc -l) -ne 0 ]; then
|
||||
enc="WEP"
|
||||
fi
|
||||
;;
|
||||
RSN:* )
|
||||
## Set Encryption to be WPA2
|
||||
enc="WPA2"
|
||||
;;
|
||||
WPA* )
|
||||
enc="WPA"
|
||||
;;
|
||||
"* Pairwise ciphers:"* )
|
||||
## Set the appropriate cipher variables
|
||||
if [ $(echo $line | grep "CCMP" | wc -l) -ne 0 ]; then
|
||||
ccmp="CCMP"
|
||||
fi
|
||||
if [ $(echo $line | grep "TKIP" | wc -l) -ne 0 ]; then
|
||||
tkip="TKIP"
|
||||
fi
|
||||
;;
|
||||
"* Authentication suites:"* )
|
||||
## Set the appropriate Authentication Suite variable
|
||||
if [ $(echo $line | grep "PSK" | wc -l) -ne 0 ]; then
|
||||
psk="PSK";
|
||||
fi
|
||||
;;
|
||||
* ) ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "$enc" == "Open" ] || [ "$enc" == "WEP" ]; then
|
||||
printf "%s\t%s\t%s\n" "$quality" "$enc" "$ssid"
|
||||
elif [ -n "$ssid" ]; then
|
||||
printf "%s\t%s-%s-%s-%s\t%s\n" "$quality" "$enc" "$ccmp" "$tkip" "$psk" "$ssid"
|
||||
fi
|
||||
}
|
||||
fi
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Copyright (c) 2014, AllSeen Alliance. All rights reserved.
|
||||
#
|
||||
# Permission to use, copy, modify, and/or distribute this software for any
|
||||
# purpose with or without fee is hereby granted, provided that the above
|
||||
# copyright notice and this permission notice appear in all copies.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#
|
||||
|
||||
iwlist scanning 2> /dev/null |
|
||||
grep -e "Quality=" -e "ESSID:" -e "Encryption key:on" -e "IE:" -e "Pairwise Ciphers" -e "Authentication Suites" |
|
||||
{
|
||||
while read -r line; do
|
||||
case "$line" in
|
||||
ESSID:\"* )
|
||||
## Handling a new SSID. Print out previously processed SSID only if it is defined.
|
||||
## Note the different syntax based on WPA/WPA2 VS Open or WEP
|
||||
if [ "$enc" == "Open" ] || [ "$enc" == "WEP" ]; then
|
||||
printf "%s\t%s\t%s\n" "$quality" "$enc" "$ssid"
|
||||
elif [ -n "$ssid" ]; then
|
||||
printf "%s\t%s-%s-%s-%s\t%s\n" "$quality" "$enc" "$ccmp" "$tkip" "$psk" "$ssid"
|
||||
fi
|
||||
|
||||
## Initialize the variables
|
||||
ssid=$(echo "${line%?}" | sed s/ESSID:\"//)
|
||||
enc="Open"
|
||||
ccmp=""
|
||||
tkip=""
|
||||
psk=""
|
||||
quality=""
|
||||
;;
|
||||
Quality=* )
|
||||
## Set signal quality variables
|
||||
quality=$(echo "$line" | sed s/.*"Signal level="// | sed s/" dBm".*/" dBm"/)
|
||||
;;
|
||||
Encryption* )
|
||||
## Encryption is on. We assume it's WEP by default, if we later find out it's WPA or WPA2 we override it
|
||||
enc="WEP"
|
||||
;;
|
||||
IE:* )
|
||||
## Set Encryption to be WPA or WPA2
|
||||
case "$line" in
|
||||
*WPA2* )
|
||||
enc="WPA2"
|
||||
;;
|
||||
*WPA* )
|
||||
enc="WPA"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
Pairwise* )
|
||||
## Set the appropriate cipher variables
|
||||
if [ $(echo $line | grep "CCMP" | wc -l) -ne 0 ]; then
|
||||
ccmp="CCMP"
|
||||
fi
|
||||
if [ $(echo $line | grep "TKIP" | wc -l) -ne 0 ]; then
|
||||
tkip="TKIP"
|
||||
fi
|
||||
;;
|
||||
Authentication* )
|
||||
## Set the appropriate Authentication Suite variable
|
||||
if [ $(echo $line | grep "PSK" | wc -l) -ne 0 ]; then
|
||||
psk="PSK";
|
||||
fi
|
||||
;;
|
||||
* ) ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "$enc" == "Open" ] || [ "$enc" == "WEP" ]; then
|
||||
printf "%s\t%s\t%s\n" "$quality" "$enc" "$ssid"
|
||||
elif [ -n "$ssid" ]; then
|
||||
printf "%s\t%s-%s-%s-%s\t%s\n" "$quality" "$enc" "$ccmp" "$tkip" "$psk" "$ssid"
|
||||
fi
|
||||
}
|
||||
|
|
@ -1,337 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Copyright (c) 2013 - 2014, AllSeen Alliance. All rights reserved.
|
||||
#
|
||||
# Permission to use, copy, modify, and/or distribute this software for any
|
||||
# purpose with or without fee is hereby granted, provided that the above
|
||||
# copyright notice and this permission notice appear in all copies.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#
|
||||
|
||||
. /lib/config/uci.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
DEBUG=
|
||||
|
||||
ERROR_NONE=0
|
||||
ERROR_UNREACHABLE=1
|
||||
ERROR_PROTOCOL=2
|
||||
ERROR_UNAUTHORIZED=3
|
||||
ERROR_GENERAL=4
|
||||
|
||||
WPA_CLI() {
|
||||
local iface=$1;shift
|
||||
local opt
|
||||
case ${iface} in
|
||||
global) opt="-g /var/run/wpa_supplicant-${iface}" ;;
|
||||
*) opt="-p /var/run/wpa_supplicant-${iface} -i ${iface}";;
|
||||
esac
|
||||
if [ -n "${DEBUG}" ]; then
|
||||
echo wpa_cli ${opt} "$@" >&2
|
||||
wpa_cli ${opt} "$@" || exit 2
|
||||
return 0
|
||||
fi
|
||||
wpa_cli ${opt} "$@" >/dev/null 2>&1 || exit 2
|
||||
}
|
||||
|
||||
wifi_connect() {
|
||||
local ssid=$(uci get alljoyn-onboarding.@onboarding[0].ssid)
|
||||
local encryption=$(uci get alljoyn-onboarding.@onboarding[0].encryption)
|
||||
local key=$(uci get alljoyn-onboarding.@onboarding[0].key)
|
||||
|
||||
if [ "$encryption" = "wep" ]; then
|
||||
local getwepkey="uci get alljoyn-onboarding.@onboarding[0].key$key"
|
||||
uci set wireless.@wifi-iface[0].key$key="$($getwepkey)"
|
||||
fi
|
||||
|
||||
uci set wireless.@wifi-iface[0].mode=sta
|
||||
uci set wireless.@wifi-iface[0].network=obswifi
|
||||
uci set wireless.@wifi-iface[0].ssid="$ssid"
|
||||
uci set wireless.@wifi-iface[0].key="$key"
|
||||
uci set wireless.@wifi-iface[0].encryption=$encryption
|
||||
uci delete wireless.@wifi-iface[0].hidden
|
||||
uci commit wireless
|
||||
wifi
|
||||
|
||||
# when in station mode, set the scan_wifi cron job to run every hour
|
||||
/etc/init.d/cron stop
|
||||
sed -i '/\/usr\/sbin\/wifi_scan/d' /etc/crontabs/root
|
||||
echo '1 * * * * /usr/sbin/wifi_scan' >> /etc/crontabs/root
|
||||
/etc/init.d/cron start
|
||||
}
|
||||
|
||||
wifi_softap() {
|
||||
local ssid=$(uci get alljoyn-onboarding.@onboarding[0].apssid)
|
||||
local encryption=$(uci get alljoyn-onboarding.@onboarding[0].apencryption)
|
||||
local key=$(uci get alljoyn-onboarding.@onboarding[0].apkey)
|
||||
local hidden=$(uci get alljoyn-onboarding.@onboarding[0].aphidden)
|
||||
uci set wireless.@wifi-iface[0].mode=ap
|
||||
uci set wireless.@wifi-iface[0].network=lan
|
||||
uci set wireless.@wifi-iface[0].ssid="$ssid"
|
||||
uci set wireless.@wifi-iface[0].key="$key"
|
||||
uci set wireless.@wifi-iface[0].encryption=$encryption
|
||||
uci set wireless.@wifi-iface[0].hidden=$hidden
|
||||
uci commit wireless
|
||||
wifi
|
||||
|
||||
# when in soft ap mode, set the scan_wifi cron job to run every 15 minutes
|
||||
/etc/init.d/cron stop
|
||||
sed -i '/\/usr\/sbin\/wifi_scan/d' /etc/crontabs/root
|
||||
echo '*/15 * * * * /usr/sbin/wifi_scan' >> /etc/crontabs/root
|
||||
/etc/init.d/cron start
|
||||
}
|
||||
|
||||
wifi_reset() {
|
||||
wifi
|
||||
}
|
||||
|
||||
wifi_configure_commit() {
|
||||
uci set alljoyn-onboarding.@onboarding[0].ssid="$1"
|
||||
uci set alljoyn-onboarding.@onboarding[0].encryption="$2"
|
||||
if [ "$2" = "wep" ]; then
|
||||
uci set alljoyn-onboarding.@onboarding[0].key="$5"
|
||||
uci set alljoyn-onboarding.@onboarding[0].key$5="$4"
|
||||
else
|
||||
uci set alljoyn-onboarding.@onboarding[0].key="$3"
|
||||
fi
|
||||
uci commit alljoyn-onboarding
|
||||
}
|
||||
|
||||
wifi_connect_status() {
|
||||
ifstatus=$(ifstatus obswifi)
|
||||
json_load "$ifstatus"
|
||||
json_get_var iface device
|
||||
local timeout=4
|
||||
local result=$ERROR_UNREACHABLE
|
||||
local conn_state=0
|
||||
|
||||
if [ -z $iface ]; then
|
||||
echo "Device not defined for obswifi" >&2
|
||||
set_error $ERROR_UNREACHABLE "Unreachable"
|
||||
return $result
|
||||
fi
|
||||
|
||||
while [ ${timeout} -gt 0 ]; do
|
||||
sleep 1
|
||||
ctrl_iface=$(grep ctrl_interface /var/run/wpa_supplicant-${iface}.conf | sed s/ctrl_interface=//)
|
||||
if [ -z "${ctrl_iface}" ]; then
|
||||
conn_state=$(wpa_cli -i ${iface} status 2>/dev/null | grep wpa_state | cut -d= -f2)
|
||||
else
|
||||
conn_state=$(wpa_cli -i ${iface} -p ${ctrl_iface} status 2>/dev/null | grep wpa_state | cut -d= -f2)
|
||||
fi
|
||||
echo ${conn_state} >&2
|
||||
if [ "${conn_state}" = "COMPLETED" ]; then
|
||||
result=$ERROR_NONE
|
||||
set_error $ERROR_NONE "Validated"
|
||||
return $result
|
||||
elif [ "${conn_state}" = "SCANNING" ]; then
|
||||
result=$ERROR_UNREACHABLE
|
||||
set_error $ERROR_UNREACHABLE "Unreachable"
|
||||
elif [ "${conn_state}" = "4WAY_HANDSHAKE" ]; then
|
||||
set_error $ERROR_UNAUTHORIZED "Unauthorized - 4WAY_HANDSHAKE timeout"
|
||||
result=$ERROR_UNAUTHORIZED
|
||||
elif [ "${conn_state}" = "DISCONNECTED" ]; then
|
||||
set_error $ERROR_UNAUTHORIZED "Unauthorized - DISCONNECTED"
|
||||
result=$ERROR_UNAUTHORIZED
|
||||
else
|
||||
result=$ERROR_PROTOCOL
|
||||
set_error $ERROR_PROTOCOL "Unsupported protocol"
|
||||
echo "wpa_cli returned unknown status" >&2
|
||||
fi
|
||||
timeout=$((--timeout))
|
||||
done
|
||||
|
||||
echo "Timeout --> unreachable" >&2
|
||||
return $result
|
||||
}
|
||||
|
||||
showhelp() {
|
||||
cat << EOF
|
||||
$0 -s <ssid> -a <auth>
|
||||
[-p <passphrase>] [-k key] [-i index] [ -t timeout ] [ -d ]
|
||||
|
||||
Mandatory parameters:
|
||||
-s <ssid>: Connect to SSID <ssid>
|
||||
-a <auth>: Use authentication <auth>, where <auth> can be one of:
|
||||
"open": No authentication
|
||||
"wep": WEP authentication
|
||||
"psk": WPA authentication
|
||||
"psk2": WPA2 authentication
|
||||
|
||||
Optional parameters:
|
||||
-p <passphrase>: (WEP or WPA only) Set the WEP (string) or WPA passphrase
|
||||
-k <key>: (WEP only) Set the key (hex key only, either 5 or 13 bytes len)
|
||||
-i <index>: (WEP only) Set the key index (1-4)
|
||||
-t <timeout>: Set the connection timeout (in seconds) - default=4
|
||||
-d : enable debug
|
||||
-h : print this help
|
||||
|
||||
Return value:
|
||||
0: Connection Success
|
||||
1: Connection Failed
|
||||
2: Error
|
||||
EOF
|
||||
}
|
||||
|
||||
check_params() {
|
||||
local ssid=$1
|
||||
local auth=$2
|
||||
local psk=$3
|
||||
local key=$4
|
||||
local index=$5
|
||||
|
||||
if [ -z "${auth}" ] || [ -z "${ssid}" ]; then
|
||||
echo "Error:ssid or authentication not found" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Using passphrase and/or key and/or index in Open mode is inconsistent
|
||||
if [ "${auth}" = "open" ]; then
|
||||
if [ -n "${key}" -o -n "${index}" -o -n "${psk}" ]; then
|
||||
echo "Open mode can't be used with passphrase/key/index" >&2
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# If wep is used, make sure we also got a key & its index
|
||||
if [ "${auth}" = "wep" ]; then
|
||||
if [ -z "${key}" ]; then
|
||||
echo "In WEP, please specify the key and optionally, the index" >&2
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Having a key and/or index with non-WEP encryption is inconsistent
|
||||
if [ "${auth}" != "wep" ]; then
|
||||
if [ -n "${key}" -o -n "${index}" ]; then
|
||||
echo "Index/Key can't be used with non-WEP authentication " >&2
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# If wpa is used, make sure we also got a passphrase
|
||||
case "$auth" in
|
||||
*psk*)
|
||||
if [ -z "${psk}" ]; then
|
||||
echo "In WPA, please specify a passphrase" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ $(expr length "${psk}") -lt 8 ]; then
|
||||
echo "In WPA, please specify a passphrase of size at least 8" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ $(expr length "${psk}") -eq 64 ]; then
|
||||
local i=0
|
||||
while [ $i -lt 64 ]; do
|
||||
char=${psk:$i:1}
|
||||
case "$char" in
|
||||
|
||||
[a-fA-F0-9] );;
|
||||
|
||||
* )
|
||||
echo "In WPA, please specify an ASCII passphrase of size less than 64 or a Hex passphrase of size 64" >&2
|
||||
return 1;;
|
||||
esac
|
||||
i=$((i+1))
|
||||
done
|
||||
elif [ $(expr length "${psk}") -gt 64 ]; then
|
||||
echo "In WPA, please specify an ASCII passphrase of size less than 64 or a Hex passphrase of size 64" >&2
|
||||
return 1
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
esac
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
wifi_configure() {
|
||||
# Process arguments
|
||||
local ssid auth psk key index
|
||||
|
||||
while [ -n "$1" ];do
|
||||
case "$1" in
|
||||
-s) ssid="$2"; shift;;
|
||||
-a) auth="$2"; shift
|
||||
|
||||
if [ "${auth}" = "OPEN" ]; then
|
||||
auth="none"
|
||||
fi
|
||||
|
||||
if [ "${auth}" = "WEP" ]; then
|
||||
auth="wep"
|
||||
fi
|
||||
|
||||
case "$auth" in
|
||||
WPA2*)
|
||||
auth="psk2+tkip+ccmp"
|
||||
;;
|
||||
WPA*)
|
||||
auth="psk+tkip+ccmp"
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "${auth}" = "WPS" ]; then
|
||||
auth="psk"
|
||||
fi
|
||||
|
||||
[ ${auth} = "none" ] || [ ${auth} = "wep" ] || [ ${auth} = "psk+tkip+ccmp" ] || [ ${auth} = "psk2+tkip+ccmp" ] || {
|
||||
echo "Invalid authentication \"${auth}\"" >&2
|
||||
echo "Valid authentication values are \"none\", \"wep\", \"psk+tkip+ccmp\", \"psk2+tkip+ccmp\"" >&2
|
||||
showhelp
|
||||
exit 2;
|
||||
};;
|
||||
-p) psk="$2"; shift;;
|
||||
-k) key="$2"; shift;;
|
||||
-i) index="$2"; shift
|
||||
if [ ! ${index} -ge 1 ] && [ ! ${index} -le 4 ]; then
|
||||
echo "Invalid index \"${index}\"" >&2
|
||||
echo "Valid index values are \"1\", \"2\", \"3\", \"4\"" >&2
|
||||
showhelp
|
||||
exit 2
|
||||
fi;;
|
||||
-t) timeout="$2"; shift;;
|
||||
-d) DEBUG=1;;
|
||||
-h) showhelp; exit 2;;
|
||||
*)
|
||||
echo "Invalid option: -${OPTARG}" >&2
|
||||
showhelp
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ "${auth}" = "wep" ]; then
|
||||
if [ -z "${index}" ]; then
|
||||
index=1
|
||||
echo "Defaulting index to 1" >&2
|
||||
fi
|
||||
fi
|
||||
|
||||
# Perform sanity checks on the script arguments
|
||||
check_params "${ssid}" "${auth}" "${psk}" "${key}" "${index}" || {
|
||||
showhelp
|
||||
exit 2
|
||||
}
|
||||
|
||||
|
||||
|
||||
wifi_configure_commit "${ssid}" "${auth}" "${psk}" "${key}" "${index}"
|
||||
}
|
||||
|
||||
set_error() {
|
||||
uci set -c /etc/alljoyn-onboarding alljoyn-onboarding-state.@onboarding[0].lasterrorcode=$1
|
||||
uci set -c /etc/alljoyn-onboarding alljoyn-onboarding-state.@onboarding[0].lasterrormsg="$2"
|
||||
uci commit -c /etc/alljoyn-onboarding alljoyn-onboarding-state
|
||||
printf '%s\n%s' "$1" "$2" > /tmp/state/alljoyn-onboarding-lasterror
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
# Copyright (c) 2014, AllSeen Alliance. All rights reserved.
|
||||
#
|
||||
# Permission to use, copy, modify, and/or distribute this software for any
|
||||
# purpose with or without fee is hereby granted, provided that the above
|
||||
# copyright notice and this permission notice appear in all copies.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#
|
||||
|
||||
findPid=$(pgrep /usr/sbin/wifi_scan)
|
||||
|
||||
if [ -z $findPid ]; then
|
||||
|
||||
## Get the scan results based on method available
|
||||
hasIw=$(which iw)
|
||||
hasIwList=$(which iwlist)
|
||||
|
||||
if [ -n "$hasIw" ]; then
|
||||
result=$(/usr/sbin/parse_iw_wifi_scan)
|
||||
elif [ -n "$hasIwList" ]; then
|
||||
result=$(/usr/sbin/parse_iwlist_wifi_scan)
|
||||
fi
|
||||
|
||||
## Sort the results based on signal strength and print it to the file
|
||||
if [ -n "$result" ]; then
|
||||
printf "$result" | sort -n -r | awk '{sep="";for (i=4;i<=NF;i++) {printf "%s%s",sep, $i;sep=" "}; printf "\t"$3"\n"}' | sort | uniq > /tmp/wifi_scan_results
|
||||
fi
|
||||
fi
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
|
||||
# Copyright (c) 2013 - 2014, AllSeen Alliance. All rights reserved.
|
||||
#
|
||||
# Permission to use, copy, modify, and/or distribute this software for any
|
||||
# purpose with or without fee is hereby granted, provided that the above
|
||||
# copyright notice and this permission notice appear in all copies.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#
|
||||
|
||||
START=61
|
||||
|
||||
boot() {
|
||||
# Schedule the script to refresh the results with a cron job
|
||||
/etc/init.d/cron stop
|
||||
sed -i '/\/usr\/sbin\/wifi_scan/d' /etc/crontabs/root
|
||||
echo '*/15 * * * * /usr/sbin/wifi_scan' >> /etc/crontabs/root
|
||||
/etc/init.d/cron start
|
||||
}
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
AJ_SERVICE:=sample_apps
|
||||
AJ_SERVICE_NAME:=sample_apps
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=alljoyn-$(AJ_SERVICE)
|
||||
PKG_BASE_VERSION:=14.12
|
||||
PKG_PATCHLEVEL:=.00
|
||||
PKG_RELEASE:=1
|
||||
PKG_MD5SUM:=389c2623619281e6849da25cee7e1bb7
|
||||
PKG_VERSION:=$(PKG_BASE_VERSION)$(PKG_PATCHLEVEL)
|
||||
PKG_TARBALL_VERSION:=$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/alljoyn-services-$(PKG_TARBALL_VERSION)-src
|
||||
PKG_SOURCE:=alljoyn-services-$(PKG_TARBALL_VERSION)-src.tar.gz
|
||||
PKG_SOURCE_URL:=https://allseenalliance.org/releases/alljoyn/$(PKG_BASE_VERSION)/
|
||||
|
||||
# SCons supports parallel builds but does not support make's jobserver
|
||||
PKG_BUILD_PARALLEL:=$(if $(CONFIG_PKG_BUILD_USE_JOBSERVER),0,1)
|
||||
|
||||
PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifneq ($(CONFIG_CCACHE),)
|
||||
TARGET_CC=$(TARGET_CC_NOCACHE)
|
||||
TARGET_CXX=$(TARGET_CXX_NOCACHE)
|
||||
endif
|
||||
|
||||
ALLJOYN_BINDINGS:=cpp,
|
||||
ALLJOYN_BUILD_SERVICES_SAMPLES:=on
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
TITLE:=AllJoyn services $(AJ_SERVICE_NAME) - sample applications
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=alljoyn \
|
||||
+alljoyn-about \
|
||||
+alljoyn-config \
|
||||
+alljoyn-controlpanel \
|
||||
+alljoyn-notification \
|
||||
+alljoyn-services_common
|
||||
URL:=http://www.allseenalliance.org
|
||||
MAINTAINER:=AllSeen Alliance <allseen-core@lists.allseenalliance.org>
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
AllJoyn services $(AJ_SERVICE_NAME) sample applications - includes ServerSample and ACServerSample.
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_DEBUG),y)
|
||||
ALLJOYN_BUILD_VARIANT:=debug
|
||||
else
|
||||
ALLJOYN_BUILD_VARIANT:=release
|
||||
endif
|
||||
|
||||
|
||||
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/services/base/$(AJ_SERVICE)/build/openwrt/openwrt/$(ALLJOYN_BUILD_VARIANT)/dist/$(AJ_SERVICE)
|
||||
|
||||
TARGET_CFLAGS+=-fPIC
|
||||
TARGET_CPPFLAGS+=-fPIC
|
||||
|
||||
define Build/Configure/Default
|
||||
# Override default to do nothing
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
scons -C $(PKG_BUILD_DIR)/services/base/$(AJ_SERVICE) \
|
||||
$(PKG_JOBS) \
|
||||
WS=off \
|
||||
CPU=openwrt \
|
||||
OS=openwrt \
|
||||
"BINDINGS=$(ALLJOYN_BINDINGS)" \
|
||||
"BUILD_SERVICES_SAMPLES=$(ALLJOYN_BUILD_SERVICES_SAMPLES)" \
|
||||
"VARIANT=$(ALLJOYN_BUILD_VARIANT)" \
|
||||
BR=off \
|
||||
BT=off \
|
||||
ICE=off \
|
||||
"TARGET_CC=$$(TARGET_CC)" \
|
||||
"TARGET_CXX=$$(TARGET_CXX)" \
|
||||
"TARGET_CFLAGS=$$(TARGET_CFLAGS)" \
|
||||
"TARGET_CPPFLAGS=$$(TARGET_CPPFLAGS)" \
|
||||
"TARGET_PATH=$$(TARGET_PATH)" \
|
||||
"TARGET_LINKFLAGS=$$(TARGET_LDFLAGS)" \
|
||||
"TARGET_LINK=$$(TARGET_CC)" \
|
||||
"TARGET_AR=$$(TARGET_AR)" \
|
||||
"TARGET_RANLIB=$$(TARGET_RANLIB)" \
|
||||
"STAGING_DIR=$$(STAGING_DIR)" \
|
||||
"ALL=1"
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/* $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/* $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
||||
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
AJ_SERVICE:=services_common
|
||||
AJ_SERVICE_NAME:=Services Common
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=alljoyn-$(AJ_SERVICE)
|
||||
PKG_BASE_VERSION:=14.12
|
||||
PKG_PATCHLEVEL:=.00
|
||||
PKG_RELEASE:=1
|
||||
PKG_MD5SUM:=389c2623619281e6849da25cee7e1bb7
|
||||
PKG_VERSION:=$(PKG_BASE_VERSION)$(PKG_PATCHLEVEL)
|
||||
PKG_TARBALL_VERSION:=$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/alljoyn-services-$(PKG_TARBALL_VERSION)-src
|
||||
PKG_SOURCE:=alljoyn-services-$(PKG_TARBALL_VERSION)-src.tar.gz
|
||||
PKG_SOURCE_URL:=https://allseenalliance.org/releases/alljoyn/$(PKG_BASE_VERSION)/
|
||||
|
||||
# SCons supports parallel builds but does not support make's jobserver
|
||||
PKG_BUILD_PARALLEL:=$(if $(CONFIG_PKG_BUILD_USE_JOBSERVER),0,1)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifneq ($(CONFIG_CCACHE),)
|
||||
TARGET_CC=$(TARGET_CC_NOCACHE)
|
||||
TARGET_CXX=$(TARGET_CXX_NOCACHE)
|
||||
endif
|
||||
|
||||
ALLJOYN_BINDINGS:=cpp,
|
||||
ALLJOYN_BUILD_SERVICES_SAMPLES:=off
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
TITLE:=AllJoyn $(AJ_SERVICE_NAME) service library
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=alljoyn
|
||||
URL:=http://www.allseenalliance.org
|
||||
MAINTAINER:=AllSeen Alliance <allseen-core@lists.allseenalliance.org>
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
AllJoyn $(AJ_SERVICE_NAME) service library.
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_DEBUG),y)
|
||||
ALLJOYN_BUILD_VARIANT:=debug
|
||||
else
|
||||
ALLJOYN_BUILD_VARIANT:=release
|
||||
endif
|
||||
|
||||
|
||||
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/services/base/$(AJ_SERVICE)/build/openwrt/openwrt/$(ALLJOYN_BUILD_VARIANT)/dist/$(AJ_SERVICE)
|
||||
|
||||
TARGET_CFLAGS+=-fPIC
|
||||
TARGET_CPPFLAGS+=-fPIC
|
||||
|
||||
define Build/Configure/Default
|
||||
# Override default to do nothing
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
scons -C $(PKG_BUILD_DIR)/services/base/$(AJ_SERVICE) \
|
||||
$(PKG_JOBS) \
|
||||
WS=off \
|
||||
CPU=openwrt \
|
||||
OS=openwrt \
|
||||
"BINDINGS=$(ALLJOYN_BINDINGS)" \
|
||||
"BUILD_SERVICES_SAMPLES=$(ALLJOYN_BUILD_SERVICES_SAMPLES)" \
|
||||
"VARIANT=$(ALLJOYN_BUILD_VARIANT)" \
|
||||
BR=off \
|
||||
BT=off \
|
||||
ICE=off \
|
||||
"TARGET_CC=$$(TARGET_CC)" \
|
||||
"TARGET_CXX=$$(TARGET_CXX)" \
|
||||
"TARGET_CFLAGS=$$(TARGET_CFLAGS)" \
|
||||
"TARGET_CPPFLAGS=$$(TARGET_CPPFLAGS)" \
|
||||
"TARGET_PATH=$$(TARGET_PATH)" \
|
||||
"TARGET_LINKFLAGS=$$(TARGET_LDFLAGS)" \
|
||||
"TARGET_LINK=$$(TARGET_CC)" \
|
||||
"TARGET_AR=$$(TARGET_AR)" \
|
||||
"TARGET_RANLIB=$$(TARGET_RANLIB)" \
|
||||
"STAGING_DIR=$$(STAGING_DIR)"
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/alljoyn/$(AJ_SERVICE)
|
||||
$(CP) $(PKG_INSTALL_DIR)/inc/alljoyn/$(AJ_SERVICE)/*.h $(1)/usr/include/alljoyn/$(AJ_SERVICE)
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/lib/liballjoyn_$(AJ_SERVICE).a $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/lib/liballjoyn_$(AJ_SERVICE).so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/lib/liballjoyn_$(AJ_SERVICE).so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
|
@ -1,301 +0,0 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=alljoyn
|
||||
PKG_BASE_VERSION:=14.12
|
||||
PKG_PATCHLEVEL:=a
|
||||
PKG_RELEASE:=1
|
||||
PKG_MD5SUM:=1435d8611a26bfde115a771ab7cd3d74
|
||||
PKG_VERSION:=$(PKG_BASE_VERSION)$(PKG_PATCHLEVEL)
|
||||
PKG_TARBALL_VERSION:=$(PKG_BASE_VERSION).00$(PKG_PATCHLEVEL)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_TARBALL_VERSION)-src
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_TARBALL_VERSION)-src.tar.gz
|
||||
PKG_SOURCE_URL:=https://allseenalliance.org/releases/alljoyn/$(PKG_BASE_VERSION)/
|
||||
|
||||
# SCons supports parallel builds but does not support make's jobserver
|
||||
PKG_BUILD_PARALLEL:=$(if $(CONFIG_PKG_BUILD_USE_JOBSERVER),0,1)
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_DEBUG \
|
||||
CONFIG_PACKAGE_alljoyn-c \
|
||||
CONFIG_PACKAGE_alljoyn-about \
|
||||
CONFIG_PACKAGE_alljoyn-samples
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifneq ($(CONFIG_CCACHE),)
|
||||
TARGET_CC=$(TARGET_CC_NOCACHE)
|
||||
TARGET_CXX=$(TARGET_CXX_NOCACHE)
|
||||
endif
|
||||
|
||||
define Package/alljoyn/Default
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=+libopenssl +libpthread +librt +libstdcpp
|
||||
URL:=http://www.allseenalliance.org
|
||||
MAINTAINER:=AllSeen Alliance <allseen-core@lists.allseenalliance.org>
|
||||
endef
|
||||
|
||||
define Package/alljoyn
|
||||
$(call Package/alljoyn/Default)
|
||||
TITLE:=AllJoyn Peer-to-Peer networking
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define Package/alljoyn/description
|
||||
AllJoyn is a daemon and application framework for developing
|
||||
ad hoc peer-to-peer applications. This includes the run-time
|
||||
daemon and C++ library.
|
||||
endef
|
||||
|
||||
|
||||
define Package/alljoyn-non-gw-config
|
||||
$(call Package/alljoyn/Default)
|
||||
TITLE:=AllJoyn - alternate non-Gateway Config
|
||||
DEPENDS:=alljoyn
|
||||
endef
|
||||
|
||||
define Package/alljoyn-non-gw-config/description
|
||||
Alternate AllJoyn configuration with defaults suitable for
|
||||
non-Gateway devices. Do not install this on devices with a
|
||||
network interface connected to an insecure network such as
|
||||
the Internet.
|
||||
endef
|
||||
|
||||
|
||||
define Package/alljoyn-c
|
||||
$(call Package/alljoyn/Default)
|
||||
TITLE:=AllJoyn - C binding
|
||||
DEPENDS:=alljoyn
|
||||
endef
|
||||
|
||||
define Package/alljoyn-c/description
|
||||
AllJoyn C binding. This provides a C library for building
|
||||
AllJoyn programs in C. This is just a C callable wrapper
|
||||
to the C++ library.
|
||||
endef
|
||||
|
||||
|
||||
define Package/alljoyn-about
|
||||
$(call Package/alljoyn/Default)
|
||||
TITLE:=AllJoyn - About service library (deprecated)
|
||||
DEPENDS:=alljoyn
|
||||
endef
|
||||
|
||||
define Package/alljoyn-about/description
|
||||
AllJoyn About services library. This library is deprecated. The functionality
|
||||
provided by About has been integrated into liballjoyn with a simpler API. This
|
||||
library will continue to be supported into 2015 and will be removed in 2016.
|
||||
endef
|
||||
|
||||
define Package/alljoyn-samples
|
||||
$(call Package/alljoyn/Default)
|
||||
TITLE:=AllJoyn - testing samples
|
||||
DEPENDS:=alljoyn \
|
||||
+PACKAGE_alljoyn-about:alljoyn-about
|
||||
endef
|
||||
|
||||
define Package/alljoyn-samples/description
|
||||
Alljoyn samples. (This is primarily for testing. The contents of this
|
||||
package vary according which other alljoyn packages are selected.)
|
||||
endef
|
||||
|
||||
ALLJOYN_BINDINGS:=cpp,
|
||||
ALLJOYN_SERVICES:=
|
||||
ALLJOYN_BUILD_SERVICES_SAMPLES:=off
|
||||
|
||||
ifdef CONFIG_PACKAGE_alljoyn-c
|
||||
ALLJOYN_BINDINGS+=c,
|
||||
endif
|
||||
|
||||
ifdef CONFIG_PACKAGE_alljoyn-about
|
||||
ALLJOYN_SERVICES+=about,
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(CONFIG_DEBUG),y)
|
||||
ALLJOYN_BUILD_VARIANT:=debug
|
||||
else
|
||||
ALLJOYN_BUILD_VARIANT:=release
|
||||
endif
|
||||
|
||||
|
||||
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/build/openwrt/openwrt/$(ALLJOYN_BUILD_VARIANT)/dist
|
||||
|
||||
TARGET_CFLAGS+=-fPIC
|
||||
TARGET_CPPFLAGS+=-fPIC
|
||||
|
||||
define Build/Configure
|
||||
# Override default to do nothing
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
scons -C $(PKG_BUILD_DIR) \
|
||||
$(PKG_JOBS) \
|
||||
WS=off \
|
||||
CPU=openwrt \
|
||||
OS=openwrt \
|
||||
"BINDINGS=$(ALLJOYN_BINDINGS)" \
|
||||
"SERVICES=$(ALLJOYN_SERVICES)" \
|
||||
"BUILD_SERVICES_SAMPLES=$(ALLJOYN_BUILD_SERVICES_SAMPLES)" \
|
||||
"VARIANT=$(ALLJOYN_BUILD_VARIANT)" \
|
||||
BR=off \
|
||||
ICE=off \
|
||||
POLICYDB=on \
|
||||
"TARGET_CC=$$(TARGET_CC)" \
|
||||
"TARGET_CXX=$$(TARGET_CXX)" \
|
||||
"TARGET_CFLAGS=$$(TARGET_CFLAGS)" \
|
||||
"TARGET_CPPFLAGS=$$(TARGET_CPPFLAGS)" \
|
||||
"TARGET_PATH=$$(TARGET_PATH)" \
|
||||
"TARGET_LINKFLAGS=$$(TARGET_LDFLAGS)" \
|
||||
"TARGET_LINK=$$(TARGET_CC)" \
|
||||
"TARGET_AR=$$(TARGET_AR)" \
|
||||
"TARGET_RANLIB=$$(TARGET_RANLIB)" \
|
||||
"STAGING_DIR=$$(STAGING_DIR)"
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/include/alljoyn
|
||||
$(INSTALL_DIR) $(1)/usr/include/qcc
|
||||
$(INSTALL_DIR) $(1)/usr/include/qcc/posix
|
||||
$(CP) $(PKG_INSTALL_DIR)/cpp/inc/alljoyn/*.h $(1)/usr/include/alljoyn/
|
||||
$(CP) $(PKG_INSTALL_DIR)/cpp/inc/qcc/*.h $(1)/usr/include/qcc/
|
||||
$(CP) $(PKG_INSTALL_DIR)/cpp/inc/qcc/posix/*.h $(1)/usr/include/qcc/posix/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/cpp/lib/liballjoyn.a $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/cpp/lib/liballjoyn.so $(1)/usr/lib/
|
||||
ifdef CONFIG_PACKAGE_alljoyn-about
|
||||
$(INSTALL_DIR) $(1)/usr/include/alljoyn/about
|
||||
$(CP) $(PKG_INSTALL_DIR)/cpp/inc/alljoyn/about/*.h $(1)/usr/include/alljoyn/about
|
||||
$(CP) $(PKG_INSTALL_DIR)/cpp/lib/liballjoyn_about.a $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/cpp/lib/liballjoyn_about.so $(1)/usr/lib/
|
||||
endif
|
||||
ifdef CONFIG_PACKAGE_alljoyn-c
|
||||
$(INSTALL_DIR) $(1)/usr/include/alljoyn_c
|
||||
$(CP) $(PKG_INSTALL_DIR)/c/inc/alljoyn_c/*.h $(1)/usr/include/alljoyn_c/
|
||||
$(CP) $(PKG_INSTALL_DIR)/c/lib/liballjoyn_c.a $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/c/lib/liballjoyn_c.so $(1)/usr/lib/
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/alljoyn/conffiles
|
||||
/etc/alljoyn/alljoyn.conf
|
||||
/etc/config/alljoyn
|
||||
endef
|
||||
|
||||
define Package/alljoyn-non-gw-config/conffiles
|
||||
/etc/config/alljoyn
|
||||
endef
|
||||
|
||||
define Package/alljoyn/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/alljoyn-daemon $(1)/usr/bin
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/cpp/lib/liballjoyn.so $(1)/usr/lib/
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/alljoyn.init $(1)/etc/init.d/alljoyn
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) ./files/alljoyn.defaults $(1)/etc/uci-defaults/alljoyn
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) ./files/alljoyn.config $(1)/etc/config/alljoyn
|
||||
$(INSTALL_DIR) $(1)/etc/alljoyn
|
||||
$(INSTALL_CONF) ./files/alljoyn.conf $(1)/etc/alljoyn/alljoyn.conf
|
||||
endef
|
||||
|
||||
define Package/alljoyn-non-gw-config/install
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) ./files/alljoyn-non-gw.config $(1)/etc/config/alljoyn
|
||||
endef
|
||||
|
||||
define Package/alljoyn-c/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/c/lib/liballjoyn_c.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/alljoyn-about/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/cpp/lib/liballjoyn_about.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/alljoyn-samples/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/advtunnel $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/aes_ccm $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/bastress $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/bastress2 $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/bbclient $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/bbjitter $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/bbjoin $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/bbservice $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/bbsig $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/bignum $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/compression $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/keystore $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/marshal $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/names $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/ns $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/rawclient $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/rawservice $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/remarshal $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/rsa $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/sessions $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/socktest $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/srp $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/unpack $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/samples/AboutClient $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/samples/AboutService $(1)/usr/bin/
|
||||
ifdef CONFIG_PACKAGE_alljoyn-about
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/cpp/bin/samples/sample_rule_app $(1)/usr/bin/
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/alljoyn/postinst
|
||||
#!/bin/sh
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
. /etc/uci-defaults/alljoyn
|
||||
rm -f /etc/uci-defaults/alljoyn
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/alljoyn/prerm
|
||||
#!/bin/sh
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
/etc/init.d/alljoyn stop
|
||||
/etc/init.d/alljoyn disable
|
||||
uci batch <<EOF
|
||||
del_list ucitrack.@network[-1].affects=alljoyn
|
||||
delete ucitrack.@alljoyn[-1]
|
||||
commit ucitrack
|
||||
EOF
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
|
||||
define Package/alljoyn-non-gw-config/preinst
|
||||
#!/bin/sh
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
echo 'Saving original alljoyn config file to alljoyn-orig'
|
||||
mv /etc/config/alljoyn /etc/config/alljoyn-orig
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/alljoyn-non-gw-config/postrm
|
||||
#!/bin/sh
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
if [ -e /etc/config/alljoyn-orig ]; then
|
||||
echo 'Restoring original alljoyn config file from alljoyn-orig'
|
||||
mv /etc/config/alljoyn-orig /etc/config/alljoyn
|
||||
fi
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,alljoyn))
|
||||
$(eval $(call BuildPackage,alljoyn-non-gw-config))
|
||||
$(eval $(call BuildPackage,alljoyn-c))
|
||||
$(eval $(call BuildPackage,alljoyn-about))
|
||||
$(eval $(call BuildPackage,alljoyn-samples))
|
||||
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
config transport 'unix'
|
||||
option enable '1'
|
||||
option path 'alljoyn'
|
||||
option abstract '1'
|
||||
|
||||
config transport 'ip'
|
||||
option enable '1'
|
||||
option max_incomplete_conn '16'
|
||||
option max_complete_conn '96'
|
||||
option bus_port '9955'
|
||||
option auth_timeout '20000'
|
||||
option advertise_daemon '1'
|
||||
option all_networks '1'
|
||||
list networks
|
||||
|
||||
config transport 'slap'
|
||||
option enable '0'
|
||||
option path '/dev/ttyUSB0'
|
||||
option baud 115200
|
||||
option databits 8
|
||||
option parity 'none'
|
||||
option stopbits 1
|
||||
|
||||
config daemon 'daemon'
|
||||
option user 'nobody'
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||
|
||||
<!--
|
||||
Copyright (c) 2014, AllSeen Alliance. All rights reserved.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
-->
|
||||
|
||||
<busconfig>
|
||||
<type>alljoyn</type>
|
||||
<fork/>
|
||||
<syslog/>
|
||||
|
||||
<!-- Default limits -->
|
||||
<limit name="auth_timeout">20000</limit>
|
||||
<limit name="max_incomplete_connections">16</limit>
|
||||
<limit name="max_completed_connections">96</limit>
|
||||
<limit name="max_untrusted_clients">96</limit>
|
||||
<flag name="restrict_untrusted_clients">false</flag>
|
||||
|
||||
<!-- Include configuration file generated from /etc/config/alljoyn -->
|
||||
<include>/var/etc/alljoyn.conf</include>
|
||||
|
||||
<!-- Include Gateway Agent policy rules configuration -->
|
||||
<includedir ignore_missing="yes">/etc/alljoyn/gwagent</includeidr>
|
||||
|
||||
</busconfig>
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
config transport 'unix'
|
||||
option enable '1'
|
||||
option path 'alljoyn'
|
||||
option abstract '1'
|
||||
|
||||
config transport 'ip'
|
||||
option enable '1'
|
||||
option max_incomplete_conn '16'
|
||||
option max_complete_conn '96'
|
||||
option bus_port '9955'
|
||||
option auth_timeout '20000'
|
||||
option advertise_daemon '1'
|
||||
option all_networks '0'
|
||||
list networks 'lan'
|
||||
|
||||
config transport 'slap'
|
||||
option enable '0'
|
||||
option path '/dev/ttyUSB0'
|
||||
option baud 115200
|
||||
option databits 8
|
||||
option parity 'none'
|
||||
option stopbits 1
|
||||
|
||||
config daemon 'daemon'
|
||||
option user 'nobody'
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
#! /bin/sh
|
||||
uci batch <<EOF
|
||||
add ucitrack alljoyn
|
||||
set ucitrack.@alljoyn[-1].init=alljoyn
|
||||
add_list ucitrack.@network[-1].affects=alljoyn
|
||||
commit ucitrack
|
||||
EOF
|
||||
/etc/init.d/alljoyn enable
|
||||
exit 0
|
||||
|
|
@ -1,170 +0,0 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
|
||||
# Copyright (c) 2013-2015, AllSeen Alliance. All rights reserved.
|
||||
#
|
||||
# Permission to use, copy, modify, and/or distribute this software for any
|
||||
# purpose with or without fee is hereby granted, provided that the above
|
||||
# copyright notice and this permission notice appear in all copies.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#
|
||||
|
||||
START=65
|
||||
|
||||
SERVICE_PID_FILE=/var/run/alljoyn.pid
|
||||
|
||||
CONFIGFILE="/etc/alljoyn/alljoyn.conf"
|
||||
GENCONFIGFILE="/var/etc/alljoyn.conf"
|
||||
|
||||
|
||||
check() {
|
||||
local flag
|
||||
|
||||
config_get_bool flag "$1" "$2" 0
|
||||
|
||||
test "$flag" == "1"
|
||||
return $?
|
||||
}
|
||||
|
||||
|
||||
process_unix_transport() {
|
||||
if check unix enable; then
|
||||
local path
|
||||
local abstract
|
||||
|
||||
|
||||
config_get path unix path "alljoyn"
|
||||
config_get_bool abstract unix abstract "1"
|
||||
|
||||
if [ -n "$abstract" ]; then
|
||||
path="abstract=$path"
|
||||
else
|
||||
path="path=$path"
|
||||
fi
|
||||
export ${NO_EXPORT:+-n} listen_specs="${listen_specs}
|
||||
<listen>unix:${path}</listen>"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
process_ip_network() {
|
||||
local network="$1"
|
||||
local port="$2"
|
||||
local ifname
|
||||
|
||||
config_get ifname "$network" ifname
|
||||
if [ -n "$ifname" ]; then
|
||||
export ${NO_EXPORT:+-n} listen_specs="${listen_specs}
|
||||
<listen>tcp:iface=${ifname},port=${port}</listen>
|
||||
<listen>udp:iface=${ifname},port=${port}</listen>"
|
||||
fi
|
||||
}
|
||||
|
||||
process_ip_transport() {
|
||||
if check ip enable; then
|
||||
local port
|
||||
|
||||
if check ip advertise_daemon; then
|
||||
export ${NO_EXPORT:+-n} ip_advertise_daemon="<property name=\"router_advertisement_prefix\">org.alljoyn.BusNode.</property>"
|
||||
fi
|
||||
|
||||
config_get port ip bus_port 9955
|
||||
|
||||
if check ip all_networks; then
|
||||
export ${NO_EXPORT:+-n} listen_specs="${listen_specs}
|
||||
<listen>tcp:iface=*,port=${port}</listen>
|
||||
<listen>udp:iface=*,port=${port}</listen>"
|
||||
else
|
||||
config_load network
|
||||
config_load alljoyn # loading the network config clobbers the alljoyn config vars
|
||||
config_list_foreach ip networks process_ip_network "${port}"
|
||||
fi
|
||||
|
||||
config_get ip_max_incomplete_conn ip max_incomplete_conn "$ip_max_incomplete_conn"
|
||||
config_get ip_max_complete_conn ip max_complete_conn "$ip_max_complete_conn"
|
||||
config_get ip_auth_timeout ip auth_timeout "$ip_auth_timeout"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
process_slap_transport() {
|
||||
if check slap enable; then
|
||||
local path
|
||||
local baud
|
||||
|
||||
config_get path slap path "/dev/ttyUSB0"
|
||||
config_get baud slap baud "115200"
|
||||
config_get databits slap databits "8"
|
||||
config_get parity slap parity "none"
|
||||
config_get stopbits slap stopbits "1"
|
||||
|
||||
export ${NO_EXPORT:+-n} listen_specs="${listen_specs}
|
||||
<listen>slap:type=uart;dev=${path};baud=${baud};databits=${databits};parity=${parity};stopbits=${stopbits}</listen>"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
process_switch_user() {
|
||||
local user
|
||||
|
||||
config_get user daemon user "root"
|
||||
|
||||
if [ "$user" != "root" ]; then
|
||||
export ${NO_EXPORT:+-n} switch_user="<user>${user}</user>"
|
||||
fi
|
||||
}
|
||||
|
||||
generate_conf_file() {
|
||||
local listen_specs=""
|
||||
|
||||
local ip_max_incomplete_conn=16
|
||||
local ip_max_complete_conn=64
|
||||
local ip_auth_timeout=20000
|
||||
local ip_networks=""
|
||||
local ip_advertise_daemon=""
|
||||
local switch_user=""
|
||||
|
||||
rm -f $GENCONFIGFILE
|
||||
|
||||
include /lib/network
|
||||
|
||||
config_load alljoyn
|
||||
|
||||
process_unix_transport
|
||||
process_ip_transport
|
||||
process_slap_transport
|
||||
process_switch_user
|
||||
|
||||
mkdir -p $(dirname $GENCONFIGFILE)
|
||||
|
||||
cat > $GENCONFIGFILE <<EOF
|
||||
<busconfig>
|
||||
<pidfile>${SERVICE_PID_FILE}</pidfile>
|
||||
${switch_user}
|
||||
${listen_specs}
|
||||
${ip_advertise_daemon}
|
||||
<limit name="auth_timeout">${ip_auth_timeout}</limit>
|
||||
<limit name="max_incomplete_connections">${ip_max_incomplete_conn}</limit>
|
||||
<limit name="max_completed_connections">${ip_max_complete_conn}</limit>
|
||||
<limit name="max_untrusted_clients">${ip_max_complete_conn}</limit>
|
||||
</busconfig>
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
start() {
|
||||
generate_conf_file
|
||||
if [ -e $CONFIGFILE ]; then
|
||||
service_start /usr/bin/alljoyn-daemon --config-file=$CONFIGFILE
|
||||
fi
|
||||
}
|
||||
|
||||
stop() {
|
||||
service_stop /usr/bin/alljoyn-daemon
|
||||
}
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
This repository is designated to serve as a feed for OpenWrt
|
||||
(http://openwrt.org) based systems. As such, the organization, management,
|
||||
and usage of this repository will be different from the other source
|
||||
repositories hosted by the AllSeen Alliance.
|
||||
|
||||
Most notable of these differences is that the master branch only contains this
|
||||
readme file. Package definitions will only exist in branches whos name
|
||||
corresponds to code names for OpenWrt releases. At the time of the initial
|
||||
commit of this readme file, there will be 2 such branches: attitude_adjustment
|
||||
and barrier_breaker. As the OpenWrt project develops and creates new
|
||||
releases, new corresponding branches will be created.
|
||||
|
||||
The reason for tracking package definitions on a per OpenWrt release basis is
|
||||
due to the fact that AllJoyn packages depend on OpenWrt packages which may
|
||||
change from release to release. This also allows us to retire support for
|
||||
obsolete versions of OpenWrt in the future without breaking others who may
|
||||
still be using/building the obsolete versions.
|
||||
|
||||
To use this feed in an OpenWrt build environment, follow these instructions:
|
||||
|
||||
1. Copy feeds.conf.default to feeds.conf (if not already done):
|
||||
|
||||
cp feeds.conf.default feeds.conf
|
||||
|
||||
|
||||
2. Add the following feeds.conf (replace <openwrt_release> with the
|
||||
appropriate branch that corresponds to the OpenWrt release you are building):
|
||||
|
||||
src-git alljoyn git://git.allseenalliance.org/gerrit/core/openwrt_feed;<openwrt_release>
|
||||
|
||||
# For Attitude Adjustment
|
||||
src-git alljoyn git://git.allseenalliance.org/gerrit/core/openwrt_feed;attitude_adjustment
|
||||
|
||||
# For Barrier Breaker
|
||||
src-git alljoyn git://git.allseenalliance.org/gerrit/core/openwrt_feed;barrier_breaker
|
||||
|
||||
|
||||
3. Update the feed information:
|
||||
|
||||
./scripts/feeds update -a
|
||||
|
||||
|
||||
4. Add the the packages from the AllJoyn feed to build system:
|
||||
|
||||
./scripts feeds install -a -p alljoyn
|
||||
|
||||
5. Enable AllJoyn in the build:
|
||||
|
||||
make menuconfig
|
||||
|
||||
Networking --->
|
||||
< > alljoyn --->
|
||||
< > alljoyn-about
|
||||
< > alljoyn-c
|
||||
< > alljoyn-config
|
||||
< > alljoyn-config-samples
|
||||
< > alljoyn-controlpanel
|
||||
< > alljoyn-controlpanel-samples
|
||||
< > alljoyn-notification
|
||||
< > alljoyn-notification-samples
|
||||
< > alljoyn-onboarding
|
||||
< > alljoyn-onboarding-samples
|
||||
< > alljoyn-sample_apps
|
||||
< > alljoyn-samples
|
||||
< > alljoyn-service_common
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2010 Vertical Communications
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
config EXTROOT_SETTLETIME
|
||||
int
|
||||
prompt "Settle time for root block device (s)" if PACKAGE_block-mount
|
||||
default 20
|
||||
help
|
||||
This is the amount of time, in seconds, to wait for the block device
|
||||
the root filesystem is on to become available, after the kernel that
|
||||
modules for the rootfs and device are loaded.
|
||||
|
||||
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2006-2012 OpenWrt.org
|
||||
# Copyright (C) 2010 Vertical Communications
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=block-mount-old
|
||||
PKG_VERSION:=0.2.0
|
||||
PKG_RELEASE:=9
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/block-mount-old/Default
|
||||
SECTION:=base
|
||||
CATEGORY:=Base system
|
||||
endef
|
||||
|
||||
define Package/block-mount-old
|
||||
$(call Package/block-mount-old/Default)
|
||||
TITLE:=Block device mounting and checking
|
||||
DEPENDS:= +blkid +swap-utils
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define Package/block-mount-old/description
|
||||
Scripts used to mount and check block devices (filesystems and swap), as well
|
||||
as hotplug scripts to automount and check block devices when hotplug event (e.g.
|
||||
from plugging in a device) occurs.
|
||||
Also includes preinit scripts for mounting a block device as the root filesystem.
|
||||
This allows one to have the root filesystem on devices other than the built in flash
|
||||
device.
|
||||
endef
|
||||
|
||||
define Package/block-mount-old/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/block-mount-old/conffiles
|
||||
/etc/config/fstab
|
||||
endef
|
||||
|
||||
define Package/block-mount-old/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/fstab.init $(1)/etc/init.d/fstab
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DATA) ./files/fstab.config $(1)/etc/config/fstab
|
||||
$(INSTALL_DIR) $(1)/lib/functions/fsck
|
||||
$(INSTALL_DATA) ./files/mount.sh $(1)/lib/functions/
|
||||
$(INSTALL_DATA) ./files/fsck.sh $(1)/lib/functions/
|
||||
$(INSTALL_DATA) ./files/block.sh $(1)/lib/functions/
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/block
|
||||
$(INSTALL_DATA) ./files/10-swap $(1)/etc/hotplug.d/block/
|
||||
$(INSTALL_DATA) ./files/20-fsck $(1)/etc/hotplug.d/block/
|
||||
$(INSTALL_DATA) ./files/40-mount $(1)/etc/hotplug.d/block/
|
||||
$(INSTALL_DATA) ./files/extmount.sh $(1)/lib/functions/
|
||||
$(INSTALL_DIR) $(1)/lib/preinit
|
||||
$(INSTALL_DATA) ./files/50_determine_usb_root $(1)/lib/preinit/
|
||||
#$(INSTALL_DATA) ./files/55_determine_extroot_sysupgrade $(1)/lib/preinit/
|
||||
#$(INSTALL_DATA) ./files/60_pivot_usb_root $(1)/lib/preinit/
|
||||
echo "extroot_settle_time=\"$(CONFIG_EXTROOT_SETTLETIME)\"" >$(1)/lib/preinit/00_extroot.conf
|
||||
$(INSTALL_DIR) $(1)/overlay
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,block-mount-old))
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Copyright (C) 2009-2010 OpenWrt.org
|
||||
# Copyright (C) 2010 Vertical Communications
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
. /lib/functions/block.sh
|
||||
|
||||
blkdev=`dirname $DEVPATH`
|
||||
|
||||
if [ `basename $blkdev` != "block" ]; then
|
||||
|
||||
device=`basename $DEVPATH`
|
||||
|
||||
|
||||
case "$ACTION" in
|
||||
add)
|
||||
local autoswap_from_fstab
|
||||
local automount_from_fstab
|
||||
local from_fstab
|
||||
local anon_mount
|
||||
local anon_swap
|
||||
local anon_fsck
|
||||
local mds_mount_device
|
||||
local sds_swap_device
|
||||
local sds_swap_enabled
|
||||
local use_device
|
||||
local do_swap=0
|
||||
|
||||
mount_dev_section_cb() {
|
||||
mds_mount_device="$3"
|
||||
}
|
||||
|
||||
swap_dev_section_cb() {
|
||||
sds_swap_device="$2"
|
||||
sds_swap_enabled="$3"
|
||||
return 0
|
||||
}
|
||||
|
||||
config_get_automount
|
||||
automount_from_fstab="$from_fstab"
|
||||
|
||||
[ "$automount_from_fstab" -eq 1 ] && {
|
||||
config_get_mount_section_by_device "/dev/$device"
|
||||
}
|
||||
|
||||
# skip trying swap if this device is defined as a mount point
|
||||
[ -z "$mds_mount_device" ] && {
|
||||
config_get_autoswap
|
||||
autoswap_from_fstab="$from_fstab"
|
||||
|
||||
[ "$autoswap_from_fstab" -eq 1 ] && {
|
||||
config_get_swap_section_by_device "/dev/$device"
|
||||
use_device="$sds_swap_device"
|
||||
do_swap="$sds_swap_enabled"
|
||||
}
|
||||
|
||||
[ -z "$use_device" ] && [ "$anon_swap" -eq 1 ] && {
|
||||
use_device="/dev/$device" && do_swap=1
|
||||
}
|
||||
}
|
||||
|
||||
[ -n "$use_device" ] && [ "$do_swap" -eq 1 ] && {
|
||||
grep -q "$use_device" /proc/swaps || grep -q "$use_device" /proc/mounts || {
|
||||
swapon "$use_device"
|
||||
}
|
||||
}
|
||||
reset_dev_section_cb
|
||||
;;
|
||||
remove)
|
||||
grep -q "/dev/$device" /proc/swaps && {
|
||||
swapoff "/dev/$device"
|
||||
}
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Copyright (C) 2009-2010 OpenWrt.org
|
||||
# Copyright (C) 2010 Vertical Communications
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
. /lib/functions/block.sh
|
||||
. /lib/functions/fsck.sh
|
||||
|
||||
blkdev=`dirname $DEVPATH`
|
||||
|
||||
if [ `basename $blkdev` != "block" ]; then
|
||||
|
||||
device=`basename $DEVPATH`
|
||||
|
||||
case "$ACTION" in
|
||||
add)
|
||||
local from_fstab
|
||||
local anon_mount
|
||||
local anon_swap
|
||||
local anon_fsck
|
||||
local mds_mount_target
|
||||
local mds_mount_device
|
||||
local mds_mount_fstype
|
||||
local mds_mount_enabled_fsck
|
||||
local sds_swap_device
|
||||
local use_device
|
||||
local do_fsck=0
|
||||
local fsck_type
|
||||
|
||||
local autoswap_from_fstab
|
||||
local automount_from_fstab
|
||||
local hotplug_blkid_fstype_match
|
||||
|
||||
mount_dev_section_cb() {
|
||||
mds_mount_device="$3"
|
||||
mds_mount_fstype="$4"
|
||||
mds_mount_enabled_fsck="$7"
|
||||
}
|
||||
|
||||
swap_dev_section_cb() {
|
||||
sds_swap_device="$2"
|
||||
return 0
|
||||
}
|
||||
|
||||
config_get_automount
|
||||
automount_from_fstab="$from_fstab"
|
||||
|
||||
[ "$automount_from_fstab" -eq 1 ] && {
|
||||
config_get_mount_section_by_device "/dev/$device"
|
||||
use_device="$mds_mount_device"
|
||||
[ "$mds_mount_enabled_fsck" -eq 1 ] && {
|
||||
do_fsck=1
|
||||
fsck_type="$mds_mount_fstype"
|
||||
}
|
||||
}
|
||||
|
||||
[ -z "$use_device" ] && {
|
||||
config_get_autoswap
|
||||
autoswap_from_fstab="$from_fstab"
|
||||
|
||||
[ "$autoswap_from_fstab" -eq 1 ] && {
|
||||
config_get_swap_section_by_device "/dev/$device"
|
||||
use_device="$sds_swap_device" && do_fsck=0
|
||||
}
|
||||
}
|
||||
|
||||
grep -q "/dev/$device" /proc/swaps || grep -q "/dev/$device" /proc/mounts || {
|
||||
[ "$anon_fsck" -eq 1 ] && [ -z "$use_device" ] && {
|
||||
use_device="/dev/$device" && do_fsck=1 && mds_mount_fstype="" && hotplug_blkid_fstype_match=0
|
||||
}
|
||||
}
|
||||
|
||||
[ "$do_fsck" -eq 1 ] && {
|
||||
libmount_fsck "$use_device" "$fsck_type" "$do_fsck"
|
||||
}
|
||||
|
||||
reset_dev_section_cb
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
|
|
@ -1,107 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Copyright (C) 2009-2012 OpenWrt.org
|
||||
# Copyright (C) 2010 Vertical Communications
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
. /lib/functions/block.sh
|
||||
|
||||
blkdev=`dirname $DEVPATH`
|
||||
if [ `basename $blkdev` != "block" ]; then
|
||||
|
||||
device=`basename $DEVPATH`
|
||||
mountpoint=`sed -ne "s|^[^ ]*/$device ||; T; s/ .*//p" /proc/self/mounts`
|
||||
|
||||
# Determine mount path
|
||||
usbno=$(echo $DEVPATH | awk -F'/' '{print$7}')
|
||||
case "$usbno" in
|
||||
*:*) usbno=$(echo $DEVPATH | awk -F'/' '{print$6}') ;;
|
||||
esac
|
||||
mnfct="$(cat /sys/bus/usb/devices/$usbno/manufacturer | sed 's/ //g')"
|
||||
prdct="$(cat /sys/bus/usb/devices/$usbno/product | sed 's/ //g')"
|
||||
mnthd="${mnfct:-$prdct}"
|
||||
serial="$(cat /sys/bus/usb/devices/$usbno/serial | sed 's/ //g')"
|
||||
|
||||
case "$ACTION" in
|
||||
add)
|
||||
|
||||
local from_fstab
|
||||
local anon_mount
|
||||
local anon_swap
|
||||
local anon_fsck
|
||||
local mds_mount_target
|
||||
local mds_mount_device
|
||||
local mds_mount_fstype
|
||||
local sds_swap_device
|
||||
local use_device
|
||||
local do_fsck=0
|
||||
local fsck_type
|
||||
|
||||
local autoswap_from_fstab
|
||||
local automount_from_fstab
|
||||
|
||||
mount_dev_section_cb() {
|
||||
mds_mount_target="$2"
|
||||
mds_mount_device="$3"
|
||||
mds_mount_fstype="$4"
|
||||
mds_mount_enabled="$6"
|
||||
}
|
||||
|
||||
swap_dev_section_cb() {
|
||||
sds_swap_device="$2"
|
||||
return 0
|
||||
}
|
||||
|
||||
config_get_automount
|
||||
automount_from_fstab="$from_fstab"
|
||||
[ "$automount_from_fstab" -eq 1 ] && {
|
||||
config_get_mount_section_by_device "/dev/$device"
|
||||
use_device="$mds_mount_device"
|
||||
[ "$mds_mount_enabled" -eq 1 ] && {
|
||||
if [ -n "$mds_mount_target" ]; then
|
||||
grep -q "/dev/$device" /proc/swaps || grep -q "/dev/$device" /proc/mounts || {
|
||||
( mkdir -p "$mds_mount_target" && mount "$mds_mount_target" ) 2>&1 | tee /proc/self/fd/2 | logger -t 'fstab'
|
||||
}
|
||||
else
|
||||
logger -t 'fstab' "Mount enabled for $mds_mount_device but it doesn't have a defined mountpoint (target)"
|
||||
fi
|
||||
}
|
||||
}
|
||||
|
||||
[ -z "$use_device" ] && {
|
||||
config_get_autoswap
|
||||
autoswap_from_fstab="$from_fstab"
|
||||
|
||||
[ "$autoswap_from_fstab" -eq 1 ] && {
|
||||
config_get_swap_section_by_device "/dev/$device"
|
||||
use_device="$sds_swap_device"
|
||||
}
|
||||
}
|
||||
|
||||
grep -q "/dev/$device" /proc/swaps || grep -q "/dev/$device" /proc/mounts || {
|
||||
[ "$anon_mount" -eq 1 -a -z "$use_device" ] && {
|
||||
case "$device" in
|
||||
mtdblock*) ;;
|
||||
*)
|
||||
mntdir="$mnthd$serial"
|
||||
( mkdir -p /mnt/$mntdir && mount /dev/$device /mnt/$mntdir -o umask=0 || ntfs-3g /dev/$device /mnt/$mntdir ) 2>&1 | tee /proc/self/fd/2 | logger -t 'fstab'
|
||||
echo "/dev/$device /mnt/$mntdir" >> /var/usbmounts
|
||||
[ -n "$mntdir" ] && ubus send usb 2>/dev/null
|
||||
;;
|
||||
esac
|
||||
}
|
||||
}
|
||||
reset_dev_section_cb
|
||||
;;
|
||||
remove)
|
||||
umount /dev/$device
|
||||
umount $mountpoint
|
||||
rm -rf $mountpoint
|
||||
sed -i "/$device/ d" /var/usbmounts
|
||||
[ -n "$device" ] && ubus send usb 2>/dev/null
|
||||
;;
|
||||
esac
|
||||
|
||||
fi
|
||||
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Copyright (C) 2010 Vertical Communications
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
|
||||
|
||||
determine_external_root() {
|
||||
. /lib/functions/extmount.sh
|
||||
. /lib/functions/mount.sh
|
||||
|
||||
local OLD_UCI_CONFIG_DIR="$UCI_CONFIG_DIR"
|
||||
local OLD_PATH="$PATH"
|
||||
local OLD_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
|
||||
set_jffs_mp
|
||||
determine_root_device
|
||||
|
||||
# extroot requires extroot and fstab config files, therefore
|
||||
# we assume configuration is incomplete and not to be used if either of them
|
||||
# is missing (for jffs versions of these files on squashfs image)
|
||||
if [ "$jffs" = "/tmp/overlay" ] && [ -r "/tmp/overlay/etc/config/fstab" ]; then
|
||||
UCI_CONFIG_DIR="/tmp/overlay/etc/config"
|
||||
ER_IS_SQUASHFS=true
|
||||
ER_OVERLAY_PREFIX="/tmp/overlay"
|
||||
PATH=$ER_OVERLAY_PREFIX/sbin:$PATH
|
||||
LD_LIBRARY_PATH=$ER_OVERLAY_PREFIX/usr/lib:$LD_LIBRARY_PATH
|
||||
export PATH LD_LIBRARY_PATH
|
||||
fi
|
||||
|
||||
# For squashfs on firstboot root_device will be tmpfs for the ramoverlay,
|
||||
# unless there is a saved config, in which case it will be /dev/root,
|
||||
# however in the case of a saved config, it won't be restored until after
|
||||
# this script, so there won't be a config on the first boot after
|
||||
# flashing a squashfs-based filesystem
|
||||
# For ext2, ramdisk, or jffs2 root filesystems root_device is /dev/root
|
||||
# For squashfs after firstboot, root filesystem is /dev/root
|
||||
# We only use the config from the root or jffs if the root_device is
|
||||
# /dev/root
|
||||
[ "$root_device" = "/dev/root" ] && {
|
||||
er_load_modules
|
||||
[ -n "$extroot_settle_time" ] && [ "$extroot_settle_time" -gt 0 ] && {
|
||||
sleep $extroot_settle_time
|
||||
}
|
||||
config_load fstab
|
||||
config_foreach config_mount_by_section mount 1
|
||||
ER_OVERLAY_ROM="/no-extroot"
|
||||
|
||||
[ "$rootfs_found" = "1" ] && grep -q ' /overlay ' /proc/mounts && {
|
||||
pi_extroot_mount_success=true
|
||||
pi_mount_skip_next=false
|
||||
ER_OVERLAY_ROM="/overlay"
|
||||
}
|
||||
[ "$rootfs_found" = "1" ] && grep -q ' /rom ' /proc/mounts && {
|
||||
pi_extroot_mount_success=true
|
||||
pi_mount_skip_next=false
|
||||
ER_OVERLAY_ROM="/rom"
|
||||
}
|
||||
}
|
||||
UCI_CONFIG_DIR="$OLD_UCI_CONFIG_DIR"
|
||||
PATH="$OLD_PATH"
|
||||
LD_LIBRARY_PATH="$OLD_LD_LIBRARY_PATH"
|
||||
export PATH LD_LIBRARY_PATH
|
||||
}
|
||||
|
||||
boot_hook_add preinit_mount_root determine_external_root
|
||||
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Copyright (C) 2010 Daniel Dickinson
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
|
||||
|
||||
check_set_md5sum() {
|
||||
local er_md5sum_file
|
||||
er_md5sum_file="${ER_OVERLAY_PREFIX}/.extroot.md5sum"
|
||||
local er_disabled
|
||||
if [ "${ER_OVERLAY_ROM}" = "/rom" ]; then
|
||||
er_disabled=/tmp/whole_root-disabled
|
||||
else
|
||||
er_disabled=/tmp${ER_OVERLAY_ROM}-disabled
|
||||
fi
|
||||
|
||||
local er_extroot_md5sum
|
||||
if [ -f $md5sum_file ]; then
|
||||
er_extroot_md5sum="$(cat $er_md5sum_file)"
|
||||
fi
|
||||
|
||||
local er_overlay_file="${ER_OVERLAY_ROM}/etc/extroot.md5sum"
|
||||
|
||||
local er_extroot_overlay_md5sum
|
||||
if [ -f "$er_overlay_file" ]; then
|
||||
er_extroot_overlay_md5sum="$(cat $er_overlay_file)"
|
||||
fi
|
||||
|
||||
if [ -z "$er_extroot_overlay_md5sum" ]; then
|
||||
cat $er_md5sum_file >$er_overlay_file
|
||||
elif [ "$er_extroot_overlay_md5sum" != "$er_extroot_md5sum" ]; then
|
||||
pi_extroot_mount_success="false"
|
||||
mkdir -p $er_disabled
|
||||
mount --move ${ER_OVERLAY_ROM} $er_disabled
|
||||
fi
|
||||
}
|
||||
|
||||
set_jffs_md5sum() {
|
||||
# We do this anytime block-extroot exists, even on the first boot with
|
||||
# no extroot defined.
|
||||
|
||||
local er_md5sum_file
|
||||
er_md5sum_file="${ER_OVERLAY_PREFIX}/.extroot.md5sum"
|
||||
|
||||
local er_extroot_md5sum
|
||||
if [ -f $er_md5sum_file ]; then
|
||||
er_extroot_md5sum="$(cat $er_md5sum_file)"
|
||||
fi
|
||||
if [ -z "$er_extroot_md5sum" ]; then
|
||||
dd if=/dev/urandom count=32 bs=1k 2>/dev/null | md5sum | cut -f1 -d\ >$er_md5sum_file
|
||||
fi
|
||||
}
|
||||
|
||||
determine_extroot_sysupgrade() {
|
||||
check_skip || set_jffs_md5sum
|
||||
|
||||
check_skip || [ "$pi_extroot_mount_success" != "true" ] || {
|
||||
check_set_md5sum
|
||||
}
|
||||
}
|
||||
|
||||
boot_hook_add preinit_mount_root determine_extroot_sysupgrade
|
||||
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Copyright (C) 2010 Vertical Communications
|
||||
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
|
||||
# Determine if we are requested to mount external root
|
||||
|
||||
external_root_pivot() {
|
||||
check_skip || [ "$pi_extroot_mount_success" != "true" ] || {
|
||||
echo "switching to external rootfs"
|
||||
if [ "$ER_OVERLAY_ROM" = "/overlay" ]; then
|
||||
if [ "$ER_IS_SQUASHFS" = "true" ]; then
|
||||
umount /tmp/overlay
|
||||
fi
|
||||
mount -o remount,ro / && fopivot /overlay /rom && pi_mount_skip_next=true
|
||||
elif [ "$ER_OVERLAY_ROM" = "/rom" ]; then
|
||||
if [ "$ER_IS_SQUASHFS" = "true" ]; then
|
||||
umount /tmp/overlay
|
||||
fi
|
||||
mount -o remount,ro / && pivot_rom /rom /rom && pi_mount_skip_next=true
|
||||
fi
|
||||
}
|
||||
}
|
||||
|
||||
boot_hook_add preinit_mount_root external_root_pivot
|
||||
|
||||
|
|
@ -1,264 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Copyright 2010 Vertical Communications
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
reset_block_cb() {
|
||||
mount_cb() {
|
||||
dmc_mount_cfg="$1"
|
||||
shift # skip optional param
|
||||
dmc_target="$2"
|
||||
dmc_mount_device="$3"
|
||||
dmc_fstype="$4"
|
||||
dmc_options="$5"
|
||||
dmc_enabled="$6"
|
||||
dmc_enabled_fsck="$7"
|
||||
dmc_uuid="$8"
|
||||
dmc_label="$9"
|
||||
shift
|
||||
dmc_is_rootfs="$9"
|
||||
return 0
|
||||
}
|
||||
swap_cb() {
|
||||
dsc_swap_cfg="$1"
|
||||
shift # skip optional param
|
||||
dsc_swap_device="$2"
|
||||
dsc_enabled="$3"
|
||||
dsc_uuid="$4"
|
||||
dsc_label="$5"
|
||||
return 0
|
||||
}
|
||||
}
|
||||
reset_block_cb
|
||||
|
||||
reset_dev_section_cb() {
|
||||
mount_dev_section_cb() {
|
||||
dmds_mount_cfg="$1"
|
||||
dmds_mount_target="$2"
|
||||
dmds_mount_device="$3"
|
||||
dmds_mount_fstype="$4"
|
||||
dmds_mount_options="$5"
|
||||
dmds_mount_enabled="$6"
|
||||
dmds_mount_enabled_fsck="$7"
|
||||
dmds_mount_uuid="$8"
|
||||
dmds_mount_label="$9"
|
||||
shift
|
||||
dmds_is_rootfs="$9"
|
||||
return 0
|
||||
}
|
||||
swap_dev_section_cb() {
|
||||
dsds_swap_cfg="$1"
|
||||
dsds_swap_device="$2"
|
||||
dsds_swap_enabled="$3"
|
||||
dsds_swap_uuid="$4"
|
||||
dsds_swap_label="$5"
|
||||
return 0
|
||||
}
|
||||
}
|
||||
reset_dev_section_cb
|
||||
|
||||
config_get_mount() {
|
||||
local gm_cfg="$1"
|
||||
local gm_param="$2"
|
||||
local gm_target
|
||||
local gm_device
|
||||
local gm_fstype
|
||||
local gm_options
|
||||
local gm_enabled
|
||||
local gm_enabled_fsck
|
||||
local gm_uuid
|
||||
local gm_label
|
||||
local gm_is_rootfs
|
||||
config_get gm_target "$1" target
|
||||
config_get gm_device "$1" device
|
||||
config_get gm_fstype "$1" fstype 'auto'
|
||||
config_get gm_options "$1" options 'rw'
|
||||
config_get_bool gm_enabled "$1" enabled 1
|
||||
config_get_bool gm_enabled_fsck "$1" enabled_fsck 0
|
||||
config_get gm_uuid "$1" uuid
|
||||
config_get gm_label "$1" label
|
||||
config_get_bool gm_is_rootfs "$1" is_rootfs 0
|
||||
mount_cb "$gm_cfg" "$gm_param" "$gm_target" "$gm_device" "$gm_fstype" "$gm_options" "$gm_enabled" "$gm_enabled_fsck" "$gm_uuid" "$gm_label" "$gm_is_rootfs"
|
||||
}
|
||||
|
||||
config_get_swap() {
|
||||
local gs_cfg="$1"
|
||||
local gs_param="$2"
|
||||
local gs_device
|
||||
local gs_enabled
|
||||
local gs_uuid
|
||||
local gs_label
|
||||
config_get gs_device "$1" device
|
||||
config_get_bool gs_enabled "$1" enabled 1
|
||||
config_get gs_uuid "$1" uuid
|
||||
config_get gs_label "$1" label
|
||||
|
||||
swap_cb "$gs_cfg" "$gs_param" "$gs_device" "$gs_enabled" "$gs_uuid" "$gs_label"
|
||||
}
|
||||
|
||||
config_get_automount() {
|
||||
config_load fstab
|
||||
config_get_bool from_fstab "automount" from_fstab 1
|
||||
config_get_bool anon_mount "automount" anon_mount 1
|
||||
config_get_bool anon_fsck "automount" anon_fsck 0
|
||||
}
|
||||
|
||||
config_get_autoswap() {
|
||||
config_load fstab
|
||||
config_get_bool from_fstab "autoswap" from_fstab 1
|
||||
config_get_bool anon_swap "autoswap" anon_swap 0
|
||||
}
|
||||
|
||||
config_create_swap_fstab_entry() {
|
||||
local device="$1"
|
||||
local enabled="$2"
|
||||
|
||||
[ -n "$device" ] || return 0
|
||||
|
||||
local fstabnew
|
||||
|
||||
mkdir -p /var/lock
|
||||
lock /var/lock/fstab.lck
|
||||
fstabnew="$(mktemp -t '.fstab.XXXXXXXX')"
|
||||
cat /tmp/fstab | grep -E -v "^$device[[:blank:]]" >>"$fstabnew"
|
||||
[ "$enabled" -eq 1 ] && echo "$device none swap sw 0 0" >> "$fstabnew"
|
||||
cat "$fstabnew" >/tmp/fstab
|
||||
rm -f $fstabnew
|
||||
lock -u /var/lock/fstab.lck
|
||||
}
|
||||
|
||||
config_create_mount_fstab_entry() {
|
||||
local device="$1"
|
||||
local target="$2"
|
||||
local fstype="$3"
|
||||
local options="$4"
|
||||
local enabled="$5"
|
||||
options="${options:-rw}"
|
||||
[ "$enabled" -eq 0 ] && options="noauto,$options"
|
||||
[ -n "$target" ] || return 0
|
||||
[ -n "$device" ] || return 0
|
||||
|
||||
local fstabnew
|
||||
|
||||
mkdir -p /var/lock
|
||||
lock /var/lock/fstab.lck
|
||||
fstabnew="$(mktemp -t '.fstab.XXXXXXXX')"
|
||||
cat /tmp/fstab | grep -E -v "^$device[[:blank:]]" | grep -v "$target" >>"$fstabnew"
|
||||
echo "$device $target $fstype $options 0 0" >>"$fstabnew"
|
||||
cat "$fstabnew" >/tmp/fstab
|
||||
rm -f $fstabnew
|
||||
lock -u /var/lock/fstab.lck
|
||||
}
|
||||
|
||||
libmount_find_token() {
|
||||
local token="$1"
|
||||
local value="$2"
|
||||
local device
|
||||
device="$(blkid -w /dev/null -c /dev/null | grep "$token=\"$value\"" | cut -f1 -d:)"
|
||||
echo "$device"
|
||||
}
|
||||
|
||||
libmount_find_device_by_id() {
|
||||
local uuid="$1"
|
||||
local label="$2"
|
||||
local device="$3"
|
||||
local cfg_device="$4"
|
||||
local found_device
|
||||
|
||||
if [ -n "$uuid" ]; then
|
||||
found_device="$(libmount_find_token "UUID" "$uuid")"
|
||||
elif [ -n "$label" ]; then
|
||||
found_device="$(libmount_find_token "LABEL" "$label")"
|
||||
elif [ "$device" = "$cfg_device" ]; then
|
||||
found_device="$device"
|
||||
elif [ -z "$device" ] && [ -e "$cfg_device" ]; then
|
||||
found_device="$cfg_device"
|
||||
fi
|
||||
[ -n "$device" ] && [ "$device" != "$found_device" ] && {
|
||||
found_device=""
|
||||
}
|
||||
echo "$found_device"
|
||||
}
|
||||
|
||||
config_get_mount_section_by_device() {
|
||||
local msbd_device="$1"
|
||||
local msbd_mount_cfg=
|
||||
local msbd_target=
|
||||
local msbd_mount_device=
|
||||
local msbd_fstype=
|
||||
local msbd_options=
|
||||
local msbd_enabled=
|
||||
local msbd_enabled_fsck=
|
||||
local msbd_uuid=
|
||||
local msbd_label=
|
||||
local msbd_is_rootfs
|
||||
local msbd_blkid_fstype_match=
|
||||
mount_cb() {
|
||||
local mc_cfg="$1"
|
||||
local mc_device="$2"
|
||||
shift
|
||||
local mc_target="$2"
|
||||
local mc_cfgdevice="$3"
|
||||
local mc_fstype="$4"
|
||||
local mc_uuid="$8"
|
||||
local mc_label="$9"
|
||||
shift
|
||||
local mc_is_rootfs="$9"
|
||||
local mc_found_device=""
|
||||
|
||||
mc_found_device="$(libmount_find_device_by_id "$mc_uuid" "$mc_label" "$mc_device" "$mc_cfgdevice")"
|
||||
if [ -n "$mc_found_device" ]; then
|
||||
msbd_mount_cfg="$mc_cfg"
|
||||
msbd_target="$mc_target"
|
||||
msbd_mount_device="$mc_found_device"
|
||||
msbd_fstype="$mc_fstype"
|
||||
msbd_options="$4"
|
||||
msbd_enabled="$5"
|
||||
msbd_enabled_fsck="$6"
|
||||
msbd_uuid="$7"
|
||||
msbd_label="$8"
|
||||
msbd_is_rootfs="$9"
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
config_foreach config_get_mount mount "$msbd_device"
|
||||
[ -n "$msbd_mount_device" ] && config_create_mount_fstab_entry "$msbd_mount_device" "$msbd_target" "$msbd_fstype" "$msbd_options" "$msbd_enabled"
|
||||
mount_dev_section_cb "$msbd_mount_cfg" "$msbd_target" "$msbd_mount_device" "$msbd_fstype" "$msbd_options" "$msbd_enabled" "$msbd_enabled_fsck" "$msbd_uuid" "$msbd_label" "$msbd_is_rootfs"
|
||||
reset_block_cb
|
||||
}
|
||||
|
||||
config_get_swap_section_by_device() {
|
||||
local ssbd_device="$1"
|
||||
local ssbd_swap_cfg=
|
||||
local ssbd_swap_device=
|
||||
local ssbd_enabled=
|
||||
local ssbd_uuid=
|
||||
local ssbd_label=
|
||||
swap_cb() {
|
||||
local sc_cfg="$1"
|
||||
local sc_device="$2"
|
||||
local sc_uuid="$5"
|
||||
local sc_label="$6"
|
||||
local sc_cfgdevice="$3"
|
||||
local sc_found_device
|
||||
|
||||
sc_found_device="$(libmount_find_device_by_id "$sc_uuid" "$sc_label" "$sc_device" "$sc_cfgdevice")"
|
||||
if [ -n "$sc_found_device" ]; then
|
||||
ssbd_swap_cfg="$sc_cfg"
|
||||
ssbd_swap_device="$sc_found_device"
|
||||
ssbd_enabled="$4"
|
||||
ssbd_uuid="$5"
|
||||
ssbd_label="$6"
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
config_foreach config_get_swap swap "$ssbd_device"
|
||||
[ -n "$ssbd_swap_device" ] && config_create_swap_fstab_entry "$ssbd_swap_device" "$ssbd_enabled"
|
||||
swap_dev_section_cb "$ssbd_swap_cfg" "$ssbd_swap_device" "$ssbd_enabled" "$ssbd_uuid" "$ssbd_label"
|
||||
reset_block_cb
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Copyright (C) 2006-2011 OpenWrt.org
|
||||
# Copyright (C) 2010 Vertical Communications
|
||||
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
|
||||
determine_root_device() {
|
||||
root_device="$(mount | grep ' / ' | cut -f1 -d\ | grep -v rootfs )"
|
||||
}
|
||||
|
||||
set_jffs_mp() {
|
||||
jffs="$(awk '/jffs2/ {print $2}' /proc/mounts)"
|
||||
}
|
||||
|
||||
er_load_modules() {
|
||||
mkdir -p /tmp/extroot_modules/modules.d
|
||||
mkdir -p /tmp/extroot_modules/modules
|
||||
cp -L /etc/modules-boot.d/* /tmp/overlay/etc/modules-boot.d/* /tmp/extroot_modules/modules.d
|
||||
ln -sf /lib/modules/*/* /tmp/overlay/lib/modules/*/* /tmp/extroot_modules/modules
|
||||
local modules="$(cat /tmp/extroot_modules/modules.d/* 2>/dev/null)"
|
||||
cd /tmp/extroot_modules/modules && [ -n "$modules" ] && {
|
||||
echo "$modules" | sed -e 's/^\([^#].*\)/insmod \.\/\1.ko/'| sh 2>&- || :
|
||||
}
|
||||
rm -rf /tmp/extroot_modules
|
||||
}
|
||||
|
||||
pivot_rom() { # <new_root> <old_root>
|
||||
mount -o move /proc $1/proc && \
|
||||
pivot_root $1 $1$2 && {
|
||||
mount -o move $2/dev /dev
|
||||
mount -o move $2/tmp /tmp
|
||||
mount -o move $2/sys /sys 2>&-
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Copyright 2010 Vertical Communications
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
libmount_fsck() {
|
||||
local device="$1"
|
||||
local fsck_fstype="$2"
|
||||
local fsck_enabled="$3"
|
||||
local known_type
|
||||
local found_fsck=0
|
||||
|
||||
|
||||
grep -q "$device" /proc/swaps || grep -q "$device" /proc/mounts || {
|
||||
[ -e "$device" ] && [ "$fsck_enabled" -eq 1 ] && {
|
||||
for known_type in $libmount_known_fsck; do
|
||||
if [ "$known_type" = "$fsck_fstype" ]; then
|
||||
fsck_${known_type} "$device"
|
||||
found_fsck=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ "$found_fsck" -ne 1 ]; then
|
||||
logger -t 'fstab' "Unable to check/repair $device; no known fsck for filesystem type $fstype"
|
||||
fi
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
libmount_known_fsck=""
|
||||
|
||||
include /lib/functions/fsck
|
||||
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
config global automount
|
||||
option from_fstab 0
|
||||
option anon_mount 1
|
||||
|
||||
config global autoswap
|
||||
option from_fstab 0
|
||||
option anon_swap 0
|
||||
|
||||
config mount
|
||||
option target /mnt
|
||||
option device /dev/sda1
|
||||
option fstype ext4
|
||||
option options rw,sync
|
||||
option enabled 0
|
||||
option enabled_fsck 0
|
||||
|
||||
config swap
|
||||
option device /dev/sda2
|
||||
option enabled 0
|
||||
|
||||
|
|
@ -1,88 +0,0 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2007 OpenWrt.org
|
||||
# Copyright (C) 2010 Vertical Communications
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
|
||||
START=20
|
||||
|
||||
EXTRA_COMMANDS="overlay_enable whole_root_enable"
|
||||
EXTRA_HELP=" overlay_enable Reenable overlay rootfs. (After you fix it).
|
||||
whole_root_enable Reenable whole-disk rootfs. (After you fix it)."
|
||||
|
||||
rootfs_enable() {
|
||||
local extroot_type="$1"
|
||||
|
||||
if [ ! -d /tmp/${extroot_type}-disabled ]; then
|
||||
echo "No disabled ${extroot_type} present (/tmp/${extroot_type}-disabled). Can't renable."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -f /tmp/${extroot_type}-disabled/.extroot.md5sum
|
||||
rm -f /tmp/${extroot_type}-disabled/etc/extroot.md5sum
|
||||
echo "Please reboot router to complete re-enabling external rootfs."
|
||||
}
|
||||
|
||||
overlay_enable() {
|
||||
rootfs_enable overlay
|
||||
}
|
||||
|
||||
whole_root_enable() {
|
||||
rootfs_enable whole_root
|
||||
}
|
||||
|
||||
do_mount() {
|
||||
local cfg="$1"
|
||||
config_mount_by_section "$cfg"
|
||||
}
|
||||
|
||||
do_swapon() {
|
||||
local cfg="$1"
|
||||
config_swapon_by_section "$cfg"
|
||||
}
|
||||
|
||||
do_unmount() {
|
||||
local cfg="$1"
|
||||
|
||||
config_get target "$cfg" target
|
||||
config_get_bool enabled "$cfg" "enabled" '1'
|
||||
[ -n "$target" -a "$enabled" -gt 0 ] || return 0
|
||||
umount $target
|
||||
}
|
||||
|
||||
do_swapoff() {
|
||||
local cfg="$1"
|
||||
|
||||
config_get device "$cfg" device
|
||||
config_get_bool enabled "$cfg" "enabled" '1'
|
||||
[ -n "$device" -a "$enabled" -gt 0 ] && type swapoff >/dev/null || return 0
|
||||
swapoff $device
|
||||
}
|
||||
|
||||
start() {
|
||||
. /lib/functions/mount.sh
|
||||
|
||||
config_load fstab
|
||||
mkdir -p /var/lock
|
||||
lock /var/lock/fstab.lck
|
||||
[ -e /tmp/fstab ] || {
|
||||
echo '# WARNING: this is an auto generated file, please use uci to set defined filesystems' > /tmp/fstab
|
||||
}
|
||||
lock -u /var/lock/fstab.lck
|
||||
config_foreach do_swapon swap
|
||||
config_foreach do_mount mount
|
||||
config_foreach do_swapon swap # do swap a second time so that swap on filesystems is enabled
|
||||
}
|
||||
|
||||
stop() {
|
||||
. /lib/functions/mount.sh
|
||||
|
||||
config_load fstab
|
||||
config_foreach do_unmount mount
|
||||
config_foreach do_swapoff swap
|
||||
swapoff -a
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Copyright 2010 Vertical Communications
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
|
||||
. /lib/functions/block.sh
|
||||
. /lib/functions/fsck.sh
|
||||
|
||||
config_mount_by_section() {
|
||||
local cfg="$1"
|
||||
local find_rootfs="$2"
|
||||
|
||||
mount_cb() {
|
||||
local cfg="$1"
|
||||
local device="$2"
|
||||
shift
|
||||
local target="$2"
|
||||
local cfgdevice="$3"
|
||||
local fstype="$4"
|
||||
local options="$5"
|
||||
local enabled="$6"
|
||||
local enabled_fsck="$7"
|
||||
local uuid="$8"
|
||||
local label="$9"
|
||||
shift
|
||||
local is_rootfs="$9"
|
||||
shift
|
||||
local found_device=""
|
||||
|
||||
found_device="$(libmount_find_device_by_id "$uuid" "$label" "$device" "$cfgdevice")"
|
||||
if [ -n "$found_device" ]; then
|
||||
if [ "$find_rootfs" != "1" ] || ( [ "$is_rootfs" -eq 1 ] || [ "$target" = "/" ] || [ "$target" = "/overlay" ] ); then
|
||||
[ "$enabled_fsck" -eq 1 ] && {
|
||||
grep -q "$found_device" /proc/swaps || grep -q "$found_device" /proc/mounts || {
|
||||
libmount_fsck "$found_device" "$fstype" "$enabled_fsck"
|
||||
}
|
||||
}
|
||||
|
||||
if [ "$find_rootfs" = "1" ]; then
|
||||
if [ "$is_rootfs" -eq 1 ]; then
|
||||
target=/overlay
|
||||
elif [ "$target" = "/" ]; then
|
||||
target=/rom
|
||||
fi
|
||||
else
|
||||
if [ "$is_rootfs" -eq 1 ] || [ "$target" = "/overlay" ]; then
|
||||
target=/tmp/overlay-disabled
|
||||
elif [ "$target" = "/" ] || [ "$target" = "/rom" ]; then
|
||||
target="/tmp/whole_root-disabled"
|
||||
fi
|
||||
fi
|
||||
|
||||
config_create_mount_fstab_entry "$found_device" "$target" "$fstype" "$options" "$enabled"
|
||||
grep -q "$found_device" /proc/swaps || grep -q "$found_device" /proc/mounts || {
|
||||
[ "$enabled" -eq 1 ] && mkdir -p "$target" && mount "$target" 2>&1 | tee /proc/self/fd/2 | logger -t 'fstab'
|
||||
}
|
||||
|
||||
fi
|
||||
fi
|
||||
[ "$find_rootfs" = "1" ] && {
|
||||
[ "$target" = "/overlay" ] && {
|
||||
rootfs_found=1
|
||||
}
|
||||
[ "$target" = "/rom" ] && {
|
||||
rootfs_found=1
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
config_get_mount "$cfg"
|
||||
reset_block_cb
|
||||
}
|
||||
|
||||
config_swapon_by_section() {
|
||||
local cfg="$1"
|
||||
|
||||
swap_cb() {
|
||||
local cfg="$1"
|
||||
local device="$2"
|
||||
local cfgdevice="$3"
|
||||
local enabled="$4"
|
||||
local uuid="$5"
|
||||
local label="$6"
|
||||
local uuid
|
||||
local label
|
||||
|
||||
local found_device=""
|
||||
|
||||
found_device="$(libmount_find_device_by_id "$uuid" "$label" "$device" "$cfgdevice")"
|
||||
|
||||
if [ -n "$found_device" ]; then
|
||||
config_create_swap_fstab_entry "$found_device" "$enabled"
|
||||
grep -q "$found_device" /proc/swaps || grep -q "$found_device" /proc/mounts || {
|
||||
[ "$enabled" -eq 1 ] && swapon "$found_device" | tee /proc/self/fd/2 | logger -t 'fstab'
|
||||
}
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
config_get_swap "$cfg"
|
||||
reset_block_cb
|
||||
}
|
||||
213
dbus/Makefile
213
dbus/Makefile
|
|
@ -1,213 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2007-2015 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
# Make sure to also update the dbus-x package
|
||||
PKG_NAME:=dbus
|
||||
PKG_VERSION:=1.9.10
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://dbus.freedesktop.org/releases/dbus/
|
||||
PKG_MD5SUM:=72390a741009017258c00a3268daa728
|
||||
PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
|
||||
PKG_LICENSE:=AFL-2.1
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
TARGET_LDFLAGS+= \
|
||||
-Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
|
||||
|
||||
define Package/dbus/Default
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Simple interprocess messaging system
|
||||
URL:=http://dbus.freedesktop.org/
|
||||
endef
|
||||
|
||||
define Package/dbus/Default/description
|
||||
D-Bus is a message bus system, a simple way for applications to talk to one
|
||||
another. In addition to interprocess communication, D-Bus helps coordinate
|
||||
process lifecycle; it makes it simple and reliable to code a "single instance"
|
||||
application or daemon, and to launch applications and daemons on demand when
|
||||
their services are needed.
|
||||
endef
|
||||
|
||||
define Package/libdbus
|
||||
$(call Package/dbus/Default)
|
||||
CATEGORY:=Libraries
|
||||
TITLE+= (library)
|
||||
DEPENDS:= +libiconv +libpthread
|
||||
endef
|
||||
|
||||
define Package/libdbus/Description
|
||||
$(call Package/dbus/Default/description)
|
||||
This package contains the D-Bus shared library.
|
||||
endef
|
||||
|
||||
define Package/dbus
|
||||
$(call Package/dbus/Default)
|
||||
TITLE+= (daemon)
|
||||
DEPENDS:= +libexpat +libdbus
|
||||
endef
|
||||
|
||||
define Package/dbus/Description
|
||||
$(call Package/dbus/Default/description)
|
||||
This package contains the D-Bus daemon.
|
||||
endef
|
||||
|
||||
define Package/dbus-utils
|
||||
$(call Package/dbus/Default)
|
||||
TITLE+= (utilities)
|
||||
DEPENDS:= dbus
|
||||
endef
|
||||
|
||||
define Package/dbus-utils/Description
|
||||
$(call Package/dbus/Default/description)
|
||||
This package contains D-Bus utilities.
|
||||
endef
|
||||
|
||||
|
||||
define Build/Prepare
|
||||
$(Build/Prepare/Default)
|
||||
$(SED) 's/-Wl,--gc-sections/--gc-sections/' $(PKG_BUILD_DIR)/configure
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-shared \
|
||||
--enable-static \
|
||||
--disable-abstract-sockets \
|
||||
--disable-ansi \
|
||||
--disable-asserts \
|
||||
--disable-console-owner-file \
|
||||
--disable-doxygen-docs \
|
||||
--disable-compiler_coverage \
|
||||
--disable-selinux \
|
||||
--disable-tests \
|
||||
--disable-verbose-mode \
|
||||
--disable-xml-docs \
|
||||
--with-xml="expat" \
|
||||
--with-dbus-user=root \
|
||||
--with-dbus-daemondir="/usr/sbin" \
|
||||
--with-system-socket="/var/run/dbus/system_bus_socket" \
|
||||
--with-system-pid-file="/var/run/dbus.pid" \
|
||||
--without-x \
|
||||
--libexecdir=/usr/lib/dbus-1
|
||||
|
||||
CONFIGURE_VARS+= \
|
||||
ac_cv_have_abstract_sockets="yes" \
|
||||
ac_cv_lib_expat_XML_ParserCreate_MM="yes" \
|
||||
|
||||
HOST_CONFIGURE_ARGS+= \
|
||||
--enable-shared \
|
||||
--enable-static \
|
||||
--disable-abstract-sockets \
|
||||
--disable-ansi \
|
||||
--disable-asserts \
|
||||
--disable-console-owner-file \
|
||||
--disable-docygen-docs \
|
||||
--disable-compiler_coverage \
|
||||
--disable-selinux \
|
||||
--disable-tests \
|
||||
--disable-verbose-mode \
|
||||
--disable-xml-docs \
|
||||
--with-dbus-user=root \
|
||||
--with-dbus-daemondir="$(STAGIND_DIR_HOST)/bin" \
|
||||
--with-system-socket="$(STAGING_DIR_HOST)/var/run/dbus/system_bus_socket" \
|
||||
--with-system-pid-file="$(STAGING_DIR_HOST)/var/run/dbus.pid" \
|
||||
--without-x \
|
||||
--libexecdir="$(STAGING_DIR_HOST)/lib/dbus-1"
|
||||
|
||||
HOST_CONFIGURE_VARS+= \
|
||||
ac_cv_have_abstract_sockets="yes" \
|
||||
ac_cv_lib_expat_XML_ParserCreate_MM="yes" \
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/include/dbus-1.0 \
|
||||
$(1)/usr/include/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/dbus-1.0/include/dbus/
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/dbus-1.0/include/dbus/*.h \
|
||||
$(1)/usr/lib/dbus-1.0/include/dbus/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/libdbus-1.{so*,la,a} \
|
||||
$(1)/usr/lib/
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/dbus-1.0 \
|
||||
$(1)/usr/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/dbus-1.pc \
|
||||
$(1)/usr/lib/pkgconfig/
|
||||
endef
|
||||
|
||||
define Package/dbus/conffiles
|
||||
/etc/dbus-1/session.conf
|
||||
/etc/dbus-1/system.conf
|
||||
endef
|
||||
|
||||
define Package/libdbus/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/libdbus-1.so.* \
|
||||
$(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/dbus/install
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/etc/dbus-1 \
|
||||
$(1)/etc/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib/dbus-1
|
||||
$(INSTALL_BIN) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/dbus-1/dbus-daemon-launch-helper \
|
||||
$(1)/usr/lib/dbus-1/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) \
|
||||
$(PKG_INSTALL_DIR)/usr/sbin/dbus-daemon \
|
||||
$(1)/usr/sbin/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) \
|
||||
$(PKG_INSTALL_DIR)/usr/bin/dbus-uuidgen \
|
||||
$(1)/usr/bin/
|
||||
|
||||
$(INSTALL_BIN) \
|
||||
$(PKG_INSTALL_DIR)/usr/bin/dbus-launch \
|
||||
$(1)/usr/bin/dbus-launch.real
|
||||
$(INSTALL_BIN) \
|
||||
./files/dbus-launch \
|
||||
$(1)/usr/bin/
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) \
|
||||
./files/dbus.init \
|
||||
$(1)/etc/init.d/dbus
|
||||
endef
|
||||
|
||||
define Package/dbus-utils/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) \
|
||||
$(PKG_INSTALL_DIR)/usr/bin/dbus-{send,monitor,cleanup-sockets} \
|
||||
$(1)/usr/bin/
|
||||
endef
|
||||
|
||||
$(eval $(call HostBuild))
|
||||
$(eval $(call BuildPackage,libdbus))
|
||||
$(eval $(call BuildPackage,dbus))
|
||||
$(eval $(call BuildPackage,dbus-utils))
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Simple wrapper script which allows us to build dbus without general x support
|
||||
# If an application needs x support in dbus-launch it has to depend on the
|
||||
# dbus-launch-x package. The script is used to prefer dbus-launch with x over
|
||||
# the dbus-lauch without x.
|
||||
|
||||
if [ -f /usr/bin/dbus-launch-x ]; then
|
||||
exec /usr/bin/dbus-launch-x $@
|
||||
else
|
||||
exec /usr/bin/dbus-launch.real $@
|
||||
fi
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2007-2011 OpenWrt.org
|
||||
|
||||
START=60
|
||||
|
||||
SERVICE_PID_FILE=/var/run/dbus.pid
|
||||
|
||||
start() {
|
||||
mkdir -m 0755 -p /var/lib/dbus
|
||||
mkdir -m 0755 -p /var/run/dbus
|
||||
[ -x /usr/bin/dbus-uuidgen ] && /usr/bin/dbus-uuidgen --ensure
|
||||
service_start /usr/sbin/dbus-daemon --system
|
||||
}
|
||||
|
||||
stop() {
|
||||
service_stop /usr/sbin/dbus-daemon && rm $SERVICE_PID_FILE
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
Index: dbus-1.9.4/tools/tool-common.c
|
||||
===================================================================
|
||||
--- dbus-1.9.4.orig/tools/tool-common.c
|
||||
+++ dbus-1.9.4/tools/tool-common.c
|
||||
@@ -29,6 +29,8 @@
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
+#include <sys/select.h>
|
||||
+
|
||||
#ifdef DBUS_WIN
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ddns-scripts
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=23
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/ddns-scripts
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=IP Addresses and Names
|
||||
TITLE:=Dynamic DNS Scripts
|
||||
PKGARCH:=all
|
||||
MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com>
|
||||
endef
|
||||
|
||||
define Package/ddns-scripts/description
|
||||
A highly configurable set of scripts for doing
|
||||
dynamic dns updates
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/ddns-scripts/conffiles
|
||||
/etc/config/ddns
|
||||
endef
|
||||
|
||||
define Package/ddns-scripts/install
|
||||
$(INSTALL_DIR) $(1)
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/etc/init.d/ddns $(1)/etc/init.d/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ddns-scripts))
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
#################################################################
|
||||
# In order to enable dynamic dns you need at least one section,
|
||||
# and in that seciton the "enabled" option must be set to one
|
||||
#
|
||||
# Each section represents an update to a different service
|
||||
#
|
||||
# You specify your domain name, your username and your password
|
||||
# with the optins "domain", "username" and "password" respectively
|
||||
#
|
||||
# Next you need to specify the name of the service you are
|
||||
# connecting to "eg. dyndns.org". The format of the update
|
||||
# urls for several different dynamic dns services is specified
|
||||
# in the /usr/lib/ddns/services file. This list is hardly complete
|
||||
# as there are many, many different dynamic dns services. If your
|
||||
# service is on the list you can merely specify it with the
|
||||
# "service_name" option. Otherwise you will need to determine
|
||||
# the format of the url to update with. You can either add an
|
||||
# entry to the /usr/lib/ddns/services file or specify this with
|
||||
# the "update_url" option.
|
||||
#
|
||||
# We also need to specify the source of the ip address to associate with
|
||||
# your domain. The "ip_source" option can be "network", "interface"
|
||||
# or "web", with "network" as the default.
|
||||
#
|
||||
# If "ip_source" is "network" you specify a network section in your
|
||||
# /etc/network config file (e.g. "wan", which is the default) with
|
||||
# the "ip_network" option. If you specify "wan", you will update
|
||||
# with whatever the ip for your wan is.
|
||||
#
|
||||
# If "ip_source" is "interface" you specify a hardware interface
|
||||
# (e.g. "eth1") and whatever the current ip of this interface is
|
||||
# will be associated with the domain when an update is performed.
|
||||
#
|
||||
# If "ip_source" is "script" you specify a script to obtain ip address.
|
||||
# The "ip_script" option should contain path to your script.
|
||||
#
|
||||
# The last possibility is that "ip_source" is "web", which means
|
||||
# that in order to obtain our ip address we will connect to a
|
||||
# website, and the first valid ip address listed on that page
|
||||
# will be assumed to be ours. If you are behind another firewall
|
||||
# this is the best option since none of the local networks or
|
||||
# interfaces will have the external ip. The website to connect
|
||||
# to is specified by the "ip_url" option. You may specify multiple
|
||||
# urls in the option, separated by whitespace.
|
||||
#
|
||||
# Finally we need to specify how often to check whether we need
|
||||
# to check whether the ip address has changed (and if so update
|
||||
# it) and how often we need to force an update ( many services
|
||||
# will expire your domain if you don't connect and do an update
|
||||
# every so often). Use the "check_interval" to specify how
|
||||
# often to check whether an update is necessary, the "retry_interval"
|
||||
# to specify how often to retry in case the update has failed, and
|
||||
# the "force_interval" option to specify how often to force an
|
||||
# update. Specify the units for these values with the "check_unit",
|
||||
# the "retry_init" and the "force_unit" options. Units can be
|
||||
# "days", "hours", "minutes" or "seconds". The default force_unit
|
||||
# is hours, the default retry_unit is seconds and the default
|
||||
# check_unit is seconds. The default check_interval is 600 seconds,
|
||||
# or ten minutes. The default retry_interval is 60 seconds, or one
|
||||
# minute. The default force_interval is 72 hours or 3 days.
|
||||
#
|
||||
#
|
||||
#########################################################
|
||||
|
||||
config service "myddns"
|
||||
option enabled "0"
|
||||
option interface "wan"
|
||||
option use_syslog "1"
|
||||
|
||||
option service_name "dyndns.org"
|
||||
option domain "mypersonaldomain.dyndns.org"
|
||||
option username "myusername"
|
||||
option password "mypassword"
|
||||
option use_https "0"
|
||||
|
||||
option force_interval "72"
|
||||
option force_unit "hours"
|
||||
option check_interval "10"
|
||||
option check_unit "minutes"
|
||||
option retry_interval "60"
|
||||
option retry_unit "seconds"
|
||||
|
||||
#option ip_source "network"
|
||||
#option ip_network "wan"
|
||||
|
||||
#option ip_source "interface"
|
||||
#option ip_interface "eth0.1"
|
||||
|
||||
#option ip_source "script"
|
||||
#option ip_script "path to your scrip"
|
||||
|
||||
option ip_source "web"
|
||||
option ip_url "http://checkip.dyndns.com/"
|
||||
|
||||
#option update_url "http://[USERNAME]:[PASSWORD]@members.dyndns.org/nic/update?hostname=[DOMAIN]&myip=[IP]"
|
||||
|
||||
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ "$ACTION" = "ifup" ]; then
|
||||
. /usr/lib/ddns/dynamic_dns_functions.sh
|
||||
/etc/init.d/ddns enabled && start_daemon_for_all_ddns_sections "$INTERFACE"
|
||||
fi
|
||||
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
START=95
|
||||
USE_PROCD=1
|
||||
|
||||
boot() {
|
||||
return 0
|
||||
}
|
||||
|
||||
start_service() {
|
||||
. /usr/lib/ddns/dynamic_dns_functions.sh
|
||||
start_daemon_for_all_ddns_sections
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
killall -9 dynamic_dns_updater.sh
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger ddns
|
||||
}
|
||||
|
||||
|
|
@ -1,144 +0,0 @@
|
|||
# /usr/lib/dynamic_dns/dynamic_dns_functions.sh
|
||||
#
|
||||
# Written by Eric Paul Bishop, Janary 2008
|
||||
# Distributed under the terms of the GNU General Public License (GPL) version 2.0
|
||||
#
|
||||
# This script is (loosely) based on the one posted by exobyte in the forums here:
|
||||
# http://forum.openwrt.org/viewtopic.php?id=14040
|
||||
|
||||
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/network.sh
|
||||
|
||||
|
||||
#loads all options for a given package and section
|
||||
#also, sets all_option_variables to a list of the variable names
|
||||
load_all_config_options()
|
||||
{
|
||||
pkg_name="$1"
|
||||
section_id="$2"
|
||||
|
||||
ALL_OPTION_VARIABLES=""
|
||||
# this callback loads all the variables
|
||||
# in the section_id section when we do
|
||||
# config_load. We need to redefine
|
||||
# the option_cb for different sections
|
||||
# so that the active one isn't still active
|
||||
# after we're done with it. For reference
|
||||
# the $1 variable is the name of the option
|
||||
# and $2 is the name of the section
|
||||
config_cb()
|
||||
{
|
||||
if [ ."$2" = ."$section_id" ]; then
|
||||
option_cb()
|
||||
{
|
||||
ALL_OPTION_VARIABLES="$ALL_OPTION_VARIABLES $1"
|
||||
}
|
||||
else
|
||||
option_cb() { return 0; }
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
config_load "$pkg_name"
|
||||
for var in $ALL_OPTION_VARIABLES
|
||||
do
|
||||
config_get "$var" "$section_id" "$var"
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
get_current_ip()
|
||||
{
|
||||
|
||||
#if ip source is not defined, assume we want to get ip from wan
|
||||
if [ "$ip_source" != "interface" ] && [ "$ip_source" != "web" ] && [ "$ip_source" != "script" ]
|
||||
then
|
||||
ip_source="network"
|
||||
fi
|
||||
|
||||
if [ "$ip_source" = "network" ]
|
||||
then
|
||||
if [ -z "$ip_network" ]
|
||||
then
|
||||
ip_network="wan"
|
||||
fi
|
||||
fi
|
||||
|
||||
current_ip='';
|
||||
if [ "$ip_source" = "network" ]
|
||||
then
|
||||
network_get_ipaddr current_ip "$ip_network" || return
|
||||
elif [ "$ip_source" = "interface" ]
|
||||
then
|
||||
current_ip=$(ifconfig $ip_interface | grep -o 'inet addr:[0-9.]*' | grep -o "$ip_regex")
|
||||
elif [ "$ip_source" = "script" ]
|
||||
then
|
||||
# get ip from script
|
||||
current_ip=$($ip_script)
|
||||
else
|
||||
# get ip from web
|
||||
# we check each url in order in ip_url variable, and if no ips are found we use dyndns ip checker
|
||||
# ip is set to FIRST expression in page that matches the ip_regex regular expression
|
||||
for addr in $ip_url
|
||||
do
|
||||
if [ -z "$current_ip" ]
|
||||
then
|
||||
current_ip=$(echo $( wget -O - $addr 2>/dev/null) | grep -o "$ip_regex")
|
||||
fi
|
||||
done
|
||||
|
||||
#here we hard-code the dyndns checkip url in case no url was specified
|
||||
if [ -z "$current_ip" ]
|
||||
then
|
||||
current_ip=$(echo $( wget -O - http://checkip.dyndns.org 2>/dev/null) | grep -o "$ip_regex")
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$current_ip"
|
||||
}
|
||||
|
||||
|
||||
verbose_echo()
|
||||
{
|
||||
if [ "$verbose_mode" = 1 ]
|
||||
then
|
||||
echo $1
|
||||
fi
|
||||
}
|
||||
|
||||
syslog_echo()
|
||||
{
|
||||
if [ "$use_syslog" = 1 ]
|
||||
then
|
||||
echo $1|logger -t ddns-scripts-$service_id
|
||||
fi
|
||||
}
|
||||
|
||||
start_daemon_for_all_ddns_sections()
|
||||
{
|
||||
local event_interface="$1"
|
||||
|
||||
SECTIONS=""
|
||||
config_cb()
|
||||
{
|
||||
SECTIONS="$SECTIONS $2"
|
||||
}
|
||||
config_load "ddns"
|
||||
|
||||
for section in $SECTIONS
|
||||
do
|
||||
local iface
|
||||
config_get iface "$section" interface "wan"
|
||||
[ -z "$event_interface" -o "$iface" = "$event_interface" ] || continue
|
||||
/usr/lib/ddns/dynamic_dns_updater.sh $section 0 > /dev/null 2>&1 &
|
||||
done
|
||||
}
|
||||
|
||||
monotonic_time()
|
||||
{
|
||||
local uptime
|
||||
read uptime < /proc/uptime
|
||||
echo "${uptime%%.*}"
|
||||
}
|
||||
|
|
@ -1,360 +0,0 @@
|
|||
#!/bin/sh
|
||||
# /usr/lib/dynamic_dns/dynamic_dns_updater.sh
|
||||
#
|
||||
# Written by Eric Paul Bishop, Janary 2008
|
||||
# Distributed under the terms of the GNU General Public License (GPL) version 2.0
|
||||
#
|
||||
# This script is (loosely) based on the one posted by exobyte in the forums here:
|
||||
# http://forum.openwrt.org/viewtopic.php?id=14040
|
||||
#
|
||||
|
||||
. /usr/lib/ddns/dynamic_dns_functions.sh
|
||||
|
||||
|
||||
service_id=$1
|
||||
if [ -z "$service_id" ]
|
||||
then
|
||||
echo "ERRROR: You must specify a service id (the section name in the /etc/config/ddns file) to initialize dynamic DNS."
|
||||
return 1
|
||||
fi
|
||||
|
||||
#default mode is verbose_mode, but easily turned off with second parameter
|
||||
verbose_mode="1"
|
||||
if [ -n "$2" ]
|
||||
then
|
||||
verbose_mode="$2"
|
||||
fi
|
||||
|
||||
###############################################################
|
||||
# Leave this comment here, to clearly document variable names
|
||||
# that are expected/possible
|
||||
#
|
||||
# Now use load_all_config_options to load config
|
||||
# options, which is a much more flexible solution.
|
||||
#
|
||||
#
|
||||
#config_load "ddns"
|
||||
#
|
||||
#config_get enabled $service_id enabled
|
||||
#config_get service_name $service_id service_name
|
||||
#config_get update_url $service_id update_url
|
||||
#
|
||||
#
|
||||
#config_get username $service_id username
|
||||
#config_get password $service_id password
|
||||
#config_get domain $service_id domain
|
||||
#
|
||||
#
|
||||
#config_get use_https $service_id use_https
|
||||
#config_get use_syslog $service_id use_syslog
|
||||
#config_get cacert $service_id cacert
|
||||
#
|
||||
#config_get ip_source $service_id ip_source
|
||||
#config_get ip_interface $service_id ip_interface
|
||||
#config_get ip_network $service_id ip_network
|
||||
#config_get ip_url $service_id ip_url
|
||||
#
|
||||
#config_get force_interval $service_id force_interval
|
||||
#config_get force_unit $service_id force_unit
|
||||
#
|
||||
#config_get check_interval $service_id check_interval
|
||||
#config_get check_unit $service_id check_unit
|
||||
#########################################################
|
||||
load_all_config_options "ddns" "$service_id"
|
||||
|
||||
|
||||
#some defaults
|
||||
if [ -z "$check_interval" ]
|
||||
then
|
||||
check_interval=600
|
||||
fi
|
||||
|
||||
if [ -z "$retry_interval" ]
|
||||
then
|
||||
retry_interval=60
|
||||
fi
|
||||
|
||||
if [ -z "$check_unit" ]
|
||||
then
|
||||
check_unit="seconds"
|
||||
fi
|
||||
|
||||
if [ -z "$force_interval" ]
|
||||
then
|
||||
force_interval=72
|
||||
fi
|
||||
|
||||
if [ -z "$force_unit" ]
|
||||
then
|
||||
force_unit="hours"
|
||||
fi
|
||||
|
||||
if [ -z $use_syslog ]
|
||||
then
|
||||
use_syslog=0
|
||||
fi
|
||||
|
||||
if [ -z "$use_https" ]
|
||||
then
|
||||
use_https=0
|
||||
fi
|
||||
|
||||
|
||||
#some constants
|
||||
|
||||
retrieve_prog="/usr/bin/wget -O - ";
|
||||
if [ "x$use_https" = "x1" ]
|
||||
then
|
||||
/usr/bin/wget --version 2>&1 |grep -q "\+ssl"
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
if [ -f "$cacert" ]
|
||||
then
|
||||
retrieve_prog="${retrieve_prog}--ca-certificate=${cacert} "
|
||||
elif [ -d "$cacert" ]
|
||||
then
|
||||
retrieve_prog="${retrieve_prog}--ca-directory=${cacert} "
|
||||
fi
|
||||
else
|
||||
retrieve_prog="/usr/bin/curl "
|
||||
if [ -f "$cacert" ]
|
||||
then
|
||||
retrieve_prog="${retrieve_prog}--cacert $cacert "
|
||||
elif [ -d "$cacert" ]
|
||||
then
|
||||
retrieve_prog="${retrieve_prog}--capath $cacert "
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
service_file="/usr/lib/ddns/services"
|
||||
|
||||
ip_regex="[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}"
|
||||
|
||||
NEWLINE_IFS='
|
||||
'
|
||||
|
||||
#determine what update url we're using if the service_name is supplied
|
||||
if [ -n "$service_name" ]
|
||||
then
|
||||
#remove any lines not containing data, and then make sure fields are enclosed in double quotes
|
||||
quoted_services=$(cat $service_file | grep "^[\t ]*[^#]" | awk ' gsub("\x27", "\"") { if ($1~/^[^\"]*$/) $1="\""$1"\"" }; { if ( $NF~/^[^\"]*$/) $NF="\""$NF"\"" }; { print $0 }' )
|
||||
|
||||
|
||||
#echo "quoted_services = $quoted_services"
|
||||
OLD_IFS=$IFS
|
||||
IFS=$NEWLINE_IFS
|
||||
for service_line in $quoted_services
|
||||
do
|
||||
#grep out proper parts of data and use echo to remove quotes
|
||||
next_name=$(echo $service_line | grep -o "^[\t ]*\"[^\"]*\"" | xargs -r -n1 echo)
|
||||
next_url=$(echo $service_line | grep -o "\"[^\"]*\"[\t ]*$" | xargs -r -n1 echo)
|
||||
|
||||
if [ "$next_name" = "$service_name" ]
|
||||
then
|
||||
update_url=$next_url
|
||||
fi
|
||||
done
|
||||
IFS=$OLD_IFS
|
||||
fi
|
||||
|
||||
if [ "x$use_https" = x1 ]
|
||||
then
|
||||
update_url=$(echo $update_url | sed -e 's/^http:/https:/')
|
||||
fi
|
||||
|
||||
verbose_echo "update_url=$update_url"
|
||||
|
||||
#if this service isn't enabled then quit
|
||||
if [ "$enabled" != "1" ]
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
|
||||
#compute update interval in seconds
|
||||
case "$force_unit" in
|
||||
"days" )
|
||||
force_interval_seconds=$(($force_interval*60*60*24))
|
||||
;;
|
||||
"hours" )
|
||||
force_interval_seconds=$(($force_interval*60*60))
|
||||
;;
|
||||
"minutes" )
|
||||
force_interval_seconds=$(($force_interval*60))
|
||||
;;
|
||||
"seconds" )
|
||||
force_interval_seconds=$force_interval
|
||||
;;
|
||||
* )
|
||||
#default is hours
|
||||
force_interval_seconds=$(($force_interval*60*60))
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
#compute check interval in seconds
|
||||
case "$check_unit" in
|
||||
"days" )
|
||||
check_interval_seconds=$(($check_interval*60*60*24))
|
||||
;;
|
||||
"hours" )
|
||||
check_interval_seconds=$(($check_interval*60*60))
|
||||
;;
|
||||
"minutes" )
|
||||
check_interval_seconds=$(($check_interval*60))
|
||||
;;
|
||||
"seconds" )
|
||||
check_interval_seconds=$check_interval
|
||||
;;
|
||||
* )
|
||||
#default is seconds
|
||||
check_interval_seconds=$check_interval
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
#compute retry interval in seconds
|
||||
case "$retry_unit" in
|
||||
"days" )
|
||||
retry_interval_seconds=$(($retry_interval*60*60*24))
|
||||
;;
|
||||
"hours" )
|
||||
retry_interval_seconds=$(($retry_interval*60*60))
|
||||
;;
|
||||
"minutes" )
|
||||
retry_interval_seconds=$(($retry_interval*60))
|
||||
;;
|
||||
"seconds" )
|
||||
retry_interval_seconds=$retry_interval
|
||||
;;
|
||||
* )
|
||||
#default is seconds
|
||||
retry_interval_seconds=$retry_interval
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
verbose_echo "force seconds = $force_interval_seconds"
|
||||
verbose_echo "check seconds = $check_interval_seconds"
|
||||
|
||||
#kill old process if it exists & set new pid file
|
||||
if [ -d /var/run/dynamic_dns ]
|
||||
then
|
||||
#if process is already running, stop it
|
||||
if [ -e "/var/run/dynamic_dns/$service_id.pid" ]
|
||||
then
|
||||
old_pid=$(cat /var/run/dynamic_dns/$service_id.pid)
|
||||
test_match=$(ps | grep "^[\t ]*$old_pid")
|
||||
verbose_echo "old process id (if it exists) = \"$test_match\""
|
||||
if [ -n "$test_match" ]
|
||||
then
|
||||
kill $old_pid
|
||||
fi
|
||||
fi
|
||||
|
||||
else
|
||||
#make dir since it doesn't exist
|
||||
mkdir /var/run/dynamic_dns
|
||||
fi
|
||||
echo $$ > /var/run/dynamic_dns/$service_id.pid
|
||||
|
||||
|
||||
|
||||
|
||||
#determine when the last update was
|
||||
current_time=$(monotonic_time)
|
||||
last_update=$(( $current_time - (2*$force_interval_seconds) ))
|
||||
if [ -e "/var/run/dynamic_dns/$service_id.update" ]
|
||||
then
|
||||
last_update=$(cat /var/run/dynamic_dns/$service_id.update)
|
||||
fi
|
||||
time_since_update=$(($current_time - $last_update))
|
||||
|
||||
|
||||
human_time_since_update=$(( $time_since_update / ( 60 * 60 ) ))
|
||||
verbose_echo "time_since_update = $human_time_since_update hours"
|
||||
|
||||
|
||||
|
||||
#do update and then loop endlessly, checking ip every check_interval and forcing an updating once every force_interval
|
||||
|
||||
while [ true ]
|
||||
do
|
||||
registered_ip=$(echo $(nslookup "$domain" 2>/dev/null) | grep -o "Name:.*" | grep -o "$ip_regex")
|
||||
current_ip=$(get_current_ip)
|
||||
|
||||
|
||||
current_time=$(monotonic_time)
|
||||
time_since_update=$(($current_time - $last_update))
|
||||
|
||||
syslog_echo "Running IP check ..."
|
||||
verbose_echo "Running IP check..."
|
||||
verbose_echo "current system ip = $current_ip"
|
||||
verbose_echo "registered domain ip = $registered_ip"
|
||||
|
||||
|
||||
if [ "$current_ip" != "$registered_ip" ] || [ $force_interval_seconds -lt $time_since_update ]
|
||||
then
|
||||
verbose_echo "update necessary, performing update ..."
|
||||
|
||||
#do replacement
|
||||
final_url=$update_url
|
||||
for option_var in $ALL_OPTION_VARIABLES
|
||||
do
|
||||
if [ "$option_var" != "update_url" ]
|
||||
then
|
||||
replace_name=$(echo "\[$option_var\]" | tr 'a-z' 'A-Z')
|
||||
replace_value=$(eval echo "\$$option_var")
|
||||
replace_value=$(echo $replace_value | sed -f /usr/lib/ddns/url_escape.sed)
|
||||
final_url=$(echo $final_url | sed s^"$replace_name"^"$replace_value"^g )
|
||||
fi
|
||||
done
|
||||
final_url=$(echo $final_url | sed s^"\[HTTPAUTH\]"^"${username//^/\\^}${password:+:${password//^/\\^}}"^g )
|
||||
final_url=$(echo $final_url | sed s/"\[IP\]"/"$current_ip"/g )
|
||||
|
||||
|
||||
verbose_echo "updating with url=\"$final_url\""
|
||||
|
||||
#here we actually connect, and perform the update
|
||||
update_output=$( $retrieve_prog "$final_url" )
|
||||
if [ $? -gt 0 ]
|
||||
then
|
||||
syslog_echo "update failed, retrying in $retry_interval_seconds seconds"
|
||||
verbose_echo "update failed"
|
||||
sleep $retry_interval_seconds
|
||||
continue
|
||||
fi
|
||||
syslog_echo "Update successful"
|
||||
verbose_echo "Update Output:"
|
||||
verbose_echo "$update_output"
|
||||
verbose_echo ""
|
||||
|
||||
#save the time of the update
|
||||
current_time=$(monotonic_time)
|
||||
last_update=$current_time
|
||||
time_since_update='0'
|
||||
registered_ip=$current_ip
|
||||
|
||||
human_time=$(date)
|
||||
verbose_echo "update complete, time is: $human_time"
|
||||
|
||||
echo "$last_update" > "/var/run/dynamic_dns/$service_id.update"
|
||||
else
|
||||
human_time=$(date)
|
||||
human_time_since_update=$(( $time_since_update / ( 60 * 60 ) ))
|
||||
verbose_echo "update unnecessary"
|
||||
verbose_echo "time since last update = $human_time_since_update hours"
|
||||
verbose_echo "the time is now $human_time"
|
||||
fi
|
||||
|
||||
#sleep for 10 minutes, then re-check ip && time since last update
|
||||
sleep $check_interval_seconds
|
||||
done
|
||||
|
||||
#should never get here since we're a daemon, but I'll throw it in anyway
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
# This file contains the update urls for various dynamic dns services.
|
||||
# Column one contains the service name, column two contains the update url.
|
||||
# within the update url there are 4 variables you can use: [USERNAME],
|
||||
# [PASSWORD], [DOMAIN] and [IP]. These are substituted for the username,
|
||||
# password, and domain name specified in the /etc/config/ddns file when an
|
||||
# update is performed. The IP is substituted for the current ip address of the
|
||||
# router. These variables are case sensitive, while urls generally are not, so
|
||||
# if you need to enter the same text in the url (which seems very unlikely) put
|
||||
# that text in lowercase, while the variables should remain in uppercase
|
||||
|
||||
"dyndns.org" "http://[USERNAME]:[PASSWORD]@members.dyndns.org/nic/update?hostname=[DOMAIN]&myip=[IP]"
|
||||
"changeip.com" "http://[USERNAME]:[PASSWORD]@nic.changeip.com/nic/update?u=[USERNAME]&p=[PASSWORD]&cmd=update&hostname=[DOMAIN]&ip=[IP]"
|
||||
"zoneedit.com" "http://[USERNAME]:[PASSWORD]@dynamic.zoneedit.com/auth/dynamic.html?host=[DOMAIN]&dnsto=[IP]"
|
||||
"free.editdns.net" "http://dyndns-free.editdns.net/api/dynLinux.php?p=[PASSWORD]&r=[DOMAIN]"
|
||||
|
||||
#noip is an alias of no-ip, so allow both names for the same service
|
||||
"no-ip.com" "http://[USERNAME]:[PASSWORD]@dynupdate.no-ip.com/nic/update?hostname=[DOMAIN]&myip=[IP]"
|
||||
"noip.com" "http://[USERNAME]:[PASSWORD]@dynupdate.no-ip.com/nic/update?hostname=[DOMAIN]&myip=[IP]"
|
||||
|
||||
#freedns.afraid.org is weird, you just need an update code, for which we use the password variable
|
||||
"freedns.afraid.org" "http://freedns.afraid.org/dynamic/update.php?[PASSWORD]&address=[IP]"
|
||||
|
||||
#### ADD YOURS HERE! ######################################################################################
|
||||
# #
|
||||
# There are TONS of dynamic dns services out there. There's a huge list of them at: #
|
||||
# http://www.dmoz.org/Computers/Software/Internet/Servers/Address_Management/Dynamic_DNS_Services/ #
|
||||
# If anyone has time they could update this file to be compatible with a bunch of them #
|
||||
# #
|
||||
###########################################################################################################
|
||||
|
||||
# DNS Max and resellers' update urls
|
||||
"dnsmax.com" "http://update.dnsmax.com/update/?username=[USERNAME]&password=[PASSWORD]&resellerid=1&clientname=openwrt&clientversion=8.09&protocolversion=2.0&updatehostname=[DOMAIN]&ip=[IP]"
|
||||
"thatip.com" "http://update.dnsmax.com/update/?username=[USERNAME]&password=[PASSWORD]&resellerid=2&clientname=openwrt&clientversion=8.09&protocolversion=2.0&updatehostname=[DOMAIN]&ip=[IP]"
|
||||
|
||||
# Hurricane Electric Dynamic DNS
|
||||
"he.net" "http://[DOMAIN]:[PASSWORD]@dyn.dns.he.net/nic/update?hostname=[DOMAIN]&myip=[IP]"
|
||||
|
||||
# DNSdynamic.org
|
||||
"dnsdynamic.org" "http://[USERNAME]:[PASSWORD]@www.dnsdynamic.org/api/?hostname=[DOMAIN]&myip=[IP]"
|
||||
|
||||
# dnsExit.com free dynamic DNS update url
|
||||
"dnsexit.com" "http://www.dnsexit.com/RemoteUpdate.sv?login=[USERNAME]&password=[PASSWORD]&host=[DOMAIN]&myip=[IP]"
|
||||
|
||||
# OVH
|
||||
"ovh.com" "http://[USERNAME]:[PASSWORD]@www.ovh.com/nic/update?system=dyndns&hostname=[DOMAIN]&myip=[IP]"
|
||||
|
||||
# dns-o-matic is a free service by opendns.com for updating multiple hosts and
|
||||
# dynamic dns services in one api call. To update all your configured services
|
||||
# at once, use "all.dnsomatic.com as the hostname.
|
||||
"dnsomatic.com" "http://[USERNAME]:[PASSWORD]@updates.dnsomatic.com/nic/update?hostname=[DOMAIN]&myip=[IP]"
|
||||
|
||||
# 3322.org
|
||||
"3322.org" "http://[USERNAME]:[PASSWORD]@members.3322.org/dyndns/update?system=dyndns&hostname=[DOMAIN]&myip=[IP]"
|
||||
|
||||
# namecheap.com
|
||||
"namecheap.com" "http://dynamicdns.park-your-domain.com/update?host=[USERNAME]&domain=[DOMAIN]&password=[PASSWORD]&ip=[IP]"
|
||||
|
||||
# easydns.com dynamic DNS
|
||||
"easydns.com" "http://[USERNAME]:[PASSWORD]@api.cp.easydns.com/dyn/tomato.php?hostname=[DOMAIN]&myip=[IP]"
|
||||
|
||||
# Winco DDNS
|
||||
"ddns.com.br" "http://[DOMAIN]:[PASSWORD]@members.ddns.com.br/nic/update?hostname=[DOMAIN]&myip=[IP]"
|
||||
|
||||
# Mythic Beasts (https://www.mythic-beasts.com) Dynamic DNS
|
||||
"mythic-beasts.com" "http://dnsapi4.mythic-beasts.com/?domain=[USERNAME]&password=[PASSWORD]&command=REPLACE%20[DOMAIN]%2060%20A%20DYNAMIC_IP"
|
||||
|
||||
# Securepoint Dynamic-DNS-Service (http://www.spdns.de)
|
||||
"spdns.de" "http://[USERNAME]:[PASSWORD]@update.spdns.de/nic/update?hostname=[DOMAIN]&myip=[IP]"
|
||||
|
||||
# duiadns.net - free dynamic DNS
|
||||
"duiadns.net" "http://ipv4.duia.ro/dynamic.duia?host=[DOMAIN]&password=[PASSWORD]&ip4=[IP]"
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
# sed url escaping
|
||||
s:%:%25:g
|
||||
s: :%20:g
|
||||
s:<:%3C:g
|
||||
s:>:%3E:g
|
||||
s:#:%23:g
|
||||
s:{:%7B:g
|
||||
s:}:%7D:g
|
||||
s:|:%7C:g
|
||||
s:\\:%5C:g
|
||||
s:\^:%5E:g
|
||||
s:~:%7E:g
|
||||
s:\[:%5B:g
|
||||
s:\]:%5D:g
|
||||
s:`:%60:g
|
||||
s:;:%3B:g
|
||||
s:/:%2F:g
|
||||
s:?:%3F:g
|
||||
s^:^%3A^g
|
||||
s:@:%40:g
|
||||
s:=:%3D:g
|
||||
s:&:%26:g
|
||||
s:\$:%24:g
|
||||
s:\!:%21:g
|
||||
s:\*:%2A:g
|
||||
100
glib2/Makefile
100
glib2/Makefile
|
|
@ -1,100 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2007-2012 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=glib2
|
||||
PKG_VERSION:=2.37.7
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=glib-$(PKG_VERSION).tar.xz
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/glib-$(PKG_VERSION)
|
||||
PKG_SOURCE_URL:=@GNOME/glib/2.37
|
||||
PKG_MD5SUM:=17a9493e3e2efebc8ab81ec8d4480bfb
|
||||
|
||||
PKG_BUILD_DEPENDS:=glib2/host libpthread zlib libintl libffi
|
||||
HOST_BUILD_DEPENDS:=libintl/host libiconv/host libffi/host
|
||||
PKG_INSTALL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/glib-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
define Package/glib2
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
DEPENDS:=$(ICONV_DEPENDS) +libiconv $(INTL_DEPENDS) +zlib +libpthread +libffi
|
||||
TITLE:=glib 2.0
|
||||
URL:=http://www.gtk.org/
|
||||
endef
|
||||
|
||||
define Package/glib2/description
|
||||
The GLib library of C routines
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
$(call Build/Configure/Default, \
|
||||
--enable-shared \
|
||||
--enable-static \
|
||||
--enable-debug=no \
|
||||
--disable-selinux \
|
||||
--disable-fam \
|
||||
$(if $(ICONV_FULL),--with-libiconv=gnu) \
|
||||
, \
|
||||
glib_cv_stack_grows=no \
|
||||
glib_cv_uscore=no \
|
||||
ac_cv_path_GLIB_GENMARSHAL=$(STAGING_DIR_HOST)/bin/glib-genmarshal \
|
||||
ac_cv_func_mmap_fixed_mapped=yes \
|
||||
ac_cv_func_posix_getpwuid_r=yes \
|
||||
ac_cv_func_posix_getgrgid_r=yes \
|
||||
);
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/include/glib-2.0 \
|
||||
$(1)/usr/include/
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/glib-2.0/include/*.h \
|
||||
$(1)/usr/include/glib-2.0/
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/include/gio-unix-2.0 \
|
||||
$(1)/usr/include/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/glib-2.0 \
|
||||
$(1)/usr/lib/
|
||||
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} \
|
||||
$(1)/usr/lib/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
|
||||
$(1)/usr/lib/pkgconfig
|
||||
|
||||
$(INSTALL_DIR) $(2)/share/aclocal/
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_INSTALL_DIR)/usr/share/aclocal/*.m4 \
|
||||
$(2)/share/aclocal/
|
||||
endef
|
||||
|
||||
define Package/glib2/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/*.so* \
|
||||
$(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call HostBuild))
|
||||
$(eval $(call BuildPackage,glib2))
|
||||
140
haproxy/Makefile
140
haproxy/Makefile
|
|
@ -1,140 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2010-2013 OpenWrt.org
|
||||
# Copyright (C) 2009-2014 Thomas Heil <heil@terminal-consulting.de>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=haproxy
|
||||
PKG_VERSION:=1.5.14
|
||||
PKG_RELEASE:=00
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/haproxy/haproxy.git
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
|
||||
PKG_SOURCE_VERSION:=master
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/haproxy/Default
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=The Reliable, High Performance TCP/HTTP Load Balancer
|
||||
URL:=http://haproxy.1wt.eu/
|
||||
endef
|
||||
|
||||
define Package/haproxy/Default/conffiles
|
||||
/etc/haproxy.cfg
|
||||
endef
|
||||
|
||||
define Package/haproxy/Default/description
|
||||
Open source Reliable, High Performance TCP/HTTP Load Balancer.
|
||||
endef
|
||||
|
||||
define Package/haproxy
|
||||
DEPENDS+= +libpcre +libltdl +zlib +libpthread +libopenssl
|
||||
TITLE+= (with SSL support)
|
||||
VARIANT:=ssl
|
||||
$(call Package/haproxy/Default)
|
||||
endef
|
||||
|
||||
define Package/haproxy/conffiles
|
||||
$(call Package/haproxy/Default/conffiles)
|
||||
endef
|
||||
|
||||
define Package/haproxy/description
|
||||
$(call Package/haproxy/Default/description)
|
||||
This package is built with SSL support.
|
||||
endef
|
||||
|
||||
define Package/haproxy-nossl
|
||||
TITLE+= (without SSL support)
|
||||
VARIANT:=nossl
|
||||
DEPENDS+= +libpcre +libltdl +zlib +libpthread
|
||||
TITLE+= (with SSL support)
|
||||
$(call Package/haproxy/Default)
|
||||
endef
|
||||
|
||||
define Package/haproxy-nossl/conffiles
|
||||
$(call Package/haproxy/Default/conffiles)
|
||||
endef
|
||||
|
||||
define Package/haproxy-nossl/description
|
||||
$(call Package/haproxy/Default/description)
|
||||
This package is built without SSL support.
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_avr32),y)
|
||||
LINUX_TARGET:=linux26
|
||||
else
|
||||
LINUX_TARGET:=linux2628
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),ssl)
|
||||
USE_OPENSSL=USE_OPENSSL=1
|
||||
else
|
||||
USE_OPENSSL=
|
||||
endif
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) TARGET=$(LINUX_TARGET) -C $(PKG_BUILD_DIR) \
|
||||
DESTDIR="$(PKG_INSTALL_DIR)" \
|
||||
CC="$(TARGET_CC)" \
|
||||
CFLAGS="$(TARGET_CFLAGS) -fno-align-jumps -fno-align-functions -fno-align-labels -fno-align-loops -pipe -fomit-frame-pointer -fhonour-copts" \
|
||||
LD="$(TARGET_CC)" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
PCREDIR="$(STAGING_DIR)/usr" \
|
||||
SMALL_OPTS="-DBUFSIZE=16384 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=165530 " \
|
||||
USE_LINUX_TPROXY=1 USE_LINUX_SPLICE=1 USE_REGPARM=1 $(USE_OPENSSL) \
|
||||
USE_ZLIB=yes USE_PCRE=1 \
|
||||
VERSION="$(PKG_VERSION)-patch$(PKG_RELEASE)" \
|
||||
install
|
||||
|
||||
$(MAKE) -C $(PKG_BUILD_DIR)/contrib/halog \
|
||||
CC="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS)" \
|
||||
OPTIMIZE="" \
|
||||
halog
|
||||
endef
|
||||
|
||||
define Package/haproxy/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/haproxy $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_CONF) ./files/haproxy.cfg $(1)/etc/
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/haproxy.init $(1)/etc/init.d/haproxy
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/net
|
||||
$(INSTALL_BIN) ./files/haproxy.hotplug $(1)/etc/hotplug.d/net/90-haproxy
|
||||
endef
|
||||
|
||||
Package/haproxy-nossl/install = $(Package/haproxy/install)
|
||||
|
||||
define Package/halog
|
||||
MENU:=1
|
||||
$(call Package/haproxy/Default)
|
||||
TITLE+= halog
|
||||
DEPENDS:=haproxy
|
||||
endef
|
||||
|
||||
define Package/halog/description
|
||||
HAProxy Log Analyzer
|
||||
endef
|
||||
|
||||
define Package/halog/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/halog/halog $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,haproxy-nossl))
|
||||
$(eval $(call BuildPackage,haproxy))
|
||||
$(eval $(call BuildPackage,halog))
|
||||
|
|
@ -1,106 +0,0 @@
|
|||
# Example configuration file for HAProxy 1.3, refer to the url below for
|
||||
# a full documentation and examples for configuration:
|
||||
# http://haproxy.1wt.eu/download/1.3/doc/configuration.txt
|
||||
|
||||
|
||||
# Global parameters
|
||||
global
|
||||
|
||||
# Log events to a remote syslog server at given address using the
|
||||
# specified facility and verbosity level. Multiple log options
|
||||
# are allowed.
|
||||
#log 10.0.0.1 daemon info
|
||||
|
||||
# Specifiy the maximum number of allowed connections.
|
||||
maxconn 32000
|
||||
|
||||
# Raise the ulimit for the maximum allowed number of open socket
|
||||
# descriptors per process. This is usually at least twice the
|
||||
# number of allowed connections (maxconn * 2 + nb_servers + 1) .
|
||||
ulimit-n 65535
|
||||
|
||||
# Drop privileges (setuid, setgid), default is "root" on OpenWrt.
|
||||
uid 0
|
||||
gid 0
|
||||
|
||||
# Perform chroot into the specified directory.
|
||||
#chroot /var/run/haproxy/
|
||||
|
||||
# Daemonize on startup
|
||||
daemon
|
||||
|
||||
nosplice
|
||||
# Enable debugging
|
||||
#debug
|
||||
|
||||
# Spawn given number of processes and distribute load among them,
|
||||
# used for multi-core environments or to circumvent per-process
|
||||
# limits like number of open file descriptors. Default is 1.
|
||||
#nbproc 2
|
||||
|
||||
|
||||
# Example HTTP proxy listener
|
||||
listen my_http_proxy
|
||||
|
||||
# Bind to port 81 and 444 on all interfaces (0.0.0.0)
|
||||
bind :81,:444
|
||||
|
||||
# We're proxying HTTP here...
|
||||
mode http
|
||||
maxconn 2
|
||||
|
||||
http-response add-header Keep-Alive 3000
|
||||
http-response add-header Connection keep-alive
|
||||
|
||||
# Simple HTTP round robin over two servers using the specified
|
||||
# source ip 192.168.1.1 .
|
||||
balance leastconn
|
||||
server juci localhost:80 source localhost
|
||||
|
||||
option http-server-close
|
||||
timeout http-keep-alive 3000
|
||||
|
||||
# Serve an internal statistics page on /stats:
|
||||
stats enable
|
||||
stats uri /stats
|
||||
|
||||
# Enable HTTP basic auth for the statistics:
|
||||
stats realm HA_Stats
|
||||
stats auth username:password
|
||||
|
||||
|
||||
# Example SMTP proxy listener
|
||||
listen my_smtp_proxy
|
||||
|
||||
# Disable this instance without commenting out the section.
|
||||
disabled
|
||||
|
||||
# Bind to port 26 and 588 on localhost
|
||||
bind 127.0.0.1:26,127.0.0.1:588
|
||||
|
||||
# This is a TCP proxy
|
||||
mode tcp
|
||||
|
||||
# Round robin load balancing over two servers on port 123 forcing
|
||||
# the address 192.168.1.1 and port 25 as source.
|
||||
balance roundrobin
|
||||
#use next line for transparent proxy, so the servers can see the
|
||||
#original ip-address and remove source keyword in server definition
|
||||
#source 0.0.0.0 usesrc clientip
|
||||
server server01 192.168.1.10:123 source 192.168.1.1:25
|
||||
server server02 192.168.1.20:123 source 192.168.1.1:25
|
||||
|
||||
|
||||
# Special health check listener for integration with external load
|
||||
# balancers.
|
||||
listen local_health_check
|
||||
|
||||
# Listen on port 60000
|
||||
bind :60000
|
||||
|
||||
# This is a health check
|
||||
mode health
|
||||
|
||||
# Enable HTTP-style responses: "HTTP/1.0 200 OK"
|
||||
# else just print "OK".
|
||||
#option httpchk
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ "$ACTION" = add ]; then
|
||||
|
||||
/etc/init.d/haproxy enabled && \
|
||||
/etc/init.d/haproxy start
|
||||
fi
|
||||
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2009-2010 OpenWrt.org
|
||||
|
||||
START=99
|
||||
STOP=80
|
||||
|
||||
SERVICE_USE_PID=1
|
||||
|
||||
HAPROXY_BIN="/usr/sbin/haproxy"
|
||||
HAPROXY_CONFIG="/etc/haproxy.cfg"
|
||||
HAPROXY_PID="/var/run/haproxy.pid"
|
||||
|
||||
start() {
|
||||
service_start $HAPROXY_BIN -q -D -f "$HAPROXY_CONFIG" -p "$HAPROXY_PID"
|
||||
}
|
||||
|
||||
stop() {
|
||||
kill -9 $(cat $HAPROXY_PID | tr "\n" " ")
|
||||
service_stop $HAPROXY_BIN
|
||||
}
|
||||
|
||||
reload() {
|
||||
$HAPROXY_BIN -D -q -f $HAPROXY_CONFIG -p $HAPROXY_PID -sf $(cat $HAPROXY_PID | tr "\n" " ")
|
||||
#$HAPROXY_BIN -D -q -f $HAPROXY_CONFIG -p $HAPROXY_PID -sf $(cat $HAPROXY_PID)
|
||||
}
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2006-2011 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=hotplug2
|
||||
PKG_REV:=201
|
||||
PKG_VERSION:=$(PKG_REV)
|
||||
PKG_RELEASE:=4
|
||||
|
||||
#PKG_SOURCE_PROTO:=svn
|
||||
#PKG_SOURCE_VERSION:=$(PKG_REV)
|
||||
#PKG_SOURCE_SUBDIR:=hotplug2-$(PKG_VERSION)
|
||||
#PKG_SOURCE_URL:=http://svn.nomi.cz/svn/isteve/hotplug2
|
||||
PKG_SOURCE:=hotplug2-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/
|
||||
PKG_MD5SUM:=7bab8ba67555a8400424f3c92ec67579
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/hotplug2
|
||||
SECTION:=base
|
||||
CATEGORY:=Base system
|
||||
VERSION:=1.0-beta-$(PKG_RELEASE)
|
||||
TITLE:=Version 1.0 Dynamic device management subsystem for embedded systems
|
||||
URL:=http://isteve.bofh.cz/~isteve/hotplug2/
|
||||
DEPENDS:=+!USE_UCLIBC:libbsd
|
||||
endef
|
||||
|
||||
define Package/hotplug2/description
|
||||
Hotplug2 is a trivial replacement of some of the UDev functionality
|
||||
in a tiny pack, intended for Linux early userspace: Init RAM FS and InitRD.
|
||||
This is an implementation of Hotplug2-1.0-beta
|
||||
endef
|
||||
|
||||
define Package/hotplug2/conffiles
|
||||
/etc/hotplug2.rules
|
||||
endef
|
||||
|
||||
MAKE_FLAGS += \
|
||||
COPTS="$(TARGET_CFLAGS)" \
|
||||
STATIC_WORKER="fork"
|
||||
|
||||
ifneq ($(CONFIG_USE_EGLIBC),)
|
||||
TARGET_LDFLAGS += -lbsd
|
||||
endif
|
||||
|
||||
define Build/Compile
|
||||
$(call Build/Compile/Default)
|
||||
$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) -o $(PKG_BUILD_DIR)/udevtrigger src/udevtrigger.c
|
||||
endef
|
||||
|
||||
define Package/hotplug2/install
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_DATA) ./files/hotplug2.rules $(1)/etc/
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/udevtrigger $(1)/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/hotplug2 $(1)/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,hotplug2))
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
$include /etc/hotplug2-common.rules
|
||||
|
||||
SUBSYSTEM ~~ (^net$|^input$|^button$|^usb$|^ieee1394$|^block$|^atm$|^zaptel$|^tty$) {
|
||||
exec /sbin/hotplug-call %SUBSYSTEM%
|
||||
}
|
||||
|
||||
DEVICENAME == watchdog {
|
||||
exec /sbin/watchdog -t 5 /dev/watchdog
|
||||
next-event
|
||||
}
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
--- a/action.c
|
||||
+++ b/action.c
|
||||
@@ -31,6 +31,30 @@ static void action_dumb(const struct set
|
||||
}
|
||||
|
||||
/**
|
||||
+ * Creates a "key=value" string from the given key and value
|
||||
+ *
|
||||
+ * @1 Key
|
||||
+ * @2 Value
|
||||
+ *
|
||||
+ * Returns: Newly allocated string in "key=value" form
|
||||
+ *
|
||||
+ */
|
||||
+static char* alloc_env(const char *key, const char *value) {
|
||||
+ size_t keylen, vallen;
|
||||
+ char *combined;
|
||||
+
|
||||
+ keylen = strlen(key);
|
||||
+ vallen = strlen(value) + 1;
|
||||
+
|
||||
+ combined = xmalloc(keylen + vallen + 1);
|
||||
+ memcpy(combined, key, keylen);
|
||||
+ combined[keylen] = '=';
|
||||
+ memcpy(&combined[keylen + 1], value, vallen);
|
||||
+
|
||||
+ return combined;
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
* Choose what action should be taken according to passed settings.
|
||||
*
|
||||
* @1 Hotplug settings
|
||||
@@ -41,16 +65,25 @@ static void action_dumb(const struct set
|
||||
*/
|
||||
void action_perform(struct settings_t *settings, struct uevent_t *event) {
|
||||
int i;
|
||||
+ char **env;
|
||||
+
|
||||
+ env = xmalloc(sizeof(char *) * event->env_vars_c);
|
||||
+
|
||||
+ for (i = 0; i < event->env_vars_c; i++) {
|
||||
+ env[i] = alloc_env(event->env_vars[i].key, event->env_vars[i].value);
|
||||
+ putenv(env[i]);
|
||||
+ }
|
||||
|
||||
- for (i = 0; i < event->env_vars_c; i++)
|
||||
- setenv(event->env_vars[i].key, event->env_vars[i].value, 1);
|
||||
-
|
||||
if (settings->dumb == 0) {
|
||||
ruleset_execute(&settings->rules, event, settings);
|
||||
} else {
|
||||
action_dumb(settings, event);
|
||||
}
|
||||
|
||||
- for (i = 0; i < event->env_vars_c; i++)
|
||||
+ for (i = 0; i < event->env_vars_c; i++) {
|
||||
unsetenv(event->env_vars[i].key);
|
||||
+ free(env[i]);
|
||||
+ }
|
||||
+
|
||||
+ free(env);
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
--- a/common.mak
|
||||
+++ b/common.mak
|
||||
@@ -1,7 +1,7 @@
|
||||
# vim:set sw=8 nosta:
|
||||
|
||||
COPTS=-Os -Wall -g
|
||||
-LDFLAGS=-g -ldl
|
||||
+LDFLAGS=-g
|
||||
|
||||
CFLAGS=$(COPTS)
|
||||
FPIC=-fPIC
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -40,5 +40,6 @@ ifdef STATIC_WORKER
|
||||
CFLAGS += -DSTATIC_WORKER=1
|
||||
else
|
||||
CFLAGS += $(FPIC)
|
||||
+ LDFLAGS += -ldl
|
||||
endif
|
||||
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
--- a/rules/command.c
|
||||
+++ b/rules/command.c
|
||||
@@ -374,9 +374,9 @@ RULES_COMMAND_F(cmd_firmware) {
|
||||
if (firmware == NULL)
|
||||
return -1;
|
||||
|
||||
- if (snprintf(sysfs_path_loading, PATH_MAX, "/sysfs%s/loading", devpath) >= PATH_MAX)
|
||||
+ if (snprintf(sysfs_path_loading, PATH_MAX, "/sys%s/loading", devpath) >= PATH_MAX)
|
||||
return -1;
|
||||
- if (snprintf(sysfs_path_data, PATH_MAX, "/sysfs%s/data", devpath) >= PATH_MAX)
|
||||
+ if (snprintf(sysfs_path_data, PATH_MAX, "/sys%s/data", devpath) >= PATH_MAX)
|
||||
return -1;
|
||||
if (snprintf(firmware_path, PATH_MAX, "%s/%s", argv[0], firmware) >= PATH_MAX)
|
||||
return -1;
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
--- a/rules/command.c
|
||||
+++ b/rules/command.c
|
||||
@@ -385,13 +385,13 @@ RULES_COMMAND_F(cmd_firmware) {
|
||||
|
||||
infp = fopen(firmware_path, "r");
|
||||
if (infp == NULL) {
|
||||
- echo_to_file(sysfs_path_loading, "0\n", 2);
|
||||
+ echo_to_file(sysfs_path_loading, "-1\n", 2);
|
||||
return -1;
|
||||
}
|
||||
outfp = fopen(sysfs_path_data, "w");
|
||||
if (outfp == NULL) {
|
||||
fclose(infp);
|
||||
- echo_to_file(sysfs_path_loading, "0\n", 2);
|
||||
+ echo_to_file(sysfs_path_loading, "-1\n", 2);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -1,237 +0,0 @@
|
|||
--- a/action.c
|
||||
+++ b/action.c
|
||||
@@ -39,7 +39,7 @@ static void action_dumb(const struct set
|
||||
* Returns: Newly allocated string in "key=value" form
|
||||
*
|
||||
*/
|
||||
-static char* alloc_env(const char *key, const char *value) {
|
||||
+char* alloc_env(const char *key, const char *value) {
|
||||
size_t keylen, vallen;
|
||||
char *combined;
|
||||
|
||||
--- a/action.h
|
||||
+++ b/action.h
|
||||
@@ -12,5 +12,6 @@
|
||||
#include "settings.h"
|
||||
|
||||
void action_perform(struct settings_t *, struct uevent_t *);
|
||||
+char* alloc_env(const char *, const char *);
|
||||
#endif /* ifndef ACTION_H */
|
||||
|
||||
--- a/workers/worker_fork.c
|
||||
+++ b/workers/worker_fork.c
|
||||
@@ -1,6 +1,69 @@
|
||||
#include "worker_fork.h"
|
||||
|
||||
static struct worker_fork_ctx_t *global_ctx;
|
||||
+static struct worker_fork_uevent_t *uevent_list;
|
||||
+
|
||||
+static void worker_fork_uevent_free(struct worker_fork_uevent_t *node) {
|
||||
+ uevent_free(node->uevent);
|
||||
+ free(node);
|
||||
+}
|
||||
+
|
||||
+static void worker_fork_uevent_add(void *in_ctx, struct uevent_t *uevent) {
|
||||
+ char **env;
|
||||
+ int i;
|
||||
+ struct worker_fork_ctx_t *ctx = in_ctx;
|
||||
+ struct worker_fork_uevent_t *node, *walker;
|
||||
+
|
||||
+ node = malloc(sizeof (struct worker_fork_uevent_t));
|
||||
+ node->uevent = uevent_dup(uevent);
|
||||
+ node->next = NULL;
|
||||
+
|
||||
+ if (!uevent_list) uevent_list = node;
|
||||
+ else {
|
||||
+ /*
|
||||
+ * Put events that need to fork first and in reverse order
|
||||
+ */
|
||||
+ env = xmalloc(sizeof(char *) * node->uevent->env_vars_c);
|
||||
+ for (i = 0; i < node->uevent->env_vars_c; i++) {
|
||||
+ env[i] = alloc_env(node->uevent->env_vars[i].key, node->uevent->env_vars[i].value);
|
||||
+ putenv(env[i]);
|
||||
+ }
|
||||
+ if (ruleset_flags(&ctx->settings->rules, uevent) & FLAG_SLOW) {
|
||||
+ node->next = uevent_list;
|
||||
+ uevent_list = node;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (walker = uevent_list; walker->next; walker = walker->next);
|
||||
+ walker->next = node;
|
||||
+ }
|
||||
+ for (i = 0; i < node->uevent->env_vars_c; i++) {
|
||||
+ unsetenv(node->uevent->env_vars[i].key);
|
||||
+ free(env[i]);
|
||||
+ }
|
||||
+ free(env);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void worker_fork_uevent_del(struct worker_fork_uevent_t *node) {
|
||||
+ struct worker_fork_uevent_t *walker;
|
||||
+
|
||||
+ if (node == uevent_list) {
|
||||
+ uevent_list = node->next;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (walker = uevent_list; walker->next; walker = walker->next)
|
||||
+ if (walker->next == node) walker->next = node->next;
|
||||
+ }
|
||||
+ worker_fork_uevent_free(node);
|
||||
+}
|
||||
+
|
||||
+static void worker_fork_uevent_empty(void) {
|
||||
+ struct worker_fork_uevent_t *walker;
|
||||
+
|
||||
+ if (!uevent_list) return;
|
||||
+ for (walker = uevent_list; walker->next; walker = walker->next) worker_fork_uevent_free(walker);
|
||||
+ uevent_list = NULL;
|
||||
+}
|
||||
|
||||
/**
|
||||
* Destroys data structures related to the given child ID (not PID).
|
||||
@@ -315,6 +378,8 @@ static void *worker_fork_init(struct set
|
||||
struct worker_fork_ctx_t *ctx;
|
||||
PRINTFUNC();
|
||||
|
||||
+ uevent_list = NULL;
|
||||
+
|
||||
ctx = malloc(sizeof(struct worker_fork_ctx_t));
|
||||
ctx->children = NULL;
|
||||
ctx->children_count = 0;
|
||||
@@ -376,26 +441,39 @@ static void worker_fork_deinit(void *in_
|
||||
free(ctx->children);
|
||||
free(ctx);
|
||||
global_ctx = NULL;
|
||||
+ worker_fork_uevent_empty();
|
||||
}
|
||||
|
||||
|
||||
static int worker_fork_process(void *in_ctx, struct uevent_t *uevent) {
|
||||
+ char **env;
|
||||
int i;
|
||||
struct worker_fork_child_t *child;
|
||||
struct worker_fork_ctx_t *ctx = in_ctx;
|
||||
+ struct worker_fork_uevent_t *node, *walker;
|
||||
+ event_seqnum_t seqnum;
|
||||
+
|
||||
+ worker_fork_uevent_add(ctx, uevent);
|
||||
+ walker = uevent_list;
|
||||
|
||||
/*
|
||||
- * A big loop, because if we fail to process the event,
|
||||
+ * A big loop, because if we fail to process the events,
|
||||
* we don't want to give up.
|
||||
*
|
||||
* TODO: Decide if we want to limit the number of attempts
|
||||
* or set a time limit before reporting terminal failure.
|
||||
*/
|
||||
do {
|
||||
+ /*
|
||||
+ * If more events are waiting, return to receive them
|
||||
+ */
|
||||
+ if (!seqnum_get(&seqnum) && seqnum > uevent->seqnum) break;
|
||||
+
|
||||
+ node = walker;
|
||||
worker_fork_update_children(ctx);
|
||||
|
||||
child = NULL;
|
||||
- for (i = 0; i < ctx->children_count; i++) {
|
||||
+ for (i = 0; i < ctx->children_count && i < ctx->max_children; i++) {
|
||||
if (ctx->children[i]->busy == 0) {
|
||||
child = ctx->children[i];
|
||||
break;
|
||||
@@ -406,21 +484,40 @@ static int worker_fork_process(void *in_
|
||||
* No child process is currently available.
|
||||
*/
|
||||
if (child == NULL) {
|
||||
+ bool is_slow;
|
||||
+
|
||||
+ env = xmalloc(sizeof(char *) * node->uevent->env_vars_c);
|
||||
+ for (i = 0; i < node->uevent->env_vars_c; i++) {
|
||||
+ env[i] = alloc_env(node->uevent->env_vars[i].key, node->uevent->env_vars[i].value);
|
||||
+ putenv(env[i]);
|
||||
+ }
|
||||
+
|
||||
+ is_slow = !!(ruleset_flags(&ctx->settings->rules, node->uevent) & FLAG_MASK_SLOW);
|
||||
+
|
||||
+ for (i = 0; i < node->uevent->env_vars_c; i++) {
|
||||
+ unsetenv(node->uevent->env_vars[i].key);
|
||||
+ free(env[i]);
|
||||
+ }
|
||||
+ free(env);
|
||||
+
|
||||
/*
|
||||
* Are the matching rules trivial enough that we
|
||||
* can execute them in the main process?
|
||||
*/
|
||||
- if (ctx->always_fork == 0 && ctx->settings->dumb == 0 &&
|
||||
- (ruleset_flags(&ctx->settings->rules, uevent) & FLAG_MASK_SLOW) == 0) {
|
||||
- action_perform(ctx->settings, uevent);
|
||||
+ if (ctx->always_fork == 0 && ctx->settings->dumb == 0 && !is_slow) {
|
||||
+ action_perform(ctx->settings, node->uevent);
|
||||
+ walker = walker->next;
|
||||
+ worker_fork_uevent_del(node);
|
||||
+ if (walker) continue;
|
||||
break;
|
||||
}
|
||||
-
|
||||
+
|
||||
/*
|
||||
* We have to fork off a new child.
|
||||
*/
|
||||
if (ctx->children_count < ctx->max_children)
|
||||
child = worker_fork_spawn(ctx);
|
||||
+
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -428,9 +525,14 @@ static int worker_fork_process(void *in_
|
||||
*/
|
||||
if (child != NULL) {
|
||||
child->busy = 1;
|
||||
- if (!worker_fork_relay_event(child->event_fd, uevent));
|
||||
- break;
|
||||
- child->busy = 0;
|
||||
+ if (worker_fork_relay_event(child->event_fd, node->uevent)) {
|
||||
+ child->busy = 0;
|
||||
+ continue;
|
||||
+ }
|
||||
+ walker = walker->next;
|
||||
+ worker_fork_uevent_del(node);
|
||||
+ if (walker) continue;
|
||||
+ break;
|
||||
}
|
||||
|
||||
/*
|
||||
--- a/uevent.c
|
||||
+++ b/uevent.c
|
||||
@@ -132,6 +132,8 @@ struct uevent_t *uevent_dup(const struct
|
||||
|
||||
dest = xmalloc(sizeof(struct uevent_t));
|
||||
dest->action = src->action;
|
||||
+ dest->seqnum = src->seqnum;
|
||||
+ dest->action_str = strdup(src->action_str);
|
||||
dest->env_vars_c = src->env_vars_c;
|
||||
dest->env_vars = xmalloc(sizeof(struct env_var_t) * dest->env_vars_c);
|
||||
dest->plain_s = src->plain_s;
|
||||
--- a/workers/worker_fork.h
|
||||
+++ b/workers/worker_fork.h
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/select.h>
|
||||
#include <unistd.h>
|
||||
+#include <stdbool.h>
|
||||
|
||||
#include "../rules/execution.h"
|
||||
|
||||
@@ -35,4 +36,9 @@ struct worker_fork_ctx_t {
|
||||
struct settings_t *settings;
|
||||
};
|
||||
|
||||
+struct worker_fork_uevent_t {
|
||||
+ struct uevent_t *uevent;
|
||||
+ struct worker_fork_uevent_t *next;
|
||||
+};
|
||||
+
|
||||
#endif
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
Index: hotplug2-201/parser/parser.c
|
||||
===================================================================
|
||||
--- hotplug2-201.orig/parser/parser.c 2009-12-09 19:44:13.000000000 +0100
|
||||
+++ hotplug2-201/parser/parser.c 2011-02-08 18:06:44.681213713 +0100
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "parser.h"
|
||||
|
||||
+#include <errno.h>
|
||||
+
|
||||
/*
|
||||
* Grammar:
|
||||
* input => directive // TOKEN_ROOTKW
|
||||
@@ -578,7 +580,7 @@
|
||||
ctx.lexer.fp = fopen(filename, "r");
|
||||
if (ctx.lexer.fp == NULL) {
|
||||
parser_clear(&ctx);
|
||||
- return -1;
|
||||
+ return (errno == ENOENT) ? 0 : -1;
|
||||
}
|
||||
ctx.lexer.filename = strdup(filename);
|
||||
|
||||
|
|
@ -1,345 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2004-2006 Kay Sievers <kay@vrfy.org>
|
||||
* Copyright (C) 2006 Hannes Reinecke <hare@suse.de>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <getopt.h>
|
||||
#include <errno.h>
|
||||
#include <dirent.h>
|
||||
#include <fcntl.h>
|
||||
#include <syslog.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#define PATH_SIZE 512
|
||||
|
||||
static int verbose;
|
||||
static int dry_run;
|
||||
|
||||
void log_message(int priority, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
va_start(args, format);
|
||||
vsyslog(priority, format, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
#undef err
|
||||
#define err(format, arg...) \
|
||||
do { \
|
||||
log_message(LOG_ERR ,"%s: " format ,__FUNCTION__ ,## arg); \
|
||||
} while (0)
|
||||
|
||||
#undef info
|
||||
#define info(format, arg...) \
|
||||
do { \
|
||||
log_message(LOG_INFO ,"%s: " format ,__FUNCTION__ ,## arg); \
|
||||
} while (0)
|
||||
|
||||
#ifdef DEBUG
|
||||
#undef dbg
|
||||
#define dbg(format, arg...) \
|
||||
do { \
|
||||
log_message(LOG_DEBUG ,"%s: " format ,__FUNCTION__ ,## arg); \
|
||||
} while (0)
|
||||
#else
|
||||
#define dbg(...) do {} while(0)
|
||||
#endif
|
||||
|
||||
|
||||
static void trigger_uevent(const char *devpath)
|
||||
{
|
||||
char filename[PATH_SIZE];
|
||||
int fd;
|
||||
|
||||
strlcpy(filename, "/sys", sizeof(filename));
|
||||
strlcat(filename, devpath, sizeof(filename));
|
||||
strlcat(filename, "/uevent", sizeof(filename));
|
||||
|
||||
if (verbose)
|
||||
printf("%s\n", devpath);
|
||||
|
||||
if (dry_run)
|
||||
return;
|
||||
|
||||
fd = open(filename, O_WRONLY);
|
||||
if (fd < 0) {
|
||||
dbg("error on opening %s: %s\n", filename, strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
if (write(fd, "add", 3) < 0)
|
||||
info("error on triggering %s: %s\n", filename, strerror(errno));
|
||||
|
||||
close(fd);
|
||||
}
|
||||
|
||||
static int sysfs_resolve_link(char *devpath, size_t size)
|
||||
{
|
||||
char link_path[PATH_SIZE];
|
||||
char link_target[PATH_SIZE];
|
||||
int len;
|
||||
int i;
|
||||
int back;
|
||||
|
||||
strlcpy(link_path, "/sys", sizeof(link_path));
|
||||
strlcat(link_path, devpath, sizeof(link_path));
|
||||
len = readlink(link_path, link_target, sizeof(link_target));
|
||||
if (len <= 0)
|
||||
return -1;
|
||||
link_target[len] = '\0';
|
||||
dbg("path link '%s' points to '%s'", devpath, link_target);
|
||||
|
||||
for (back = 0; strncmp(&link_target[back * 3], "../", 3) == 0; back++)
|
||||
;
|
||||
dbg("base '%s', tail '%s', back %i", devpath, &link_target[back * 3], back);
|
||||
for (i = 0; i <= back; i++) {
|
||||
char *pos = strrchr(devpath, '/');
|
||||
|
||||
if (pos == NULL)
|
||||
return -1;
|
||||
pos[0] = '\0';
|
||||
}
|
||||
dbg("after moving back '%s'", devpath);
|
||||
strlcat(devpath, "/", size);
|
||||
strlcat(devpath, &link_target[back * 3], size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int device_list_insert(const char *path)
|
||||
{
|
||||
char filename[PATH_SIZE];
|
||||
char devpath[PATH_SIZE];
|
||||
struct stat statbuf;
|
||||
|
||||
dbg("add '%s'" , path);
|
||||
|
||||
/* we only have a device, if we have an uevent file */
|
||||
strlcpy(filename, path, sizeof(filename));
|
||||
strlcat(filename, "/uevent", sizeof(filename));
|
||||
if (stat(filename, &statbuf) < 0)
|
||||
return -1;
|
||||
if (!(statbuf.st_mode & S_IWUSR))
|
||||
return -1;
|
||||
|
||||
strlcpy(devpath, &path[4], sizeof(devpath));
|
||||
|
||||
/* resolve possible link to real target */
|
||||
if (lstat(path, &statbuf) < 0)
|
||||
return -1;
|
||||
if (S_ISLNK(statbuf.st_mode))
|
||||
if (sysfs_resolve_link(devpath, sizeof(devpath)) != 0)
|
||||
return -1;
|
||||
|
||||
trigger_uevent(devpath);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void scan_subsystem(const char *subsys)
|
||||
{
|
||||
char base[PATH_SIZE];
|
||||
DIR *dir;
|
||||
struct dirent *dent;
|
||||
|
||||
strlcpy(base, "/sys/", sizeof(base));
|
||||
strlcat(base, subsys, sizeof(base));
|
||||
|
||||
dir = opendir(base);
|
||||
if (dir != NULL) {
|
||||
for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
|
||||
char dirname[PATH_SIZE];
|
||||
DIR *dir2;
|
||||
struct dirent *dent2;
|
||||
|
||||
if (dent->d_name[0] == '.')
|
||||
continue;
|
||||
|
||||
strlcpy(dirname, base, sizeof(dirname));
|
||||
strlcat(dirname, "/", sizeof(dirname));
|
||||
strlcat(dirname, dent->d_name, sizeof(dirname));
|
||||
strlcat(dirname, "/devices", sizeof(dirname));
|
||||
|
||||
/* look for devices */
|
||||
dir2 = opendir(dirname);
|
||||
if (dir2 != NULL) {
|
||||
for (dent2 = readdir(dir2); dent2 != NULL; dent2 = readdir(dir2)) {
|
||||
char dirname2[PATH_SIZE];
|
||||
|
||||
if (dent2->d_name[0] == '.')
|
||||
continue;
|
||||
|
||||
strlcpy(dirname2, dirname, sizeof(dirname2));
|
||||
strlcat(dirname2, "/", sizeof(dirname2));
|
||||
strlcat(dirname2, dent2->d_name, sizeof(dirname2));
|
||||
device_list_insert(dirname2);
|
||||
}
|
||||
closedir(dir2);
|
||||
}
|
||||
}
|
||||
closedir(dir);
|
||||
}
|
||||
}
|
||||
|
||||
static void scan_block(void)
|
||||
{
|
||||
char base[PATH_SIZE];
|
||||
DIR *dir;
|
||||
struct dirent *dent;
|
||||
|
||||
strlcpy(base, "/sys/block", sizeof(base));
|
||||
|
||||
dir = opendir(base);
|
||||
if (dir != NULL) {
|
||||
for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
|
||||
char dirname[PATH_SIZE];
|
||||
DIR *dir2;
|
||||
struct dirent *dent2;
|
||||
|
||||
if (dent->d_name[0] == '.')
|
||||
continue;
|
||||
|
||||
strlcpy(dirname, base, sizeof(dirname));
|
||||
strlcat(dirname, "/", sizeof(dirname));
|
||||
strlcat(dirname, dent->d_name, sizeof(dirname));
|
||||
if (device_list_insert(dirname) != 0)
|
||||
continue;
|
||||
|
||||
/* look for partitions */
|
||||
dir2 = opendir(dirname);
|
||||
if (dir2 != NULL) {
|
||||
for (dent2 = readdir(dir2); dent2 != NULL; dent2 = readdir(dir2)) {
|
||||
char dirname2[PATH_SIZE];
|
||||
|
||||
if (dent2->d_name[0] == '.')
|
||||
continue;
|
||||
|
||||
if (!strcmp(dent2->d_name,"device"))
|
||||
continue;
|
||||
|
||||
strlcpy(dirname2, dirname, sizeof(dirname2));
|
||||
strlcat(dirname2, "/", sizeof(dirname2));
|
||||
strlcat(dirname2, dent2->d_name, sizeof(dirname2));
|
||||
device_list_insert(dirname2);
|
||||
}
|
||||
closedir(dir2);
|
||||
}
|
||||
}
|
||||
closedir(dir);
|
||||
}
|
||||
}
|
||||
|
||||
static void scan_class(void)
|
||||
{
|
||||
char base[PATH_SIZE];
|
||||
DIR *dir;
|
||||
struct dirent *dent;
|
||||
|
||||
strlcpy(base, "/sys/class", sizeof(base));
|
||||
|
||||
dir = opendir(base);
|
||||
if (dir != NULL) {
|
||||
for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
|
||||
char dirname[PATH_SIZE];
|
||||
DIR *dir2;
|
||||
struct dirent *dent2;
|
||||
|
||||
if (dent->d_name[0] == '.')
|
||||
continue;
|
||||
|
||||
strlcpy(dirname, base, sizeof(dirname));
|
||||
strlcat(dirname, "/", sizeof(dirname));
|
||||
strlcat(dirname, dent->d_name, sizeof(dirname));
|
||||
dir2 = opendir(dirname);
|
||||
if (dir2 != NULL) {
|
||||
for (dent2 = readdir(dir2); dent2 != NULL; dent2 = readdir(dir2)) {
|
||||
char dirname2[PATH_SIZE];
|
||||
|
||||
if (dent2->d_name[0] == '.')
|
||||
continue;
|
||||
|
||||
if (!strcmp(dent2->d_name, "device"))
|
||||
continue;
|
||||
|
||||
strlcpy(dirname2, dirname, sizeof(dirname2));
|
||||
strlcat(dirname2, "/", sizeof(dirname2));
|
||||
strlcat(dirname2, dent2->d_name, sizeof(dirname2));
|
||||
device_list_insert(dirname2);
|
||||
}
|
||||
closedir(dir2);
|
||||
}
|
||||
}
|
||||
closedir(dir);
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[], char *envp[])
|
||||
{
|
||||
char base[PATH_SIZE];
|
||||
struct stat statbuf;
|
||||
int failed = 0;
|
||||
int option;
|
||||
|
||||
openlog("udevtrigger", LOG_PID | LOG_CONS, LOG_DAEMON);
|
||||
|
||||
while (1) {
|
||||
option = getopt(argc, argv, "vnh");
|
||||
if (option == -1)
|
||||
break;
|
||||
|
||||
switch (option) {
|
||||
case 'v':
|
||||
verbose = 1;
|
||||
break;
|
||||
case 'n':
|
||||
dry_run = 1;
|
||||
break;
|
||||
case 'h':
|
||||
printf("Usage: udevtrigger OPTIONS\n"
|
||||
" -v print the list of devices while running\n"
|
||||
" -n do not actually trigger the events\n"
|
||||
" -h print this text\n"
|
||||
"\n");
|
||||
goto exit;
|
||||
default:
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* if we have /sys/subsystem, forget all the old stuff */
|
||||
scan_subsystem("bus");
|
||||
scan_class();
|
||||
|
||||
/* scan "block" if it isn't a "class" */
|
||||
strlcpy(base, "/sys/class/block", sizeof(base));
|
||||
if (stat(base, &statbuf) != 0)
|
||||
scan_block();
|
||||
|
||||
exit:
|
||||
|
||||
closelog();
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2009-2012 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libffi
|
||||
PKG_VERSION:=3.0.11
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=ftp://sourceware.org/pub/libffi/
|
||||
PKG_MD5SUM:=f69b9693227d976835b4857b1ba7d0e3
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_INSTALL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
|
||||
define Package/libffi
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=Foreign Function Interface (FFI) library
|
||||
URL:=http://sourceware.org/libffi/
|
||||
endef
|
||||
|
||||
define Package/libffi/description
|
||||
The libffi library provides a portable, high level programming interface to
|
||||
various calling conventions. This allows a programmer to call any function
|
||||
specified by a call interface description at run-time.
|
||||
|
||||
FFI stands for Foreign Function Interface. A foreign function interface is the
|
||||
popular name for the interface that allows code written in one language to call
|
||||
code written in another language. The libffi library really only provides the
|
||||
lowest, machine dependent layer of a fully featured foreign function interface.
|
||||
A layer must exist above libffi that handles type conversions for values passed
|
||||
between the two languages.
|
||||
endef
|
||||
|
||||
CONFIGURE_PATH = build
|
||||
CONFIGURE_CMD = ../configure
|
||||
MAKE_PATH = build
|
||||
|
||||
define Build/Configure
|
||||
mkdir -p $(PKG_BUILD_DIR)/build
|
||||
$(Build/Configure/Default)
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/libffi.{so*,a,la} \
|
||||
$(1)/usr/lib/
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
|
||||
$(1)/usr/lib/pkgconfig/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/libffi-$(PKG_VERSION)/include/*.h \
|
||||
$(1)/usr/include/
|
||||
endef
|
||||
|
||||
define Package/libffi/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/libffi.so.* \
|
||||
$(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call HostBuild))
|
||||
$(eval $(call BuildPackage,libffi))
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2006 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libipfix
|
||||
PKG_VERSION:=r51
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
|
||||
PKG_MD5SUM:=0e5b2871ea20ac48eda3f6006c5dba28
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME).$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/libipfix
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=IP Flow Information Export Library
|
||||
URL:=http://www.fokus.fraunhofer.de/de/net/more_about/download/ipfixlib.html
|
||||
BUILDONLY:=1
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-ffunction-sections -fdata-sections
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
CCOPT="$(TARGET_CFLAGS) -I$(BUILD_DIR)/linux/include" \
|
||||
prefix="$(PKG_INSTALL_DIR)/usr" \
|
||||
exec_prefix="$(PKG_INSTALL_DIR)/usr" \
|
||||
all install
|
||||
$(TARGET_CROSS)ranlib $(PKG_INSTALL_DIR)/usr/lib/libipfix.a
|
||||
$(TARGET_CROSS)ranlib $(PKG_INSTALL_DIR)/usr/lib/libipfixmisc.a
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)
|
||||
$(CP) $(PKG_INSTALL_DIR)/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libipfix))
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
use strict;
|
||||
|
||||
my @fields = (
|
||||
[ "_n", "UINT", " - Number of samples", 4 ],
|
||||
[ "_s", "UINT", " - Sum of samples", 8 ],
|
||||
[ "_ss", "UINT", " - Sum of squared samples", 8 ],
|
||||
);
|
||||
|
||||
my $file = $ARGV[0] or die "Syntax: $0 <file> <start>\n";
|
||||
-f $file or die "File not found\n";
|
||||
my $start = $ARGV[1];
|
||||
$start =~ /^\d+$/ or die "Invalid start number";
|
||||
open FILE, "<$file" or die "Can't open file";
|
||||
while (<FILE>) {
|
||||
/^(%?)(\w+),\s*(\w+),\s*(.+)$/ and do {
|
||||
my $counter = $1;
|
||||
my $rfield = $2;
|
||||
my $nfield = $3;
|
||||
my $descr = $4;
|
||||
my @f;
|
||||
if ($counter) {
|
||||
@f = [ "", "UINT", "", 4];
|
||||
} else {
|
||||
@f = @fields;
|
||||
}
|
||||
foreach my $f (@f) {
|
||||
my $nr = $start++;
|
||||
my $n = $f->[0];
|
||||
my $N = uc $n;
|
||||
my $ftype = $f->[1];
|
||||
my $fdesc = $f->[2];
|
||||
my $size = $f->[3];
|
||||
print "$nr, IPFIX_FT_WPROBE_$rfield$N, $size, IPFIX_CODING_$ftype, \"$nfield$n\", \"$descr$fdesc\"\n";
|
||||
}
|
||||
};
|
||||
}
|
||||
close FILE;
|
||||
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
NOISE, global_noise, wprobe global noice floor
|
||||
PHY_BUSY, global_phy_busy, wprobe global airtime total
|
||||
PHY_RX, global_phy_rx, wprobe global airtime total from rx-frame
|
||||
PHY_TX, global_phy_tx, wprobe global airtime total from tx-frame
|
||||
RSSI, link_rssi, wprobe link received signal strength indication
|
||||
SIGNAL, link_signal, wprobe link signal strength in dB
|
||||
IEEE_RX_RATE, link_ieee_rx_rate, wprobe link IEEE 802.11 RX data rate
|
||||
IEEE_TX_RATE, link_ieee_tx_rate, wprobe link IEEE 802.11 TX data rate
|
||||
RETRANSMIT_200, link_retransmit_200, wprobe link total retransmissions per packet - <200 bytes
|
||||
RETRANSMIT_400, link_retransmit_400, wprobe link total retransmissions per packet - <400 bytes
|
||||
RETRANSMIT_800, link_retransmit_800, wprobe link total retransmissions per packet - <800 bytes
|
||||
RETRANSMIT_1600, link_retransmit_1600, wprobe link total retransmissions per packet - >800 bytes
|
||||
%FRAMES, global_frames, wprobe global number of 802.11 frames seen
|
||||
%PROBEREQ, global_probereq, wprobe global number of 802.11 probe requests seen
|
||||
|
|
@ -1,474 +0,0 @@
|
|||
--- a/lib/ipfix.c
|
||||
+++ b/lib/ipfix.c
|
||||
@@ -37,6 +37,9 @@ $$LIC$$
|
||||
#ifdef SCTPSUPPORT
|
||||
#include <netinet/sctp.h>
|
||||
#endif
|
||||
+#ifndef NOTHREADS
|
||||
+#include <pthread.h>
|
||||
+#endif
|
||||
#include <fcntl.h>
|
||||
#include <netdb.h>
|
||||
|
||||
@@ -123,6 +126,18 @@ static uint16_t g_lasttid;
|
||||
static ipfix_datarecord_t g_data = { NULL, NULL, 0 }; /* ipfix_export */
|
||||
|
||||
static ipfix_field_t *g_ipfix_fields;
|
||||
+#ifndef NOTHREADS
|
||||
+static pthread_mutex_t g_mutex;
|
||||
+#define mod_lock() { \
|
||||
+ if ( pthread_mutex_lock( &g_mutex ) !=0 ) \
|
||||
+ mlogf( 0, "[ipfix] mutex_lock() failed: %s\n", \
|
||||
+ strerror( errno ) ); \
|
||||
+ }
|
||||
+#define mod_unlock() { pthread_mutex_unlock( &g_mutex ); }
|
||||
+#else
|
||||
+#define mod_lock()
|
||||
+#define mod_unlock()
|
||||
+#endif
|
||||
|
||||
/*----- prototypes -------------------------------------------------------*/
|
||||
|
||||
@@ -133,6 +148,7 @@ int _ipfix_send_message( ipfix_t *ifh,
|
||||
ipfix_message_t *message );
|
||||
int _ipfix_write_msghdr( ipfix_t *ifh, ipfix_message_t *msg, iobuf_t *buf );
|
||||
void _ipfix_disconnect( ipfix_collector_t *col );
|
||||
+int _ipfix_export_flush( ipfix_t *ifh );
|
||||
|
||||
|
||||
/* name : do_writeselect
|
||||
@@ -576,16 +592,18 @@ int ipfix_decode_float( void *in, void *
|
||||
|
||||
int ipfix_snprint_float( char *str, size_t size, void *data, size_t len )
|
||||
{
|
||||
- float tmp32;
|
||||
- double tmp64;
|
||||
+ uint32_t tmp32;
|
||||
+ uint64_t tmp64;
|
||||
|
||||
switch ( len ) {
|
||||
case 4:
|
||||
- ipfix_decode_float( data, &tmp32, 4);
|
||||
- return snprintf( str, size, "%f", tmp32 );
|
||||
+ memcpy( &tmp32, data, len );
|
||||
+ tmp32 = htonl( tmp32 );
|
||||
+ return snprintf( str, size, "%f", (float)tmp32 );
|
||||
case 8:
|
||||
- ipfix_decode_float( data, &tmp64, 8);
|
||||
- return snprintf( str, size, "%lf", tmp64);
|
||||
+ memcpy( &tmp64, data, len );
|
||||
+ tmp64 = HTONLL( tmp64 );
|
||||
+ return snprintf( str, size, "%lf", (double)tmp64 );
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -682,12 +700,19 @@ int ipfix_get_eno_ieid( char *field, int
|
||||
* parameters:
|
||||
* remarks: init module, read field type info.
|
||||
*/
|
||||
-int ipfix_init ( void )
|
||||
+int ipfix_init( void )
|
||||
{
|
||||
if ( g_tstart ) {
|
||||
ipfix_cleanup();
|
||||
}
|
||||
|
||||
+#ifndef NOTHREADS
|
||||
+ if ( pthread_mutex_init( &g_mutex, NULL ) !=0 ) {
|
||||
+ mlogf( 0, "[ipfix] pthread_mutex_init() failed: %s\n",
|
||||
+ strerror(errno) );
|
||||
+ return -1;
|
||||
+ }
|
||||
+#endif
|
||||
g_tstart = time(NULL);
|
||||
signal( SIGPIPE, SIG_IGN );
|
||||
g_lasttid = 255;
|
||||
@@ -806,6 +831,9 @@ void ipfix_cleanup ( void )
|
||||
g_data.maxfields = 0;
|
||||
g_data.lens = NULL;
|
||||
g_data.addrs = NULL;
|
||||
+#ifndef NOTHREADS
|
||||
+ (void)pthread_mutex_destroy( &g_mutex );
|
||||
+#endif
|
||||
}
|
||||
|
||||
int _ipfix_connect ( ipfix_collector_t *col )
|
||||
@@ -1465,7 +1493,7 @@ int _ipfix_write_template( ipfix_t
|
||||
default:
|
||||
/* check space */
|
||||
if ( tsize+ifh->offset > IPFIX_DEFAULT_BUFLEN ) {
|
||||
- if ( ipfix_export_flush( ifh ) < 0 )
|
||||
+ if ( _ipfix_export_flush( ifh ) < 0 )
|
||||
return -1;
|
||||
if ( tsize+ifh->offset > IPFIX_DEFAULT_BUFLEN )
|
||||
return -1;
|
||||
@@ -1474,6 +1502,8 @@ int _ipfix_write_template( ipfix_t
|
||||
/* write template prior to data */
|
||||
if ( ifh->offset > 0 ) {
|
||||
memmove( ifh->buffer + tsize, ifh->buffer, ifh->offset );
|
||||
+ if ( ifh->cs_tid )
|
||||
+ ifh->cs_header += tsize;
|
||||
}
|
||||
|
||||
buf = ifh->buffer;
|
||||
@@ -1615,8 +1645,11 @@ int ipfix_open( ipfix_t **ipfixh, int so
|
||||
return -1;
|
||||
}
|
||||
node->ifh = i;
|
||||
+
|
||||
+ mod_lock();
|
||||
node->next = g_ipfixlist;
|
||||
g_ipfixlist = node;
|
||||
+ mod_unlock();
|
||||
|
||||
*ipfixh = i;
|
||||
return 0;
|
||||
@@ -1633,7 +1666,8 @@ void ipfix_close( ipfix_t *h )
|
||||
{
|
||||
ipfix_node_t *l, *n;
|
||||
|
||||
- ipfix_export_flush( h );
|
||||
+ mod_lock();
|
||||
+ _ipfix_export_flush( h );
|
||||
|
||||
while( h->collectors )
|
||||
_ipfix_drop_collector( (ipfix_collector_t**)&h->collectors );
|
||||
@@ -1659,6 +1693,7 @@ void ipfix_close( ipfix_t *h )
|
||||
#endif
|
||||
free(h->buffer);
|
||||
free(h);
|
||||
+ mod_unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2156,6 +2191,22 @@ void ipfix_release_template( ipfix_t *if
|
||||
ipfix_delete_template( ifh, templ );
|
||||
}
|
||||
|
||||
+static void _finish_cs( ipfix_t *ifh )
|
||||
+{
|
||||
+ size_t buflen;
|
||||
+ uint8_t *buf;
|
||||
+
|
||||
+ /* finish current dataset */
|
||||
+ if ( (buf=ifh->cs_header) ==NULL )
|
||||
+ return;
|
||||
+ buflen = 0;
|
||||
+ INSERTU16( buf+buflen, buflen, ifh->cs_tid );
|
||||
+ INSERTU16( buf+buflen, buflen, ifh->cs_bytes );
|
||||
+ ifh->cs_bytes = 0;
|
||||
+ ifh->cs_header = NULL;
|
||||
+ ifh->cs_tid = 0;
|
||||
+}
|
||||
+
|
||||
int ipfix_export( ipfix_t *ifh, ipfix_template_t *templ, ... )
|
||||
{
|
||||
int i;
|
||||
@@ -2199,13 +2250,14 @@ int ipfix_export( ipfix_t *ifh, ipfix_te
|
||||
g_data.addrs, g_data.lens );
|
||||
}
|
||||
|
||||
-int ipfix_export_array( ipfix_t *ifh,
|
||||
- ipfix_template_t *templ,
|
||||
- int nfields,
|
||||
- void **fields,
|
||||
- uint16_t *lengths )
|
||||
+static int
|
||||
+_ipfix_export_array( ipfix_t *ifh,
|
||||
+ ipfix_template_t *templ,
|
||||
+ int nfields,
|
||||
+ void **fields,
|
||||
+ uint16_t *lengths )
|
||||
{
|
||||
- int i;
|
||||
+ int i, newset_f=0;
|
||||
size_t buflen, datasetlen;
|
||||
uint8_t *p, *buf;
|
||||
|
||||
@@ -2249,7 +2301,19 @@ int ipfix_export_array( ipfix_t
|
||||
|
||||
/** get size of data set, check space
|
||||
*/
|
||||
- for ( i=0, datasetlen=4; i<nfields; i++ ) {
|
||||
+ if ( templ->tid == ifh->cs_tid ) {
|
||||
+ newset_f = 0;
|
||||
+ datasetlen = 0;
|
||||
+ }
|
||||
+ else {
|
||||
+ if ( ifh->cs_tid > 0 ) {
|
||||
+ _finish_cs( ifh );
|
||||
+ }
|
||||
+ newset_f = 1;
|
||||
+ datasetlen = 4;
|
||||
+ }
|
||||
+
|
||||
+ for ( i=0; i<nfields; i++ ) {
|
||||
if ( templ->fields[i].flength == IPFIX_FT_VARLEN ) {
|
||||
if ( lengths[i]>254 )
|
||||
datasetlen += 3;
|
||||
@@ -2263,21 +2327,29 @@ int ipfix_export_array( ipfix_t
|
||||
}
|
||||
datasetlen += lengths[i];
|
||||
}
|
||||
- if ( ((ifh->offset + datasetlen) > IPFIX_DEFAULT_BUFLEN )
|
||||
- && (ipfix_export_flush( ifh ) <0) ) {
|
||||
- return -1;
|
||||
+
|
||||
+ if ( (ifh->offset + datasetlen) > IPFIX_DEFAULT_BUFLEN ) {
|
||||
+ if ( ifh->cs_tid )
|
||||
+ _finish_cs( ifh );
|
||||
+ newset_f = 1;
|
||||
+
|
||||
+ if ( _ipfix_export_flush( ifh ) <0 )
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
- /* fill buffer
|
||||
- */
|
||||
+ /* fill buffer */
|
||||
buf = (uint8_t*)(ifh->buffer) + ifh->offset;
|
||||
buflen = 0;
|
||||
|
||||
- /* insert data set
|
||||
- */
|
||||
- ifh->nrecords ++;
|
||||
- INSERTU16( buf+buflen, buflen, templ->tid );
|
||||
- INSERTU16( buf+buflen, buflen, datasetlen );
|
||||
+ if ( newset_f ) {
|
||||
+ /* insert data set
|
||||
+ */
|
||||
+ ifh->cs_bytes = 0;
|
||||
+ ifh->cs_header = buf;
|
||||
+ ifh->cs_tid = templ->tid;
|
||||
+ INSERTU16( buf+buflen, buflen, templ->tid );
|
||||
+ INSERTU16( buf+buflen, buflen, 4 );
|
||||
+ }
|
||||
|
||||
/* insert data record
|
||||
*/
|
||||
@@ -2303,7 +2375,9 @@ int ipfix_export_array( ipfix_t
|
||||
buflen += lengths[i];
|
||||
}
|
||||
|
||||
+ ifh->nrecords ++;
|
||||
ifh->offset += buflen;
|
||||
+ ifh->cs_bytes += buflen;
|
||||
if ( ifh->version == IPFIX_VERSION )
|
||||
ifh->seqno ++;
|
||||
return 0;
|
||||
@@ -2313,7 +2387,7 @@ int ipfix_export_array( ipfix_t
|
||||
* parameters:
|
||||
* remarks: rewrite this func!
|
||||
*/
|
||||
-int ipfix_export_flush( ipfix_t *ifh )
|
||||
+int _ipfix_export_flush( ipfix_t *ifh )
|
||||
{
|
||||
iobuf_t *buf;
|
||||
ipfix_collector_t *col;
|
||||
@@ -2322,8 +2396,14 @@ int ipfix_export_flush( ipfix_t *ifh )
|
||||
if ( (ifh==NULL) || (ifh->offset==0) )
|
||||
return 0;
|
||||
|
||||
- if ( (buf=_ipfix_getbuf()) ==NULL )
|
||||
+ if ( ifh->cs_tid > 0 ) {
|
||||
+ /* finish current dataset */
|
||||
+ _finish_cs( ifh );
|
||||
+ }
|
||||
+
|
||||
+ if ( (buf=_ipfix_getbuf()) ==NULL ) {
|
||||
return -1;
|
||||
+ }
|
||||
|
||||
#ifdef DEBUG
|
||||
mlogf( 0, "[ipfix_export_flush] msg has %d records, %d bytes\n",
|
||||
@@ -2350,3 +2430,30 @@ int ipfix_export_flush( ipfix_t *ifh )
|
||||
_ipfix_freebuf( buf );
|
||||
return ret;
|
||||
}
|
||||
+
|
||||
+int ipfix_export_array( ipfix_t *ifh,
|
||||
+ ipfix_template_t *templ,
|
||||
+ int nfields,
|
||||
+ void **fields,
|
||||
+ uint16_t *lengths )
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ mod_lock();
|
||||
+ ret = _ipfix_export_array( ifh, templ, nfields, fields, lengths );
|
||||
+ mod_unlock();
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+int ipfix_export_flush( ipfix_t *ifh )
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ mod_lock();
|
||||
+ ret = _ipfix_export_flush( ifh );
|
||||
+ mod_unlock();
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
--- a/lib/ipfix.h
|
||||
+++ b/lib/ipfix.h
|
||||
@@ -142,6 +142,12 @@ typedef struct
|
||||
int nrecords; /* no. of records in buffer */
|
||||
size_t offset; /* output buffer fill level */
|
||||
uint32_t seqno; /* sequence no. of next message */
|
||||
+
|
||||
+ /* experimental */
|
||||
+ int cs_tid; /* template id of current dataset */
|
||||
+ int cs_bytes; /* size of current set */
|
||||
+ uint8_t *cs_header; /* start of current set */
|
||||
+
|
||||
} ipfix_t;
|
||||
|
||||
/** exporter funcs
|
||||
--- a/lib/ipfix_col.c
|
||||
+++ b/lib/ipfix_col.c
|
||||
@@ -897,6 +897,8 @@ int ipfix_decode_datarecord( ipfixt_node
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ n->ipfixt->fields[i].elem->decode(p,p,len);
|
||||
+
|
||||
data->lens[i] = len;
|
||||
data->addrs[i] = p;
|
||||
|
||||
@@ -907,7 +909,7 @@ int ipfix_decode_datarecord( ipfixt_node
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static void do_free_datarecord( ipfix_datarecord_t *data )
|
||||
+void ipfix_free_datarecord( ipfix_datarecord_t *data )
|
||||
{
|
||||
if ( data ) {
|
||||
if ( data->addrs )
|
||||
@@ -925,6 +927,7 @@ int ipfix_parse_msg( ipfix_input_t *inpu
|
||||
ipfix_hdr_t hdr; /* ipfix packet header */
|
||||
ipfixs_node_t *s;
|
||||
ipfix_datarecord_t data = { NULL, NULL, 0 };
|
||||
+ ipfixe_node_t *e;
|
||||
uint8_t *buf; /* ipfix payload */
|
||||
uint16_t setid, setlen; /* set id, set lenght */
|
||||
int i, nread, offset; /* counter */
|
||||
@@ -1042,6 +1045,12 @@ int ipfix_parse_msg( ipfix_input_t *inpu
|
||||
err_flag = 1;
|
||||
}
|
||||
else {
|
||||
+ for ( e=g_exporter; e!=NULL; e=e->next ) {
|
||||
+ if ( e->elem->export_dset )
|
||||
+ (void) e->elem->export_dset( t, buf+nread, setlen,
|
||||
+ e->elem->data );
|
||||
+ }
|
||||
+
|
||||
/** read data records
|
||||
*/
|
||||
for ( offset=nread, bytesleft=setlen; bytesleft>4; ) {
|
||||
@@ -1076,11 +1085,11 @@ int ipfix_parse_msg( ipfix_input_t *inpu
|
||||
goto errend;
|
||||
|
||||
end:
|
||||
- do_free_datarecord( &data );
|
||||
+ ipfix_free_datarecord( &data );
|
||||
return nread;
|
||||
|
||||
errend:
|
||||
- do_free_datarecord( &data );
|
||||
+ ipfix_free_datarecord( &data );
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1093,7 +1102,7 @@ void process_client_tcp( int fd, int mas
|
||||
tcp_conn_t *tcon = (tcp_conn_t*)data;
|
||||
char *func = "process_client_tcp";
|
||||
|
||||
- mlogf( 3, "[%s] fd %d mask %d called.\n", func, fd, mask );
|
||||
+ mlogf( 4, "[%s] fd %d mask %d called.\n", func, fd, mask );
|
||||
|
||||
/** read ipfix header
|
||||
*/
|
||||
--- a/lib/ipfix_col.h
|
||||
+++ b/lib/ipfix_col.h
|
||||
@@ -88,6 +88,7 @@ typedef struct ipfix_col_info
|
||||
int (*export_newsource)(ipfixs_node_t*,void*);
|
||||
int (*export_newmsg)(ipfixs_node_t*,ipfix_hdr_t*,void*);
|
||||
int (*export_trecord)(ipfixs_node_t*,ipfixt_node_t*,void*);
|
||||
+ int (*export_dset)(ipfixt_node_t*,uint8_t*,size_t,void*);
|
||||
int (*export_drecord)(ipfixs_node_t*,ipfixt_node_t*,
|
||||
ipfix_datarecord_t*,void*);
|
||||
void (*export_cleanup)(void*);
|
||||
--- a/lib/ipfix_col_files.c
|
||||
+++ b/lib/ipfix_col_files.c
|
||||
@@ -68,7 +68,7 @@ static int export_newsource_file( ipfixs
|
||||
return -1;
|
||||
}
|
||||
snprintf( s->fname+strlen(s->fname), PATH_MAX-strlen(s->fname),
|
||||
- "/%u", s->odid );
|
||||
+ "/%u", (unsigned int)s->odid );
|
||||
if ( (access( s->fname, R_OK ) <0 )
|
||||
&& (mkdir( s->fname, S_IRWXU ) <0) ) {
|
||||
mlogf( 0, "[%s] cannot access dir '%s': %s\n",
|
||||
--- a/lib/ipfix_FOKUS_IEs.txt
|
||||
+++ b/lib/ipfix_FOKUS_IEs.txt
|
||||
@@ -24,6 +24,8 @@
|
||||
196, IPFIX_FT_PKTID, 4, IPFIX_CODING_UINT, "pktId", "FOKUS packet id"
|
||||
197, IPFIX_FT_STARTTIME, 4, IPFIX_CODING_INT, "startTime", "FOKUS interval start"
|
||||
198, IPFIX_FT_ENDTIME, 4, IPFIX_CODING_INT, "endTime", "FOKUS interval end"
|
||||
+199, IPFIX_FT_RTT_USEC, 8, IPFIX_CODING_UINT, "rtt_usec", "FOKUS rtt in us"
|
||||
+
|
||||
300, IPFIX_FT_FLOWCREATIONTIMEUSEC, 4, IPFIX_CODING_INT, "flowCreationTimeUsec", "FOKUS flow start usec fraction"
|
||||
301, IPFIX_FT_FLOWENDTIMEUSEC, 4, IPFIX_CODING_INT, "flowEndTimeUsec", "FOKUS flow end usec fraction"
|
||||
303, IPFIX_FT_TC_PACKETS, 4, IPFIX_CODING_UINT, "tcPackets", "DAIDALOS Packets seen"
|
||||
@@ -39,3 +41,48 @@
|
||||
313, IPFIX_FT_OWDVARMIN_NSEC, 4, IPFIX_CODING_INT, "owdvarmin_nsec", "FOKUS minimum owd variance in ns"
|
||||
314, IPFIX_FT_OWDVARMAX_NSEC, 4, IPFIX_CODING_INT, "owdvarmax_nsec", "FOKUS maximum ow variance in ns"
|
||||
|
||||
+# Project INTERSECTION
|
||||
+315, IPFIX_FT_SOURCEIPV4FANOUT, 4, IPFIX_CODING_UINT,"sourceIPv4FanOut", "FOKUS IPv4 fanout"
|
||||
+316, IPFIX_FT_DESTINATIONIPV4FANIN, 4, IPFIX_CODING_UINT,"destinationIPv4FanIn", "FOKUS IPv4 fanin"
|
||||
+
|
||||
+# Project PRISM
|
||||
+
|
||||
+330, IPFIX_FT_PR_SESSIONID, 4, IPFIX_CODING_UINT, "sessionId", "PRISM Session ID"
|
||||
+331, IPFIX_FT_PR_TRANSACTIONID, 4, IPFIX_CODING_UINT, "transactionId", "PRISM Transaction ID"
|
||||
+332, IPFIX_FT_PR_ENCRYPTEDDATA, 65535, IPFIX_CODING_STRING, "encryptedData", "PRISM encrypted data"
|
||||
+333, IPFIX_FT_PR_DECRYPTIONKEY, 65535, IPFIX_CODING_STRING, "decryptionKey", "PRISM decryption key"
|
||||
+334, IPFIX_FT_PR_KEYSHARE, 65535, IPFIX_CODING_STRING, "keyShare", "PRISM key share"
|
||||
+335, IPFIX_FT_PR_KEYSHAREADP, 65535, IPFIX_CODING_STRING, "keyShareAdp", "PRISM key share ADP"
|
||||
+336, IPFIX_FT_PR_INITVECTOR, 65535, IPFIX_CODING_STRING, "cryptoInitVector", "PRISM crypto init vector"
|
||||
+
|
||||
+
|
||||
+# these information elements have been defined by FOKUS for the Oracle project
|
||||
+
|
||||
+402, IPFIX_FT_ORsignalBandwidth, 4, IPFIX_CODING_UINT, "ORsignalBandwidth", "signal bandwidth"
|
||||
+403, IPFIX_FT_ORsignalPower, 2, IPFIX_CODING_UINT, "ORsignalPower", "ERIP"
|
||||
+404, IPFIX_FT_ORmodulationType, 2, IPFIX_CODING_UINT, "ORmodulationType", "AM/FM,.."
|
||||
+405, IPFIX_FT_ORsymbolRate, 2, IPFIX_CODING_UINT, "ORsymbolRate", "symbol rate"
|
||||
+406, IPFIX_FT_ORmodulationOrder, 1, IPFIX_CODING_UINT, "ORmodulationOrder", "number of levels"
|
||||
+407, IPFIX_FT_ORrolloffFactor, 2, IPFIX_CODING_UINT, "ORrolloffFactor", "roll of factor"
|
||||
+408, IPFIX_FT_ORgeopositionLon, 4, IPFIX_CODING_UINT, "ORgeopositionLon", "GPS coordinate, resolution 1 cm"
|
||||
+409, IPFIX_FT_ORgeopositionLat, 4, IPFIX_CODING_UINT, "ORgeopositionLat", "GPS coordinate, resolution 1 cm"
|
||||
+410, IPFIX_FT_ORgeopositionElev, 4, IPFIX_CODING_UINT, "ORgeopositionElev", "GPS coordinate, resolution 1 cm"
|
||||
+411, IPFIX_FT_ORpolicyRecord, 65535, IPFIX_CODING_STRING, "ORpolicyRecord", "policy record has variable length, First 8 bits in data describe the length (in bytes) of the field"
|
||||
+420, IPFIX_FT_channel_status, 1, IPFIX_CODING_UINT, "channel_status", vacancy of the scanned channel (1: channel busy, 0: channel idle)"
|
||||
+421, IPFIX_FT_sensing_value, 2, IPFIX_CODING_UINT, "sensing_value", "Cost function output"
|
||||
+422, IPFIX_FT_sensing_threshold, 2, IPFIX_CODING_UINT, "sensing_threshold", "Decision threshold"
|
||||
+423, IPFIX_FT_OR_terminal_id, 1, IPFIX_CODING_UINT, "OR_terminal_id", "terminal identifier"
|
||||
+424, IPFIX_FT_OR_terminal_id_list, 65535, IPFIX_CODING_STRING, "OR_terminal_id_list", "terminal identifier list"
|
||||
+425, IPFIX_FT_Infrastructure_network_id, 1, IPFIX_CODING_UINT, "Infrastructure_network_id", "network identifier"
|
||||
+426, IPFIX_FT_Infrastructure_network_type, 1, IPFIX_CODING_UINT, "Infrastructure_network_type", "network type (GSM - 1, UMTS - 2, WiMAX - 3, WiFi - 4)"
|
||||
+427, IPFIX_FT_Battery_lifetime_min, 1, IPFIX_CODING_UINT, "Battery_lifetime_min", "expected battery lifetime to provide requested services or functionalities, in minutes"
|
||||
+428, IPFIX_FT_Battery_lifetime_h, 1, IPFIX_CODING_UINT, "Battery_lifetime_h", "expected battery lifetime to provide requested services or functionalities, in hours"
|
||||
+429, IPFIX_FT_Battery_status, 1, IPFIX_CODING_UINT, "Battery_status", "expected battery lifetime to provide requested services or functionalities, 1 bit status flag, values 1 or 0"
|
||||
+430, IPFIX_FT_Cell_id_number, 4, IPFIX_CODING_UINT, "Cell_id_number", "16-32 bit cell id number, identifier"
|
||||
+431, IPFIX_FT_Spectral_allocation_vector, 1, IPFIX_CODING_UINT, "Spectral_allocation_vector", "binary vector to indicate whether a band is free 1 bit 0 or not 1 bit 1"
|
||||
+432, IPFIX_FT_Spectral_allocation_profile, 2, IPFIX_CODING_UINT, "Spectral_allocation_profile", "received power spectral density vs. frequency to indicate spectral activity in the band of interest (8-16 bits per discrete frequency value)"
|
||||
+433, IPFIX_FT_Center_frequency, 2, IPFIX_CODING_UINT, "Center_frequency", "Center frequency of the sensed band"
|
||||
+434, IPFIX_FT_Bandwidth_of_CAP, 2, IPFIX_CODING_UINT, "Bandwidth_of_CAP", "Bandwidth of the spectral allocation profile"
|
||||
+435, IPFIX_FT_ORmodulation, 1, IPFIX_CODING_UINT, "ORmodulation", "CREST factor"
|
||||
+436, IPFIX_FT_ORprofileRecord, 65535, IPFIX_CODING_STRING, "ORprofileRecord", "profile record has variable length, First 8 bits in data describe the length (in bytes) of the field"
|
||||
+
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
--- a/lib/ipfix_FOKUS_IEs.txt
|
||||
+++ b/lib/ipfix_FOKUS_IEs.txt
|
||||
@@ -86,3 +86,41 @@
|
||||
435, IPFIX_FT_ORmodulation, 1, IPFIX_CODING_UINT, "ORmodulation", "CREST factor"
|
||||
436, IPFIX_FT_ORprofileRecord, 65535, IPFIX_CODING_STRING, "ORprofileRecord", "profile record has variable length, First 8 bits in data describe the length (in bytes) of the field"
|
||||
|
||||
+500, IPFIX_FT_WPROBE_NOISE_N, 4, IPFIX_CODING_UINT, "global_noise_n", "wprobe global noice floor - Number of samples"
|
||||
+501, IPFIX_FT_WPROBE_NOISE_S, 8, IPFIX_CODING_UINT, "global_noise_s", "wprobe global noice floor - Sum of samples"
|
||||
+502, IPFIX_FT_WPROBE_NOISE_SS, 8, IPFIX_CODING_UINT, "global_noise_ss", "wprobe global noice floor - Sum of squared samples"
|
||||
+503, IPFIX_FT_WPROBE_PHY_BUSY_N, 4, IPFIX_CODING_UINT, "global_phy_busy_n", "wprobe global airtime total - Number of samples"
|
||||
+504, IPFIX_FT_WPROBE_PHY_BUSY_S, 8, IPFIX_CODING_UINT, "global_phy_busy_s", "wprobe global airtime total - Sum of samples"
|
||||
+505, IPFIX_FT_WPROBE_PHY_BUSY_SS, 8, IPFIX_CODING_UINT, "global_phy_busy_ss", "wprobe global airtime total - Sum of squared samples"
|
||||
+506, IPFIX_FT_WPROBE_PHY_RX_N, 4, IPFIX_CODING_UINT, "global_phy_rx_n", "wprobe global airtime total from rx-frame - Number of samples"
|
||||
+507, IPFIX_FT_WPROBE_PHY_RX_S, 8, IPFIX_CODING_UINT, "global_phy_rx_s", "wprobe global airtime total from rx-frame - Sum of samples"
|
||||
+508, IPFIX_FT_WPROBE_PHY_RX_SS, 8, IPFIX_CODING_UINT, "global_phy_rx_ss", "wprobe global airtime total from rx-frame - Sum of squared samples"
|
||||
+509, IPFIX_FT_WPROBE_PHY_TX_N, 4, IPFIX_CODING_UINT, "global_phy_tx_n", "wprobe global airtime total from tx-frame - Number of samples"
|
||||
+510, IPFIX_FT_WPROBE_PHY_TX_S, 8, IPFIX_CODING_UINT, "global_phy_tx_s", "wprobe global airtime total from tx-frame - Sum of samples"
|
||||
+511, IPFIX_FT_WPROBE_PHY_TX_SS, 8, IPFIX_CODING_UINT, "global_phy_tx_ss", "wprobe global airtime total from tx-frame - Sum of squared samples"
|
||||
+512, IPFIX_FT_WPROBE_RSSI_N, 4, IPFIX_CODING_UINT, "link_rssi_n", "wprobe link received signal strength indication - Number of samples"
|
||||
+513, IPFIX_FT_WPROBE_RSSI_S, 8, IPFIX_CODING_UINT, "link_rssi_s", "wprobe link received signal strength indication - Sum of samples"
|
||||
+514, IPFIX_FT_WPROBE_RSSI_SS, 8, IPFIX_CODING_UINT, "link_rssi_ss", "wprobe link received signal strength indication - Sum of squared samples"
|
||||
+515, IPFIX_FT_WPROBE_SIGNAL_N, 4, IPFIX_CODING_UINT, "link_signal_n", "wprobe link signal strength in dB - Number of samples"
|
||||
+516, IPFIX_FT_WPROBE_SIGNAL_S, 8, IPFIX_CODING_UINT, "link_signal_s", "wprobe link signal strength in dB - Sum of samples"
|
||||
+517, IPFIX_FT_WPROBE_SIGNAL_SS, 8, IPFIX_CODING_UINT, "link_signal_ss", "wprobe link signal strength in dB - Sum of squared samples"
|
||||
+518, IPFIX_FT_WPROBE_IEEE_RX_RATE_N, 4, IPFIX_CODING_UINT, "link_ieee_rx_rate_n", "wprobe link IEEE 802.11 RX data rate - Number of samples"
|
||||
+519, IPFIX_FT_WPROBE_IEEE_RX_RATE_S, 8, IPFIX_CODING_UINT, "link_ieee_rx_rate_s", "wprobe link IEEE 802.11 RX data rate - Sum of samples"
|
||||
+520, IPFIX_FT_WPROBE_IEEE_RX_RATE_SS, 8, IPFIX_CODING_UINT, "link_ieee_rx_rate_ss", "wprobe link IEEE 802.11 RX data rate - Sum of squared samples"
|
||||
+521, IPFIX_FT_WPROBE_IEEE_TX_RATE_N, 4, IPFIX_CODING_UINT, "link_ieee_tx_rate_n", "wprobe link IEEE 802.11 TX data rate - Number of samples"
|
||||
+522, IPFIX_FT_WPROBE_IEEE_TX_RATE_S, 8, IPFIX_CODING_UINT, "link_ieee_tx_rate_s", "wprobe link IEEE 802.11 TX data rate - Sum of samples"
|
||||
+523, IPFIX_FT_WPROBE_IEEE_TX_RATE_SS, 8, IPFIX_CODING_UINT, "link_ieee_tx_rate_ss", "wprobe link IEEE 802.11 TX data rate - Sum of squared samples"
|
||||
+524, IPFIX_FT_WPROBE_RETRANSMIT_200_N, 4, IPFIX_CODING_UINT, "link_retransmit_200_n", "wprobe link total retransmissions per packet - <200 bytes - Number of samples"
|
||||
+525, IPFIX_FT_WPROBE_RETRANSMIT_200_S, 8, IPFIX_CODING_UINT, "link_retransmit_200_s", "wprobe link total retransmissions per packet - <200 bytes - Sum of samples"
|
||||
+526, IPFIX_FT_WPROBE_RETRANSMIT_200_SS, 8, IPFIX_CODING_UINT, "link_retransmit_200_ss", "wprobe link total retransmissions per packet - <200 bytes - Sum of squared samples"
|
||||
+527, IPFIX_FT_WPROBE_RETRANSMIT_400_N, 4, IPFIX_CODING_UINT, "link_retransmit_400_n", "wprobe link total retransmissions per packet - <400 bytes - Number of samples"
|
||||
+528, IPFIX_FT_WPROBE_RETRANSMIT_400_S, 8, IPFIX_CODING_UINT, "link_retransmit_400_s", "wprobe link total retransmissions per packet - <400 bytes - Sum of samples"
|
||||
+529, IPFIX_FT_WPROBE_RETRANSMIT_400_SS, 8, IPFIX_CODING_UINT, "link_retransmit_400_ss", "wprobe link total retransmissions per packet - <400 bytes - Sum of squared samples"
|
||||
+530, IPFIX_FT_WPROBE_RETRANSMIT_800_N, 4, IPFIX_CODING_UINT, "link_retransmit_800_n", "wprobe link total retransmissions per packet - <800 bytes - Number of samples"
|
||||
+531, IPFIX_FT_WPROBE_RETRANSMIT_800_S, 8, IPFIX_CODING_UINT, "link_retransmit_800_s", "wprobe link total retransmissions per packet - <800 bytes - Sum of samples"
|
||||
+532, IPFIX_FT_WPROBE_RETRANSMIT_800_SS, 8, IPFIX_CODING_UINT, "link_retransmit_800_ss", "wprobe link total retransmissions per packet - <800 bytes - Sum of squared samples"
|
||||
+533, IPFIX_FT_WPROBE_RETRANSMIT_1600_N, 4, IPFIX_CODING_UINT, "link_retransmit_1600_n", "wprobe link total retransmissions per packet - >800 bytes - Number of samples"
|
||||
+534, IPFIX_FT_WPROBE_RETRANSMIT_1600_S, 8, IPFIX_CODING_UINT, "link_retransmit_1600_s", "wprobe link total retransmissions per packet - >800 bytes - Sum of samples"
|
||||
+535, IPFIX_FT_WPROBE_RETRANSMIT_1600_SS, 8, IPFIX_CODING_UINT, "link_retransmit_1600_ss", "wprobe link total retransmissions per packet - >800 bytes - Sum of squared samples"
|
||||
+536, IPFIX_FT_WPROBE_FRAMES, 4, IPFIX_CODING_UINT, "global_frames", "wprobe global number of 802.11 frames seen"
|
||||
+537, IPFIX_FT_WPROBE_PROBEREQ, 4, IPFIX_CODING_UINT, "global_probereq", "wprobe global number of 802.11 probe requests seen"
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
Index: libipfix.r51/lib/Makefile.in
|
||||
===================================================================
|
||||
--- libipfix.r51.orig/lib/Makefile.in 2008-08-05 15:15:23.000000000 +0200
|
||||
+++ libipfix.r51/lib/Makefile.in 2012-06-05 19:26:34.061692890 +0200
|
||||
@@ -41,7 +41,7 @@
|
||||
INCLS = -I. -I..
|
||||
CFLAGS = $(CCOPT) $(INCLS) $(DEFS)
|
||||
|
||||
-TARGETS = libmisc.a libipfix.a
|
||||
+TARGETS = libipfixmisc.a libipfix.a
|
||||
OBJS = ipfix.o ipfix_col.o ipfix_print.o \
|
||||
ipfix_col_files.o ipfix_col_db.o @IPFIX_DB_OBJ@ @IPFIX_SSL_OBJ@
|
||||
DEPHDR = ipfix.h ipfix_def.h ipfix_fields.h ipfix_def_fokus.h ipfix_fields_fokus.h
|
||||
@@ -60,11 +60,11 @@
|
||||
install:
|
||||
@[ -d ${libdir} ] || (mkdir -p ${libdir}; chmod 755 ${libdir})
|
||||
$(INSTALL_DATA) libipfix.a ${libdir}/
|
||||
- $(INSTALL_DATA) libmisc.a ${libdir}/
|
||||
+ $(INSTALL_DATA) libipfixmisc.a ${libdir}/
|
||||
@[ -d ${includedir} ] || (mkdir -p ${includedir}; chmod 755 ${includedir})
|
||||
$(INSTALL_HEADER) ipfix*.h mlog.h mpoll.h ${includedir}/
|
||||
|
||||
-libmisc.a: $(MISCOBJS) Makefile
|
||||
+libipfixmisc.a: $(MISCOBJS) Makefile
|
||||
@rm -f $@
|
||||
$(AR) rc $@ $(MISCOBJS)
|
||||
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2012 Aleksander Morgado <aleksander@lanedo.com>
|
||||
# Copyright (C) 2013 Rusink <rzrusink@qmail.com>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libmbim
|
||||
PKG_VERSION:=1.8.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=libmbim-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://cgit.freedesktop.org/libmbim/libmbim/snapshot/
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
define Package/libmbim
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
DEPENDS:=+glib2 +zlib
|
||||
TITLE:=libmbim
|
||||
URL:=http://www.lanedo.com/~aleksander
|
||||
endef
|
||||
|
||||
define Package/libmbim/description
|
||||
Helper library and utils to talk to MBIM enabled modems
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
$(SH) $(PKG_BUILD_DIR)/autogen.sh
|
||||
$(Build/Configure/Default)
|
||||
endef
|
||||
|
||||
CONFIGURE_VARS+= CFLAGS="$$$$CFLAGS -DMESSAGE_ENABLE_TRACE"
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/include/libmbim-glib \
|
||||
$(1)/usr/include/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} \
|
||||
$(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libmbim/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/*.so* \
|
||||
$(1)/usr/lib/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
|
||||
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libmbim))
|
||||
|
|
@ -1,144 +0,0 @@
|
|||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -68,9 +68,9 @@ dnl General dependencies for libmbim-glib
|
||||
PKG_CHECK_MODULES(LIBMBIM_GLIB,
|
||||
glib-2.0 >= 2.32
|
||||
gobject-2.0
|
||||
- gio-2.0
|
||||
- gudev-1.0 >= 147)
|
||||
+ gio-2.0)
|
||||
AC_SUBST(LIBMBIM_GLIB_CFLAGS)
|
||||
+LIBMBIM_GLIB_LIBS="-Wl,-rpath-link=$STAGING_DIR/usr/lib/libiconv-full/lib $LIBMBIM_GLIB_LIBS"
|
||||
AC_SUBST(LIBMBIM_GLIB_LIBS)
|
||||
|
||||
dnl General dependencies for mbimcli
|
||||
@@ -79,6 +79,7 @@ PKG_CHECK_MODULES(MBIMCLI,
|
||||
gobject-2.0
|
||||
gio-2.0)
|
||||
AC_SUBST(MBIMCLI_CFLAGS)
|
||||
+MBIMCLI_LIBS="-Wl,-rpath-link=$STAGING_DIR/usr/lib/libiconv-full/lib $MBIMCLI_LIBS"
|
||||
AC_SUBST(MBIMCLI_LIBS)
|
||||
|
||||
GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
|
||||
|
||||
--- a/src/libmbim-glib/mbim-device.c
|
||||
+++ b/src/libmbim-glib/mbim-device.c
|
||||
@@ -28,7 +28,6 @@
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
#include <gio/gio.h>
|
||||
-#include <gudev/gudev.h>
|
||||
#include <sys/ioctl.h>
|
||||
#define IOCTL_WDM_MAX_COMMAND _IOR('H', 0xA0, guint16)
|
||||
|
||||
@@ -666,110 +665,7 @@ struct usb_cdc_mbim_desc {
|
||||
static guint16
|
||||
read_max_control_transfer (MbimDevice *self)
|
||||
{
|
||||
- static const guint8 mbim_signature[4] = { 0x0c, 0x24, 0x1b, 0x00 };
|
||||
guint16 max = MAX_CONTROL_TRANSFER;
|
||||
- GUdevClient *client;
|
||||
- GUdevDevice *device = NULL;
|
||||
- GUdevDevice *parent_device = NULL;
|
||||
- GUdevDevice *grandparent_device = NULL;
|
||||
- gchar *descriptors_path = NULL;
|
||||
- gchar *device_basename = NULL;
|
||||
- GError *error = NULL;
|
||||
- gchar *contents = NULL;
|
||||
- gsize length = 0;
|
||||
- guint i;
|
||||
-
|
||||
- client = g_udev_client_new (NULL);
|
||||
- if (!G_UDEV_IS_CLIENT (client)) {
|
||||
- g_warning ("[%s] Couldn't get udev client",
|
||||
- self->priv->path_display);
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
- /* We need to get the sysfs of the cdc-wdm's grandfather:
|
||||
- *
|
||||
- * * Device's sysfs path is like:
|
||||
- * /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5/2-1.5:2.0/usbmisc/cdc-wdm0
|
||||
- * * Parent's sysfs path is like:
|
||||
- * /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5/2-1.5:2.0
|
||||
- * * Grandparent's sysfs path is like:
|
||||
- * /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5
|
||||
- *
|
||||
- * Which is the one with the descriptors file.
|
||||
- */
|
||||
-
|
||||
- device_basename = g_path_get_basename (self->priv->path);
|
||||
- device = g_udev_client_query_by_subsystem_and_name (client, "usb", device_basename);
|
||||
- if (!device) {
|
||||
- device = g_udev_client_query_by_subsystem_and_name (client, "usbmisc", device_basename);
|
||||
- if (!device) {
|
||||
- g_warning ("[%s] Couldn't find udev device",
|
||||
- self->priv->path_display);
|
||||
- goto out;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- parent_device = g_udev_device_get_parent (device);
|
||||
- if (!parent_device) {
|
||||
- g_warning ("[%s] Couldn't find parent udev device",
|
||||
- self->priv->path_display);
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
- grandparent_device = g_udev_device_get_parent (parent_device);
|
||||
- if (!grandparent_device) {
|
||||
- g_warning ("[%s] Couldn't find grandparent udev device",
|
||||
- self->priv->path_display);
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
- descriptors_path = g_build_path (G_DIR_SEPARATOR_S,
|
||||
- g_udev_device_get_sysfs_path (grandparent_device),
|
||||
- "descriptors",
|
||||
- NULL);
|
||||
- if (!g_file_get_contents (descriptors_path,
|
||||
- &contents,
|
||||
- &length,
|
||||
- &error)) {
|
||||
- g_warning ("[%s] Couldn't read descriptors file: %s",
|
||||
- self->priv->path_display,
|
||||
- error->message);
|
||||
- g_error_free (error);
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
- i = 0;
|
||||
- while (i <= (length - sizeof (struct usb_cdc_mbim_desc))) {
|
||||
- /* Try to match the MBIM descriptor signature */
|
||||
- if ((memcmp (&contents[i], mbim_signature, sizeof (mbim_signature)) == 0)) {
|
||||
- /* Found! */
|
||||
- max = GUINT16_FROM_LE (((struct usb_cdc_mbim_desc *)&contents[i])->wMaxControlMessage);
|
||||
- g_debug ("[%s] Read max control message size from descriptors file: %" G_GUINT16_FORMAT,
|
||||
- self->priv->path_display,
|
||||
- max);
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
- /* The first byte of the descriptor info is the length; so keep on
|
||||
- * skipping descriptors until we match the MBIM one */
|
||||
- i += contents[i];
|
||||
- }
|
||||
-
|
||||
- g_warning ("[%s] Couldn't find MBIM signature in descriptors file",
|
||||
- self->priv->path_display);
|
||||
-
|
||||
-out:
|
||||
- g_free (contents);
|
||||
- g_free (device_basename);
|
||||
- g_free (descriptors_path);
|
||||
- if (parent_device)
|
||||
- g_object_unref (parent_device);
|
||||
- if (grandparent_device)
|
||||
- g_object_unref (grandparent_device);
|
||||
- if (device)
|
||||
- g_object_unref (device);
|
||||
- if (client)
|
||||
- g_object_unref (client);
|
||||
|
||||
return max;
|
||||
}
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2012 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libmicroxml
|
||||
PKG_VERSION:=2012-06-11
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=git://dev.freecwmp.org/microxml
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=72965423184f24cc0b963d91c2d1863cdb01b6aa
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_MD5SUM:=20b9f69978968f557375102771448375
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/libmicroxml
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=XML library
|
||||
endef
|
||||
|
||||
define Package/libmicroxml/description
|
||||
A micro sized XML library
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--disable-threads \
|
||||
--enable-static \
|
||||
--enable-shared
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) $(PKG_BUILD_DIR)/microxml.h $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libmicroxml.so* $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
||||
$(CP) $(PKG_BUILD_DIR)/microxml.pc $(1)/usr/lib/pkgconfig
|
||||
endef
|
||||
|
||||
define Package/libmicroxml/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libmicroxml.so* $(1)/usr/lib
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libmicroxml))
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
From f7f79d9447d4ee00feb4954aa3bd6dd01a498c92 Mon Sep 17 00:00:00 2001
|
||||
From: Mohamed Kallel <mohamed.kallel@pivasoftware.com>
|
||||
Date: Fri, 11 Oct 2013 16:35:48 +0100
|
||||
Subject: [PATCH] build witout rpath
|
||||
|
||||
---
|
||||
configure.in | 2 +-
|
||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/configure.in b/configure.in
|
||||
index 18b9d96..4063afb 100644
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -199,7 +199,7 @@ if test x$enable_shared != xno; then
|
||||
AC_MSG_RESULT(yes)
|
||||
LIBMICROXML_SHARED="libmicroxml.so.1.0"
|
||||
DSO="\$(CC)"
|
||||
- DSOFLAGS="$DSOFLAGS -Wl,-soname,libmicroxml.so.1,-rpath,\$(libdir) -shared \$(OPTIM)"
|
||||
+ DSOFLAGS="$DSOFLAGS -Wl,-soname,libmicroxml.so.1 -shared \$(OPTIM)"
|
||||
LDFLAGS="$LDFLAGS -Wl,-rpath,\$(libdir)"
|
||||
;;
|
||||
|
||||
--
|
||||
1.7.4.1
|
||||
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
--- a/mxml-file.c
|
||||
+++ b/mxml-file.c
|
||||
@@ -2782,7 +2782,7 @@ mxml_write_node(mxml_node_t *node, /* I - Node to write */
|
||||
|
||||
if (attr->value)
|
||||
width += strlen(attr->value) + 3;
|
||||
-
|
||||
+#if 0
|
||||
if (global->wrap > 0 && (col + width) > global->wrap)
|
||||
{
|
||||
if ((*putc_cb)('\n', p) < 0)
|
||||
@@ -2792,11 +2792,14 @@ mxml_write_node(mxml_node_t *node, /* I - Node to write */
|
||||
}
|
||||
else
|
||||
{
|
||||
+#endif
|
||||
if ((*putc_cb)(' ', p) < 0)
|
||||
return (-1);
|
||||
|
||||
col ++;
|
||||
+#if 0
|
||||
}
|
||||
+#endif
|
||||
|
||||
if (mxml_write_name(attr->name, p, putc_cb) < 0)
|
||||
return (-1);
|
||||
108
libpcre/Makefile
108
libpcre/Makefile
|
|
@ -1,108 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2006-2015 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=pcre
|
||||
PKG_VERSION:=8.37
|
||||
PKG_RELEASE:=2
|
||||
|
||||
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/vmg/libpcre.git
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
|
||||
PKG_SOURCE_VERSION:=9006e252208e23f13701316b21d8051d64af9674
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENCE
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/libpcre/default
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
URL:=http://www.pcre.org/
|
||||
endef
|
||||
|
||||
define Package/libpcre
|
||||
$(call Package/libpcre/default)
|
||||
TITLE:=A Perl Compatible Regular Expression library
|
||||
endef
|
||||
|
||||
define Package/libpcre16
|
||||
$(call Package/libpcre/default)
|
||||
TITLE:=A Perl Compatible Regular Expression library (16bit support)
|
||||
endef
|
||||
|
||||
define Package/libpcrecpp
|
||||
$(call Package/libpcre/default)
|
||||
TITLE:=C++ wrapper for Perl Compatible Regular Expression library
|
||||
DEPENDS:=+libpcre +libstdcpp
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += $(FPIC)
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-utf8 \
|
||||
--enable-unicode-properties \
|
||||
--enable-pcre16 \
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_libpcrecpp),)
|
||||
CONFIGURE_ARGS+= --enable-cpp
|
||||
else
|
||||
CONFIGURE_ARGS+= --disable-cpp
|
||||
endif
|
||||
|
||||
MAKE_FLAGS += \
|
||||
CFLAGS="$(TARGET_CFLAGS)"
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pcre-config $(1)/usr/bin/
|
||||
|
||||
$(INSTALL_DIR) $(2)/bin
|
||||
$(LN) $(STAGING_DIR)/usr/bin/pcre-config $(2)/bin
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/pcre*.h $(1)/usr/include/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre*.{a,so*} $(1)/usr/lib/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpcre*.pc $(1)/usr/lib/pkgconfig/
|
||||
endef
|
||||
|
||||
define Package/libpcre/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre{,posix}.so.* $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libpcre16/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre16.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libpcrecpp/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcrecpp.so.* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libpcre))
|
||||
$(eval $(call BuildPackage,libpcre16))
|
||||
$(eval $(call BuildPackage,libpcrecpp))
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libqmi
|
||||
PKG_VERSION:=1.10.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=libqmi-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://cgit.freedesktop.org/libqmi/snapshot/
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
define Package/libqmi
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
DEPENDS:=+glib2 +zlib
|
||||
TITLE:=Helper library and utils to talk to QMI enabled modems
|
||||
endef
|
||||
|
||||
define Package/libqmi/description
|
||||
Helper library and utils to talk to QMI enabled modems
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
$(SH) $(PKG_BUILD_DIR)/autogen.sh
|
||||
$(Build/Configure/Default)
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/include/libqmi-glib \
|
||||
$(1)/usr/include/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} \
|
||||
$(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libqmi/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/*.so* \
|
||||
$(1)/usr/lib/
|
||||
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/qmi-proxy \
|
||||
$(1)/usr/lib/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libqmi))
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -71,6 +71,7 @@ PKG_CHECK_MODULES(GLIB,
|
||||
gio-2.0
|
||||
gio-unix-2.0)
|
||||
AC_SUBST(GLIB_CFLAGS)
|
||||
+GLIB_LIBS="-Wl,-rpath-link=$STAGING_DIR/usr/lib/libiconv-full/lib $GLIB_LIBS"
|
||||
AC_SUBST(GLIB_LIBS)
|
||||
|
||||
GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2013 Inteno
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libucix
|
||||
PKG_VERSION:=0.0.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
target=$(firstword $(subst -, ,$(BOARD)))
|
||||
|
||||
-Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
|
||||
-Wl,-rpath-link=$(STAGING_DIR)/lib -luci
|
||||
|
||||
TARGET_LDFLAGS += -shared -luci -Wl,-soname
|
||||
TARGET_CFLAGS += $(FPIC) -Dtarget_$(target)=1 -Wall
|
||||
MAKE_FLAGS += TARGET="$(target)"
|
||||
|
||||
define Package/libucix
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=UCI library
|
||||
DEPENDS:=+libuci
|
||||
endef
|
||||
|
||||
define Package/libucix/description
|
||||
UCI helper library
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
define Package/libucix/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/
|
||||
( cd $(PKG_BUILD_DIR) ; rm -f libucix.so && ln -s libucix.so.$(PKG_VERSION) libucix.so )
|
||||
$(CP) $(PKG_BUILD_DIR)/libucix.so* $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/libucix.so* $(STAGING_DIR)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/*.h $(STAGING_DIR)/usr/include/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libucix))
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# Makefile for libucix
|
||||
|
||||
OBJS = libucix.o
|
||||
SRCS = libucix.c
|
||||
|
||||
all: libucix
|
||||
|
||||
libucix: ${OBJS}
|
||||
${CC} ${LDFLAGS} -o libucix.so.${PKG_VERSION} ${OBJS} ${LIBDIR} ${LIBS}
|
||||
|
||||
clean:
|
||||
rm -f libucix.so.* libucix.a ${OBJS}
|
||||
|
||||
depend:
|
||||
${MAKEDEPEND} ${INCL} ${SRCS} ${LIBSRCS}
|
||||
|
|
@ -1,172 +0,0 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Copyright (C) 2008 John Crispin <blogic@openwrt.org>
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <uci_config.h>
|
||||
#include <uci.h>
|
||||
#include "ucix.h"
|
||||
|
||||
static struct uci_ptr ptr;
|
||||
|
||||
static inline int ucix_get_ptr(struct uci_context *ctx, const char *p, const char *s, const char *o, const char *t)
|
||||
{
|
||||
memset(&ptr, 0, sizeof(ptr));
|
||||
ptr.package = p;
|
||||
ptr.section = s;
|
||||
ptr.option = o;
|
||||
ptr.value = t;
|
||||
return uci_lookup_ptr(ctx, &ptr, NULL, true);
|
||||
}
|
||||
|
||||
struct uci_context* ucix_init(const char *config_file)
|
||||
{
|
||||
struct uci_context *ctx = uci_alloc_context();
|
||||
uci_add_delta_path(ctx, "/var/state");
|
||||
if(uci_load(ctx, config_file, NULL) != UCI_OK)
|
||||
{
|
||||
printf("%s/%s is missing or corrupt\n", ctx->savedir, config_file);
|
||||
return NULL;
|
||||
}
|
||||
return ctx;
|
||||
}
|
||||
|
||||
struct uci_context* ucix_init_path(const char *path, const char *config_file)
|
||||
{
|
||||
struct uci_context *ctx = uci_alloc_context();
|
||||
if(path)
|
||||
uci_set_confdir(ctx, path);
|
||||
if(uci_load(ctx, config_file, NULL) != UCI_OK)
|
||||
{
|
||||
printf("%s/%s is missing or corrupt\n", ctx->savedir, config_file);
|
||||
return NULL;
|
||||
}
|
||||
return ctx;
|
||||
}
|
||||
|
||||
void ucix_cleanup(struct uci_context *ctx)
|
||||
{
|
||||
uci_free_context(ctx);
|
||||
}
|
||||
|
||||
void ucix_save(struct uci_context *ctx)
|
||||
{
|
||||
uci_set_savedir(ctx, "/tmp/.uci/");
|
||||
uci_save(ctx, NULL);
|
||||
}
|
||||
|
||||
void ucix_save_state(struct uci_context *ctx)
|
||||
{
|
||||
uci_set_savedir(ctx, "/var/state/");
|
||||
uci_save(ctx, NULL);
|
||||
}
|
||||
|
||||
const char* ucix_get_option(struct uci_context *ctx, const char *p, const char *s, const char *o)
|
||||
{
|
||||
struct uci_element *e = NULL;
|
||||
const char *value = NULL;
|
||||
if(ucix_get_ptr(ctx, p, s, o, NULL))
|
||||
return NULL;
|
||||
if (!(ptr.flags & UCI_LOOKUP_COMPLETE))
|
||||
return NULL;
|
||||
e = ptr.last;
|
||||
switch (e->type)
|
||||
{
|
||||
case UCI_TYPE_SECTION:
|
||||
value = uci_to_section(e)->type;
|
||||
break;
|
||||
case UCI_TYPE_OPTION:
|
||||
switch(ptr.o->type) {
|
||||
case UCI_TYPE_STRING:
|
||||
value = ptr.o->v.string;
|
||||
break;
|
||||
default:
|
||||
value = NULL;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
int ucix_get_option_int(struct uci_context *ctx, const char *p, const char *s, const char *o, int def)
|
||||
{
|
||||
const char *tmp = ucix_get_option(ctx, p, s, o);
|
||||
int ret = def;
|
||||
|
||||
if (tmp)
|
||||
ret = atoi(tmp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void ucix_add_section(struct uci_context *ctx, const char *p, const char *s, const char *t)
|
||||
{
|
||||
if(ucix_get_ptr(ctx, p, s, NULL, t))
|
||||
return;
|
||||
uci_set(ctx, &ptr);
|
||||
}
|
||||
|
||||
void ucix_add_option(struct uci_context *ctx, const char *p, const char *s, const char *o, const char *t)
|
||||
{
|
||||
if(ucix_get_ptr(ctx, p, s, o, (t)?(t):("")))
|
||||
return;
|
||||
uci_set(ctx, &ptr);
|
||||
}
|
||||
|
||||
void ucix_add_option_int(struct uci_context *ctx, const char *p, const char *s, const char *o, int t)
|
||||
{
|
||||
char tmp[64];
|
||||
snprintf(tmp, 64, "%d", t);
|
||||
ucix_add_option(ctx, p, s, o, tmp);
|
||||
}
|
||||
|
||||
void ucix_del(struct uci_context *ctx, const char *p, const char *s, const char *o)
|
||||
{
|
||||
if(!ucix_get_ptr(ctx, p, s, o, NULL))
|
||||
uci_delete(ctx, &ptr);
|
||||
}
|
||||
|
||||
void ucix_revert(struct uci_context *ctx, const char *p, const char *s, const char *o)
|
||||
{
|
||||
if(!ucix_get_ptr(ctx, p, s, o, NULL))
|
||||
uci_revert(ctx, &ptr);
|
||||
}
|
||||
|
||||
void ucix_for_each_section_type(struct uci_context *ctx,
|
||||
const char *p, const char *t,
|
||||
void (*cb)(const char*, void*), void *priv)
|
||||
{
|
||||
struct uci_element *e;
|
||||
if(ucix_get_ptr(ctx, p, NULL, NULL, NULL))
|
||||
return;
|
||||
uci_foreach_element(&ptr.p->sections, e)
|
||||
if (!strcmp(t, uci_to_section(e)->type))
|
||||
cb(e->name, priv);
|
||||
}
|
||||
|
||||
int ucix_commit(struct uci_context *ctx, const char *p)
|
||||
{
|
||||
if(ucix_get_ptr(ctx, p, NULL, NULL, NULL))
|
||||
return 1;
|
||||
return uci_commit(ctx, &ptr.p, false);
|
||||
}
|
||||
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Copyright (C) 2008 John Crispin <blogic@openwrt.org>
|
||||
*/
|
||||
|
||||
#ifndef _UCI_H__
|
||||
#define _UCI_H__
|
||||
struct uci_context* ucix_init(const char *config_file);
|
||||
struct uci_context* ucix_init_path(const char *path, const char *config_file);
|
||||
void ucix_cleanup(struct uci_context *ctx);
|
||||
void ucix_save(struct uci_context *ctx);
|
||||
void ucix_save_state(struct uci_context *ctx);
|
||||
const char* ucix_get_option(struct uci_context *ctx,
|
||||
const char *p, const char *s, const char *o);
|
||||
int ucix_get_option_int(struct uci_context *ctx,
|
||||
const char *p, const char *s, const char *o, int def);
|
||||
void ucix_add_section(struct uci_context *ctx,
|
||||
const char *p, const char *s, const char *t);
|
||||
void ucix_add_option(struct uci_context *ctx,
|
||||
const char *p, const char *s, const char *o, const char *t);
|
||||
void ucix_add_option_int(struct uci_context *ctx,
|
||||
const char *p, const char *s, const char *o, int t);
|
||||
int ucix_commit(struct uci_context *ctx, const char *p);
|
||||
void ucix_revert(struct uci_context *ctx,
|
||||
const char *p, const char *s, const char *o);
|
||||
void ucix_del(struct uci_context *ctx, const char *p,
|
||||
const char *s, const char *o);
|
||||
#endif
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2010-2014 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=minidlna
|
||||
PKG_VERSION:=1.1.4
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=@SF/minidlna
|
||||
PKG_MD5SUM:=67c9e91285bc3801fd91a5d26ea775d7
|
||||
PKG_LICENSE:=GPL-2.0 BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=COPYING LICENCE.miniupnpd
|
||||
|
||||
PKG_MAINTAINER:=Knyazkov Dmitry <medavedik@gmail.com>
|
||||
|
||||
PKG_BUILD_PARALLEL:=0
|
||||
PKG_BUILD_DEPENDS:=util-linux
|
||||
PKG_FIXUP:=autoreconf
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
define Package/minidlna
|
||||
SECTION:=multimedia
|
||||
CATEGORY:=Multimedia
|
||||
TITLE:=UPnP A/V & DLNA Media Server
|
||||
URL:=http://minidlna.sourceforge.net/
|
||||
DEPENDS:= +libpthread +libexif +libjpeg +libsqlite3 +libffmpeg \
|
||||
+libid3tag +libflac +libvorbis +libuuid \
|
||||
$(ICONV_DEPENDS) $(INTL_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/minidlna/description
|
||||
MiniDLNA (aka ReadyDLNA) is server software with the aim of
|
||||
being fully compliant with DLNA/UPnP-AV clients.
|
||||
endef
|
||||
|
||||
define Package/minidlna/conffiles
|
||||
/etc/config/minidlna
|
||||
endef
|
||||
|
||||
TARGET_CPPFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/FLAC \
|
||||
-I$(STAGING_DIR)/usr/include/libexif \
|
||||
-I$(STAGING_DIR)/usr/include/uuid \
|
||||
-I$(STAGING_DIR)/usr/include/vorbis \
|
||||
-I$(ICONV_PREFIX)/include \
|
||||
-I$(INTL_PREFIX)/include \
|
||||
-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \
|
||||
|
||||
TARGET_LDFLAGS += \
|
||||
-L$(ICONV_PREFIX)/lib \
|
||||
-L$(INTL_PREFIX)/lib \
|
||||
-Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
|
||||
|
||||
MAKE_FLAGS +=\
|
||||
CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
ICONV_LIBS="-liconv $(if $(INTL_FULL),-lintl)" \
|
||||
|
||||
CONFIGURE_ARGS +=\
|
||||
--with-libiconv-prefix="$(ICONV_PREFIX)" \
|
||||
--with-libintl-prefix="$(INTL_PREFIX)" \
|
||||
--with-os-name="OpenWrt Linux" \
|
||||
--with-os-version="$(LINUX_VERSION)" \
|
||||
--with-os-url="http://openwrt.org/" \
|
||||
--with-db-path="/var/run/minidlna" \
|
||||
--with-log-path="/var/log" \
|
||||
|
||||
define Package/minidlna/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/minidlna $(1)/usr/bin/minidlna
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/minidlna.init $(1)/etc/init.d/minidlna
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) ./files/minidlna.config $(1)/etc/config/minidlna
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,minidlna))
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
config minidlna config
|
||||
option 'enabled' '1'
|
||||
option port '8200'
|
||||
option interface 'br-lan'
|
||||
option friendly_name 'Inteno DLNA Server'
|
||||
option db_dir '/var/run/minidlna'
|
||||
option log_dir '/var/log'
|
||||
option inotify '1'
|
||||
option enable_tivo '0'
|
||||
option strict_dlna '0'
|
||||
option presentation_url ''
|
||||
option notify_interval '900'
|
||||
option serial '12345678'
|
||||
option model_number '1'
|
||||
option root_container '.'
|
||||
list media_dir '/mnt'
|
||||
option album_art_names 'Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg'
|
||||
|
|
@ -1,112 +0,0 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2010 OpenWrt.org
|
||||
|
||||
START=50
|
||||
USE_PROCD=1
|
||||
|
||||
SERVICE_USE_PID=1
|
||||
|
||||
MINIDLNA_CONFIG_FILE="/tmp/minidlna.conf"
|
||||
|
||||
minidlna_cfg_append() {
|
||||
echo "$1" >> "$MINIDLNA_CONFIG_FILE"
|
||||
}
|
||||
|
||||
minidlna_cfg_addbool() {
|
||||
local cfg="$1"
|
||||
local key="$2"
|
||||
local def="$3"
|
||||
local val
|
||||
|
||||
config_get_bool val "$cfg" "$key" "$def"
|
||||
[ "$val" -gt 0 ] && val="yes" || val="no"
|
||||
minidlna_cfg_append "$key=$val"
|
||||
}
|
||||
|
||||
minidlna_cfg_addstr() {
|
||||
local cfg="$1"
|
||||
local key="$2"
|
||||
local def="$3"
|
||||
local val
|
||||
|
||||
config_get val "$cfg" "$key" "$def"
|
||||
[ -n "$val" ] && minidlna_cfg_append "$key=$val"
|
||||
}
|
||||
|
||||
minidlna_cfg_add_media_dir() {
|
||||
local val=$1
|
||||
|
||||
minidlna_cfg_append "media_dir=$val"
|
||||
}
|
||||
|
||||
minidlna_create_config() {
|
||||
local cfg=$1
|
||||
local port
|
||||
local interface
|
||||
local network
|
||||
|
||||
config_get port $cfg port
|
||||
#config_get interface $cfg interface
|
||||
config_get network $cfg network "lan"
|
||||
|
||||
[ -n "$network" ] && . /lib/functions/network.sh && network_get_device interface $network
|
||||
|
||||
[ -z "$interface" -o -t "$port" ] && return 1
|
||||
|
||||
echo "# this file is generated automatically, don't edit" > "$MINIDLNA_CONFIG_FILE"
|
||||
|
||||
minidlna_cfg_append "port=$port"
|
||||
minidlna_cfg_append "network_interface=$interface"
|
||||
|
||||
minidlna_cfg_addstr $cfg friendly_name
|
||||
minidlna_cfg_addstr $cfg db_dir
|
||||
minidlna_cfg_addstr $cfg log_dir
|
||||
minidlna_cfg_addbool $cfg inotify '1'
|
||||
minidlna_cfg_addbool $cfg enable_tivo '0'
|
||||
minidlna_cfg_addbool $cfg strict_dlna '0'
|
||||
minidlna_cfg_addstr $cfg album_art_names
|
||||
minidlna_cfg_addstr $cfg presentation_url
|
||||
minidlna_cfg_addstr $cfg notify_interval '900'
|
||||
minidlna_cfg_addstr $cfg serial '12345678'
|
||||
minidlna_cfg_addstr $cfg model_number '1'
|
||||
minidlna_cfg_addstr $cfg minissdpsocket
|
||||
minidlna_cfg_addstr $cfg root_container '.'
|
||||
config_list_foreach "$cfg" "media_dir" minidlna_cfg_add_media_dir
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local enabled
|
||||
local db_dir
|
||||
local log_dir
|
||||
|
||||
config_load 'minidlna'
|
||||
config_get_bool enabled config 'enabled' '0'
|
||||
|
||||
[ "$enabled" -gt 0 ] || return 1
|
||||
|
||||
minidlna_create_config config || return 1
|
||||
|
||||
config_get db_dir config 'db_dir' '/var/run/minidlna'
|
||||
config_get log_dir config 'log_dir' '/var/log'
|
||||
|
||||
mkdir -m 0755 -p $db_dir
|
||||
mkdir -m 0755 -p $log_dir
|
||||
service_start /usr/bin/minidlna -f "$MINIDLNA_CONFIG_FILE"
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
# service_stop /usr/bin/minidlna
|
||||
kill -9 `cat /var/run/minidlna/minidlna.pid`
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger minidlna
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
--- a/libav.h
|
||||
+++ b/libav.h
|
||||
@@ -167,7 +167,7 @@
|
||||
static inline int
|
||||
lav_is_thumbnail_stream(AVStream *s, uint8_t **data, int *size)
|
||||
{
|
||||
-#if LIBAVFORMAT_VERSION_INT >= ((54<<16)+(6<<8))
|
||||
+/*if LIBAVFORMAT_VERSION_INT >= ((54<<16)+(6<<8))
|
||||
if (s->disposition & AV_DISPOSITION_ATTACHED_PIC &&
|
||||
s->codec->codec_id == AV_CODEC_ID_MJPEG)
|
||||
{
|
||||
@@ -177,6 +177,6 @@
|
||||
*size = s->attached_pic.size;
|
||||
return 1;
|
||||
}
|
||||
-#endif
|
||||
+endif*/
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -19,9 +19,9 @@
|
||||
|
||||
SUBDIRS=po
|
||||
|
||||
-sbin_PROGRAMS = minidlnad
|
||||
+sbin_PROGRAMS = minidlna
|
||||
check_PROGRAMS = testupnpdescgen
|
||||
-minidlnad_SOURCES = minidlna.c upnphttp.c upnpdescgen.c upnpsoap.c \
|
||||
+minidlna_SOURCES = minidlna.c upnphttp.c upnpdescgen.c upnpsoap.c \
|
||||
upnpreplyparse.c minixml.c clients.c \
|
||||
getifaddr.c process.c upnpglobalvars.c \
|
||||
options.c minissdp.c uuid.c upnpevents.c \
|
||||
@@ -38,7 +38,7 @@
|
||||
flacoggflag = -logg
|
||||
#endif
|
||||
|
||||
-minidlnad_LDADD = \
|
||||
+minidlna_LDADD = \
|
||||
@LIBJPEG_LIBS@ \
|
||||
@LIBID3TAG_LIBS@ \
|
||||
@LIBSQLITE3_LIBS@ \
|
||||
@@ -49,7 +49,7 @@
|
||||
@LIBICONV@ \
|
||||
-lFLAC $(flacoggflag) $(vorbisflag)
|
||||
|
||||
-minidlnad_LDFLAGS = @STATIC_LDFLAGS@
|
||||
+minidlna_LDFLAGS = @STATIC_LDFLAGS@
|
||||
|
||||
testupnpdescgen_SOURCES = testupnpdescgen.c upnpdescgen.c
|
||||
testupnpdescgen_LDADD = \
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2010-2012 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=multiwan
|
||||
PKG_VERSION:=1.0.22
|
||||
PKG_RELEASE:=2
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/multiwan
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=+ip +iptables +kmod-ipt-conntrack +iptables-mod-conntrack-extra +iptables-mod-ipopt
|
||||
TITLE:=Simple multi WAN configuration
|
||||
URL:=ftp://ftp.netlab7.com/
|
||||
MAINTAINER:=Craig M. Coffee <craigc@netlab7.com>
|
||||
endef
|
||||
|
||||
define Package/multiwan/description
|
||||
An agent script that makes Multi-WAN configuration simple,
|
||||
easy and manageable. Complete with load balancing, failover and an easy
|
||||
to manage traffic ruleset.
|
||||
endef
|
||||
|
||||
define Package/multiwan/conffiles
|
||||
/etc/config/multiwan
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/multiwan/install
|
||||
$(CP) ./files/* $(1)
|
||||
endef
|
||||
|
||||
define Package/multiwan/postinst
|
||||
[ -n "$${IPKG_INSTROOT}" ] || /etc/init.d/multiwan enable
|
||||
exit 0
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,multiwan))
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
|
||||
config 'multiwan' 'config'
|
||||
# REMOVE THIS LINE OR PUT TO 1 TO ENABLE MULTIWAN
|
||||
option 'enabled' '0'
|
||||
|
||||
option 'default_route' 'balancer'
|
||||
# health_monitor below is defaulted to parallel, and can be set to
|
||||
# serial to save system resources.
|
||||
# option 'health_monitor' 'serial'
|
||||
# option 'debug' '1'
|
||||
|
||||
config 'interface' 'wan'
|
||||
option 'weight' '10'
|
||||
option 'health_interval' '10'
|
||||
option 'icmp_hosts' 'dns'
|
||||
# icmp_count is defaulted to 1, and can be increased to reduce
|
||||
# false positives.
|
||||
# option 'icmp_count' '3'
|
||||
option 'timeout' '3'
|
||||
option 'health_fail_retries' '3'
|
||||
option 'health_recovery_retries' '5'
|
||||
option 'failover_to' 'wan2'
|
||||
option 'dns' 'auto'
|
||||
|
||||
config 'interface' 'wan2'
|
||||
option 'weight' '10'
|
||||
option 'health_interval' '10'
|
||||
option 'icmp_hosts' 'gateway'
|
||||
option 'timeout' '3'
|
||||
option 'health_fail_retries' '3'
|
||||
option 'health_recovery_retries' '5'
|
||||
option 'failover_to' 'balancer'
|
||||
option 'dns' '208.67.222.222 208.67.220.220'
|
||||
|
||||
config 'mwanfw'
|
||||
option 'src' '192.168.1.0/24'
|
||||
option 'dst' 'ftp.netlab7.com'
|
||||
option 'proto' 'tcp'
|
||||
option 'ports' '21'
|
||||
option 'wanrule' 'wan2'
|
||||
|
||||
# VoIP traffic goes through wan
|
||||
# config 'mwanfw'
|
||||
# option 'src' '192.168.1.0/24'
|
||||
# option 'proto' 'udp'
|
||||
# option 'port_type' 'source-ports'
|
||||
# option 'ports' '5060,16384:16482'
|
||||
# option 'wanrule' 'wan'
|
||||
|
||||
config 'mwanfw'
|
||||
option 'src' '192.168.0.3'
|
||||
option 'proto' 'icmp'
|
||||
option 'wanrule' 'balancer'
|
||||
|
||||
config 'mwanfw'
|
||||
option 'dst' 'www.whatismyip.com'
|
||||
option 'wanrule' 'fastbalancer'
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
START=99
|
||||
EXTRA_COMMANDS="single"
|
||||
USE_PROCD=1
|
||||
|
||||
start_service () {
|
||||
/usr/bin/multiwan agent &
|
||||
}
|
||||
|
||||
stop_service () {
|
||||
sh /usr/bin/multiwan stop
|
||||
}
|
||||
|
||||
reload_service () {
|
||||
/usr/bin/multiwan restart &
|
||||
}
|
||||
|
||||
single () {
|
||||
/usr/bin/multiwan single &
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger multiwan
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,262 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2006-2014 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=net-snmp
|
||||
PKG_VERSION:=5.4.4
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=@SF/net-snmp
|
||||
PKG_MD5SUM:=95aa054f3c99a1ce242807d7eaf98619
|
||||
PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
|
||||
PKG_LICENSE:=MIT BSD-3-Clause-Clear
|
||||
|
||||
PKG_FIXUP = patch-libtool
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/net-snmp/Default
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
URL:=http://www.net-snmp.org/
|
||||
endef
|
||||
|
||||
define Package/net-snmp/Default/description
|
||||
Simple Network Management Protocol (SNMP) is a widely used protocol for
|
||||
monitoring the health and welfare of network equipment (eg. routers),
|
||||
computer equipment and even devices like UPSs. Net-SNMP is a suite of
|
||||
applications used to implement SNMP v1, SNMP v2c and SNMP v3 using both
|
||||
IPv4 and IPv6.
|
||||
endef
|
||||
|
||||
|
||||
define Package/libnetsnmp
|
||||
$(call Package/net-snmp/Default)
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=Open source SNMP implementation (libraries)
|
||||
endef
|
||||
|
||||
define Package/libnetsnmp/description
|
||||
$(call Package/net-snmp/Default/description)
|
||||
.
|
||||
This package contains shared libraries, needed by other programs.
|
||||
endef
|
||||
|
||||
|
||||
define Package/snmp-utils
|
||||
$(call Package/net-snmp/Default)
|
||||
DEPENDS:=+libnetsnmp
|
||||
TITLE:=Open source SNMP implementation (utilities)
|
||||
endef
|
||||
|
||||
define Package/snmp-utils/description
|
||||
$(call Package/net-snmp/Default/description)
|
||||
.
|
||||
This package contains SNMP client utilities.
|
||||
endef
|
||||
|
||||
|
||||
define Package/snmpd
|
||||
$(call Package/net-snmp/Default)
|
||||
DEPENDS:=+libnetsnmp
|
||||
TITLE:=Open source SNMP implementation (daemon)
|
||||
endef
|
||||
|
||||
define Package/snmpd/description
|
||||
$(call Package/net-snmp/Default/description)
|
||||
.
|
||||
This package contains the SNMP agent, dynamically linked.
|
||||
endef
|
||||
|
||||
|
||||
define Package/snmpd-static
|
||||
$(call Package/net-snmp/Default)
|
||||
TITLE:=Open source SNMP implementation (daemon)
|
||||
endef
|
||||
|
||||
define Package/snmpd-static/description
|
||||
$(call Package/net-snmp/Default/description)
|
||||
.
|
||||
This package contains the SNMP agent, statically linked.
|
||||
endef
|
||||
|
||||
|
||||
SNMP_MIB_MODULES_INCLUDED = \
|
||||
host/hr_device \
|
||||
host/hr_disk \
|
||||
host/hr_filesys \
|
||||
host/hr_network \
|
||||
host/hr_partition \
|
||||
host/hr_proc \
|
||||
host/hr_storage \
|
||||
host/hr_system \
|
||||
ieee802dot11 \
|
||||
if-mib/ifXTable \
|
||||
mibII/at \
|
||||
mibII/icmp \
|
||||
mibII/ifTable \
|
||||
mibII/ip \
|
||||
mibII/snmp_mib \
|
||||
mibII/sysORTable \
|
||||
mibII/system_mib \
|
||||
mibII/tcp \
|
||||
mibII/udp \
|
||||
mibII/vacm_context \
|
||||
mibII/vacm_vars \
|
||||
snmpv3/snmpEngine \
|
||||
snmpv3/snmpMPDStats \
|
||||
snmpv3/usmConf \
|
||||
snmpv3/usmStats \
|
||||
snmpv3/usmUser \
|
||||
tunnel \
|
||||
ucd-snmp/disk \
|
||||
ucd-snmp/dlmod \
|
||||
ucd-snmp/extensible \
|
||||
ucd-snmp/loadave \
|
||||
ucd-snmp/memory \
|
||||
ucd-snmp/pass \
|
||||
ucd-snmp/proc \
|
||||
ucd-snmp/vmstat \
|
||||
util_funcs \
|
||||
utilities/execute \
|
||||
|
||||
SNMP_MIB_MODULES_EXCLUDED = \
|
||||
agent_mibs \
|
||||
agentx \
|
||||
disman/event \
|
||||
disman/schedule \
|
||||
hardware \
|
||||
host \
|
||||
if-mib \
|
||||
mibII \
|
||||
notification \
|
||||
notification-log-mib \
|
||||
snmpv3mibs \
|
||||
target \
|
||||
tcp-mib \
|
||||
ucd_snmp \
|
||||
udp-mib \
|
||||
utilities \
|
||||
|
||||
SNMP_TRANSPORTS_INCLUDED = Callback UDP
|
||||
|
||||
SNMP_TRANSPORTS_EXCLUDED = TCP TCPIPv6 Unix
|
||||
|
||||
TARGET_CFLAGS += $(FPIC)
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-mfd-rewrites \
|
||||
--enable-shared \
|
||||
--enable-static \
|
||||
--with-endianness=$(if $(CONFIG_BIG_ENDIAN),big,little) \
|
||||
--with-logfile=/var/log/snmpd.log \
|
||||
--with-persistent-directory=/usr/lib/snmp/ \
|
||||
--with-default-snmp-version=1 \
|
||||
--with-sys-contact=root@localhost \
|
||||
--with-sys-location=Unknown \
|
||||
--enable-applications \
|
||||
--disable-debugging \
|
||||
--disable-manuals \
|
||||
--disable-mibs \
|
||||
--disable-scripts \
|
||||
--with-out-mib-modules="$(SNMP_MIB_MODULES_EXCLUDED)" \
|
||||
--with-mib-modules="$(SNMP_MIB_MODULES_INCLUDED)" \
|
||||
--with-out-transports="$(SNMP_TRANSPORTS_EXCLUDED)" \
|
||||
--with-transports="$(SNMP_TRANSPORTS_INCLUDED)" \
|
||||
--without-openssl \
|
||||
--without-libwrap \
|
||||
--without-rpm \
|
||||
--without-zlib \
|
||||
$(call autoconf_bool,CONFIG_IPV6,ipv6) \
|
||||
|
||||
ifeq ($(CONFIG_IPV6),y)
|
||||
SNMP_TRANSPORTS_INCLUDED+= UDPIPv6
|
||||
endif
|
||||
|
||||
TARGET_LDFLAGS += -L$(TOOLCHAIN_DIR)/usr/lib
|
||||
|
||||
ifdef CONFIG_PACKAGE_snmpd-static
|
||||
define Build/Compile/static
|
||||
$(MAKE) -C $(PKG_BUILD_DIR)/agent \
|
||||
LDFLAGS="$(TARGET_LDFLAGS) -lm -static" \
|
||||
EXEEXT="-static" \
|
||||
snmpd-static
|
||||
endef
|
||||
endif
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS) -lm -lc" \
|
||||
all install
|
||||
$(Build/Compile/static)
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(2)/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/net-snmp-config $(2)/bin/
|
||||
$(SED) 's,=/usr,=$(STAGING_DIR)/usr,g' $(2)/bin/net-snmp-config
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/net-snmp $(1)/usr/include/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.{a,so*} $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libnetsnmp/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.so.* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/snmpd/conffiles
|
||||
/etc/default/snmpd
|
||||
/etc/config/snmpd
|
||||
endef
|
||||
|
||||
define Package/snmpd/install
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DATA) ./files/snmpd.conf $(1)/etc/config/snmpd
|
||||
$(INSTALL_DIR) $(1)/etc/snmp
|
||||
ln -sf /var/run/snmpd.conf $(1)/etc/snmp/
|
||||
$(INSTALL_DIR) $(1)/etc/default
|
||||
$(INSTALL_DATA) ./files/snmpd.default $(1)/etc/default/snmpd
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/snmpd.init $(1)/etc/init.d/snmpd
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snmpd $(1)/usr/sbin/snmpd
|
||||
endef
|
||||
|
||||
define Package/snmpd-static/conffiles
|
||||
/etc/default/snmpd
|
||||
/etc/config/snmpd
|
||||
endef
|
||||
|
||||
define Package/snmpd-static/install
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DATA) ./files/snmpd.conf $(1)/etc/config/snmpd
|
||||
$(INSTALL_DIR) $(1)/etc/snmp
|
||||
ln -sf /var/run/snmpd.conf $(1)/etc/snmp/
|
||||
$(INSTALL_DIR) $(1)/etc/default
|
||||
$(INSTALL_DATA) ./files/snmpd.default $(1)/etc/default/snmpd
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/snmpd.init $(1)/etc/init.d/snmpd
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/agent/snmpd-static $(1)/usr/sbin/snmpd
|
||||
endef
|
||||
|
||||
define Package/snmp-utils/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/snmp{get,set,status,test,trap,walk} $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libnetsnmp))
|
||||
$(eval $(call BuildPackage,snmp-utils))
|
||||
$(eval $(call BuildPackage,snmpd))
|
||||
$(eval $(call BuildPackage,snmpd-static))
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
config snmp daemon
|
||||
option enabled 0
|
||||
|
||||
config agent
|
||||
option agentaddress UDP:161
|
||||
|
||||
config com2sec public
|
||||
option secname ro
|
||||
option source default
|
||||
option community public
|
||||
|
||||
config com2sec private
|
||||
option secname rw
|
||||
option source localhost
|
||||
option community private
|
||||
|
||||
config group public_v1
|
||||
option group public
|
||||
option version v1
|
||||
option secname ro
|
||||
|
||||
config group public_v2c
|
||||
option group public
|
||||
option version v2c
|
||||
option secname ro
|
||||
|
||||
config group public_usm
|
||||
option group public
|
||||
option version usm
|
||||
option secname ro
|
||||
|
||||
config group private_v1
|
||||
option group private
|
||||
option version v1
|
||||
option secname rw
|
||||
|
||||
config group private_v2c
|
||||
option group private
|
||||
option version v2c
|
||||
option secname rw
|
||||
|
||||
config group private_usm
|
||||
option group private
|
||||
option version usm
|
||||
option secname rw
|
||||
|
||||
config view all
|
||||
option viewname all
|
||||
option type included
|
||||
option oid .1
|
||||
|
||||
config access public_access
|
||||
option group public
|
||||
option context none
|
||||
option version any
|
||||
option level noauth
|
||||
option prefix exact
|
||||
option read all
|
||||
option write none
|
||||
option notify none
|
||||
|
||||
config access private_access
|
||||
option group private
|
||||
option context none
|
||||
option version any
|
||||
option level noauth
|
||||
option prefix exact
|
||||
option read all
|
||||
option write all
|
||||
option notify all
|
||||
|
||||
config system
|
||||
option sysLocation 'office'
|
||||
option sysContact 'bofh@example.com'
|
||||
option sysName 'HeartOfGold'
|
||||
# option sysServices 72
|
||||
# option sysDescr 'adult playground'
|
||||
# option sysObjectID '1.2.3.4'
|
||||
|
||||
|
|
@ -1 +0,0 @@
|
|||
OPTIONS="-Lf /dev/null -p /var/run/snmpd.pid"
|
||||
|
|
@ -1,163 +0,0 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2008 OpenWrt.org
|
||||
START=50
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=snmpd
|
||||
PROG=/usr/sbin/snmpd
|
||||
DEFAULT=/etc/default/snmpd
|
||||
LIB_D=/var/lib/snmp
|
||||
LOG_D=/var/log
|
||||
RUN_D=/var/run
|
||||
PID_F=$RUN_D/snmpd.pid
|
||||
RUN_C=$RUN_D/snmpd.conf
|
||||
|
||||
snmpd_agent_add() {
|
||||
local cfg="$1"
|
||||
|
||||
config_get agentaddress "$cfg" agentaddress
|
||||
[ -n "$agentaddress" ] || return 0
|
||||
echo "agentaddress $agentaddress" >> $RUN_C
|
||||
}
|
||||
snmpd_system_add() {
|
||||
local cfg="$1"
|
||||
config_get syslocation "$cfg" sysLocation
|
||||
[ -n "$syslocation" ] && echo "sysLocation $syslocation" >> $RUN_C
|
||||
config_get syscontact "$cfg" sysContact
|
||||
[ -n "$syscontact" ] && echo "sysContact $syscontact" >> $RUN_C
|
||||
config_get sysname "$cfg" sysName
|
||||
[ -n "$sysname" ] && echo "sysName $sysname" >> $RUN_C
|
||||
config_get sysservice "$cfg" sysService
|
||||
[ -n "$sysservice" ] && echo "sysService $sysservice" >> $RUN_C
|
||||
config_get sysdescr "$cfg" sysDescr
|
||||
[ -n "$sysdescr" ] && echo "sysDescr $sysdescr" >> $RUN_C
|
||||
config_get sysobjectid "$cfg" sysObjectID
|
||||
[ -n "$sysobjectid" ] && echo "sysObjectID $sysobjectid" >> $RUN_C
|
||||
}
|
||||
snmpd_com2sec_add() {
|
||||
local cfg="$1"
|
||||
config_get secname "$cfg" secname
|
||||
[ -n "$secname" ] || return 0
|
||||
config_get source "$cfg" source
|
||||
[ -n "$source" ] || return 0
|
||||
config_get community "$cfg" community
|
||||
[ -n "$community" ] || return 0
|
||||
echo "com2sec $secname $source $community" >> $RUN_C
|
||||
}
|
||||
snmpd_com2sec6_add() {
|
||||
local cfg="$1"
|
||||
config_get secname "$cfg" secname
|
||||
[ -n "$secname" ] || return 0
|
||||
config_get source "$cfg" source
|
||||
[ -n "$source" ] || return 0
|
||||
config_get community "$cfg" community
|
||||
[ -n "$community" ] || return 0
|
||||
echo "com2sec6 $secname $source $community" >> $RUN_C
|
||||
}
|
||||
snmpd_group_add() {
|
||||
local cfg="$1"
|
||||
config_get group "$cfg" group
|
||||
[ -n "$group" ] || return 0
|
||||
config_get version "$cfg" version
|
||||
[ -n "$version" ] || return 0
|
||||
config_get secname "$cfg" secname
|
||||
[ -n "$secname" ] || return 0
|
||||
echo "group $group $version $secname" >> $RUN_C
|
||||
}
|
||||
snmpd_view_add() {
|
||||
local cfg="$1"
|
||||
config_get viewname "$cfg" viewname
|
||||
[ -n "$viewname" ] || return 0
|
||||
config_get type "$cfg" type
|
||||
[ -n "$type" ] || return 0
|
||||
config_get oid "$cfg" oid
|
||||
[ -n "$oid" ] || return 0
|
||||
# optional mask
|
||||
config_get mask "$cfg" mask
|
||||
echo "view $viewname $type $oid $mask" >> $RUN_C
|
||||
}
|
||||
snmpd_access_add() {
|
||||
local cfg="$1"
|
||||
config_get group "$cfg" group
|
||||
[ -n "$group" ] || return 0
|
||||
config_get context "$cfg" context
|
||||
[ -n $context ] || return 0
|
||||
[ "$context" == "none" ] && context='""'
|
||||
config_get version "$cfg" version
|
||||
[ -n "$version" ] || return 0
|
||||
config_get level "$cfg" level
|
||||
[ -n "$level" ] || return 0
|
||||
config_get prefix "$cfg" prefix
|
||||
[ -n "$prefix" ] || return 0
|
||||
config_get read "$cfg" read
|
||||
[ -n "$read" ] || return 0
|
||||
config_get write "$cfg" write
|
||||
[ -n "$write" ] || return 0
|
||||
config_get notify "$cfg" notify
|
||||
[ -n "$notify" ] || return 0
|
||||
echo "access $group $context $version $level $prefix $read $write $notify" >> $RUN_C
|
||||
}
|
||||
snmpd_pass_add() {
|
||||
local cfg="$1"
|
||||
local pass='pass'
|
||||
|
||||
config_get miboid "$cfg" miboid
|
||||
[ -n "$miboid" ] || return 0
|
||||
config_get prog "$cfg" prog
|
||||
[ -n "$prog" ] || return 0
|
||||
config_get_bool persist "$cfg" persist 0
|
||||
[ $persist -ne 0 ] && pass='pass_persist'
|
||||
config_get priority "$cfg" priority
|
||||
priority=${priority:+-p $priority}
|
||||
echo "$pass $priority $miboid $prog" >> $RUN_C
|
||||
}
|
||||
snmpd_exec_add() {
|
||||
local cfg="$1"
|
||||
|
||||
config_get name "$cfg" name
|
||||
[ -n "$name" ] || return 0
|
||||
config_get prog "$cfg" prog
|
||||
[ -n "$prog" ] || return 0
|
||||
config_get args "$cfg" args
|
||||
config_get miboid "$cfg" miboid
|
||||
echo "exec $miboid $name $prog $args" >> $RUN_C
|
||||
}
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger snmpd
|
||||
}
|
||||
start_service() {
|
||||
config_load snmpd
|
||||
config_get_bool enabled daemon enabled 0
|
||||
|
||||
[ "$enabled" == "1" ] || return
|
||||
|
||||
[ -d $LIB_D ] || mkdir -p $LIB_D
|
||||
[ -d $LOG_D ] || mkdir -p $LOG_D
|
||||
[ -d $RUN_D ] || mkdir -p $RUN_D
|
||||
[ -f $RUN_C ] && rm -f $RUN_C
|
||||
|
||||
config_foreach snmpd_agent_add agent
|
||||
config_foreach snmpd_system_add system
|
||||
config_foreach snmpd_com2sec_add com2sec
|
||||
config_foreach snmpd_com2sec6_add com2sec6
|
||||
config_foreach snmpd_group_add group
|
||||
config_foreach snmpd_view_add view
|
||||
config_foreach snmpd_access_add access
|
||||
config_foreach snmpd_pass_add pass
|
||||
# config_foreach snmpd_exec_add exec
|
||||
|
||||
[ -f $DEFAULT ] && . $DEFAULT
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG" -f $OPTIONS
|
||||
procd_close_instance
|
||||
}
|
||||
stop_service() {
|
||||
service_stop /usr/sbin/snmpd
|
||||
[ -f $PID_F ] && rm -f $PID_F
|
||||
[ -f $RUN_C ] && rm -f $RUN_C
|
||||
}
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
--- a/agent/mibgroup/mibII/interfaces.c
|
||||
+++ b/agent/mibgroup/mibII/interfaces.c
|
||||
@@ -1561,6 +1561,10 @@ Interface_Scan_Init(void)
|
||||
struct ifnet *nnew;
|
||||
char *stats, *ifstart = line;
|
||||
|
||||
+ /* Ignore interfaces with no statistics. */
|
||||
+ if (strstr(line, "No statistics available."))
|
||||
+ continue;
|
||||
+
|
||||
if (line[strlen(line) - 1] == '\n')
|
||||
line[strlen(line) - 1] = '\0';
|
||||
|
||||
@@ -1594,7 +1598,7 @@ Interface_Scan_Init(void)
|
||||
&coll) != 5)) {
|
||||
if ((scan_line_to_use == scan_line_2_2)
|
||||
&& !strstr(line, "No statistics available"))
|
||||
- snmp_log(LOG_ERR,
|
||||
+ snmp_log(LOG_DEBUG,
|
||||
"/proc/net/dev data format error, line ==|%s|",
|
||||
line);
|
||||
continue;
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
--- a/local/Makefile.in
|
||||
+++ b/local/Makefile.in
|
||||
@@ -100,7 +100,7 @@ tkmib.made: $(srcdir)/tkmib
|
||||
|
||||
mib2c.made: $(srcdir)/mib2c
|
||||
if test "x$(PERL)" != "x" ; then \
|
||||
- $(PERL) -p -e 's%^#!.*/perl.*%#!$(PERL)%;s#/usr/local/share/snmp#$(snmplibdir)#;' ${srcdir}/mib2c > mib2c.made; \
|
||||
+ $(PERL) -p -e 's%^#!.*/perl.*%#!$(PERL)%;s#/usr/local/share/snmp#$(snmplibdir)#;s#/usr/local/etc/snmp#$(SNMPCONFPATH)#;' ${srcdir}/mib2c > mib2c.made; \
|
||||
else \
|
||||
touch mib2c.made; \
|
||||
fi
|
||||
--- a/mibs/Makefile.in
|
||||
+++ b/mibs/Makefile.in
|
||||
@@ -48,11 +48,15 @@ NETSNMPMIBS = NET-SNMP-TC.txt NET-SNMP-M
|
||||
UCDMIBS = UCD-SNMP-MIB.txt UCD-DEMO-MIB.txt UCD-IPFWACC-MIB.txt \
|
||||
UCD-DLMOD-MIB.txt UCD-DISKIO-MIB.txt
|
||||
|
||||
+EXTRAMIBS = BGP4-MIB.txt BRIDGE-MIB.txt GNOME-SMI.txt OSPF-MIB.txt \
|
||||
+ OSPF-TRAP-MIB.txt RIPv2-MIB.txt SOURCE-ROUTING-MIB.txt \
|
||||
+ LM-SENSORS-MIB.txt
|
||||
+
|
||||
DEFAULTMIBS = @default_mibs_install@
|
||||
|
||||
MIBS = $(V1MIBS) $(V2MIBS) $(V3MIBS) $(RFCMIBS) \
|
||||
$(AGENTMIBS) $(IANAMIBS) \
|
||||
- $(NETSNMPMIBS) $(UCDMIBS) $(DEFAULTMIBS)
|
||||
+ $(NETSNMPMIBS) $(UCDMIBS) $(DEFAULTMIBS) $(EXTRAMIBS)
|
||||
|
||||
all: standardall
|
||||
|
||||
--- a/Makefile.top
|
||||
+++ b/Makefile.top
|
||||
@@ -26,6 +26,7 @@ man8dir = $(mandir)/man8
|
||||
snmplibdir = $(datadir)/snmp
|
||||
mibdir = $(snmplibdir)/mibs
|
||||
persistentdir = @PERSISTENT_DIRECTORY@
|
||||
+sysconfdir = @sysconfdir@
|
||||
DESTDIR = @INSTALL_PREFIX@
|
||||
INSTALL_PREFIX = $(DESTDIR)
|
||||
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
--- a/local/mib2c
|
||||
+++ b/local/mib2c
|
||||
@@ -60,8 +60,9 @@ $currentlevel = -1;
|
||||
if($ENV{MIB2C_DIR}) {
|
||||
push @def_search_dirs, split(/:/, $ENV{MIB2C_DIR});
|
||||
}
|
||||
-push @def_search_dirs, "/usr/local/share/snmp/";
|
||||
-push @def_search_dirs, "/usr/local/share/snmp/mib2c-data";
|
||||
+push @def_search_dirs, "/etc/snmp/";
|
||||
+push @def_search_dirs, "/usr/share/snmp/";
|
||||
+push @def_search_dirs, "/usr/share/snmp/mib2c-data";
|
||||
push @def_search_dirs, "./mib2c-conf.d";
|
||||
|
||||
sub usage {
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,11 +0,0 @@
|
|||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -10216,7 +10216,7 @@ linux* | k*bsd*-gnu)
|
||||
need_version=no
|
||||
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
||||
soname_spec='${libname}${release}${shared_ext}$major'
|
||||
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
|
||||
+ finish_cmds=''
|
||||
shlibpath_var=LD_LIBRARY_PATH
|
||||
shlibpath_overrides_runpath=no
|
||||
# This implies no fast_install, which is unacceptable.
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue