mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-01-07 09:02:36 +08:00
Compare commits
21 Commits
libtracefi
...
release-5.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c394034abd | ||
|
|
ff6f0d86e3 | ||
|
|
9c374abe87 | ||
|
|
2abf1cbd60 | ||
|
|
42ac8650cc | ||
|
|
6620496980 | ||
|
|
1b0d5ca9f2 | ||
|
|
fc9b4f5be2 | ||
|
|
f80a9e5d96 | ||
|
|
c130ffe882 | ||
|
|
84b5b1a42f | ||
|
|
60fcda1616 | ||
|
|
a3df9da723 | ||
|
|
ed169fbc0c | ||
|
|
41405f112b | ||
|
|
6cce55d77a | ||
|
|
b266e2a2fa | ||
|
|
491b977545 | ||
|
|
42a4daae03 | ||
|
|
84ea2908c6 | ||
|
|
c333460ac6 |
@@ -24,7 +24,6 @@ PKG_SOURCE_PROTO:=git
|
|||||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/mediatek/ated.git
|
PKG_SOURCE_URL:=https://dev.iopsys.eu/mediatek/ated.git
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
|
||||||
PKG_MIRROR_HASH:=skip
|
|
||||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||||
|
|
||||||
|
|||||||
@@ -1,27 +1,27 @@
|
|||||||
config BBF_VENDOR_EXTENSION
|
if PACKAGE_libbbfdm
|
||||||
bool "Enable Vendor Extension"
|
|
||||||
|
config LIBBBFDM_VENDOR_PREFIX
|
||||||
|
string "Vendor Prefix"
|
||||||
|
default "X_IOPSYS_EU_"
|
||||||
|
|
||||||
|
config BBF_TR181
|
||||||
|
bool "Compile with tr181 device features"
|
||||||
default y
|
default y
|
||||||
|
|
||||||
config BBF_VENDOR_LIST
|
|
||||||
string "Vendor List"
|
|
||||||
default "iopsys"
|
|
||||||
|
|
||||||
config BBF_VENDOR_PREFIX
|
|
||||||
string "Vendor Prefix"
|
|
||||||
default "X_IOPSYS_EU_"
|
|
||||||
|
|
||||||
config BBF_TR104
|
config BBF_TR104
|
||||||
bool "Enable TR-104 Data Model Support"
|
bool "Compile with tr104 voice features"
|
||||||
default y
|
default y
|
||||||
|
|
||||||
config BBF_TR143
|
config BBF_TR143
|
||||||
bool "Enable TR-143 Data Model Support"
|
bool "Compile with tr143 diagnostics features"
|
||||||
default y
|
default y
|
||||||
|
|
||||||
config BBFDM_ENABLE_JSON_PLUGIN
|
config BBF_TR157
|
||||||
bool "Enable json plugin to extend datamodel"
|
bool "Compile with tr157 bulkdata collector features"
|
||||||
default y
|
default y
|
||||||
|
|
||||||
|
config BBF_TR064
|
||||||
|
bool "Compile with tr064 features"
|
||||||
|
default n
|
||||||
|
|
||||||
config BBFDM_ENABLE_DOTSO_PLUGIN
|
endif
|
||||||
bool "Enable shared library plugin to extend datamodel"
|
|
||||||
default y
|
|
||||||
|
|||||||
153
bbf/Makefile
153
bbf/Makefile
@@ -1,69 +1,38 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2022 IOPSYS
|
# Copyright (C) 2019 IOPSYS
|
||||||
#
|
#
|
||||||
|
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=libbbfdm
|
PKG_NAME:=libbbfdm
|
||||||
PKG_VERSION:=6.6.36
|
PKG_VERSION:=1.6-2020-08-25
|
||||||
|
PKG_FIXUP:=autoreconf
|
||||||
PKG_SOURCE_PROTO:=git
|
|
||||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bbf.git
|
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bbf.git
|
||||||
PKG_SOURCE_VERSION:=180119192418dbac64713c3e5efe761a1f8e871e
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
PKG_SOURCE_VERSION:=bfe14a431d408614ed30e2d831ebd927eab719e2
|
||||||
PKG_MIRROR_HASH:=skip
|
|
||||||
|
|
||||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||||
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||||
|
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||||
|
|
||||||
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||||
|
|
||||||
PKG_LICENSE:=LGPL-2.1
|
PKG_LICENSE:=LGPL-2.1
|
||||||
PKG_LICENSE_FILES:=LICENSE
|
PKG_LICENSE_FILES:=LICENSE
|
||||||
|
|
||||||
PKG_FIXUP:=autoreconf
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
define Package/libbbf_api
|
define Package/libbbf_api
|
||||||
SECTION:=utils
|
SECTION:=libs
|
||||||
CATEGORY:=Utilities
|
CATEGORY:=Libraries
|
||||||
SUBMENU:=TRx69
|
|
||||||
TITLE:=Library for libbbfdm API
|
TITLE:=Library for libbbfdm API
|
||||||
endef
|
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c
|
||||||
|
|
||||||
define Package/libbbfdm/default
|
|
||||||
SECTION:=utils
|
|
||||||
CATEGORY:=Utilities
|
|
||||||
SUBMENU:=TRx69
|
|
||||||
TITLE:=Library for broadband forum data model support
|
|
||||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libtrace +libcurl
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/libbbfdm
|
define Package/libbbfdm
|
||||||
$(Package/libbbfdm/default)
|
SECTION:=libs
|
||||||
TITLE += (internal)
|
CATEGORY:=Libraries
|
||||||
VARIANT:=internal
|
TITLE:=Library for broadband-forum data model
|
||||||
endef
|
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libtrace +libbbf_api +libopenssl +libmbedtls
|
||||||
|
|
||||||
define Package/libbbfdm-mbedtls
|
|
||||||
$(Package/libbbfdm/default)
|
|
||||||
TITLE += (mbedtls)
|
|
||||||
DEPENDS += +PACKAGE_libbbfdm-mbedtls:libmbedtls
|
|
||||||
VARIANT:=mbedtls
|
|
||||||
DEFAULT_VARIANT:=1
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/libbbfdm-openssl
|
|
||||||
$(Package/libbbfdm/default)
|
|
||||||
TITLE += (openssl)
|
|
||||||
DEPENDS += +PACKAGE_libbbfdm-openssl:libopenssl
|
|
||||||
CONFLICTS := libbbfdm-mbedtls
|
|
||||||
VARIANT:=openssl
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/libbbfdm-wolfssl
|
|
||||||
$(Package/libbbfdm/default)
|
|
||||||
TITLE += (wolfssl)
|
|
||||||
DEPENDS += +PACKAGE_libbbfdm-wolfssl:libwolfssl
|
|
||||||
CONFLICTS := libbbfdm-mbedtls libbbfdm-openssl
|
|
||||||
VARIANT:=wolfssl
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/libbbfdm/config
|
define Package/libbbfdm/config
|
||||||
@@ -75,7 +44,7 @@ define Package/libbbf_api/description
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/libbbfdm/description
|
define Package/libbbfdm/description
|
||||||
Library contains the data model tree. It includes TR181, TR104 and TR143 data models
|
Library contains the data model tree. It includes TR181, TR104, TR143, TR157 and TR064 data models
|
||||||
endef
|
endef
|
||||||
|
|
||||||
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
|
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
|
||||||
@@ -85,12 +54,15 @@ define Build/Prepare
|
|||||||
endef
|
endef
|
||||||
endif
|
endif
|
||||||
|
|
||||||
TARGET_CFLAGS += \
|
TARGET_CFLAGS += -DCUSTOM_PREFIX=\\\"$(CONFIG_LIBBBFDM_VENDOR_PREFIX)\\\"
|
||||||
-D_GNU_SOURCE \
|
|
||||||
-Wall -Werror \
|
|
||||||
|
|
||||||
|
TARGET_CFLAGS += \
|
||||||
|
-D_GNU_SOURCE -D_AADJ
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_BBF_TR181),y)
|
||||||
CONFIGURE_ARGS += \
|
CONFIGURE_ARGS += \
|
||||||
--enable-tr181
|
--enable-tr181
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_BBF_TR104),y)
|
ifeq ($(CONFIG_BBF_TR104),y)
|
||||||
CONFIGURE_ARGS += \
|
CONFIGURE_ARGS += \
|
||||||
@@ -102,84 +74,53 @@ CONFIGURE_ARGS += \
|
|||||||
--enable-tr143
|
--enable-tr143
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_BBF_VENDOR_EXTENSION),y)
|
ifeq ($(CONFIG_BBF_TR157),y)
|
||||||
CONFIGURE_ARGS += \
|
CONFIGURE_ARGS += \
|
||||||
--enable-vendor-extension
|
--enable-tr157
|
||||||
|
|
||||||
CONFIGURE_ARGS += \
|
|
||||||
BBF_VENDOR_LIST="$(CONFIG_BBF_VENDOR_LIST)" \
|
|
||||||
BBF_VENDOR_PREFIX="$(CONFIG_BBF_VENDOR_PREFIX)"
|
|
||||||
|
|
||||||
endif ##CONFIG_BBF_VENDOR_EXTENSION
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_BBFDM_ENABLE_JSON_PLUGIN),y)
|
|
||||||
CONFIGURE_ARGS += \
|
|
||||||
--enable-json-plugin
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_BBFDM_ENABLE_DOTSO_PLUGIN),y)
|
ifeq ($(CONFIG_BBF_TR064),y)
|
||||||
CONFIGURE_ARGS += \
|
CONFIGURE_ARGS += \
|
||||||
--enable-shared-library
|
--enable-tr064
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(BUILD_VARIANT),openssl)
|
ifeq ($(CONFIG_PACKAGE_libopenssl),y)
|
||||||
CONFIGURE_ARGS += --enable-libopenssl
|
CONFIGURE_ARGS += \
|
||||||
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/
|
--enable-libopenssl
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(BUILD_VARIANT),wolfssl)
|
ifeq ($(CONFIG_PACKAGE_libmbedtls),y)
|
||||||
CONFIGURE_ARGS += --enable-libwolfssl
|
CONFIGURE_ARGS += \
|
||||||
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/wolfssl
|
--enable-libmbedtls
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BUILD_VARIANT),mbedtls)
|
|
||||||
CONFIGURE_ARGS += --enable-libmbedtls
|
|
||||||
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
define Package/libbbf_api/install
|
define Package/libbbf_api/install
|
||||||
$(INSTALL_DIR) $(1)/lib
|
$(INSTALL_DIR) $(1)/lib
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbf_api.so* $(1)/lib/
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/libbbfdm/default/install
|
define Package/libbbfdm/install
|
||||||
$(INSTALL_DIR) $(1)/lib
|
$(INSTALL_DIR) $(1)/lib
|
||||||
$(INSTALL_DIR) $(1)/usr/share/bbfdm
|
|
||||||
$(INSTALL_DIR) $(1)/etc/bbfdm
|
|
||||||
$(INSTALL_DIR) $(1)/etc/bbfdm/dmmap
|
|
||||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.so* $(1)/lib/
|
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.so* $(1)/lib/
|
||||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/* $(1)/usr/share/bbfdm
|
$(INSTALL_DIR) $(1)/etc/bbfdm
|
||||||
|
$(INSTALL_DIR) $(1)/etc/bbfdm/json
|
||||||
|
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/dmmap $(1)/etc/bbfdm
|
||||||
|
$(INSTALL_DIR) $(1)/usr/share/bbfdm
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/scripts/functions $(1)/usr/share/bbfdm
|
||||||
|
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/libbbfdm/default/prerm
|
|
||||||
#!/bin/sh
|
|
||||||
rm -rf /etc/bbfdm/dmmap/*
|
|
||||||
exit 0
|
|
||||||
endef
|
|
||||||
|
|
||||||
Package/libbbfdm-openssl/prerm = $(Package/libbbfdm/default/prerm)
|
|
||||||
Package/libbbfdm-wolfssl/prerm = $(Package/libbbfdm/default/prerm)
|
|
||||||
Package/libbbfdm-mbedtls/prerm = $(Package/libbbfdm/default/prerm)
|
|
||||||
|
|
||||||
Package/libbbfdm-openssl/install = $(Package/libbbfdm/default/install)
|
|
||||||
Package/libbbfdm-wolfssl/install = $(Package/libbbfdm/default/install)
|
|
||||||
Package/libbbfdm-mbedtls/install = $(Package/libbbfdm/default/install)
|
|
||||||
|
|
||||||
define Build/InstallDev
|
define Build/InstallDev
|
||||||
$(INSTALL_DIR) $(1)/usr/lib
|
|
||||||
$(INSTALL_DIR) $(1)/usr/include
|
|
||||||
$(INSTALL_DIR) $(1)/usr/include/libbbfdm
|
$(INSTALL_DIR) $(1)/usr/include/libbbfdm
|
||||||
$(INSTALL_DIR) $(1)/usr/include/libbbf_api
|
$(INSTALL_DIR) $(1)/usr/include/libbbf_api
|
||||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/include/*.h $(1)/usr/include/
|
$(CP) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/libbbfdm/
|
||||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/libbbfdm/
|
$(CP) $(PKG_BUILD_DIR)/dmtree/tr181/*.h $(1)/usr/include/libbbfdm/
|
||||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbf_api/*.h $(1)/usr/include/libbbf_api/
|
$(CP) $(PKG_BUILD_DIR)/dmtree/tr157/*.h $(1)/usr/include/libbbfdm/
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/libbbf_api/*.h $(1)/usr/include/libbbf_api/
|
||||||
|
$(INSTALL_DIR) $(1)/usr/lib
|
||||||
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.{a,so*} $(1)/usr/lib/
|
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.{a,so*} $(1)/usr/lib/
|
||||||
touch $(1)/usr/lib/libbbf_api.so
|
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbf_api.{a,so*} $(1)/usr/lib/
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call BuildPackage,libbbf_api))
|
$(eval $(call BuildPackage,libbbf_api))
|
||||||
$(eval $(call BuildPackage,libbbfdm))
|
$(eval $(call BuildPackage,libbbfdm))
|
||||||
$(eval $(call BuildPackage,libbbfdm-openssl))
|
|
||||||
$(eval $(call BuildPackage,libbbfdm-wolfssl))
|
|
||||||
$(eval $(call BuildPackage,libbbfdm-mbedtls))
|
|
||||||
|
|||||||
@@ -1,58 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (C) 2022 iopsys Software Solutions AB
|
|
||||||
#
|
|
||||||
# This is free software, licensed under the GNU General Public License v2.
|
|
||||||
# See /LICENSE for more information.
|
|
||||||
#
|
|
||||||
|
|
||||||
include $(TOPDIR)/rules.mk
|
|
||||||
|
|
||||||
PKG_NAME:=bulkdata
|
|
||||||
PKG_VERSION:=2.0.3
|
|
||||||
|
|
||||||
LOCAL_DEV:=0
|
|
||||||
ifneq ($(LOCAL_DEV),1)
|
|
||||||
PKG_SOURCE_PROTO:=git
|
|
||||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bulkdata.git
|
|
||||||
PKG_SOURCE_VERSION:=85d7486a21a9eb0e0f345b587b3ac506edcb72fe
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
|
||||||
PKG_MIRROR_HASH:=skip
|
|
||||||
endif
|
|
||||||
|
|
||||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
|
||||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
|
||||||
|
|
||||||
PKG_LICENSE:=GPL-2.0-only
|
|
||||||
PKG_LICENSE_FILES:=LICENSE
|
|
||||||
|
|
||||||
PKG_BUILD_DEPENDS:=bbf
|
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
|
||||||
|
|
||||||
define Package/$(PKG_NAME)
|
|
||||||
SECTION:=utils
|
|
||||||
CATEGORY:=Utilities
|
|
||||||
SUBMENU:=TRx69
|
|
||||||
TITLE:=BBF BulkData Collection
|
|
||||||
DEPENDS:=+libubus +libuci +libubox +libjson-c +libcurl +libblobmsg-json
|
|
||||||
endef
|
|
||||||
|
|
||||||
TARGET_CFLAGS += \
|
|
||||||
-D_GNU_SOURCE \
|
|
||||||
-Wall -Werror
|
|
||||||
|
|
||||||
ifeq ($(LOCAL_DEV),1)
|
|
||||||
define Build/Prepare
|
|
||||||
$(CP) -rf ~/git/bulkdata/* $(PKG_BUILD_DIR)/
|
|
||||||
endef
|
|
||||||
endif
|
|
||||||
|
|
||||||
define Package/$(PKG_NAME)/install
|
|
||||||
$(INSTALL_DIR) $(1)/usr/sbin
|
|
||||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bulkdatad $(1)/usr/sbin/
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
|
||||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbf_plugin/*.so $(1)/usr/lib/bbfdm
|
|
||||||
$(CP) ./files/* $(1)/
|
|
||||||
endef
|
|
||||||
|
|
||||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
|
|
||||||
config bulkdata 'bulkdata'
|
|
||||||
option enable '0'
|
|
||||||
#Log levels: Error=1, Warning=2, Info=3, Debug=4
|
|
||||||
option log_level '3'
|
|
||||||
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
#!/bin/sh /etc/rc.common
|
|
||||||
|
|
||||||
START=99
|
|
||||||
STOP=10
|
|
||||||
|
|
||||||
USE_PROCD=1
|
|
||||||
PROG="/usr/sbin/bulkdatad"
|
|
||||||
|
|
||||||
start_service() {
|
|
||||||
local enable=$(uci -q get bulkdata.bulkdata.enable)
|
|
||||||
|
|
||||||
[ "$enable" != "1" ] && {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
procd_open_instance
|
|
||||||
procd_set_param command "$PROG"
|
|
||||||
procd_set_param respawn "3" "7" "0"
|
|
||||||
procd_close_instance
|
|
||||||
}
|
|
||||||
|
|
||||||
boot() {
|
|
||||||
start
|
|
||||||
}
|
|
||||||
|
|
||||||
reload_service() {
|
|
||||||
stop
|
|
||||||
start
|
|
||||||
}
|
|
||||||
|
|
||||||
service_triggers()
|
|
||||||
{
|
|
||||||
procd_add_reload_trigger bulkdata
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. /lib/functions.sh
|
|
||||||
|
|
||||||
PROFILE_COUNT=1
|
|
||||||
|
|
||||||
get_next_count()
|
|
||||||
{
|
|
||||||
local config="$1"
|
|
||||||
local default_name="${2}"
|
|
||||||
local count=${3}
|
|
||||||
local found=0
|
|
||||||
|
|
||||||
if [ -z "$count" ]; then
|
|
||||||
count=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
while [ "${found}" -ne 1 ]; do
|
|
||||||
uci -q get ${config}.${default_name}_${count} >/dev/null
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
count=$((count + 1))
|
|
||||||
else
|
|
||||||
found=1;
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "${default_name}_${count}"
|
|
||||||
}
|
|
||||||
|
|
||||||
translate_profile_id_to_profile_name() {
|
|
||||||
local section="${1}"
|
|
||||||
local profile_id="${2}"
|
|
||||||
local profile_name="${3}"
|
|
||||||
local curr_profile_id
|
|
||||||
|
|
||||||
config_get curr_profile_id "${section}" profile_id
|
|
||||||
|
|
||||||
[ -n "${curr_profile_id}" ] || return
|
|
||||||
|
|
||||||
[ "${curr_profile_id}" != "${profile_id}" ] && return
|
|
||||||
|
|
||||||
uci -q set bulkdata.${section}.profile_name="${profile_name}"
|
|
||||||
uci -q set bulkdata.${section}.profile_id=""
|
|
||||||
}
|
|
||||||
|
|
||||||
update_profile_sections() {
|
|
||||||
local section="${1}"
|
|
||||||
local default="${2}"
|
|
||||||
local profile_name
|
|
||||||
|
|
||||||
config_get profile_id "${section}" profile_id
|
|
||||||
|
|
||||||
[ -n "${profile_id}" ] || return
|
|
||||||
|
|
||||||
case "${section}" in
|
|
||||||
"cfg"*)
|
|
||||||
profile_name="$(get_next_count bulkdata ${default} ${PROFILE_COUNT})"
|
|
||||||
uci_rename bulkdata "${section}" "${profile_name}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
PROFILE_COUNT=$((PROFILE_COUNT + 1))
|
|
||||||
|
|
||||||
[ -n "$profile_name" ] && section="${profile_name}"
|
|
||||||
|
|
||||||
uci -q set bulkdata.${section}.profile_id=""
|
|
||||||
|
|
||||||
config_foreach translate_profile_id_to_profile_name profile_parameter "${profile_id}" "${profile_name}"
|
|
||||||
config_foreach translate_profile_id_to_profile_name profile_http_request_uri_parameter "${profile_id}" "${profile_name}"
|
|
||||||
}
|
|
||||||
|
|
||||||
config_load bulkdata
|
|
||||||
config_foreach update_profile_sections profile profile
|
|
||||||
uci commit bulkdata
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (C) 2019 IOPSYS
|
|
||||||
#
|
|
||||||
|
|
||||||
include $(TOPDIR)/rules.mk
|
|
||||||
|
|
||||||
PKG_NAME:=bulut
|
|
||||||
PKG_VERSION:=0.2
|
|
||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
|
||||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bulut/bulut-gw-client.git
|
|
||||||
PKG_SOURCE_VERSION:=227700c44817afa2c392fa08bf4cf70fa6177f01
|
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
|
||||||
PKG_MIRROR_HASH:=skip
|
|
||||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
|
||||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
|
||||||
|
|
||||||
define Package/bulut
|
|
||||||
CATEGORY:=Utilities
|
|
||||||
DEPENDS:=
|
|
||||||
TITLE:=bulut
|
|
||||||
endef
|
|
||||||
|
|
||||||
TARGET_CFLAGS += \
|
|
||||||
-I$(STAGING_DIR)/usr/include
|
|
||||||
|
|
||||||
define Package/bulut/description
|
|
||||||
obuspa keys
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/bulut/install
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/files/* $(1)/
|
|
||||||
endef
|
|
||||||
|
|
||||||
$(eval $(call BuildPackage,bulut))
|
|
||||||
@@ -1,4 +1,7 @@
|
|||||||
#!/bin/sh /etc/rc.common
|
#!/bin/sh /etc/rc.common
|
||||||
|
#
|
||||||
|
# Copyright (C) 2015 inteno.org
|
||||||
|
#
|
||||||
|
|
||||||
START=71
|
START=71
|
||||||
USE_PROCD=1
|
USE_PROCD=1
|
||||||
|
|||||||
53
cifsd-tools/Makefile
Normal file
53
cifsd-tools/Makefile
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_NAME:=cifsd-tools
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
|
PKG_SOURCE_PROTO:=git
|
||||||
|
PKG_SOURCE_URL:=https://github.com/namjaejeon/cifsd-tools.git
|
||||||
|
PKG_SOURCE_DATE:=2019-02-14
|
||||||
|
PKG_SOURCE_VERSION:=a7d7dfc40524b88dbcb2052034a75f446b3cefdd
|
||||||
|
PKG_MIRROR_HASH:=a74f95a79c3cdcc78e66c080729141abee0d821e21a326d88b11d849738314fb
|
||||||
|
|
||||||
|
PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
|
||||||
|
PKG_LICENSE:=GPL-2.0
|
||||||
|
PKG_LICENSE_FILES:=COPYING
|
||||||
|
|
||||||
|
PKG_INSTALL:=1
|
||||||
|
PKG_FIXUP:=autoreconf
|
||||||
|
PKG_REMOVE_FILES:=autogen.sh aclocal.m4
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
include $(INCLUDE_DIR)/nls.mk
|
||||||
|
|
||||||
|
define Package/cifsd-tools
|
||||||
|
SECTION:=net
|
||||||
|
CATEGORY:=Network
|
||||||
|
SUBMENU:=Filesystem
|
||||||
|
TITLE:=Kernel CIFS/SMB server support and userspace tools
|
||||||
|
DEPENDS:=+kmod-fs-cifsd +glib2 +libnl-core +libnl-genl $(ICONV_DEPENDS)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/cifsd-tools/description
|
||||||
|
Userspace tools (cifsd, cifsadmin) for the CIFS/SMB kernel fileserver.
|
||||||
|
The config file location is /etc/cifs/smb.conf
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/cifsd-tools/install
|
||||||
|
$(INSTALL_DIR) $(1)/usr/lib
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcifsdtools.so* $(1)/usr/lib/
|
||||||
|
|
||||||
|
$(INSTALL_DIR) $(1)/etc/cifs
|
||||||
|
$(INSTALL_CONF) $(PKG_BUILD_DIR)/smb.conf.example $(1)/etc/cifs
|
||||||
|
|
||||||
|
$(INSTALL_DIR) $(1)/etc/config
|
||||||
|
$(INSTALL_CONF) ./files/cifsd.config $(1)/etc/config/cifsd
|
||||||
|
|
||||||
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
|
$(INSTALL_BIN) ./files/cifsd.init $(1)/etc/init.d/cifsd
|
||||||
|
|
||||||
|
$(INSTALL_DIR) $(1)/usr/sbin
|
||||||
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{cifsadmin,cifsd} $(1)/usr/sbin/
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call BuildPackage,cifsd-tools))
|
||||||
9
cifsd-tools/files/cifsd.config
Normal file
9
cifsd-tools/files/cifsd.config
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
config global 'global'
|
||||||
|
option server_string 'CIFSD on OpenWRT'
|
||||||
|
option ipc_timeout '8' # IPC timeout is used as a workaround for uninterruptible sleep until this is fixed upstream.
|
||||||
|
|
||||||
|
config share
|
||||||
|
option name 'share'
|
||||||
|
option comment 'Default guest share'
|
||||||
|
option path '/mnt'
|
||||||
|
option guest_ok 'yes'
|
||||||
161
cifsd-tools/files/cifsd.init
Normal file
161
cifsd-tools/files/cifsd.init
Normal file
@@ -0,0 +1,161 @@
|
|||||||
|
#!/bin/sh /etc/rc.common
|
||||||
|
|
||||||
|
START=90
|
||||||
|
USE_PROCD=1
|
||||||
|
PROG=/usr/sbin/cifsd
|
||||||
|
USER_DB=/etc/cifs/cifsdpwd.db
|
||||||
|
CIFS_ADMIN=cifsadmin
|
||||||
|
|
||||||
|
EXTRA_COMMANDS="users"
|
||||||
|
EXTRA_HELP=" users Show list of users created by cifsadmin"
|
||||||
|
|
||||||
|
users() {
|
||||||
|
[ -f "$USER_DB" ] && cut -d ':' $USER_DB -f1 || \
|
||||||
|
printf "No users available.\n"
|
||||||
|
}
|
||||||
|
|
||||||
|
validate_cifsd_global() {
|
||||||
|
uci_validate_section cifsd global global \
|
||||||
|
'server_string:string' \
|
||||||
|
'workgroup:string' \
|
||||||
|
'netbios_name:string' \
|
||||||
|
'interface:string' \
|
||||||
|
'ipc_timeout:uinteger'
|
||||||
|
}
|
||||||
|
|
||||||
|
validate_cifsd_share() {
|
||||||
|
uci_validate_section cifsd share "${1}" \
|
||||||
|
'name:string' \
|
||||||
|
'comment:string' \
|
||||||
|
'path:string' \
|
||||||
|
'guest_ok:bool' \
|
||||||
|
'read_only:bool' \
|
||||||
|
'allow_hosts:list' \
|
||||||
|
'deny_hosts:list' \
|
||||||
|
'users:string' \
|
||||||
|
'invalid_users:string' \
|
||||||
|
'create_mask:string' \
|
||||||
|
'dir_mask:string' \
|
||||||
|
'max_connections:uinteger' \
|
||||||
|
'veto_files:list'
|
||||||
|
}
|
||||||
|
|
||||||
|
validate_cifsd_users() {
|
||||||
|
uci_validate_section cifsd users "${1}" \
|
||||||
|
'user:string' \
|
||||||
|
'password:string' \
|
||||||
|
'desc:string'
|
||||||
|
}
|
||||||
|
|
||||||
|
load_cifsd_global() {
|
||||||
|
local server_string
|
||||||
|
local workgroup
|
||||||
|
local netbios_name
|
||||||
|
local ipc_timeout
|
||||||
|
|
||||||
|
validate_cifsd_global
|
||||||
|
|
||||||
|
echo -e "[global]" >> /var/etc/cifsd.conf
|
||||||
|
[ -n "$server_string" ] && echo -e "\tserver string = $server_string" >> /var/etc/cifsd.conf
|
||||||
|
[ -n "$workgroup" ] && echo -e "\tworkgroup = $workgroup" >> /var/etc/cifsd.conf
|
||||||
|
[ -n "$netbios_name" ] && echo -e "\tnetbios name = $netbios_name" >> /var/etc/cifsd.conf
|
||||||
|
[ -n "$ipc_timeout" ] && echo -e "\tipc timeout name = $ipc_timeout" >> /var/etc/cifsd.conf || \
|
||||||
|
echo -e "\tipc timeout name = 8" >> /var/etc/cifsd.conf
|
||||||
|
}
|
||||||
|
|
||||||
|
load_cifsd_share() {
|
||||||
|
local name
|
||||||
|
local comment
|
||||||
|
local path
|
||||||
|
local guest_ok
|
||||||
|
local allow_hosts
|
||||||
|
local deny_hosts
|
||||||
|
local users
|
||||||
|
local invalid_users
|
||||||
|
local max_connections
|
||||||
|
local veto_files
|
||||||
|
local dir_mask
|
||||||
|
local create_mask
|
||||||
|
local read_only
|
||||||
|
|
||||||
|
validate_cifsd_share ${1}
|
||||||
|
|
||||||
|
if [ -z "$name" -o -z "$path" ]; then
|
||||||
|
logread -t ${0} "Missing name or path."
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "\n[$name]\n\tpath = $path" >> /var/etc/cifsd.conf
|
||||||
|
[ -n "$comment" ] && echo -e "\tcomment = $comment" >> /var/etc/cifsd.conf
|
||||||
|
[ -n "$guest_ok" ] && echo -e "\tguest ok = $guest_ok" >> /var/etc/cifsd.conf
|
||||||
|
[ -n "$allow_hosts" ] && echo -e "\tallow hosts = $allow_hosts" >> /var/etc/cifsd.conf
|
||||||
|
[ -n "$deny_hosts" ] && echo -e "\tdeny hosts = $deny_hosts" >> /var/etc/cifsd.conf
|
||||||
|
[ -n "$users" ] && echo -e "\tvalid users = $users" >> /var/etc/cifsd.conf
|
||||||
|
[ -n "$invalid_users" ] && echo -e "\tinvalid users = $invalid_users" >> /var/etc/cifsd.conf
|
||||||
|
[ -n "$max_connections" ] && echo -e "\tmax connections = $max_connections" >> /var/etc/cifsd.conf
|
||||||
|
[ -n "$create_mask" ] && echo -e "\tcreate mask = $create_mask" >> /var/etc/cifsd.conf
|
||||||
|
[ -n "$dir_mask" ] && echo -e "\tdirectory mask = $dir_mask" >> /var/etc/cifsd.conf
|
||||||
|
|
||||||
|
if [ -n "$read_only" ]; then
|
||||||
|
echo -e "\tread only = $read_only" >> /var/etc/cifsd.conf
|
||||||
|
if [ "${read_only}" -eq "0" ]; then
|
||||||
|
echo -e "\twrite ok = 1" >> /var/etc/cifsd.conf
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo -e "\twrite ok = 1" >> /var/etc/cifsd.conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
[ -n "$veto_files" ] && echo -e "\tveto files = $veto_files" >> /var/etc/cifsd.conf
|
||||||
|
}
|
||||||
|
|
||||||
|
load_cifsd_users() {
|
||||||
|
local user
|
||||||
|
local password
|
||||||
|
local desc
|
||||||
|
|
||||||
|
validate_cifsd_users ${1}
|
||||||
|
[ $(which ${CIFS_ADMIN}) ] || {
|
||||||
|
logread -t ${0} "${CIFS_ADMIN} tools is not available"
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
cifsadmin -a "${user}" -p "${password}"
|
||||||
|
if [ "$?" -ne 0 ]; then
|
||||||
|
logread -t ${0} "Failed to create/update ${user}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
service_triggers()
|
||||||
|
{
|
||||||
|
procd_add_config_trigger "config.change" "cifsd" /etc/init.d/cifsd restart
|
||||||
|
}
|
||||||
|
|
||||||
|
init_config() {
|
||||||
|
[ -f "/var/etc/cifsd.conf" ] && rm /var/etc/cifsd.conf
|
||||||
|
|
||||||
|
config_load cifsd
|
||||||
|
load_cifsd_global
|
||||||
|
|
||||||
|
# Delete existing users
|
||||||
|
[ -f "${USER_DB}" ] && {
|
||||||
|
rm -f "${USER_DB}"
|
||||||
|
}
|
||||||
|
config_foreach load_cifsd_users users
|
||||||
|
config_foreach load_cifsd_share share
|
||||||
|
}
|
||||||
|
|
||||||
|
start_service() {
|
||||||
|
. /lib/functions.sh
|
||||||
|
init_config
|
||||||
|
|
||||||
|
[ ! "$(grep cifsd /proc/modules)" ] && modprobe cifsd
|
||||||
|
procd_open_instance
|
||||||
|
procd_set_param command /usr/bin/env LANG=en_US.UTF-8 $PROG -c /var/etc/cifsd.conf
|
||||||
|
procd_set_param respawn
|
||||||
|
procd_close_instance
|
||||||
|
}
|
||||||
|
|
||||||
|
stop_service() {
|
||||||
|
killall cifsd
|
||||||
|
# IPC timeout will kill the remaining processes.
|
||||||
|
}
|
||||||
73
cifsd/001-fix_implicit_declarations.patch
Normal file
73
cifsd/001-fix_implicit_declarations.patch
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
For some reason, fs.h on Inteno kernel is missing inode->i_mutex nesting subclasses for the lock validator
|
||||||
|
which is triggering implicit declaration error. To workaround this hardcore use of mutex_lock by removing
|
||||||
|
kernel version check.
|
||||||
|
---
|
||||||
|
--- a/vfs.c
|
||||||
|
+++ b/vfs.c
|
||||||
|
@@ -544,15 +544,9 @@ int cifsd_vfs_setattr(struct cifsd_work
|
||||||
|
|
||||||
|
attrs->ia_valid |= ATTR_CTIME;
|
||||||
|
|
||||||
|
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
|
||||||
|
- inode_lock(inode);
|
||||||
|
- err = notify_change(dentry, attrs, NULL);
|
||||||
|
- inode_unlock(inode);
|
||||||
|
-#else
|
||||||
|
mutex_lock(&inode->i_mutex);
|
||||||
|
err = notify_change(dentry, attrs, NULL);
|
||||||
|
mutex_unlock(&inode->i_mutex);
|
||||||
|
-#endif
|
||||||
|
|
||||||
|
if (update_size)
|
||||||
|
put_write_access(inode);
|
||||||
|
@@ -753,11 +747,8 @@ int cifsd_vfs_remove_file(char *name)
|
||||||
|
if (!dir->d_inode)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
|
||||||
|
- inode_lock_nested(dir->d_inode, I_MUTEX_PARENT);
|
||||||
|
-#else
|
||||||
|
mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
|
||||||
|
-#endif
|
||||||
|
+
|
||||||
|
dentry = lookup_one_len(last, dir, strlen(last));
|
||||||
|
if (IS_ERR(dentry)) {
|
||||||
|
err = PTR_ERR(dentry);
|
||||||
|
@@ -783,11 +774,7 @@ int cifsd_vfs_remove_file(char *name)
|
||||||
|
|
||||||
|
dput(dentry);
|
||||||
|
out_err:
|
||||||
|
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
|
||||||
|
- inode_unlock(dir->d_inode);
|
||||||
|
-#else
|
||||||
|
mutex_unlock(&dir->d_inode->i_mutex);
|
||||||
|
-#endif
|
||||||
|
out:
|
||||||
|
path_put(&parent);
|
||||||
|
return err;
|
||||||
|
@@ -1302,11 +1289,8 @@ int cifsd_vfs_unlink(struct dentry *dir,
|
||||||
|
int err = 0;
|
||||||
|
|
||||||
|
dget(dentry);
|
||||||
|
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
|
||||||
|
- inode_lock(dir->d_inode);
|
||||||
|
-#else
|
||||||
|
mutex_lock(&dir->d_inode->i_mutex);
|
||||||
|
-#endif
|
||||||
|
+
|
||||||
|
if (!dentry->d_inode || !dentry->d_inode->i_nlink) {
|
||||||
|
err = -ENOENT;
|
||||||
|
goto out;
|
||||||
|
@@ -1318,11 +1302,8 @@ int cifsd_vfs_unlink(struct dentry *dir,
|
||||||
|
err = vfs_unlink(dir->d_inode, dentry, NULL);
|
||||||
|
|
||||||
|
out:
|
||||||
|
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
|
||||||
|
- inode_unlock(dir->d_inode);
|
||||||
|
-#else
|
||||||
|
mutex_unlock(&dir->d_inode->i_mutex);
|
||||||
|
-#endif
|
||||||
|
+
|
||||||
|
dput(dentry);
|
||||||
|
if (err)
|
||||||
|
cifsd_debug("failed to delete, err %d\n", err);
|
||||||
60
cifsd/Makefile
Normal file
60
cifsd/Makefile
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
include $(INCLUDE_DIR)/kernel.mk
|
||||||
|
|
||||||
|
PKG_NAME:=cifsd
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
|
PKG_SOURCE_PROTO:=git
|
||||||
|
PKG_SOURCE_URL:=https://github.com/namjaejeon/cifsd.git
|
||||||
|
PKG_SOURCE_DATE:=2019-03-05
|
||||||
|
PKG_SOURCE_VERSION:=e1715ce125d55b125b1b58a6f1819ef8e54cc3ba
|
||||||
|
PKG_MIRROR_HASH:=521585ebfda0ecc02372b1a38ebf762fbbcead6d0b754a47599a5bf6bfdb3fb6
|
||||||
|
|
||||||
|
PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
|
||||||
|
PKG_LICENSE:=GPL-2.0
|
||||||
|
PKG_LICENSE_FILES:=COPYING
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
define KernelPackage/fs-cifsd
|
||||||
|
SUBMENU:=Filesystems
|
||||||
|
TITLE:=CIFS/SMB kernel server support
|
||||||
|
FILES:=$(PKG_BUILD_DIR)/cifsd.$(LINUX_KMOD_SUFFIX)
|
||||||
|
DEPENDS+= \
|
||||||
|
+kmod-nls-base \
|
||||||
|
+kmod-nls-utf8 \
|
||||||
|
+kmod-crypto-md4 \
|
||||||
|
+kmod-crypto-md5 \
|
||||||
|
+kmod-crypto-hmac \
|
||||||
|
+kmod-crypto-ecb \
|
||||||
|
+kmod-crypto-des \
|
||||||
|
+kmod-crypto-sha256 \
|
||||||
|
+kmod-crypto-cmac \
|
||||||
|
+kmod-crypto-sha512 \
|
||||||
|
+kmod-crypto-aead \
|
||||||
|
+kmod-crypto-ccm
|
||||||
|
KCONFIG:= \
|
||||||
|
CONFIG_KEYS=y \
|
||||||
|
CONFIG_CRYPTO_ARC4=y
|
||||||
|
endef
|
||||||
|
|
||||||
|
define KernelPackage/fs-cifsd/description
|
||||||
|
Kernel module for a CIFS/SMBv2,3 fileserver.
|
||||||
|
endef
|
||||||
|
|
||||||
|
TARGET_CFLAGS+= -DCONFIG_CIFSD_ACL
|
||||||
|
|
||||||
|
MAKE_OPTS:=\
|
||||||
|
ARCH="$(LINUX_KARCH)" \
|
||||||
|
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||||
|
M="$(PKG_BUILD_DIR)"
|
||||||
|
|
||||||
|
define Build/Compile
|
||||||
|
$(MAKE) -C "$(LINUX_DIR)" \
|
||||||
|
$(MAKE_OPTS) \
|
||||||
|
CFLAGS="$(TARGET_CFLAGS)" \
|
||||||
|
CONFIG_CIFS_SERVER=m \
|
||||||
|
modules
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call KernelPackage,fs-cifsd))
|
||||||
69
cifsd/patches/001-fix_implicit_declarations.patch
Normal file
69
cifsd/patches/001-fix_implicit_declarations.patch
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
--- a/vfs.c
|
||||||
|
+++ b/vfs.c
|
||||||
|
@@ -544,15 +544,9 @@ int cifsd_vfs_setattr(struct cifsd_work
|
||||||
|
|
||||||
|
attrs->ia_valid |= ATTR_CTIME;
|
||||||
|
|
||||||
|
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
|
||||||
|
- inode_lock(inode);
|
||||||
|
- err = notify_change(dentry, attrs, NULL);
|
||||||
|
- inode_unlock(inode);
|
||||||
|
-#else
|
||||||
|
mutex_lock(&inode->i_mutex);
|
||||||
|
err = notify_change(dentry, attrs, NULL);
|
||||||
|
mutex_unlock(&inode->i_mutex);
|
||||||
|
-#endif
|
||||||
|
|
||||||
|
if (update_size)
|
||||||
|
put_write_access(inode);
|
||||||
|
@@ -753,11 +747,8 @@ int cifsd_vfs_remove_file(char *name)
|
||||||
|
if (!dir->d_inode)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
|
||||||
|
- inode_lock_nested(dir->d_inode, I_MUTEX_PARENT);
|
||||||
|
-#else
|
||||||
|
mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
|
||||||
|
-#endif
|
||||||
|
+
|
||||||
|
dentry = lookup_one_len(last, dir, strlen(last));
|
||||||
|
if (IS_ERR(dentry)) {
|
||||||
|
err = PTR_ERR(dentry);
|
||||||
|
@@ -783,11 +774,7 @@ int cifsd_vfs_remove_file(char *name)
|
||||||
|
|
||||||
|
dput(dentry);
|
||||||
|
out_err:
|
||||||
|
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
|
||||||
|
- inode_unlock(dir->d_inode);
|
||||||
|
-#else
|
||||||
|
mutex_unlock(&dir->d_inode->i_mutex);
|
||||||
|
-#endif
|
||||||
|
out:
|
||||||
|
path_put(&parent);
|
||||||
|
return err;
|
||||||
|
@@ -1302,11 +1289,8 @@ int cifsd_vfs_unlink(struct dentry *dir,
|
||||||
|
int err = 0;
|
||||||
|
|
||||||
|
dget(dentry);
|
||||||
|
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
|
||||||
|
- inode_lock(dir->d_inode);
|
||||||
|
-#else
|
||||||
|
mutex_lock(&dir->d_inode->i_mutex);
|
||||||
|
-#endif
|
||||||
|
+
|
||||||
|
if (!dentry->d_inode || !dentry->d_inode->i_nlink) {
|
||||||
|
err = -ENOENT;
|
||||||
|
goto out;
|
||||||
|
@@ -1318,11 +1302,8 @@ int cifsd_vfs_unlink(struct dentry *dir,
|
||||||
|
err = vfs_unlink(dir->d_inode, dentry, NULL);
|
||||||
|
|
||||||
|
out:
|
||||||
|
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
|
||||||
|
- inode_unlock(dir->d_inode);
|
||||||
|
-#else
|
||||||
|
mutex_unlock(&dir->d_inode->i_mutex);
|
||||||
|
-#endif
|
||||||
|
+
|
||||||
|
dput(dentry);
|
||||||
|
if (err)
|
||||||
|
cifsd_debug("failed to delete, err %d\n", err);
|
||||||
40
crashlog/Makefile
Normal file
40
crashlog/Makefile
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2019 iopsys Software Solutions AB
|
||||||
|
#
|
||||||
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
|
# See /LICENSE for more information.
|
||||||
|
#
|
||||||
|
|
||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_NAME:=crashlog
|
||||||
|
PKG_VERSION:=1.0.0
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
PKG_LICENSE:=GPLv2
|
||||||
|
PKG_LICENSE_FILES:=none
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
define Package/crashlog
|
||||||
|
CATEGORY:=Utilities
|
||||||
|
TITLE:=Handling kernel crash logs
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/crashlog/description
|
||||||
|
Handling kernel crash logs.
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Prepare
|
||||||
|
mkdir -p $(PKG_BUILD_DIR)
|
||||||
|
$(CP) ./files/* $(PKG_BUILD_DIR)/
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Compile
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/crashlog/install
|
||||||
|
$(CP) ./files/* $(1)/
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call BuildPackage,crashlog))
|
||||||
BIN
crashlog/files/etc/dropbear/logid
Normal file
BIN
crashlog/files/etc/dropbear/logid
Normal file
Binary file not shown.
11
crashlog/files/etc/init.d/corelog
Executable file
11
crashlog/files/etc/init.d/corelog
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh /etc/rc.common
|
||||||
|
|
||||||
|
START=01
|
||||||
|
|
||||||
|
start()
|
||||||
|
{
|
||||||
|
if [ -e /proc/sys/kernel/core_pattern ]
|
||||||
|
then
|
||||||
|
echo "|/sbin/logcore %e %s" > /proc/sys/kernel/core_pattern
|
||||||
|
fi
|
||||||
|
}
|
||||||
55
crashlog/files/etc/init.d/crashlog
Executable file
55
crashlog/files/etc/init.d/crashlog
Executable file
@@ -0,0 +1,55 @@
|
|||||||
|
#!/bin/sh /etc/rc.common
|
||||||
|
|
||||||
|
START=99
|
||||||
|
|
||||||
|
send_log()
|
||||||
|
{
|
||||||
|
nr=$(db get hw.board.serial_number)
|
||||||
|
hw=$(db get hw.board.model_name)
|
||||||
|
fam=$(db get hw.board.iopVerFam)
|
||||||
|
sw=$(db get hw.board.iopVersion)
|
||||||
|
server=$(/sbin/uci get system.crashlog.server)
|
||||||
|
|
||||||
|
while true
|
||||||
|
do
|
||||||
|
scp -S /usr/sbin/logssh /proc/last_kmsg log@${server}:log/${fam}_${hw}_${sw}_${nr}
|
||||||
|
if [ $? == 0 ]
|
||||||
|
then
|
||||||
|
break;
|
||||||
|
fi
|
||||||
|
# wait for another minute then try again
|
||||||
|
sleep 60
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
fill_in_default()
|
||||||
|
{
|
||||||
|
/sbin/uci add system log
|
||||||
|
/sbin/uci rename system.@log[-1]=crashlog
|
||||||
|
/sbin/uci set system.crashlog.enable=no
|
||||||
|
/sbin/uci set system.crashlog.server="crashlog.iopsys.eu"
|
||||||
|
/sbin/uci commit
|
||||||
|
}
|
||||||
|
|
||||||
|
boot()
|
||||||
|
{
|
||||||
|
# is crashlog enabled ?
|
||||||
|
enable=$(/sbin/uci get system.crashlog.enable)
|
||||||
|
case $enable in
|
||||||
|
0|no|NO|false|FALSE)
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
"")
|
||||||
|
fill_in_default
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# is this boot a result from a crash ?
|
||||||
|
reason=$(cat /etc/boot_reason)
|
||||||
|
case $reason in
|
||||||
|
HW|WD)
|
||||||
|
send_log&
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
60
crashlog/files/sbin/logcore
Executable file
60
crashlog/files/sbin/logcore
Executable file
@@ -0,0 +1,60 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
TMP_CORE=/tmp/new_core
|
||||||
|
# first test if we can contact the log server.
|
||||||
|
# if not abort directly the core file takes up memory
|
||||||
|
alive()
|
||||||
|
{
|
||||||
|
ping -c1 $server
|
||||||
|
|
||||||
|
if [ $? != 0 ]
|
||||||
|
then
|
||||||
|
# drain core file from kernel
|
||||||
|
cat >/dev/null
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
fill_in_default()
|
||||||
|
{
|
||||||
|
/sbin/uci add system log
|
||||||
|
/sbin/uci rename system.@log[-1]=corelog
|
||||||
|
/sbin/uci set system.corelog.enable=no
|
||||||
|
/sbin/uci set system.corelog.server="corelog.iopsys.eu"
|
||||||
|
/sbin/uci commit
|
||||||
|
}
|
||||||
|
|
||||||
|
# is corelog enabled ?
|
||||||
|
enable=$(/sbin/uci get system.corelog.enable)
|
||||||
|
case $enable in
|
||||||
|
0|no|NO|false|FALSE)
|
||||||
|
# drain core file from kernel
|
||||||
|
cat >/dev/null
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
"")
|
||||||
|
fill_in_default
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
server=$(/sbin/uci get system.corelog.server)
|
||||||
|
|
||||||
|
alive
|
||||||
|
|
||||||
|
# dump out the core to disk we need this as scp needs a size before we send data
|
||||||
|
# and this is the only way to know how much data there is
|
||||||
|
cat >$TMP_CORE
|
||||||
|
|
||||||
|
# in case filesystem/memory is full at least kill the core in the kernel memory should give us some
|
||||||
|
# more memory to work with. normally this would do nothing.
|
||||||
|
cat >/dev/null
|
||||||
|
|
||||||
|
nr=$(db get hw.board.serial_number)
|
||||||
|
hw=$(db get hw.board.model_name)
|
||||||
|
fam=$(hw.board.iopVerFam)
|
||||||
|
sw=$(db get hw.board.iopVersion)
|
||||||
|
|
||||||
|
scp -S /usr/sbin/logssh $TMP_CORE log@${server}:log/core_${1}_${2}_${fam}_${hw}_${sw}_${nr}
|
||||||
|
rm $TMP_CORE
|
||||||
|
|
||||||
6
crashlog/files/usr/sbin/logssh
Executable file
6
crashlog/files/usr/sbin/logssh
Executable file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# we need to have the -y option to dropbear to not halt the scp when
|
||||||
|
# transfering the log file to a new server for the first time.
|
||||||
|
# since we already need this also put in the keyfile
|
||||||
|
|
||||||
|
ssh -y -i /etc/dropbear/logid $@
|
||||||
42
crashlog/readme
Normal file
42
crashlog/readme
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
Install scp server.
|
||||||
|
|
||||||
|
Create a user account on a server and make sure it's possible to login to it
|
||||||
|
using ssh.
|
||||||
|
|
||||||
|
For now the user has to be called "log"
|
||||||
|
|
||||||
|
USER is the user name of the account
|
||||||
|
HOME is the user home directory.
|
||||||
|
Both should be changed to the correct value in all following example commands.
|
||||||
|
|
||||||
|
create HOME/bin
|
||||||
|
Put scp_upload in HOME/bin
|
||||||
|
make it executable "chmod a+x HOME/bin/scp_upload"
|
||||||
|
|
||||||
|
create home/.ssh (observer the dot .shh)
|
||||||
|
|
||||||
|
create an empty file HOME/.ssh/authorized_keys
|
||||||
|
|
||||||
|
-------------------------------
|
||||||
|
Now everyhting is setup for use but we have not added any clients.
|
||||||
|
What we need is the public key for the clients.
|
||||||
|
|
||||||
|
For dropbear "dropbearkey -y -f files/etc/dropbear/logid" will generate the public key.
|
||||||
|
|
||||||
|
----------
|
||||||
|
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwn9RaDAzxW1dTmIhXgFBnpi1lhj8xhYpCVQiPxxdk9IEmH8zjo4y9j3sPkqKOlRnkwjpZIpLEKBnpQTwVIMCU/AG7nDJX3OH9RfS9mLJQLfFL8HyGCyqDezFWldbyovhJZvdUeK4tAXJWv2W3OVHiz2L8IlncBgP/E9DJElsyhhQHsM96UE6tBkXsvXkoDbMSYXFcLbgiUwBKfmM2BF/aPDL45iznGur7/2j9v95PwJ0gtMu9jjNRq+pXCXhTh3bsnczm0MpZC1aiRc9nJAeGIMmhrf15E4jBKgTnrstzJxGVAdajKeR954KcNsS33cS2Wmui2YjmPbBXjqf1frzJ log@inteno
|
||||||
|
----------
|
||||||
|
|
||||||
|
The public key should be just one line. Add that line to the
|
||||||
|
HOME/.ssh/authorized_keys file on the scp server. Then add the follwoing as
|
||||||
|
the first text on the same line. that is insert before the key data.
|
||||||
|
|
||||||
|
command="HOME/bin/scp_upload",no-port-forwarding,no-agent-forwarding,no-X11-forwarding
|
||||||
|
|
||||||
|
Do not forget to change HOME to the correct value for the server and there
|
||||||
|
should be one space separating the key data and the above text.
|
||||||
|
---------------------------------
|
||||||
|
Now test to make sure that you can upload new files, not download files
|
||||||
|
and not overwrite files from the client.
|
||||||
|
|
||||||
|
|
||||||
53
crashlog/scp_upload
Normal file
53
crashlog/scp_upload
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
# authorized_keys command="/home/boxi/my_scp",no-port-forwarding,no-agent-forwarding,no-X11-forwarding
|
||||||
|
|
||||||
|
val=`expr match "$SSH_ORIGINAL_COMMAND" "scp"`
|
||||||
|
if [ $val != 3 ]
|
||||||
|
then
|
||||||
|
echo "only scp is allowed for this rsa key"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
#strip out "scp" as getopts barf on anything not an option
|
||||||
|
|
||||||
|
args=${SSH_ORIGINAL_COMMAND:3}
|
||||||
|
|
||||||
|
# we must set args to positional paramters otherwise it's next to impossible
|
||||||
|
# to get to the rest of the line that is not arguments.
|
||||||
|
|
||||||
|
set -- $args
|
||||||
|
while getopts "rftdvpq" Option
|
||||||
|
do
|
||||||
|
case $Option in
|
||||||
|
r ) echo "recursive not allowed";exit 1;;
|
||||||
|
f ) echo "reading files not allowed";exit 1;;
|
||||||
|
t ) ;;
|
||||||
|
d ) ;;
|
||||||
|
v ) ;;
|
||||||
|
p ) ;;
|
||||||
|
q ) ;;
|
||||||
|
* ) ;; # Default.
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
shift $(($OPTIND - 1))
|
||||||
|
|
||||||
|
file="$*"
|
||||||
|
dir=$(dirname "$file")
|
||||||
|
|
||||||
|
if [ "$dir" != "log" ]
|
||||||
|
then
|
||||||
|
echo "only allowed to write to log/"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# try to create uniq files
|
||||||
|
EXTRA=$((0))
|
||||||
|
while [ -e "${file}_${EXTRA}" ]
|
||||||
|
do
|
||||||
|
EXTRA=$((EXTRA +1))
|
||||||
|
done
|
||||||
|
|
||||||
|
logger -t scp_upload "${SSH_ORIGINAL_COMMAND}_${EXTRA}"
|
||||||
|
|
||||||
|
exec ${SSH_ORIGINAL_COMMAND}_${EXTRA}
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
if PACKAGE_dectmngr
|
|
||||||
|
|
||||||
menu "Configuration"
|
|
||||||
|
|
||||||
config ENABLE_LINE_SETTINGS_EXTENSION
|
|
||||||
bool "Enable Line Settings List extension "
|
|
||||||
default y
|
|
||||||
|
|
||||||
endmenu
|
|
||||||
|
|
||||||
endif
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (C) 2021 IOPSYS Software Solutions AB
|
|
||||||
#
|
|
||||||
# This is free software, licensed under the GNU General Public License v2.
|
|
||||||
# See /LICENSE for more information.
|
|
||||||
#
|
|
||||||
include $(TOPDIR)/rules.mk
|
|
||||||
|
|
||||||
PKG_NAME:=dectmngr
|
|
||||||
PKG_RELEASE:=3
|
|
||||||
PKG_VERSION:=3.5.1
|
|
||||||
|
|
||||||
LOCAL_DEV=0
|
|
||||||
ifneq ($(LOCAL_DEV),1)
|
|
||||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
|
||||||
PKG_SOURCE_PROTO:=git
|
|
||||||
PKG_SOURCE_VERSION:=8c94908eb230dc453dd2f5575be6c06b086b2e7d
|
|
||||||
PKG_MIRROR_HASH:=skip
|
|
||||||
endif
|
|
||||||
|
|
||||||
PKG_LICENSE:=PROPRIETARY
|
|
||||||
PKG_LICENSE_FILES:=LICENSE
|
|
||||||
|
|
||||||
RSTRIP:=true
|
|
||||||
export BUILD_DIR
|
|
||||||
|
|
||||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
|
||||||
PKG_BUILD_PARALLEL:=1
|
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
|
||||||
|
|
||||||
define Package/$(PKG_NAME)
|
|
||||||
CATEGORY:=Utilities
|
|
||||||
TITLE:=DECT Manager
|
|
||||||
DEPENDS:= +libubox +ubus +uci +libxml2 +libjson-c
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/$(PKG_NAME)/description
|
|
||||||
DECT manager is a daemon that provides UBUS RPC objects and sends UBUS events for communication with the DECT chip.
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/$(PKG_NAME)/config
|
|
||||||
source "$(SOURCE)/Config.in"
|
|
||||||
endef
|
|
||||||
|
|
||||||
ifeq ($(LOCAL_DEV),1)
|
|
||||||
define Build/Prepare
|
|
||||||
rsync -av --exclude=.* ~/git/voip/dectmngr/* $(PKG_BUILD_DIR)/
|
|
||||||
endef
|
|
||||||
endif
|
|
||||||
|
|
||||||
TARGET_CFLAGS += \
|
|
||||||
-Wall \
|
|
||||||
-Werror \
|
|
||||||
-I$(STAGING_DIR)/usr/include/libxml2
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_ENABLE_LINE_SETTINGS_EXTENSION),y)
|
|
||||||
TARGET_CFLAGS += -DENABLE_LINE_SETTINGS_EXTENSION
|
|
||||||
endif
|
|
||||||
|
|
||||||
define Package/$(PKG_NAME)/install
|
|
||||||
$(INSTALL_DIR) $(1)/usr/sbin
|
|
||||||
$(INSTALL_DIR) $(1)/etc
|
|
||||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
|
||||||
|
|
||||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/app/dectmngr $(1)/usr/sbin/
|
|
||||||
$(STRIP) $(1)/usr/sbin/dectmngr
|
|
||||||
$(CP) ./files/etc/* $(1)/etc/
|
|
||||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/dect $(1)/lib/upgrade/keep.d/dect
|
|
||||||
endef
|
|
||||||
|
|
||||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
config dect 'global'
|
|
||||||
option log_dect_cmbs 'syslog'
|
|
||||||
option log_level 'realtime,warning,error'
|
|
||||||
Binary file not shown.
@@ -1,96 +0,0 @@
|
|||||||
#!/bin/sh /etc/rc.common
|
|
||||||
|
|
||||||
source /lib/functions/uci-defaults.sh
|
|
||||||
|
|
||||||
START=70
|
|
||||||
STOP=12
|
|
||||||
|
|
||||||
USE_PROCD=1
|
|
||||||
NAME=dectmngr
|
|
||||||
PROG=/usr/sbin/dectmngr
|
|
||||||
LOG_PATH=/var/log/dectmngr
|
|
||||||
DB_PATH=/etc/dect
|
|
||||||
|
|
||||||
# Ask dectmngr to exit nicely and wait for it to clean up, which is a slow process.
|
|
||||||
stop_and_wait_dectmngr() {
|
|
||||||
pidof $NAME && killall -q $NAME
|
|
||||||
|
|
||||||
pidof $NAME && sleep 2 # wait for the process to stop gracefully
|
|
||||||
while pidof $NAME; do
|
|
||||||
killall -q -9 $NAME
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
start_service() {
|
|
||||||
local opt_ext=
|
|
||||||
local rfpi=
|
|
||||||
local model_id=
|
|
||||||
local rxtun=
|
|
||||||
|
|
||||||
test $(db get hw.board.hasDect) = "0" && return
|
|
||||||
|
|
||||||
echo 1 > /sys/class/gpio/gpio14/value
|
|
||||||
|
|
||||||
rfpi=$(db -q get hw.board.dect_rfpi)
|
|
||||||
[ -n "$rfpi" -a ${#rfpi} -eq 14 ] && opt_ext="$opt_ext -rfpi $rfpi"
|
|
||||||
|
|
||||||
model_id=$(db -q get hw.board.dect_model_id)
|
|
||||||
[ -n "$model_id" -a ${#model_id} -eq 8 ] || {
|
|
||||||
echo "Invalid hw.board.dect_model_id:$model_id. Set to 30.3B.06"
|
|
||||||
model_id="30.3B.06"
|
|
||||||
}
|
|
||||||
opt_ext="$opt_ext -model $model_id"
|
|
||||||
|
|
||||||
rxtun=$(db -q get hw.board.dect_rxtun)
|
|
||||||
[ -n "$rxtun" -a ${#rxtun} -eq 2 ] && opt_ext="$opt_ext -rxtun $rxtun"
|
|
||||||
|
|
||||||
config_load dect
|
|
||||||
config_get log_dect_cmbs global log_dect_cmbs syslog
|
|
||||||
|
|
||||||
procd_open_instance
|
|
||||||
if [ "$log_dect_cmbs" = "none" ]; then
|
|
||||||
echo "Starting dectmngr with cmbs logging disabled"
|
|
||||||
procd_set_param command $PROG -comname ttyH0 $opt_ext
|
|
||||||
rm -f $LOG_PATH/*
|
|
||||||
elif [ "$log_dect_cmbs" = "file" ]; then
|
|
||||||
echo "Starting dectmngr with cmbs logging enabled to file"
|
|
||||||
procd_set_param command $PROG -comname ttyH0 -log $LOG_PATH/dect-cmbs.log $opt_ext
|
|
||||||
else
|
|
||||||
echo "Starting dectmngr with cmbs logging enabled to syslog"
|
|
||||||
procd_set_param command $PROG -comname ttyH0 -syslog $opt_ext
|
|
||||||
rm -f $LOG_PATH/*
|
|
||||||
fi
|
|
||||||
|
|
||||||
procd_set_param respawn 6 2 3
|
|
||||||
procd_set_param term_timeout 20
|
|
||||||
procd_set_param triggers asterisk
|
|
||||||
procd_close_instance
|
|
||||||
}
|
|
||||||
|
|
||||||
stop_service() {
|
|
||||||
test $(db get hw.board.hasDect) = "0" && return
|
|
||||||
|
|
||||||
echo 0 > /sys/class/gpio/gpio14/value
|
|
||||||
stop_and_wait_dectmngr
|
|
||||||
}
|
|
||||||
|
|
||||||
reload_service() {
|
|
||||||
ubus call dect reload
|
|
||||||
}
|
|
||||||
|
|
||||||
service_triggers()
|
|
||||||
{
|
|
||||||
procd_add_config_trigger "config.change" "asterisk" /etc/init.d/dectmngr restart
|
|
||||||
procd_add_config_trigger "config.change" "dect" /etc/init.d/dectmngr reload
|
|
||||||
}
|
|
||||||
|
|
||||||
boot() {
|
|
||||||
echo 14 > /sys/class/gpio/export
|
|
||||||
echo out > /sys/class/gpio/gpio14/direction
|
|
||||||
|
|
||||||
[ ! -d $LOG_PATH ] && mkdir -p $LOG_PATH
|
|
||||||
[ ! -d $DB_PATH ] && mkdir -p $DB_PATH
|
|
||||||
start
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/etc/dect/LA_DB
|
|
||||||
56
dectmngr2/Makefile
Normal file
56
dectmngr2/Makefile
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2019 iopsys Software Solutions AB
|
||||||
|
#
|
||||||
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
|
# See /LICENSE for more information.
|
||||||
|
#
|
||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
PKG_VERSION:=1.3.0
|
||||||
|
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||||
|
PKG_SOURCE_PROTO:=git
|
||||||
|
PKG_SOURCE_VERSION:=2c8990fd5275d469e8ab6c7a99e17fe0a56052ea
|
||||||
|
PKG_NAME:=dectmngr2
|
||||||
|
|
||||||
|
PKG_LICENSE:=GPLv2
|
||||||
|
PKG_LICENSE_FILES:=LICENSE
|
||||||
|
|
||||||
|
export BUILD_DIR
|
||||||
|
|
||||||
|
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||||
|
|
||||||
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||||
|
PKG_BUILD_PARALLEL:=1
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
define Package/dectmngr2
|
||||||
|
CATEGORY:=Utilities
|
||||||
|
TITLE:=Dectmngr2
|
||||||
|
URL:=
|
||||||
|
DEPENDS:= +natalie-dect-h bcmkernel +libubox +ubus +libpicoevent endptmngr
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/dectmngr2/description
|
||||||
|
Dectmngr2
|
||||||
|
endef
|
||||||
|
|
||||||
|
|
||||||
|
define Package/dectmngr2/install
|
||||||
|
$(INSTALL_DIR) $(1)/usr/sbin
|
||||||
|
$(INSTALL_DIR) $(1)/etc/dect/
|
||||||
|
$(INSTALL_DIR) $(1)/etc/config/
|
||||||
|
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||||
|
$(INSTALL_DIR) $(1)/etc/uci-defaults/
|
||||||
|
|
||||||
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dectmngr2 $(1)/usr/sbin/
|
||||||
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/target.bin $(1)/etc/dect/
|
||||||
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/nvs_default $(1)/etc/dect/
|
||||||
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/dect $(1)/etc/init.d/
|
||||||
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/dectmngr-wrapper.sh $(1)/usr/sbin/
|
||||||
|
$(CP) ./files/dect.config $(1)/etc/config/dect
|
||||||
|
$(CP) ./files/etc/uci-defaults/* $(1)/etc/uci-defaults/
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call BuildPackage,dectmngr2))
|
||||||
4
dectmngr2/files/dect.config
Normal file
4
dectmngr2/files/dect.config
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
config dect 'dect'
|
||||||
|
option radio 'auto'
|
||||||
|
|
||||||
23
dectmngr2/files/etc/uci-defaults/22-dect-defaults
Executable file
23
dectmngr2/files/etc/uci-defaults/22-dect-defaults
Executable file
@@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
|
||||||
|
# Workaround for product DG400 which has an
|
||||||
|
# incorrect value in nvram from factory.
|
||||||
|
|
||||||
|
if [ -e "/proc/nvram/BoardId" ]; then
|
||||||
|
boardid=$(cat /proc/nvram/BoardId)
|
||||||
|
ulBoardStuffOption=$(cat /proc/nvram/ulBoardStuffOption)
|
||||||
|
|
||||||
|
if [ "$boardid" = "DG400R0" -a "$ulBoardStuffOption" = "0xffffffff" ]; then
|
||||||
|
echo "0xfffffff2" >/proc/nvram/ulBoardStuffOption
|
||||||
|
|
||||||
|
db -q batch <<-EOT
|
||||||
|
set hw.board.has_dect=1
|
||||||
|
commit hw.board
|
||||||
|
EOT
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
@@ -8,15 +8,14 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=dslmngr
|
PKG_NAME:=dslmngr
|
||||||
PKG_VERSION:=1.1.2
|
PKG_VERSION:=1.0.1
|
||||||
|
|
||||||
LOCAL_DEV=0
|
LOCAL_DEV=0
|
||||||
ifneq ($(LOCAL_DEV),1)
|
ifneq ($(LOCAL_DEV),1)
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_VERSION:=bb754ae620a9fc66fd6fc0745f0fead0708c7a17
|
PKG_SOURCE_VERSION:=63525fe43aa57a710bb097e4c0ed496c4032db6d
|
||||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dslmngr.git
|
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dslmngr.git
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||||
PKG_MIRROR_HASH:=skip
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||||
@@ -26,8 +25,16 @@ PKG_LICENSE_FILES:=LICENSE
|
|||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_mips),y)
|
||||||
TARGET_PLATFORM=BROADCOM
|
TARGET_PLATFORM=BROADCOM
|
||||||
|
else ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
||||||
|
TARGET_PLATFORM=BROADCOM
|
||||||
|
else ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
|
||||||
|
TARGET_PLATFORM=MEDIATEK
|
||||||
|
else ifeq ($(CONFIG_TARGET_iopsys_linksys),y)
|
||||||
|
TARGET_PLATFORM=MARVELL
|
||||||
|
else ifeq ($(CONFIG_TARGET_intel_mips),y)
|
||||||
|
TARGET_PLATFORM=INTEL
|
||||||
else
|
else
|
||||||
$(info Unexpected CONFIG_TARGET)
|
$(info Unexpected CONFIG_TARGET)
|
||||||
endif
|
endif
|
||||||
@@ -38,7 +45,7 @@ define Package/dslmngr
|
|||||||
SECTION:=utils
|
SECTION:=utils
|
||||||
CATEGORY:=Utilities
|
CATEGORY:=Utilities
|
||||||
TITLE:=XDSL status and configration utility
|
TITLE:=XDSL status and configration utility
|
||||||
DEPENDS:=+libdsl +libuci +libubox +ubus +libpthread +libnl-genl +libeasy
|
DEPENDS:=+libdsl +libuci +libubox +ubus +libpthread +libnl-genl
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/dslmngr/description
|
define Package/dslmngr/description
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ define Package/easy-qos
|
|||||||
SECTION:=net
|
SECTION:=net
|
||||||
CATEGORY:=Network
|
CATEGORY:=Network
|
||||||
TITLE:=Easy QoS
|
TITLE:=Easy QoS
|
||||||
DEPENDS:=@TARGET_iopsys_brcm63xx_arm
|
DEPENDS:=@(TARGET_intel_mips||TARGET_iopsys_brcm63xx_arm||TARGET_iopsys_brcm63xx_mips)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/easy-qos/description
|
define Package/easy-qos/description
|
||||||
@@ -39,7 +39,11 @@ define Package/easy-qos/install
|
|||||||
$(INSTALL_DIR) $(1)/etc/init.d
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||||
$(CP) ./files/etc/config/easy_qos $(1)/etc/config/
|
$(CP) ./files/etc/config/easy_qos $(1)/etc/config/
|
||||||
|
ifeq ($(CONFIG_TARGET_intel_mips),y)
|
||||||
|
$(CP) ./files/etc/init.d/easy_qos.classcfg $(1)/etc/init.d/easy_qos
|
||||||
|
else
|
||||||
$(CP) ./files/etc/init.d/easy_qos.iptables $(1)/etc/init.d/easy_qos
|
$(CP) ./files/etc/init.d/easy_qos.iptables $(1)/etc/init.d/easy_qos
|
||||||
|
endif
|
||||||
$(CP) ./files/etc/uci-defaults/* $(1)/etc/uci-defaults/
|
$(CP) ./files/etc/uci-defaults/* $(1)/etc/uci-defaults/
|
||||||
$(CP) ./files/etc/firewall.easyqos $(1)/etc/firewall.easyqos
|
$(CP) ./files/etc/firewall.easyqos $(1)/etc/firewall.easyqos
|
||||||
endef
|
endef
|
||||||
|
|||||||
301
easy-qos/files/etc/init.d/easy_qos.classcfg
Executable file
301
easy-qos/files/etc/init.d/easy_qos.classcfg
Executable file
@@ -0,0 +1,301 @@
|
|||||||
|
#!/bin/sh /etc/rc.common
|
||||||
|
|
||||||
|
START=99
|
||||||
|
USE_PROCD=1
|
||||||
|
|
||||||
|
RULE_LIST="/tmp/easy_qos_rule.list"
|
||||||
|
CLIENT_LIST="/tmp/easy_qos_class_client.list"
|
||||||
|
BRIDGE_INTF=""
|
||||||
|
|
||||||
|
[ -f /etc/profile.d/intel.sh ] && {
|
||||||
|
. /etc/profile.d/intel.sh
|
||||||
|
sh /etc/profile.d/intel.sh
|
||||||
|
}
|
||||||
|
|
||||||
|
log() {
|
||||||
|
echo "${@}"|logger -t easy_qos_class -p debug
|
||||||
|
}
|
||||||
|
|
||||||
|
exec_log() {
|
||||||
|
${@}
|
||||||
|
if [ "${?}" -ne 0 ]; then
|
||||||
|
log "Failed to create ${@}";
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
exec_class_log() {
|
||||||
|
${@} |grep -i successful
|
||||||
|
if [ "${?}" -ne 0 ]; then
|
||||||
|
log "Failed to create ${@}";
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
get_priority() {
|
||||||
|
local prio=$(echo $1|tr [A-Z] [a-z]);
|
||||||
|
case "${prio}" in
|
||||||
|
"lowest")
|
||||||
|
echo 8;;
|
||||||
|
"low")
|
||||||
|
echo 7;;
|
||||||
|
"besteffort")
|
||||||
|
echo 6;;
|
||||||
|
"normal")
|
||||||
|
echo 5;;
|
||||||
|
"video")
|
||||||
|
echo 4;;
|
||||||
|
"medium")
|
||||||
|
echo 3;;
|
||||||
|
"high")
|
||||||
|
echo 2;;
|
||||||
|
"highest")
|
||||||
|
echo 1;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
get_mark() {
|
||||||
|
local prio=$(echo $1|tr [A-Z] [a-z]);
|
||||||
|
case "${prio}" in
|
||||||
|
"lowest")
|
||||||
|
echo "0x41/0x3df";;
|
||||||
|
"low")
|
||||||
|
echo "0x82/0x3df";;
|
||||||
|
"besteffort")
|
||||||
|
echo "0xc3/0x3df";;
|
||||||
|
"normal")
|
||||||
|
echo "0x104/0x3df";;
|
||||||
|
"video")
|
||||||
|
echo "0x145/0x3df";;
|
||||||
|
"medium")
|
||||||
|
echo "0x186/0x3df";;
|
||||||
|
"high")
|
||||||
|
echo "0x1c7/0x3df";;
|
||||||
|
"highest")
|
||||||
|
echo "0x208/0x3df";;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
clean_client_entries() {
|
||||||
|
[ -f ${CLIENT_LIST} ] && rm ${CLIENT_LIST}
|
||||||
|
}
|
||||||
|
|
||||||
|
map_client_entries() {
|
||||||
|
local clients ip mac host
|
||||||
|
|
||||||
|
json_load "$(ubus call router.network 'clients')"
|
||||||
|
json_get_keys keys
|
||||||
|
|
||||||
|
for key in ${keys};
|
||||||
|
do
|
||||||
|
json_select ${key}
|
||||||
|
json_get_vars ipaddr macaddr hostname
|
||||||
|
clients="${macaddr} ${ipaddr} ${hostname};${clients}"
|
||||||
|
json_select ..
|
||||||
|
done
|
||||||
|
|
||||||
|
json_init
|
||||||
|
|
||||||
|
IFS=";"
|
||||||
|
for client in ${clients};
|
||||||
|
do
|
||||||
|
macaddr=$(echo ${client} | cut -d" " -f1)
|
||||||
|
json_add_object "${macaddr//:/_}"
|
||||||
|
json_add_string "ip" "$(echo ${client} | cut -d" " -f2)"
|
||||||
|
json_add_string "macaddr" "$(echo ${client} | cut -d" " -f1)"
|
||||||
|
json_add_string "host" "$(echo ${client} | cut -d" " -f3)"
|
||||||
|
json_close_object
|
||||||
|
done
|
||||||
|
|
||||||
|
IFS=' '
|
||||||
|
echo `json_dump` > ${CLIENT_LIST}
|
||||||
|
json_cleanup
|
||||||
|
}
|
||||||
|
|
||||||
|
# Find the IP of a corresponding mac from arp table
|
||||||
|
get_ipaddress() {
|
||||||
|
local clients ip mac host
|
||||||
|
|
||||||
|
json_load "$(cat ${CLIENT_LIST})"
|
||||||
|
json_get_keys keys
|
||||||
|
|
||||||
|
# jshn seems a bit iffy on having : in key, replace by _
|
||||||
|
json_select "${1//:/_}" 2 > /dev/null
|
||||||
|
json_get_var ip ip
|
||||||
|
|
||||||
|
echo "$ip"
|
||||||
|
}
|
||||||
|
|
||||||
|
check_and_create() {
|
||||||
|
iptables -t mangle -C PREROUTING ${@} 2>/dev/null
|
||||||
|
# Create rule if not exists
|
||||||
|
if [ ${?} -ne 0 ]; then
|
||||||
|
exec_log iptables -t mangle -A PREROUTING ${@}
|
||||||
|
else
|
||||||
|
log "Rule exists for ${@}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
create_ip_rule() {
|
||||||
|
local proto=$1; shift
|
||||||
|
local src_ip=$1; shift
|
||||||
|
local mark=$1; shift
|
||||||
|
local ports=$1;
|
||||||
|
local cmd="";
|
||||||
|
|
||||||
|
cmd="-j EXTMARK --set-mark ${mark}";
|
||||||
|
if [ "${proto}" != "icmp" ]; then
|
||||||
|
if [ -n "${ports}" ]; then
|
||||||
|
cmd="--match multiport --dports ${ports} ${cmd}";
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${proto}" == "icmp" ]; then
|
||||||
|
cmd="-p icmp -m icmp --icmp-type 8 $cmd"
|
||||||
|
elif [ "${proto}" == "all" ]; then
|
||||||
|
cmd="-p all $cmd"
|
||||||
|
else
|
||||||
|
cmd="-p ${proto} -m ${proto} $cmd"
|
||||||
|
fi
|
||||||
|
cmd="-s ${src_ip} $cmd"
|
||||||
|
|
||||||
|
check_and_create ${cmd}
|
||||||
|
}
|
||||||
|
|
||||||
|
is_lan_bridge() {
|
||||||
|
local _section=$1
|
||||||
|
local _type
|
||||||
|
local _is_lan
|
||||||
|
|
||||||
|
config_get _type "$section" "type"
|
||||||
|
config_get _is_lan "$section" "is_lan"
|
||||||
|
|
||||||
|
if [ "${_type}" == "bridge" -a "${_is_lan}" == "1" ]; then
|
||||||
|
BRIDGE_INTF="br-${_section}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
get_bridge_interface() {
|
||||||
|
config_load network
|
||||||
|
config_foreach is_lan_bridge interface
|
||||||
|
}
|
||||||
|
|
||||||
|
validate_rule_section()
|
||||||
|
{
|
||||||
|
uci_validate_section easy_qos rule "${1}" \
|
||||||
|
'priority:string' \
|
||||||
|
'macaddr:string' \
|
||||||
|
'proto:string:none' \
|
||||||
|
'port:list(uinteger)' \
|
||||||
|
'comment:string:none'
|
||||||
|
}
|
||||||
|
|
||||||
|
# Clear existing rules before applying new rules
|
||||||
|
clear_existing_rules() {
|
||||||
|
# execute the delete rules written onto a file then delete the file
|
||||||
|
[ -f ${RULE_LIST} ] || return 0
|
||||||
|
|
||||||
|
while read line
|
||||||
|
do
|
||||||
|
log "Deleting old classification rules"
|
||||||
|
exec_class_log classcfg -D ${line} -i ${BRIDGE_INTF}
|
||||||
|
done <${RULE_LIST}
|
||||||
|
|
||||||
|
local rule=$(iptables -t mangle -S PREROUTING|grep -m 1 EXTMARK |sed 's/-A/-D/1')
|
||||||
|
while [ -n "${rule}" ]; do
|
||||||
|
exec_log iptables -t mangle ${rule}
|
||||||
|
rule=$(iptables -t mangle -S PREROUTING|grep -m 1 EXTMARK |sed 's/-A/-D/1')
|
||||||
|
done
|
||||||
|
sync
|
||||||
|
|
||||||
|
[ -f ${RULE_LIST} ] && rm ${RULE_LIST}
|
||||||
|
}
|
||||||
|
|
||||||
|
# classcfg -M local_dhcp -i lo -p udp --dport 67:67 --dport 68:68 -j mark --mark 1
|
||||||
|
create_rule() {
|
||||||
|
local proto=$1; shift
|
||||||
|
local mac_addr=$1; shift
|
||||||
|
local mark=$1; shift
|
||||||
|
local ports=$1;
|
||||||
|
local cmd="";
|
||||||
|
# Rule name is uniqe, so we take hash of all the input as rule_name
|
||||||
|
local rule_name="$(echo ${mac_addr}${proto}${mark}${ports} |md5sum |head -c 30)"
|
||||||
|
|
||||||
|
cmd="-j mark --mark ${mark}";
|
||||||
|
|
||||||
|
if [ "${mac_addr}" != "none" ]; then
|
||||||
|
cmd="--smac ${mac_addr} ${cmd}";
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${proto}" != "icmp" ]; then
|
||||||
|
if [ "${ports}" != "none" ]; then
|
||||||
|
IFS=","
|
||||||
|
for port in ${ports};
|
||||||
|
do
|
||||||
|
cmd="--dport ${port}:${port} ${cmd}";
|
||||||
|
done
|
||||||
|
IFS=' '
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ "${proto}" != "none" ]; then
|
||||||
|
cmd="-p ${proto} $cmd"
|
||||||
|
fi
|
||||||
|
cmd="-i ${BRIDGE_INTF} $cmd"
|
||||||
|
cmd="-A ${rule_name} $cmd"
|
||||||
|
|
||||||
|
# Store the rule_names for cleanup on reload
|
||||||
|
exec_class_log classcfg ${cmd}
|
||||||
|
[ $? -eq 0 ] && \
|
||||||
|
echo ${rule_name} >> ${RULE_LIST}
|
||||||
|
}
|
||||||
|
|
||||||
|
manage_rule() {
|
||||||
|
local cfg="$1"
|
||||||
|
local priority macaddr proto port comment prio_num port_list ip ipmark
|
||||||
|
|
||||||
|
validate_rule_section "${1}" || {
|
||||||
|
log "Validation of section failed"
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
prio_num=$(get_priority ${priority})
|
||||||
|
port_list=$(echo ${port}|sed 's/ /,/g')
|
||||||
|
ipmark=$(get_mark ${priority})
|
||||||
|
ip=$(get_ipaddress ${macaddr})
|
||||||
|
|
||||||
|
if [ -n "${prio_num}" ]; then
|
||||||
|
if [ "${proto}" == "none" -o "${proto}" == "tcpudp" ]; then
|
||||||
|
create_rule tcp ${macaddr} ${prio_num} ${port_list}
|
||||||
|
create_rule udp ${macaddr} ${prio_num} ${port_list}
|
||||||
|
if [ -n "${ip}" ]; then
|
||||||
|
create_ip_rule tcp ${ip} ${ipmark} ${port_list}
|
||||||
|
create_ip_rule udp ${ip} ${ipmark} ${port_list}
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
create_rule ${proto} ${macaddr} ${prio_num} ${port_list}
|
||||||
|
if [ -n "${ip}" ]; then
|
||||||
|
create_ip_rule ${proto} ${ip} ${ipmark} ${port_list}
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
reload_service() {
|
||||||
|
get_bridge_interface
|
||||||
|
map_client_entries
|
||||||
|
clear_existing_rules
|
||||||
|
config_load easy_qos
|
||||||
|
config_foreach manage_rule rule
|
||||||
|
clean_client_entries
|
||||||
|
}
|
||||||
|
|
||||||
|
start_service() {
|
||||||
|
[ -x /opt/intel/usr/sbin/classcfg ] || exit 0
|
||||||
|
reload_service
|
||||||
|
log "Easy QoS class installed"
|
||||||
|
}
|
||||||
|
|
||||||
|
service_triggers() {
|
||||||
|
procd_add_reload_trigger "easy_qos" "network"
|
||||||
|
}
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ exec_log() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get_priority() {
|
get_priority() {
|
||||||
local prio=$(echo $1|tr 'A-Z' 'a-z');
|
local prio=$(echo $1|tr [A-Z] [a-z]);
|
||||||
case "${prio}" in
|
case "${prio}" in
|
||||||
"lowest")
|
"lowest")
|
||||||
echo 0;;
|
echo 0;;
|
||||||
@@ -98,7 +98,7 @@ manage_rule() {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
protocol=$(echo ${proto}|tr 'A-Z' 'a-z')
|
protocol=$(echo ${proto}|tr [A-Z] [a-z])
|
||||||
prio_num=$(get_priority ${priority})
|
prio_num=$(get_priority ${priority})
|
||||||
if [ -n "${macaddr}" -a -n "${prio_num}" ]; then
|
if [ -n "${macaddr}" -a -n "${prio_num}" ]; then
|
||||||
for p in ${port}; do
|
for p in ${port}; do
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ exec_log() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get_priority() {
|
get_priority() {
|
||||||
local prio=$(echo $1|tr 'A-Z' 'a-z');
|
local prio=$(echo $1|tr [A-Z] [a-z]);
|
||||||
case "${prio}" in
|
case "${prio}" in
|
||||||
"lowest")
|
"lowest")
|
||||||
echo 0;;
|
echo 0;;
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ PKG_SOURCE_PROTO:=git
|
|||||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/easy-soc-events.git
|
PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/easy-soc-events.git
|
||||||
PKG_SOURCE_VERSION:=5c582b0165b574dc94e4865f82e0bb91fa561754
|
PKG_SOURCE_VERSION:=5c582b0165b574dc94e4865f82e0bb91fa561754
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||||
PKG_MIRROR_HASH:=skip
|
|
||||||
PKG_BUILD_DIR:=$(BUILD_DIR)/easy-soc-events-$(PKG_VERSION)
|
PKG_BUILD_DIR:=$(BUILD_DIR)/easy-soc-events-$(PKG_VERSION)
|
||||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,23 @@
|
|||||||
# libeasy configuration
|
if (PACKAGE_libwifi || PACKAGE_libdsl || PACKAGE_libethernet)
|
||||||
|
menu "configurations"
|
||||||
|
|
||||||
config LIBWIFI_USE_CTRL_IFACE
|
config IOP_LLA_LIBS_DEBUG
|
||||||
bool "Use UNIX sockets"
|
bool "Enable debugging support"
|
||||||
default n
|
default n
|
||||||
|
|
||||||
|
config LIBWIFI_DEBUG
|
||||||
|
depends on PACKAGE_libwifi
|
||||||
|
bool "Enable wifi debugging"
|
||||||
|
default n
|
||||||
|
|
||||||
|
config LIBDSL_DEBUG
|
||||||
|
depends on PACKAGE_libdsl
|
||||||
|
bool "Enable xdsl debugging"
|
||||||
|
default n
|
||||||
|
|
||||||
|
config LIBDSL_TEST
|
||||||
|
depends on PACKAGE_libdsl
|
||||||
|
bool "Libdsl test program"
|
||||||
|
default n
|
||||||
|
endmenu
|
||||||
|
endif
|
||||||
|
|||||||
@@ -7,17 +7,16 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=easy-soc-libs
|
PKG_NAME:=easy-soc-libs
|
||||||
PKG_VERSION:=6.4.44
|
PKG_VERSION:=3.3.12
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
LOCAL_DEV=0
|
LOCAL_DEV=0
|
||||||
ifneq ($(LOCAL_DEV),1)
|
ifneq ($(LOCAL_DEV),1)
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_VERSION:=e4f811b7cd2836cdcce5ea0f97f515a317da5bc3
|
PKG_SOURCE_VERSION:=f508577fae01c4820fad884a5a0847d26104721c
|
||||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/easy-soc-libs.git
|
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/easy-soc-libs.git
|
||||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||||
PKG_MIRROR_HASH:=skip
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||||
@@ -30,21 +29,61 @@ include $(INCLUDE_DIR)/package.mk
|
|||||||
define Package/easy-soc-libs
|
define Package/easy-soc-libs
|
||||||
SECTION:=libs
|
SECTION:=libs
|
||||||
CATEGORY:=Libraries
|
CATEGORY:=Libraries
|
||||||
TITLE:=IOPSYS Easy SoC libraries
|
TITLE:=IOPSYS easy SoC libraries
|
||||||
SUBMENU:=IOPSYS Easy SoC libraries
|
SUBMENU:=IOPSYS easy SoC libraries
|
||||||
DEPENDS:=+libopenssl
|
DEPENDS:=+libopenssl
|
||||||
MENU:=1
|
MENU:=1
|
||||||
endef
|
endef
|
||||||
|
|
||||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
define Package/libwifi/config
|
||||||
|
source "$(SOURCE)/Config.in"
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/libeasy
|
||||||
|
$(call Package/easy-soc-libs)
|
||||||
|
TITLE:= Common helper functions library (libeasy)
|
||||||
|
DEPENDS+=+libnl +libnl-route
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/libwifi
|
||||||
|
$(call Package/easy-soc-libs)
|
||||||
|
TITLE:= WiFi library (libwifi)
|
||||||
|
DEPENDS+=+libnl +libnl-route +libeasy
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/libethernet
|
||||||
|
$(call Package/easy-soc-libs)
|
||||||
|
TITLE:= Ethernet library (libethernet)
|
||||||
|
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_iopsys_ramips:swconfig
|
||||||
|
endef
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_mips),y)
|
||||||
TARGET_PLATFORM=BROADCOM
|
TARGET_PLATFORM=BROADCOM
|
||||||
CHIP_ID=$(patsubst "%",%,$(CONFIG_BCM_CHIP_ID))
|
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCONFIG_BCM963138 \
|
||||||
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCHIP_$(CHIP_ID) -DCONFIG_BCM9$(CHIP_ID) \
|
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx
|
||||||
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
|
KERNEL_DIR:=$(BUILD_DIR)/bcmkernel/bcm963xx
|
||||||
-I$(STAGING_DIR)/usr/include/bcm963xx/userspace/public/include
|
else ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
||||||
|
TARGET_PLATFORM=BROADCOM
|
||||||
|
TARGET_CFLAGS +=-DIOPSYS_BROADCOM \
|
||||||
|
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx
|
||||||
|
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm_panther),y)
|
||||||
|
TARGET_CFLAGS +=-DCONFIG_BCM96846
|
||||||
|
else ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm_tiger),y)
|
||||||
|
TARGET_CFLAGS +=-DCONFIG_BCM96858
|
||||||
|
else ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm_eagle),y)
|
||||||
|
TARGET_CFLAGS +=-DCONFIG_BCM963178
|
||||||
|
else
|
||||||
|
TARGET_CFLAGS +=-DCONFIG_BCM963138
|
||||||
|
endif
|
||||||
else ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
|
else ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
|
||||||
TARGET_PLATFORM=MEDIATEK
|
TARGET_PLATFORM=MEDIATEK
|
||||||
TARGET_CFLAGS +=-DIOPSYS_MEDIATEK
|
TARGET_CFLAGS +=-DIOPSYS_MEDIATEK
|
||||||
|
else ifeq ($(CONFIG_TARGET_iopsys_linksys),y)
|
||||||
|
TARGET_PLATFORM=MARVELL
|
||||||
|
TARGET_CFLAGS +=-DIOPSYS_MARVELL
|
||||||
|
else ifeq ($(CONFIG_TARGET_intel_mips),y)
|
||||||
|
TARGET_PLATFORM=INTEL
|
||||||
|
TARGET_CFLAGS +=-DIOPSYS_INTEL
|
||||||
else ifeq ($(CONFIG_TARGET_iopsys_x86),y)
|
else ifeq ($(CONFIG_TARGET_iopsys_x86),y)
|
||||||
TARGET_PLATFORM=TEST
|
TARGET_PLATFORM=TEST
|
||||||
TARGET_CFLAGS +=-DIOPSYS_TEST
|
TARGET_CFLAGS +=-DIOPSYS_TEST
|
||||||
@@ -52,30 +91,26 @@ else ifeq ($(CONFIG_TARGET_iopsys_armvirt),y)
|
|||||||
TARGET_PLATFORM=TEST
|
TARGET_PLATFORM=TEST
|
||||||
TARGET_CFLAGS +=-DIOPSYS_TEST
|
TARGET_CFLAGS +=-DIOPSYS_TEST
|
||||||
else
|
else
|
||||||
$(info Unexpected CONFIG_TARGET, use default MAC80211)
|
$(info Unexpected CONFIG_TARGET)
|
||||||
TARGET_PLATFORM=MAC80211
|
|
||||||
TARGET_CFLAGS +=-DIOPSYS_MAC80211
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
export TARGET_PLATFORM
|
export TARGET_PLATFORM
|
||||||
|
|
||||||
|
ifdef CONFIG_IOP_LLA_LIBS_DEBUG
|
||||||
|
TARGET_CFLAGS += -DIOP_LLA_LIBS_DEBUG
|
||||||
|
endif
|
||||||
|
|
||||||
|
define Package/libdsl
|
||||||
|
$(call Package/easy-soc-libs)
|
||||||
|
TITLE:= XDSL library (libdsl)
|
||||||
|
DEPENDS+=+TARGET_intel_mips:dsl-cpe-api-vrx +TARGET_intel_mips:dsl-cpe-fapi +TARGET_intel_mips:kmod-ppa-drv
|
||||||
|
endef
|
||||||
|
|
||||||
subdirs := \
|
subdirs := \
|
||||||
$(if $(CONFIG_PACKAGE_libeasy),libeasy) \
|
$(if $(CONFIG_PACKAGE_libeasy),libeasy) \
|
||||||
$(if $(CONFIG_PACKAGE_libwifi),libwifi) \
|
$(if $(CONFIG_PACKAGE_libwifi),libwifi) \
|
||||||
$(if $(CONFIG_PACKAGE_libdsl),libdsl) \
|
$(if $(CONFIG_PACKAGE_libdsl),libdsl) \
|
||||||
$(if $(CONFIG_PACKAGE_libethernet),libethernet) \
|
$(if $(CONFIG_PACKAGE_libethernet),libethernet)
|
||||||
$(if $(CONFIG_PACKAGE_libqos),libqos)
|
|
||||||
|
|
||||||
EASY_SOC_LIBS := \
|
|
||||||
libeasy \
|
|
||||||
libwifi \
|
|
||||||
libdsl \
|
|
||||||
libethernet \
|
|
||||||
libqos
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_LIBWIFI_USE_CTRL_IFACE),y)
|
|
||||||
TARGET_CFLAGS +=-DLIBWIFI_USE_CTRL_IFACE
|
|
||||||
endif
|
|
||||||
|
|
||||||
TARGET_CFLAGS += \
|
TARGET_CFLAGS += \
|
||||||
-I$(STAGING_DIR)/usr/include \
|
-I$(STAGING_DIR)/usr/include \
|
||||||
@@ -95,36 +130,78 @@ define Build/Prepare
|
|||||||
endef
|
endef
|
||||||
endif
|
endif
|
||||||
|
|
||||||
include easy.mk
|
define Build/InstallDev/libeasy
|
||||||
include wifi.mk
|
$(INSTALL_DIR) $(1)/usr/include/easy
|
||||||
include dsl.mk
|
$(INSTALL_DIR) $(1)/usr/lib
|
||||||
include ethernet.mk
|
$(CP) $(PKG_BUILD_DIR)/libeasy/easy.h $(1)/usr/include/easy/
|
||||||
include qos.mk
|
$(CP) $(PKG_BUILD_DIR)/libeasy/event.h $(1)/usr/include/easy/
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/libeasy/utils.h $(1)/usr/include/easy/
|
||||||
ifneq ($(wildcard $(PKG_BUILD_DIR)/.config_*),\
|
$(CP) $(PKG_BUILD_DIR)/libeasy/libeasy*.so* $(1)/usr/lib/
|
||||||
$(PKG_BUILD_DIR)/.config_$(patsubst "%",%,$(CONFIG_TARGET_PROFILE)))
|
|
||||||
define Build/Compile/rebuild
|
|
||||||
$(FIND) $(PKG_BUILD_DIR) -name \*.o -or -name \*.so\* | $(XARGS) rm -f;
|
|
||||||
$(if $(wildcard $(PKG_BUILD_DIR)/config_*), \
|
|
||||||
rm -f $(PKG_BUILD_DIR)/.config_*)
|
|
||||||
endef
|
endef
|
||||||
endif
|
|
||||||
|
|
||||||
STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell echo $(TARGET_CFLAGS) | mkhash md5)
|
define Build/InstallDev/libwifi
|
||||||
|
$(INSTALL_DIR) $(1)/usr/include
|
||||||
|
$(INSTALL_DIR) $(1)/usr/lib
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/libwifi/wifi.h $(1)/usr/include/
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifi*.so* $(1)/usr/lib/
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/InstallDev/libdsl
|
||||||
|
$(INSTALL_DIR) $(1)/usr/include/xdsl
|
||||||
|
$(INSTALL_DIR) $(1)/usr/lib
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/libdsl/xdsl.h $(1)/usr/include/xdsl
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/libdsl/xtm.h $(1)/usr/include/xdsl
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/libdsl/common.h $(1)/usr/include/xdsl
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/libdsl/libdsl.so* $(1)/usr/lib/
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/InstallDev/libethernet
|
||||||
|
$(INSTALL_DIR) $(1)/usr/include
|
||||||
|
$(INSTALL_DIR) $(1)/usr/lib
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/libethernet/ethernet.h $(1)/usr/include/
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/libethernet/libethernet.so $(1)/usr/lib/
|
||||||
|
endef
|
||||||
|
|
||||||
define Build/Compile
|
define Build/Compile
|
||||||
$(Build/Compile/rebuild)
|
|
||||||
touch $(PKG_BUILD_DIR)/.config_$(CONFIG_TARGET_PROFILE)
|
|
||||||
$(call Build/Compile/Default)
|
$(call Build/Compile/Default)
|
||||||
$(foreach dir,$(subdirs),$(call Build/Compile/$(dir)))
|
ifeq ($(CONFIG_LIBDSL_TEST),y)
|
||||||
|
$(MAKE) -C "$(PKG_BUILD_DIR)/libdsl/test" $(MAKE_FLAGS)
|
||||||
|
endif
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Build/InstallDev
|
define Build/InstallDev
|
||||||
$(foreach dir,$(subdirs),$(call Build/InstallDev/$(dir),$(1),$(2));)
|
$(foreach dir,$(subdirs),$(call Build/InstallDev/$(dir),$(1),$(2));)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define Package/libeasy/install
|
||||||
|
$(INSTALL_DIR) $(1)/usr/lib
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/libeasy/libeasy*.so* $(1)/usr/lib/
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/libwifi/install
|
||||||
|
$(INSTALL_DIR) $(1)/usr/lib
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifi*.so* $(1)/usr/lib/
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/libethernet/install
|
||||||
|
$(INSTALL_DIR) $(1)/usr/lib
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/libethernet/libethernet.so* $(1)/usr/lib/
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/libdsl/install
|
||||||
|
$(INSTALL_DIR) $(1)/usr/lib
|
||||||
|
$(INSTALL_DIR) $(1)/usr/bin
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/libdsl/libdsl.so* $(1)/usr/lib/
|
||||||
|
ifeq ($(CONFIG_LIBDSL_TEST),y)
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/libdsl/test/libdsl_test $(1)/usr/bin/
|
||||||
|
endif
|
||||||
|
endef
|
||||||
|
|
||||||
define Package/easy-soc-libs/install
|
define Package/easy-soc-libs/install
|
||||||
:
|
:
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(foreach e,$(EASY_SOC_LIBS),$(call BuildPackage,$(e))))
|
$(eval $(call BuildPackage,libeasy))
|
||||||
|
$(eval $(call BuildPackage,libwifi))
|
||||||
|
$(eval $(call BuildPackage,libdsl))
|
||||||
|
$(eval $(call BuildPackage,libethernet))
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
|
|
||||||
define Package/libdsl
|
|
||||||
$(call Package/easy-soc-libs)
|
|
||||||
TITLE:= xDSL library (libdsl)
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/libdsl/config
|
|
||||||
if PACKAGE_libdsl
|
|
||||||
config LIBDSL_DEBUG
|
|
||||||
depends on PACKAGE_libdsl
|
|
||||||
bool "Enable dsl debugging"
|
|
||||||
default n
|
|
||||||
|
|
||||||
config LIBDSL_TEST
|
|
||||||
depends on PACKAGE_libdsl
|
|
||||||
bool "Enable dsl test program"
|
|
||||||
default n
|
|
||||||
|
|
||||||
endif
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/InstallDev/libdsl
|
|
||||||
$(INSTALL_DIR) $(1)/usr/include/xdsl
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/libdsl/xdsl.h $(1)/usr/include/xdsl
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/libdsl/xtm.h $(1)/usr/include/xdsl
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/libdsl/common.h $(1)/usr/include/xdsl
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/libdsl/libdsl.so* $(1)/usr/lib/
|
|
||||||
endef
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_LIBDSL_TEST),y)
|
|
||||||
define Build/Compile/libdsl
|
|
||||||
$(MAKE) -C "$(PKG_BUILD_DIR)/libdsl/test" $(MAKE_FLAGS)
|
|
||||||
endef
|
|
||||||
endif
|
|
||||||
|
|
||||||
define Package/libdsl/install
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib
|
|
||||||
$(INSTALL_DIR) $(1)/usr/bin
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/libdsl/libdsl.so* $(1)/usr/lib/
|
|
||||||
ifeq ($(CONFIG_LIBDSL_TEST),y)
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/libdsl/test/libdsl_test $(1)/usr/bin/
|
|
||||||
endif
|
|
||||||
endef
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
define Package/libeasy
|
|
||||||
$(call Package/easy-soc-libs)
|
|
||||||
TITLE:= Common helper functions library (libeasy)
|
|
||||||
DEPENDS+=+libnl +libnl-route
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/libeasy/config
|
|
||||||
source "$(SOURCE)/Config.in"
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/InstallDev/libeasy
|
|
||||||
$(INSTALL_DIR) $(1)/usr/include/easy
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/libeasy/easy.h $(1)/usr/include/easy/
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/libeasy/event.h $(1)/usr/include/easy/
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/libeasy/utils.h $(1)/usr/include/easy/
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/libeasy/if_utils.h $(1)/usr/include/easy/
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/libeasy/debug.h $(1)/usr/include/easy/
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/libeasy/hlist.h $(1)/usr/include/easy/
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/libeasy/libeasy*.so* $(1)/usr/lib/
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/libeasy/install
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/libeasy/libeasy*.so* $(1)/usr/lib/
|
|
||||||
endef
|
|
||||||
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
|
|
||||||
define Package/libethernet
|
|
||||||
$(call Package/easy-soc-libs)
|
|
||||||
TITLE:= Ethernet library (libethernet)
|
|
||||||
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_iopsys_ramips:swconfig
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/libethernet/config
|
|
||||||
config LIBETHERNET_DEBUG
|
|
||||||
depends on PACKAGE_libethernet
|
|
||||||
bool "Enable ethernet debugging"
|
|
||||||
default n
|
|
||||||
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/InstallDev/libethernet
|
|
||||||
$(INSTALL_DIR) $(1)/usr/include
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/libethernet/ethernet.h $(1)/usr/include/
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/libethernet/libethernet.so $(1)/usr/lib/
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/libethernet/install
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/libethernet/libethernet.so* $(1)/usr/lib/
|
|
||||||
endef
|
|
||||||
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
|
|
||||||
define Package/libqos
|
|
||||||
$(call Package/easy-soc-libs)
|
|
||||||
TITLE:= QoS library (libqos)
|
|
||||||
DEPENDS+=+libnl +libnl-route +libeasy
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/libqos/config
|
|
||||||
config LIBQOS_DEBUG
|
|
||||||
depends on PACKAGE_libqos
|
|
||||||
bool "Enable qos debugging"
|
|
||||||
default n
|
|
||||||
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/InstallDev/libqos
|
|
||||||
$(INSTALL_DIR) $(1)/usr/include
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/libqos/include/qos.h $(1)/usr/include/
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/libqos/libqos.so $(1)/usr/lib/
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/libqos/install
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/libqos/libqos*.so* $(1)/usr/lib/
|
|
||||||
endef
|
|
||||||
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
|
|
||||||
define Package/libwifi
|
|
||||||
$(call Package/easy-soc-libs)
|
|
||||||
TITLE:= WiFi library (libwifi)
|
|
||||||
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_iopsys_brcm63xx_arm:bcmkernel
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/libwifi/config
|
|
||||||
if PACKAGE_libdsl
|
|
||||||
config LIBWIFI_DEBUG
|
|
||||||
depends on PACKAGE_libwifi
|
|
||||||
bool "Enable wifi debugging"
|
|
||||||
default n
|
|
||||||
|
|
||||||
endif
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/InstallDev/libwifi
|
|
||||||
$(INSTALL_DIR) $(1)/usr/include
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/libwifi/wifi.h $(1)/usr/include/
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifi*.so* $(1)/usr/lib/
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/libwifi/install
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifi*.so* $(1)/usr/lib/
|
|
||||||
endef
|
|
||||||
|
|
||||||
@@ -6,32 +6,31 @@
|
|||||||
#
|
#
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=endptmngr
|
PKG_RELEASE:=1
|
||||||
PKG_VERSION:=0.6
|
PKG_VERSION:=0.3
|
||||||
|
PKG_SOURCE_VERSION:=34ae1996beda98691d779e49f231bd662fc87cda
|
||||||
LOCAL_DEV=0
|
PKG_LICENSE:=MIT
|
||||||
ifneq ($(LOCAL_DEV),1)
|
|
||||||
PKG_SOURCE_PROTO:=git
|
|
||||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/endptmngr.git
|
|
||||||
PKG_SOURCE_VERSION:=2390a3503990e04e33e8e448ad9dccc00f206908
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
|
||||||
PKG_MIRROR_HASH:=skip
|
|
||||||
endif
|
|
||||||
|
|
||||||
PKG_LICENSE:=PROPRIETARY
|
|
||||||
PKG_LICENSE_FILES:=LICENSE
|
PKG_LICENSE_FILES:=LICENSE
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_ENDPT_OPEN),y)
|
||||||
|
BRCM_KERNEL_PROFILE=$(shell echo $(CONFIG_BCM_KERNEL_PROFILE) | sed s/\"//g)
|
||||||
|
PKG_SOURCE:=endptmngr-$(BRCM_KERNEL_PROFILE)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||||
|
PKG_SOURCE_URL:=http://download.iopsys.eu/iopsys/opensdk/
|
||||||
|
PKG_NAME:=endptmngr-open
|
||||||
|
PATCH_DIR:=
|
||||||
|
else
|
||||||
|
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/endptmngr.git
|
||||||
|
PKG_SOURCE_PROTO:=git
|
||||||
|
PKG_NAME:=endptmngr
|
||||||
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||||
|
endif
|
||||||
|
|
||||||
export BUILD_DIR
|
export BUILD_DIR
|
||||||
|
|
||||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||||
PKG_BUILD_PARALLEL:=1
|
PKG_BUILD_PARALLEL:=1
|
||||||
|
|
||||||
# All config variable that are passed to the make invocation, directly or
|
|
||||||
# indirectly. This ensures that the package is rebuilt on config-changes.
|
|
||||||
PKG_CONFIG_DEPENDS:=CONFIG_TARGET_BOARD
|
|
||||||
|
|
||||||
export CONFIG_BRCM_SDK_VER_504021
|
|
||||||
export CONFIG_BCM_CHIP_ID
|
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
@@ -41,28 +40,27 @@ endef
|
|||||||
|
|
||||||
define Package/endptmngr
|
define Package/endptmngr
|
||||||
CATEGORY:=Utilities
|
CATEGORY:=Utilities
|
||||||
TITLE:=Broadcom Voice Endpoint Manager
|
TITLE:=Brcmslic
|
||||||
URL:=
|
URL:=
|
||||||
DEPENDS:= +libubox +ubus +libpicoevent +uci +bcmkernel @TARGET_HAS_VOICE @BCM_VOICE
|
DEPENDS:= +libubox +ubus +libpicoevent +bcmkernel @TARGET_HAS_VOICE
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/endptmngr/description
|
define Package/endptmngr/description
|
||||||
endptmngr
|
endptmngr
|
||||||
endef
|
endef
|
||||||
|
|
||||||
ifeq ($(LOCAL_DEV),1)
|
ifeq ($(CONFIG_ENDPT_OPEN),y)
|
||||||
define Build/Prepare
|
|
||||||
rsync -av --exclude=.* ~/git/endptmngr/* $(PKG_BUILD_DIR)/
|
define Build/Compile
|
||||||
endef
|
endef
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
TARGET_CFLAGS += \
|
|
||||||
-Wall \
|
|
||||||
-Werror
|
|
||||||
|
|
||||||
define Package/endptmngr/install
|
define Package/endptmngr/install
|
||||||
$(CP) ./files/* $(1)/
|
|
||||||
$(INSTALL_DIR) $(1)/usr/sbin
|
$(INSTALL_DIR) $(1)/usr/sbin
|
||||||
|
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||||
|
cp $(PKG_BUILD_DIR)/files/etc/init.d/* $(1)/etc/init.d/
|
||||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/endptmngr $(1)/usr/sbin/
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/endptmngr $(1)/usr/sbin/
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
#!/bin/sh /etc/rc.common
|
|
||||||
|
|
||||||
START=68
|
|
||||||
STOP=12
|
|
||||||
|
|
||||||
USE_PROCD=1
|
|
||||||
NAME=endptmngr
|
|
||||||
|
|
||||||
start_service() {
|
|
||||||
[ "$(db -q get hw.board.hasVoice)" = "1" ] || return
|
|
||||||
|
|
||||||
procd_open_instance
|
|
||||||
procd_set_param env hw_board_hasDect=$(db get hw.board.hasDect)
|
|
||||||
procd_set_param command $NAME
|
|
||||||
procd_set_param respawn "5" "0" "3"
|
|
||||||
procd_set_param nice -12
|
|
||||||
procd_close_instance
|
|
||||||
}
|
|
||||||
|
|
||||||
reload_service() {
|
|
||||||
stop
|
|
||||||
start
|
|
||||||
}
|
|
||||||
|
|
||||||
service_triggers() {
|
|
||||||
procd_add_reload_trigger asterisk
|
|
||||||
}
|
|
||||||
@@ -5,14 +5,13 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=ethmngr
|
PKG_NAME:=ethmngr
|
||||||
PKG_VERSION:=2.0.1
|
PKG_VERSION:=1.0.4
|
||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_VERSION:=5a0ff3bc7c49dcb05129f423ef8e0c4929f6aa03
|
PKG_SOURCE_VERSION:=b7135381aedf1bde6f7ab10b41be372a9bd7d155
|
||||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ethmngr.git
|
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ethmngr.git
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||||
PKG_MIRROR_HASH:=skip
|
|
||||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||||
PKG_LICENSE:=GPL-2.0-only
|
PKG_LICENSE:=GPL-2.0-only
|
||||||
PKG_LICENSE_FILES:=LICENSE
|
PKG_LICENSE_FILES:=LICENSE
|
||||||
|
|||||||
@@ -1,75 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (C) 2022 IOPSYS Software Solutions AB
|
|
||||||
#
|
|
||||||
|
|
||||||
include $(TOPDIR)/rules.mk
|
|
||||||
|
|
||||||
PKG_NAME:=evoice
|
|
||||||
PKG_VERSION:=0.2.1
|
|
||||||
|
|
||||||
LOCAL_DEV=0
|
|
||||||
ifneq ($(LOCAL_DEV),1)
|
|
||||||
PKG_SOURCE_PROTO:=git
|
|
||||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/evoice.git
|
|
||||||
PKG_SOURCE_VERSION:=f2477946f9e142d01820b38e32ce98a781e0310e
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
|
||||||
PKG_MIRROR_HASH:=skip
|
|
||||||
endif
|
|
||||||
|
|
||||||
PKG_LICENSE:=PROPRIETARY
|
|
||||||
PKG_LICENSE_FILES:=LICENSE
|
|
||||||
|
|
||||||
|
|
||||||
# All config variable that are passed to the make invocation, directly or
|
|
||||||
# indirectly. This ensures that the package is rebuilt on config-changes.
|
|
||||||
#PKG_CONFIG_DEPENDS:=CONFIG_TARGET_BOARD
|
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
|
||||||
|
|
||||||
define Package/$(PKG_NAME)
|
|
||||||
CATEGORY:=Network
|
|
||||||
SUBMENU:=Telephony
|
|
||||||
TITLE:=Ensemble Voice
|
|
||||||
URL:=
|
|
||||||
DEPENDS:= +libubox +libubus +libpicoevent +libuci +libstdcpp +TARGET_iopsys_brcm63xx_arm:bcmkernel +TARGET_iopsys_econet:kmod-voip_driver
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/$(PKG_NAME)/description
|
|
||||||
Ensemble Voice. A stand alone SIP VoIP application.
|
|
||||||
endef
|
|
||||||
|
|
||||||
ifeq ($(LOCAL_DEV),1)
|
|
||||||
# If you want to build the code from your own local repositiory enable
|
|
||||||
# LOCAL_DEV and change the path below to your own git repository.
|
|
||||||
define Build/Prepare
|
|
||||||
rsync -av /swdev/bide/evoice_clean/* $(PKG_BUILD_DIR)/
|
|
||||||
endef
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
|
||||||
TARGET_PLATFORM=BROADCOM
|
|
||||||
export IDIR = $(STAGING_DIR)/usr/include
|
|
||||||
export BDIR = bcm963xx/userspace/private/apps/voice
|
|
||||||
export _XFLAGS = -I$(IDIR) -I$(IDIR)/$(BDIR)/inc -I$(IDIR)/bcm963xx/xchg/bos/publicInc -I$(IDIR)/bcm963xx/bcmdrivers/broadcom/include/bcm963xx
|
|
||||||
else ifeq ($(CONFIG_TARGET_iopsys_econet),y)
|
|
||||||
TARGET_PLATFORM=ECONET
|
|
||||||
endif
|
|
||||||
|
|
||||||
export TARGET_PLATFORM
|
|
||||||
|
|
||||||
|
|
||||||
define Build/Compile
|
|
||||||
@echo "TARGET_PLATFORM=${TARGET_PLATFORM}"
|
|
||||||
+$(MAKE) -r -R -C $(PKG_BUILD_DIR) -f _bld/src/cdabs.mk SWB=b_gxxqca6 HWA=a_openwrt HWC=c_hosted OSP=p_posix TRG=SVrgBcmFxs LIF=cerder DBG=dbg
|
|
||||||
+$(MAKE) -r -R -C $(PKG_BUILD_DIR) -f _bld/src/cdabs.mk SWB=b_gxxqca6 HWA=a_openwrt HWC=c_hosted OSP=p_posix TRG=libvoiceservice LIF=cerder DBG=dbg
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/evoice/install
|
|
||||||
$(CP) ./files/* $(1)/
|
|
||||||
$(INSTALL_DIR) $(1)/usr/sbin
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
|
||||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/_bin/a_openwrt/evoice $(1)/usr/sbin/
|
|
||||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/_bin/a_openwrt/libvoiceservice.so $(1)/usr/lib/bbfdm/
|
|
||||||
endef
|
|
||||||
|
|
||||||
$(eval $(call BuildPackage,evoice))
|
|
||||||
@@ -1,345 +0,0 @@
|
|||||||
|
|
||||||
config SIPClient 'Client1'
|
|
||||||
option Enable '1'
|
|
||||||
option RegisterMode 'RFC3261'
|
|
||||||
option AuthUserName '51234'
|
|
||||||
option AuthPassword '51234'
|
|
||||||
option Network 'Network1'
|
|
||||||
option MaxSessions '5'
|
|
||||||
option RegisiterURI '51234@sip-proxy.iopsys.eu'
|
|
||||||
option E164Format '1'
|
|
||||||
|
|
||||||
config SIPClient 'Client2'
|
|
||||||
option Enable '1'
|
|
||||||
option RegisterMode 'RFC3261'
|
|
||||||
option AuthUserName '51235'
|
|
||||||
option AuthPassword '51235'
|
|
||||||
option Network 'Network1'
|
|
||||||
option MaxSessions '5'
|
|
||||||
option RegisiterURI '51235@sip-proxy.iopsys.eu'
|
|
||||||
option E164Format '1'
|
|
||||||
|
|
||||||
config SIPNetwork 'Network1'
|
|
||||||
option Enable '1'
|
|
||||||
option ProxyServer 'sip-proxy.iopsys.eu'
|
|
||||||
option ProxyServerPort '5060'
|
|
||||||
option ProxyServerTransport 'UDP'
|
|
||||||
option RegistrarServer 'sip-proxy.iopsys.eu'
|
|
||||||
option RegistrarServerPort '5060'
|
|
||||||
option RegistrarServerTransport 'UDP'
|
|
||||||
option RegistrationPeriod '3240'
|
|
||||||
option RegisterExpires '3600'
|
|
||||||
option UserAgentDomain ' '
|
|
||||||
option TimerRegistrationFailed '120'
|
|
||||||
option TimerT1 '500'
|
|
||||||
option VoIPProfile 'VoIPProfile1'
|
|
||||||
list CodecList '1CodecProfile1'
|
|
||||||
list CodecList '1CodecProfile2'
|
|
||||||
list CodecList '1CodecProfile3'
|
|
||||||
list CodecList '1CodecProfile5'
|
|
||||||
list CodecList '1CodecProfile4'
|
|
||||||
|
|
||||||
config Capabilities 'Capabilities'
|
|
||||||
option FacilityActions 'CW_ACTIVE,CFU_ACTIVE'
|
|
||||||
|
|
||||||
config CapabilitiesCodec 'Codec1'
|
|
||||||
option Codec 'G.711ALaw'
|
|
||||||
|
|
||||||
config CapabilitiesCodec 'Codec2'
|
|
||||||
option Codec 'G.711MuLaw'
|
|
||||||
|
|
||||||
config CapabilitiesCodec 'Codec3'
|
|
||||||
option Codec 'G.726'
|
|
||||||
|
|
||||||
config CapabilitiesCodec 'Codec4'
|
|
||||||
option Codec 'G.722'
|
|
||||||
|
|
||||||
config CapabilitiesCodec 'Codec5'
|
|
||||||
option Codec 'G.729'
|
|
||||||
|
|
||||||
config CodecProfile '1CodecProfile1'
|
|
||||||
option Enable '1'
|
|
||||||
option Codec 'Codec1'
|
|
||||||
option PacketizationPeriod '20'
|
|
||||||
option SilenceSupression '1'
|
|
||||||
|
|
||||||
config CodecProfile '1CodecProfile2'
|
|
||||||
option Enable '1'
|
|
||||||
option Codec 'Codec2'
|
|
||||||
option PacketizationPeriod '20'
|
|
||||||
option SilenceSupression '1'
|
|
||||||
|
|
||||||
config CodecProfile '1CodecProfile3'
|
|
||||||
option Enable '1'
|
|
||||||
option Codec 'Codec3'
|
|
||||||
option PacketizationPeriod '20'
|
|
||||||
option SilenceSupression '0'
|
|
||||||
|
|
||||||
config CodecProfile '1CodecProfile4'
|
|
||||||
option Enable '1'
|
|
||||||
option Codec 'Codec4'
|
|
||||||
option PacketizationPeriod '20'
|
|
||||||
option SilenceSupression '0'
|
|
||||||
|
|
||||||
config CodecProfile '1CodecProfile5'
|
|
||||||
option Enable '1'
|
|
||||||
option Codec 'Codec5'
|
|
||||||
option PacketizationPeriod '20'
|
|
||||||
option SilenceSupression '0'
|
|
||||||
|
|
||||||
config VoIPProfile 'VoIPProfile1'
|
|
||||||
option Enable '1'
|
|
||||||
option DTMFMethod 'RFC4733'
|
|
||||||
option RTP '1RTP'
|
|
||||||
|
|
||||||
config RTP '1RTP'
|
|
||||||
option LocalPortMin '10020'
|
|
||||||
option LocalPortMax '10039'
|
|
||||||
option JitterBufferType 'Static'
|
|
||||||
|
|
||||||
config FXXPorts 'POTS'
|
|
||||||
option Region 'US'
|
|
||||||
|
|
||||||
config FXSPorts 'FXS1'
|
|
||||||
option Enable '1'
|
|
||||||
option DialType 'Tone'
|
|
||||||
option TransmitGain '0'
|
|
||||||
option ReceiveGain '0'
|
|
||||||
option EchoCancellationEnable '1'
|
|
||||||
|
|
||||||
config FXSPorts 'FXS2'
|
|
||||||
option Enable '1'
|
|
||||||
option DialType 'Tone'
|
|
||||||
option TransmitGain '0'
|
|
||||||
option ReceiveGain '0'
|
|
||||||
option EchoCancellationEnable '1'
|
|
||||||
|
|
||||||
config Extension 'Extension1'
|
|
||||||
option Enable '1'
|
|
||||||
option ExtensionNumber '10#'
|
|
||||||
option Provider 'FXS1'
|
|
||||||
option CallingFeatures 'Set1'
|
|
||||||
option Name 'Phone 1'
|
|
||||||
|
|
||||||
config Extension 'Extension2'
|
|
||||||
option Enable '1'
|
|
||||||
option ExtensionNumber '11#'
|
|
||||||
option Provider 'FXS2'
|
|
||||||
option CallingFeatures 'Set1'
|
|
||||||
option Name 'Phone 2'
|
|
||||||
|
|
||||||
config Line 'Line1'
|
|
||||||
option Enable '1'
|
|
||||||
option Provider 'Client1'
|
|
||||||
option CallingFeatures 'Set1'
|
|
||||||
|
|
||||||
config Line 'Line2'
|
|
||||||
option Enable '1'
|
|
||||||
option Provider 'Client2'
|
|
||||||
option CallingFeatures 'Set2'
|
|
||||||
|
|
||||||
config IncomingMap 'IncomingMap1'
|
|
||||||
option Enable '1'
|
|
||||||
option Extension 'Extension1'
|
|
||||||
option Line 'Line1'
|
|
||||||
|
|
||||||
config IncomingMap 'IncomingMap2'
|
|
||||||
option Enable '1'
|
|
||||||
option Extension 'Extension2'
|
|
||||||
option Line 'Line2'
|
|
||||||
|
|
||||||
config IncomingMap 'IncomingMap3'
|
|
||||||
option Enable '1'
|
|
||||||
option Extension 'Extension2'
|
|
||||||
option Line 'Line1'
|
|
||||||
|
|
||||||
config OutgoingMap 'OutgoingMap1'
|
|
||||||
option Enable '1'
|
|
||||||
option Extension 'Extension1'
|
|
||||||
option Line 'Line1'
|
|
||||||
|
|
||||||
config OutgoingMap 'OutgoingMap2'
|
|
||||||
option Enable '1'
|
|
||||||
option Extension 'Extension2'
|
|
||||||
option Line 'Line2'
|
|
||||||
|
|
||||||
config CallingFeatures 'Set1'
|
|
||||||
option CallerIDEnable '1'
|
|
||||||
option CallerIDNameEnable '1'
|
|
||||||
option CallForwardUnconditionalEnable '0'
|
|
||||||
option CallForwardUnconditionalNumber ' '
|
|
||||||
option CallForwardOnBusyEnable '0'
|
|
||||||
option CallForwardOnBusyNumber ' '
|
|
||||||
option CallForwardOnNoAnswerEnable '0'
|
|
||||||
option CallForwardOnNoAnswerRingTimeout '24'
|
|
||||||
option CallForwardOnNoAnswerNumber ' '
|
|
||||||
option CallTransferEnable '1'
|
|
||||||
option MWIEnable '1'
|
|
||||||
option VMWIEnable '1'
|
|
||||||
option LineMessagesWaiting '0'
|
|
||||||
option AnonymousCallRejectionEnable '0'
|
|
||||||
option AnonymousCallEnable '1'
|
|
||||||
option DoNotDisturbEnable '1'
|
|
||||||
option RepeatDialEnable '1'
|
|
||||||
option VoiceMailEnable '1'
|
|
||||||
option CallPickUpEnable '1'
|
|
||||||
option CCBSEnable '1'
|
|
||||||
option CallWaitingEnable '0'
|
|
||||||
|
|
||||||
config CallingFeatures 'Set2'
|
|
||||||
option CallerIDEnable '1'
|
|
||||||
option CallerIDNameEnable '1'
|
|
||||||
option CallForwardUnconditionalEnable '0'
|
|
||||||
option CallForwardUnconditionalNumber ' '
|
|
||||||
option CallForwardOnBusyEnable '0'
|
|
||||||
option CallForwardOnBusyNumber ' '
|
|
||||||
option CallForwardOnNoAnswerEnable '0'
|
|
||||||
option CallForwardOnNoAnswerRingTimeout '24'
|
|
||||||
option CallForwardOnNoAnswerNumber ' '
|
|
||||||
option CallTransferEnable '1'
|
|
||||||
option MWIEnable '1'
|
|
||||||
option VMWIEnable '1'
|
|
||||||
option LineMessagesWaiting '0'
|
|
||||||
option AnonymousCallRejectionEnable '0'
|
|
||||||
option AnonymousCallEnable '1'
|
|
||||||
option DoNotDisturbEnable '1'
|
|
||||||
option RepeatDialEnable '1'
|
|
||||||
option VoiceMailEnable '1'
|
|
||||||
option CallPickUpEnable '1'
|
|
||||||
option CCBSEnable '1'
|
|
||||||
option CallWaitingEnable '1'
|
|
||||||
|
|
||||||
config NumberingPlan 'NumberingPlan1'
|
|
||||||
option MinimumNumberOfDigits '1'
|
|
||||||
option MaximumNumberOfDigits '15'
|
|
||||||
option InterDigitTimerStd '2000'
|
|
||||||
option InterDigitTimerOpen '2000'
|
|
||||||
option TerminationDigit '#'
|
|
||||||
|
|
||||||
config NumberingPlan 'NumberingPlan2'
|
|
||||||
option MinimumNumberOfDigits '5'
|
|
||||||
option MaximumNumberOfDigits '15'
|
|
||||||
option InterDigitTimerStd '2000'
|
|
||||||
option InterDigitTimerOpen '2000'
|
|
||||||
option TerminationDigit ' '
|
|
||||||
list PrefixList '3PrefixInfo1'
|
|
||||||
list PrefixList '3PrefixInfo2'
|
|
||||||
list PrefixList '3PrefixInfo3'
|
|
||||||
list PrefixList '3PrefixInfo4'
|
|
||||||
list PrefixList '3PrefixInfo5'
|
|
||||||
list PrefixList '3PrefixInfo6'
|
|
||||||
list PrefixList '3PrefixInfo7'
|
|
||||||
list PrefixList '3PrefixInfo8'
|
|
||||||
list PrefixList '3PrefixInfo9'
|
|
||||||
|
|
||||||
config NumberingPlan 'NumberingPlan3'
|
|
||||||
option MinimumNumberOfDigits '5'
|
|
||||||
option MaximumNumberOfDigits '15'
|
|
||||||
option InterDigitTimerStd '2000'
|
|
||||||
option InterDigitTimerOpen '2000'
|
|
||||||
option TerminationDigit '#'
|
|
||||||
list PrefixList '4PrefixInfo1'
|
|
||||||
|
|
||||||
config PrefixInfo '3PrefixInfo1'
|
|
||||||
option Enable '1'
|
|
||||||
option PrefixRange '*43#'
|
|
||||||
option PrefixMinNumberOfDigits '4'
|
|
||||||
option PrefixMaxNumberOfDigits '4'
|
|
||||||
option NumberOfDigitsToRemove '0'
|
|
||||||
option PosOfDigitsToRemove '0'
|
|
||||||
option FacilityAction 'CW_ACTIVATE'
|
|
||||||
option FacilityActionArgument ' '
|
|
||||||
|
|
||||||
config PrefixInfo '3PrefixInfo2'
|
|
||||||
option Enable '1'
|
|
||||||
option PrefixRange '#43#'
|
|
||||||
option PrefixMinNumberOfDigits '4'
|
|
||||||
option PrefixMaxNumberOfDigits '4'
|
|
||||||
option NumberOfDigitsToRemove '0'
|
|
||||||
option PosOfDigitsToRemove '0'
|
|
||||||
option FacilityAction 'CW_DEACTIVATE'
|
|
||||||
option FacilityActionArgument ' '
|
|
||||||
|
|
||||||
config PrefixInfo '3PrefixInfo3'
|
|
||||||
option Enable '1'
|
|
||||||
option PrefixRange '*21*(X+)#'
|
|
||||||
option PrefixMinNumberOfDigits '9'
|
|
||||||
option PrefixMaxNumberOfDigits '9'
|
|
||||||
option NumberOfDigitsToRemove '0'
|
|
||||||
option PosOfDigitsToRemove '0'
|
|
||||||
option FacilityAction 'CFU_ACTIVATE'
|
|
||||||
option FacilityActionArgument ' '
|
|
||||||
|
|
||||||
config PrefixInfo '3PrefixInfo4'
|
|
||||||
option Enable '1'
|
|
||||||
option PrefixRange '#21#'
|
|
||||||
option PrefixMinNumberOfDigits '4'
|
|
||||||
option PrefixMaxNumberOfDigits '4'
|
|
||||||
option NumberOfDigitsToRemove '0'
|
|
||||||
option PosOfDigitsToRemove '0'
|
|
||||||
option FacilityAction 'CFU_DEACTIVATE'
|
|
||||||
option FacilityActionArgument ' '
|
|
||||||
|
|
||||||
config PrefixInfo '3PrefixInfo5'
|
|
||||||
option Enable '1'
|
|
||||||
option PrefixRange '*67*(X+)#'
|
|
||||||
option PrefixMinNumberOfDigits '9'
|
|
||||||
option PrefixMaxNumberOfDigits '9'
|
|
||||||
option NumberOfDigitsToRemove '0'
|
|
||||||
option PosOfDigitsToRemove '0'
|
|
||||||
option FacilityAction 'CFB_ACTIVATE'
|
|
||||||
option FacilityActionArgument ' '
|
|
||||||
|
|
||||||
config PrefixInfo '3PrefixInfo6'
|
|
||||||
option Enable '1'
|
|
||||||
option PrefixRange '#67#'
|
|
||||||
option PrefixMinNumberOfDigits '4'
|
|
||||||
option PrefixMaxNumberOfDigits '4'
|
|
||||||
option NumberOfDigitsToRemove '0'
|
|
||||||
option PosOfDigitsToRemove '0'
|
|
||||||
option FacilityAction 'CFB_DEACTIVATE'
|
|
||||||
option FacilityActionArgument ' '
|
|
||||||
|
|
||||||
config PrefixInfo '3PrefixInfo7'
|
|
||||||
option Enable '1'
|
|
||||||
option PrefixRange '*61*(X+(*X+)?)#'
|
|
||||||
option PrefixMinNumberOfDigits '15'
|
|
||||||
option PrefixMaxNumberOfDigits '15'
|
|
||||||
option NumberOfDigitsToRemove '0'
|
|
||||||
option PosOfDigitsToRemove '0'
|
|
||||||
option FacilityAction 'CFNR_ACTIVATE'
|
|
||||||
option FacilityActionArgument ' '
|
|
||||||
|
|
||||||
config PrefixInfo '3PrefixInfo8'
|
|
||||||
option Enable '1'
|
|
||||||
option PrefixRange '#61#'
|
|
||||||
option PrefixMinNumberOfDigits '4'
|
|
||||||
option PrefixMaxNumberOfDigits '4'
|
|
||||||
option NumberOfDigitsToRemove '0'
|
|
||||||
option PosOfDigitsToRemove '0'
|
|
||||||
option FacilityAction 'CFNR_DEACTIVATE'
|
|
||||||
option FacilityActionArgument ' '
|
|
||||||
|
|
||||||
config PrefixInfo '3PrefixInfo9'
|
|
||||||
option Enable '1'
|
|
||||||
option PrefixRange '*31*'
|
|
||||||
option PrefixMinNumberOfDigits '4'
|
|
||||||
option PrefixMaxNumberOfDigits '4'
|
|
||||||
option NumberOfDigitsToRemove '0'
|
|
||||||
option PosOfDigitsToRemove '0'
|
|
||||||
option FacilityAction 'CA_ACTIVATE'
|
|
||||||
option FacilityActionArgument ' '
|
|
||||||
|
|
||||||
config PrefixInfo '4PrefixInfo1'
|
|
||||||
option Enable '1'
|
|
||||||
option PrefixRange '110|112'
|
|
||||||
option PrefixMinNumberOfDigits '7'
|
|
||||||
option PrefixMaxNumberOfDigits '7'
|
|
||||||
option NumberOfDigitsToRemove '0'
|
|
||||||
option PosOfDigitsToRemove '0'
|
|
||||||
option FacilityAction 'X_IOPSYS_EU_EMERGENCY'
|
|
||||||
option FacilityActionArgument ' '
|
|
||||||
|
|
||||||
config DialPlan 'X_IOPSYS_EU_InternalNumber1'
|
|
||||||
option RegExp '1X#'
|
|
||||||
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
# Capabilties are platform dependent. Keep these separated from customer configuration
|
|
||||||
|
|
||||||
config capabilities_prm 'limits'
|
|
||||||
option MaxCallLogCount '100'
|
|
||||||
|
|
||||||
config capabilities_prm 'features'
|
|
||||||
option QIModelsSupported 'G.107'
|
|
||||||
|
|
||||||
config CapabilitiesCodec 'Codec1'
|
|
||||||
option Codec 'G.711ALaw'
|
|
||||||
option BitRate '64000'
|
|
||||||
option PacketizationPeriod '20,30'
|
|
||||||
option SilenceSupression '1'
|
|
||||||
|
|
||||||
config CapabilitiesCodec 'Codec2'
|
|
||||||
option Codec 'G.711MuLaw'
|
|
||||||
option BitRate '64000'
|
|
||||||
option PacketizationPeriod '20,30'
|
|
||||||
option SilenceSupression '1'
|
|
||||||
|
|
||||||
config CapabilitiesCodec 'Codec3'
|
|
||||||
option Codec 'G.726'
|
|
||||||
option BitRate '32000'
|
|
||||||
option PacketizationPeriod '20,30'
|
|
||||||
option SilenceSupression '0'
|
|
||||||
|
|
||||||
config CapabilitiesCodec 'Codec4'
|
|
||||||
option Codec 'G.722'
|
|
||||||
option BitRate '64000'
|
|
||||||
option PacketizationPeriod '20,30'
|
|
||||||
option SilenceSupression '0'
|
|
||||||
|
|
||||||
config CapabilitiesCodec 'Codec4'
|
|
||||||
option Codec 'G.729'
|
|
||||||
option BitRate '8000'
|
|
||||||
option PacketizationPeriod '20,30'
|
|
||||||
option SilenceSupression '0'
|
|
||||||
|
|
||||||
@@ -1,166 +0,0 @@
|
|||||||
# RO (Main)
|
|
||||||
config account 'map_board'
|
|
||||||
option HW_Has_Voice 'hw.board.hasVoice'
|
|
||||||
option HW_Has_DECT 'hw.board.hasDect'
|
|
||||||
option HW_Nr_Of_POTS_Ports 'hw.board.VoicePorts'
|
|
||||||
option ProductID 'device.deviceinfo.ModelName'
|
|
||||||
option I3_VERSION 'device.deviceinfo.SoftwareVersion'
|
|
||||||
option SerialNumber 'device.deviceinfo.SerialNumber'
|
|
||||||
|
|
||||||
config account 'map_pots'
|
|
||||||
option Country 'voice.POTS.Region'
|
|
||||||
|
|
||||||
# Voice Service navigation paths
|
|
||||||
# Not used to initialize internal configuration
|
|
||||||
config navigation 'map_vs'
|
|
||||||
option Account 'voice.Client@.'
|
|
||||||
option Network 'voice.Client@.Network'
|
|
||||||
option VoIPProfile 'voice.Network@.VoIPProfile'
|
|
||||||
option CfAccount 'voice.Line@.CallingFeatures'
|
|
||||||
option CfPhone 'voice.Extension@.CallingFeatures'
|
|
||||||
option CodecList 'voice.Network@.CodecList'
|
|
||||||
option Codec 'voice.Codec@.Codec'
|
|
||||||
option OutgoingMapEnabled 'voice.OutgoingMap@.Enable'
|
|
||||||
option From_Phone 'voice.OutgoingMap@.Extension'
|
|
||||||
option Extension 'voice.Extension@.Provider'
|
|
||||||
option To_Account 'voice.OutgoingMap@.Line'
|
|
||||||
option Line 'voice.Line@.Provider'
|
|
||||||
option LineEnable 'voice.Line@.Enable'
|
|
||||||
option LineProvider 'voice.Line@.Provider'
|
|
||||||
option IncomingMapEnabled 'voice.IncomingMap@.Enable'
|
|
||||||
option From_Account 'voice.IncomingMap@.Line'
|
|
||||||
option To_Phone 'voice.IncomingMap@.Extension'
|
|
||||||
option ExtensionEnable 'voice.Extension@.Enable'
|
|
||||||
option ExtensionProvider 'voice.Extension@.Provider'
|
|
||||||
|
|
||||||
# Registration for account A-Z is associate with SIP.Clienti.Enable
|
|
||||||
# All parameters in this table are written to internal configuration
|
|
||||||
config account 'map_account'
|
|
||||||
option Registration 'voice.Client@.Enable'
|
|
||||||
option Display_Name ''
|
|
||||||
option PhoneNumber 'voice.Client@.RegisiterURI'
|
|
||||||
option Username 'voice.Client@.AuthUserName'
|
|
||||||
option Password 'voice.Client@.AuthPassword'
|
|
||||||
option SIP_Telephone_Syntax 'voice.Client@.E164Format'
|
|
||||||
option Device_Description 'voice.Client@.UserAgent'
|
|
||||||
|
|
||||||
# Network stuff associated with an account.
|
|
||||||
# All parameters in this table are written to internal configuration
|
|
||||||
config network 'map_net'
|
|
||||||
option Enable 'voice.Network@.Enable'
|
|
||||||
option Registration_Server 'voice.Network@.RegistrarServer'
|
|
||||||
option Outbound_Proxy 'voice.Network@.ProxyServer'
|
|
||||||
option SIP_Port 'voice.Network@.RegistrarServerPort'
|
|
||||||
option SIP_Transport 'voice.Network@.RegistrarServerTransport'
|
|
||||||
option RegistrationPeriod 'voice.Network@.RegistrationPeriod'
|
|
||||||
option Registration_Interval 'voice.Network@.RegisterExpires'
|
|
||||||
option Reg_Failure_Interval 'voice.Network@.TimerRegistrationFailed'
|
|
||||||
option T1 'voice.Network@.TimerT1'
|
|
||||||
option UserAgentDomain 'voice.Network@.UserAgentDomain'
|
|
||||||
|
|
||||||
config VoIPProfile 'map_voip'
|
|
||||||
option Enable 'voice.VoIPProfile@.Enable'
|
|
||||||
option DTMF_Method 'voice.VoIPProfile@.DTMFMethod'
|
|
||||||
option RTP 'voice.VoIPProfile@.RTP'
|
|
||||||
|
|
||||||
config RTP 'map_rtp'
|
|
||||||
option RTP_Port_Base 'voice.@RTP@.LocalPortMin'
|
|
||||||
option RTP_Port_End 'voice.@RTP@.LocalPortMax'
|
|
||||||
|
|
||||||
config codecs 'map_codec'
|
|
||||||
option Codec 'voice.CodecProfile@.Codec'
|
|
||||||
option enable 'voice.CodecProfile@.Enable'
|
|
||||||
option ptime 'voice.CodecProfile@.PacketizationPeriod'
|
|
||||||
option dtx 'voice.CodecProfile@.SilenceSupression'
|
|
||||||
|
|
||||||
config extensioninfo 'map_ext'
|
|
||||||
option Enable 'voice.Extension@.Enable'
|
|
||||||
option Internal_Number_Phone 'voice.Extension@.ExtensionNumber'
|
|
||||||
option Display_Name_Phone 'voice.Extension@.Name'
|
|
||||||
|
|
||||||
config capabilities 'map_capa'
|
|
||||||
option Call_Waiting_Enable 'voice.Capabilities@FacilityActions'
|
|
||||||
option Enable_Call_Diversion 'voice.Capabilities@FacilityActions'
|
|
||||||
|
|
||||||
config cs_account 'map_set'
|
|
||||||
option BusyCallWait 'voice.Set@.CallWaitingEnable'
|
|
||||||
option AlwaysDivert 'voice.Set@.CallForwardUnconditionalEnable'
|
|
||||||
option CFU_Number 'voice.Set@.CallForwardUnconditionalNumber'
|
|
||||||
option BusyDivert 'voice.Set@.CallForwardOnBusyEnable'
|
|
||||||
option CFB_Number 'voice.Set@.CallForwardOnBusyNumber'
|
|
||||||
option NoAnswDivert 'voice.Set@.CallForwardOnNoAnswerEnable'
|
|
||||||
option CFNR_Number 'voice.Set@.CallForwardOnNoAnswerNumber'
|
|
||||||
option CFNR_Timeout 'voice.Set@.CallForwardOnNoAnswerRingTimeout'
|
|
||||||
option Enable_Call_Transfer 'voice.Set@.CallTransferEnable'
|
|
||||||
option AnonymousReject 'voice.Set@.AnonymousCallRejectionEnable'
|
|
||||||
option AllowAnonymousConf 'voice.Set@.AnonymousCallEnable'
|
|
||||||
option CallerIDEnable 'voice.Set@.CallerIDEnable'
|
|
||||||
|
|
||||||
config cs_xvendor 'map_np_cs'
|
|
||||||
option np_sc_actCW 'voice.X_IOPSYS_EU_NpSc@.CW_ACT'
|
|
||||||
option np_sc_actCW_output 'voice.X_IOPSYS_EU_NpSc@.CW_OUT'
|
|
||||||
option np_sc_deactCW 'voice.X_IOPSYS_EU_NpSc@.CW_DEACT'
|
|
||||||
option np_sc_isactCW 'voice.X_IOPSYS_EU_NpSc@.CW_ISACT'
|
|
||||||
option np_sc_actCFU 'voice.X_IOPSYS_EU_NpSc@.CFU_ACT'
|
|
||||||
option np_sc_actCFU_output 'voice.X_IOPSYS_EU_NpSc@.CFU_OUT'
|
|
||||||
option np_sc_deactCFU 'voice.X_IOPSYS_EU_NpSc@.CFU_DEACT'
|
|
||||||
option np_sc_actCFB 'voice.X_IOPSYS_EU_NpSc@.CFB_ACT'
|
|
||||||
option np_sc_actCFB_output 'voice.X_IOPSYS_EU_NpSc@.CFB_OUT'
|
|
||||||
option np_sc_deactCFB 'voice.X_IOPSYS_EU_NpSc@.CFB_DEACT'
|
|
||||||
option np_sc_actCFNR 'voice.X_IOPSYS_EU_NpSc@.CFNR_ACT'
|
|
||||||
option np_sc_actCFNR_output 'voice.X_IOPSYS_EU_NpSc@.CFNR_OUT'
|
|
||||||
option np_sc_deactCFNR 'voice.X_IOPSYS_EU_NpSc@.CFNR_DEACT'
|
|
||||||
option np_sc_actRA 'voice.X_IOPSYS_EU_NpSc@.RA_ACT'
|
|
||||||
option np_sc_deactRA 'voice.X_IOPSYS_EU_NpSc@.RA_DEACT'
|
|
||||||
option np_sc_actAC 'voice.X_IOPSYS_EU_NpSc@.AC_ACT'
|
|
||||||
option np_sc_deactAC 'voice.X_IOPSYS_EU_NpSc@.AC_DEACT'
|
|
||||||
option np_sc_actAA 'voice.X_IOPSYS_EU_NpSc@.AA_ACT'
|
|
||||||
option np_sc_deactAA 'voice.X_IOPSYS_EU_NpSc@.AA_DEACT'
|
|
||||||
option np_sc_actAD 'voice.X_IOPSYS_EU_NpSc@.AD_ACT'
|
|
||||||
option np_sc_actAD_output 'voice.X_IOPSYS_EU_NpSc@.AD_OUT'
|
|
||||||
option np_sc_deactAD 'voice.X_IOPSYS_EU_NpSc@.AD_DEACT'
|
|
||||||
option np_sc_actMWSplash 'voice.X_IOPSYS_EU_NpSc@.MWI_SPLASH_ACT'
|
|
||||||
option np_sc_deactMWSplash 'voice.X_IOPSYS_EU_NpSc@.MWI_SPLASH_DEACT'
|
|
||||||
option np_sc_actMWTone 'voice.X_IOPSYS_EU_NpSc@.MWI_TONE_ACT'
|
|
||||||
option np_sc_deactMWTone 'voice.X_IOPSYS_EU_NpSc@.MWI_TONE_DEACT'
|
|
||||||
option np_sc_redial 'voice.X_IOPSYS_EU_NpSc@.REDIAL'
|
|
||||||
option np_sc_setMiscConf 'voice.X_IOPSYS_EU_NpSc@.SET_MISC'
|
|
||||||
|
|
||||||
config cc_xvendor 'map_np_in'
|
|
||||||
option np_in_limitExp 'voice.X_IOPSYS_EU_InternalNumber@.RegExp'
|
|
||||||
|
|
||||||
config cc_xvendor 'map_np_sh'
|
|
||||||
option sh_no_str 'voice.X_IOPSYS_EU_ShortNumber@.RegExp'
|
|
||||||
|
|
||||||
config cc_xvendor 'map_np_eme'
|
|
||||||
option np_eme 'voice.X_IOPSYS_EU_EmergencyNumber@.RegExp'
|
|
||||||
option np_eme_out 'voice.X_IOPSYS_EU_EmergencyNumber@.OutStr'
|
|
||||||
|
|
||||||
config cc_xvendor 'map_np_rn'
|
|
||||||
option np_rn 'voice.X_IOPSYS_EU_RegularNumber@.RegExp'
|
|
||||||
option np_rn_out 'voice.X_IOPSYS_EU_RegularNumber@.OutStr'
|
|
||||||
option np_rn_account 'voice.X_IOPSYS_EU_RegularNumber@.AccStr'
|
|
||||||
|
|
||||||
config cc_xvendor 'map_np_bn'
|
|
||||||
option np_bn 'voice.X_IOPSYS_EU_BarredNumber@.RegExp'
|
|
||||||
option np_bn_out 'voice.X_IOPSYS_EU_BarredNumber@.OutStr'
|
|
||||||
|
|
||||||
config TR104NumberingPlan 'map_np_tr'
|
|
||||||
option min_digits 'voice.NumberingPlan@.MinimumNumberOfDigits'
|
|
||||||
option max_digits 'voice.NumberingPlan@.MaximumNumberOfDigits'
|
|
||||||
option tmo_std 'voice.NumberingPlan@.InterDigitTimerStd'
|
|
||||||
option tmo_open 'voice.NumberingPlan@.InterDigitTimerOpen'
|
|
||||||
option term_digit 'voice.NumberingPlan@.TerminationDigit'
|
|
||||||
option prefix_list 'voice.NumberingPlan@.PrefixList'
|
|
||||||
|
|
||||||
config TR104NumberingPlanPrefix 'map_np_pf'
|
|
||||||
option enable 'voice.@PrefixInfo@.Enable'
|
|
||||||
option range 'voice.@PrefixInfo@.PrefixRange'
|
|
||||||
option prefix_min_digits 'voice.@PrefixInfo@.PrefixMinNumberOfDigits'
|
|
||||||
option prefix_max_digits 'voice.@PrefixInfo@.PrefixMaxNumberOfDigits'
|
|
||||||
option remove_digits 'voice.@PrefixInfo@.NumberOfDigitsToRemove'
|
|
||||||
option remove_pos 'voice.@PrefixInfo@.NumberOfDigitsToRemove'
|
|
||||||
option facility_act 'voice.@PrefixInfo@.FacilityAction'
|
|
||||||
option facility_arg 'voice.@PrefixInfo@.FacilityActionArgument'
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
config static_prm 'defaults'
|
|
||||||
option Print_Control '4'
|
|
||||||
option Print_UDP_Addr '192.168.1.3'
|
|
||||||
option Print_UDP_Port '60000'
|
|
||||||
option Verbosity 'On'
|
|
||||||
option Failure_Log 'On'
|
|
||||||
option Message_Log 'On'
|
|
||||||
option Method_Trace 'Off'
|
|
||||||
option Dial_Cache_Size '0'
|
|
||||||
option Reverse_Fax_Detection '0'
|
|
||||||
option DSP_24 '0'
|
|
||||||
option DSP_36 '0'
|
|
||||||
option DSP_43 '0'
|
|
||||||
option Swap_Name_Nr_CID '0'
|
|
||||||
option R_Button_Lower_Lim '100'
|
|
||||||
option R_Button_Upper_Lim '800'
|
|
||||||
option HookOn_Delay '0'
|
|
||||||
option SupportLDD '0'
|
|
||||||
option LDD_Min_Break_Time '41'
|
|
||||||
option LDD_Max_Break_Time '94'
|
|
||||||
option LDD_Percent_Break '55'
|
|
||||||
option Tone_On_Hangup '1'
|
|
||||||
option BusyTone_On_Hangup '1'
|
|
||||||
option Enable_Analouge_Conf '0'
|
|
||||||
option SIP_SessTmrEnable '0'
|
|
||||||
option PrackUsage '1'
|
|
||||||
option SIP_SupportedPath '0'
|
|
||||||
option IMS_Access_Network_Info ' '
|
|
||||||
option SIP_Reason_Protocol '0'
|
|
||||||
option SIP_Body_QOST '0'
|
|
||||||
option SIP_HistoryInfo '0'
|
|
||||||
option Customer_Spec2 '1'
|
|
||||||
option UTF8_Enable '0'
|
|
||||||
option RFC3325 '0'
|
|
||||||
option Accept_From_Registered '0'
|
|
||||||
option Polarity_Reversal '0'
|
|
||||||
option Closed_Dial_Plan '0'
|
|
||||||
option Netw_Dial '0'
|
|
||||||
option No_Answer_Tmo '180'
|
|
||||||
option UPnP_Enabled '0'
|
|
||||||
option NAT_Address ' '
|
|
||||||
option NAT_Address_From_SIP '0'
|
|
||||||
option HookOn_Transfer '0'
|
|
||||||
option Enable_Call_Transfer '1'
|
|
||||||
option CallerIDEnable '1'
|
|
||||||
option Multiparty_Transp '0'
|
|
||||||
option Presence_Indication '0'
|
|
||||||
option Login_Note ' '
|
|
||||||
option Login_Description ' '
|
|
||||||
option Logout_Note ' '
|
|
||||||
option Logout_Description ' '
|
|
||||||
option Resolve_Every_Transaction '2'
|
|
||||||
option Translate_Plus '1'
|
|
||||||
option Mid_Call_Services '0'
|
|
||||||
option Account_Restriction '0'
|
|
||||||
option Answering_Machine_Enable '0'
|
|
||||||
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
#!/bin/sh /etc/rc.common
|
|
||||||
|
|
||||||
START=68
|
|
||||||
STOP=12
|
|
||||||
|
|
||||||
USE_PROCD=1
|
|
||||||
NAME=evoice
|
|
||||||
|
|
||||||
start_service() {
|
|
||||||
[ "$(db -q get hw.board.hasVoice)" = "1" ] || return
|
|
||||||
|
|
||||||
procd_open_instance
|
|
||||||
procd_set_param command $NAME
|
|
||||||
procd_set_param respawn "5" "0" "3"
|
|
||||||
procd_close_instance
|
|
||||||
}
|
|
||||||
|
|
||||||
reload_service() {
|
|
||||||
stop
|
|
||||||
start
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (C) 2021 IOPSYS Software Solutions AB
|
|
||||||
#
|
|
||||||
# This is free software, licensed under the GNU General Public License v2.
|
|
||||||
# See /LICENSE for more information.
|
|
||||||
#
|
|
||||||
include $(TOPDIR)/rules.mk
|
|
||||||
|
|
||||||
PKG_NAME:=fdtextract
|
|
||||||
PKG_RELEASE:=1
|
|
||||||
PKG_VERSION:=1.0
|
|
||||||
|
|
||||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/fdtextract.git
|
|
||||||
PKG_SOURCE_PROTO:=git
|
|
||||||
PKG_SOURCE_VERSION:=0ebaf1e7d1f09318ae75d0f475a25280742b790e
|
|
||||||
PKG_MIRROR_HASH:=skip
|
|
||||||
|
|
||||||
PKG_LICENSE:=GPLv2
|
|
||||||
PKG_LICENSE_FILES:=LICENSE
|
|
||||||
|
|
||||||
RSTRIP:=true
|
|
||||||
export BUILD_DIR
|
|
||||||
|
|
||||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
|
||||||
PKG_BUILD_PARALLEL:=1
|
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
|
||||||
|
|
||||||
define Package/$(PKG_NAME)
|
|
||||||
CATEGORY:=Utilities
|
|
||||||
TITLE:=fdtextract
|
|
||||||
DEPENDS:= +libfdt
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/$(PKG_NAME)/description
|
|
||||||
Command to extract sub images from FIT images.
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/$(PKG_NAME)/install
|
|
||||||
$(INSTALL_DIR) $(1)/usr/sbin
|
|
||||||
|
|
||||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/fdtextract $(1)/usr/sbin/
|
|
||||||
$(STRIP) $(1)/usr/sbin/fdtextract
|
|
||||||
endef
|
|
||||||
|
|
||||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
|
||||||
@@ -28,7 +28,6 @@ define KernelPackage/$(PKG_NAME)
|
|||||||
FILES:=$(PKG_BUILD_DIR)/$(PKG_NAME).$(LINUX_KMOD_SUFFIX)
|
FILES:=$(PKG_BUILD_DIR)/$(PKG_NAME).$(LINUX_KMOD_SUFFIX)
|
||||||
KCONFIG:=CONFIG_PACKAGE_kmod-gryphon-led-kernel-module=y
|
KCONFIG:=CONFIG_PACKAGE_kmod-gryphon-led-kernel-module=y
|
||||||
AUTOLOAD:=$(call AutoLoad,60,$(PKG_NAME))
|
AUTOLOAD:=$(call AutoLoad,60,$(PKG_NAME))
|
||||||
DEPENDS:= +(TARGET_iopsys_brcm63xx_arm):bcmkernel
|
|
||||||
PKG_LICENSE:=GPLv2
|
PKG_LICENSE:=GPLv2
|
||||||
PKG_LICENSE_URL:=
|
PKG_LICENSE_URL:=
|
||||||
endef
|
endef
|
||||||
@@ -41,21 +40,6 @@ EXTRA_KCONFIG:= CONFIG_RGB_LED=m
|
|||||||
|
|
||||||
MODULE_INCLUDE=-I$(PKG_BUILD_DIR)
|
MODULE_INCLUDE=-I$(PKG_BUILD_DIR)
|
||||||
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
|
||||||
LINUX_DIR:=$(BUILD_DIR)/bcmkernel/bcm963xx/kernel/linux-4.19
|
|
||||||
MODULES_SUBDIR:=lib/modules/4.19.183
|
|
||||||
TARGET_CROSS:=$(CONFIG_BRCM_ALT_TOOLCHAIN_BASE)/$(CONFIG_BRCM_ALT_ARM_TOOLCHAIN_TOPDIR)/bin/$(CONFIG_BRCM_ALT_ARM_TOOLCHAIN_PREFIX)-
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_BCM_CHIP_ID),$(filter $(CONFIG_BCM_CHIP_ID),"63158" "6856" "6858"))
|
|
||||||
# These targets use a 64-bit kernel
|
|
||||||
LINUX_KARCH:=arm64
|
|
||||||
TARGET_CROSS:=$(CONFIG_BRCM_ALT_TOOLCHAIN_BASE)/$(CONFIG_BRCM_ALT_AARCH64_TOOLCHAIN_TOPDIR)/bin/$(CONFIG_BRCM_ALT_AARCH64_TOOLCHAIN_PREFIX)-
|
|
||||||
endif
|
|
||||||
# For some reason, Broadcom's kernel does not set the include paths correctly when compiling out-of-tree modules
|
|
||||||
EXTRA_KCPPFLAGS:="-I $(LINUX_DIR)/../bcmkernel/include -I $(LINUX_DIR)/arch/arm/mach-bcm963xx/include"
|
|
||||||
endif
|
|
||||||
|
|
||||||
define Build/Prepare
|
define Build/Prepare
|
||||||
mkdir -p $(PKG_BUILD_DIR)/kdevlinks/
|
mkdir -p $(PKG_BUILD_DIR)/kdevlinks/
|
||||||
$(CP) -s `pwd`/src/* $(PKG_BUILD_DIR)/kdevlinks/
|
$(CP) -s `pwd`/src/* $(PKG_BUILD_DIR)/kdevlinks/
|
||||||
|
|||||||
@@ -43,18 +43,12 @@
|
|||||||
static ssize_t get_led_color(struct device *dev,
|
static ssize_t get_led_color(struct device *dev,
|
||||||
struct device_attribute *attr, char *buf)
|
struct device_attribute *attr, char *buf)
|
||||||
{
|
{
|
||||||
|
/* [ln] todo: dummy implementation */
|
||||||
int len;
|
int len;
|
||||||
struct sk9822_leds *sk9822 = dev_get_drvdata(dev);
|
|
||||||
|
|
||||||
if (IS_ERR(sk9822)) {
|
len = sprintf(buf, "%d\n", 123);
|
||||||
printk(KERN_ERR "Platform get drvdata returned NULL\n");
|
|
||||||
return -EIO;
|
|
||||||
}
|
|
||||||
|
|
||||||
len = scnprintf(buf, PAGE_SIZE, "%02x%02x%02x\n", sk9822->led_colors[0].r, sk9822->led_colors[0].g, sk9822->led_colors[0].b);
|
|
||||||
if (len <= 0) {
|
if (len <= 0) {
|
||||||
dev_err(dev, "sk9822: Invalid sprintf len: %d\n", len);
|
dev_err(dev, "sk9822: Invalid sprintf len: %d\n", len);
|
||||||
return -EIO;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return len;
|
return len;
|
||||||
@@ -105,69 +99,8 @@ static ssize_t set_led_color(struct device *dev,
|
|||||||
}
|
}
|
||||||
static DEVICE_ATTR(led_color, S_IRUGO | S_IWUSR, get_led_color, set_led_color);
|
static DEVICE_ATTR(led_color, S_IRUGO | S_IWUSR, get_led_color, set_led_color);
|
||||||
|
|
||||||
static ssize_t get_led_brightness(struct device *dev,
|
|
||||||
struct device_attribute *attr, char *buf)
|
|
||||||
{
|
|
||||||
int len;
|
|
||||||
struct sk9822_leds *sk9822 = dev_get_drvdata(dev);
|
|
||||||
|
|
||||||
if (IS_ERR(sk9822)) {
|
|
||||||
printk(KERN_ERR "Platform get drvdata returned NULL\n");
|
|
||||||
return -EIO;
|
|
||||||
}
|
|
||||||
|
|
||||||
len = scnprintf(buf, PAGE_SIZE, "%x\n", sk9822->led_brightness);
|
|
||||||
if (len <= 0) {
|
|
||||||
dev_err(dev, "sk9822: Invalid sprintf len: %d\n", len);
|
|
||||||
return -EIO;
|
|
||||||
}
|
|
||||||
|
|
||||||
return len;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Set LED brightness
|
|
||||||
* @retval count number of bytes written
|
|
||||||
* @retval -EINVAL if the message is not a valid hexadecimal number
|
|
||||||
* @retval -EIO for all other errors (e.g. leds cannot be configured)
|
|
||||||
*/
|
|
||||||
static ssize_t set_led_brightness(struct device *dev,
|
|
||||||
struct device_attribute *attr, const char *buf, size_t count)
|
|
||||||
{
|
|
||||||
int ret = 0;
|
|
||||||
struct sk9822_leds *sk9822 = dev_get_drvdata(dev);
|
|
||||||
unsigned long val = SK9822_DEFAULT_BRIGHTNESS;
|
|
||||||
|
|
||||||
if (IS_ERR(sk9822)) {
|
|
||||||
printk(KERN_ERR "Platform get drvdata returned NULL\n");
|
|
||||||
return -EIO;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (kstrtoul(buf, 16, &val)) {
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(val > SK9822_DEFAULT_BRIGHTNESS) {
|
|
||||||
val = SK9822_DEFAULT_BRIGHTNESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
sk9822->led_brightness = (uint8_t)val;
|
|
||||||
|
|
||||||
// Now push to the HW
|
|
||||||
ret = sk9822_update(sk9822);
|
|
||||||
if (ret != 0) {
|
|
||||||
printk(KERN_ERR "Failed to update led\n");
|
|
||||||
return -EIO;
|
|
||||||
}
|
|
||||||
|
|
||||||
return count;
|
|
||||||
}
|
|
||||||
static DEVICE_ATTR(led_brightness, S_IRUGO | S_IWUSR, get_led_brightness, set_led_brightness);
|
|
||||||
|
|
||||||
|
|
||||||
static struct attribute *sk9822_dev_attrs[] = {
|
static struct attribute *sk9822_dev_attrs[] = {
|
||||||
&dev_attr_led_color.attr,
|
&dev_attr_led_color.attr,
|
||||||
&dev_attr_led_brightness.attr,
|
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -196,8 +129,6 @@ static int canyon_led_probe(struct platform_device *pdev)
|
|||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
dev_warn(&pdev->dev, "Could not read led-count property\n");
|
dev_warn(&pdev->dev, "Could not read led-count property\n");
|
||||||
leds->led_count = SK9822_DEFAULT_NUM_LEDS;
|
leds->led_count = SK9822_DEFAULT_NUM_LEDS;
|
||||||
} else {
|
|
||||||
printk(KERN_INFO "Got led count: %u\n", leds->led_count);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
leds->led_colors = devm_kzalloc(&pdev->dev,
|
leds->led_colors = devm_kzalloc(&pdev->dev,
|
||||||
@@ -209,7 +140,7 @@ static int canyon_led_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
platform_set_drvdata(pdev, leds);
|
platform_set_drvdata(pdev, leds);
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
|
#if LINUX_VERSION_CODE <= KERNEL_VERSION(3, 16, 0)
|
||||||
leds->clock_gpio = gpiod_get_index(&pdev->dev, "led", 0);
|
leds->clock_gpio = gpiod_get_index(&pdev->dev, "led", 0);
|
||||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
|
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
|
||||||
leds->clock_gpio = gpiod_get_index(&pdev->dev, "led", 0, GPIOD_OUT_HIGH);
|
leds->clock_gpio = gpiod_get_index(&pdev->dev, "led", 0, GPIOD_OUT_HIGH);
|
||||||
@@ -217,12 +148,6 @@ static int canyon_led_probe(struct platform_device *pdev)
|
|||||||
dev_warn(&pdev->dev, "Kernel version Not supported\n");
|
dev_warn(&pdev->dev, "Kernel version Not supported\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
#endif
|
#endif
|
||||||
if (IS_ERR(leds->clock_gpio)) {
|
|
||||||
dev_err(&pdev->dev, "Failed to acquire clock GPIO %ld\n",
|
|
||||||
PTR_ERR(leds->clock_gpio));
|
|
||||||
leds->clock_gpio = NULL;
|
|
||||||
return PTR_ERR(leds->clock_gpio);
|
|
||||||
}
|
|
||||||
|
|
||||||
gpiod_direction_output(leds->clock_gpio, 1);
|
gpiod_direction_output(leds->clock_gpio, 1);
|
||||||
if (IS_ERR(leds->clock_gpio)) {
|
if (IS_ERR(leds->clock_gpio)) {
|
||||||
@@ -235,7 +160,7 @@ static int canyon_led_probe(struct platform_device *pdev)
|
|||||||
gpiod_set_value(leds->clock_gpio, 0);
|
gpiod_set_value(leds->clock_gpio, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
|
#if LINUX_VERSION_CODE <= KERNEL_VERSION(3, 16, 0)
|
||||||
leds->data_gpio = gpiod_get_index(&pdev->dev, "led", 1);
|
leds->data_gpio = gpiod_get_index(&pdev->dev, "led", 1);
|
||||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
|
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
|
||||||
leds->data_gpio = gpiod_get_index(&pdev->dev, "led", 1, GPIOD_OUT_HIGH);
|
leds->data_gpio = gpiod_get_index(&pdev->dev, "led", 1, GPIOD_OUT_HIGH);
|
||||||
@@ -243,12 +168,6 @@ static int canyon_led_probe(struct platform_device *pdev)
|
|||||||
dev_warn(&pdev->dev, "Kernel version Not supported\n");
|
dev_warn(&pdev->dev, "Kernel version Not supported\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
#endif
|
#endif
|
||||||
if (IS_ERR(leds->data_gpio)) {
|
|
||||||
dev_err(&pdev->dev, "Failed to acquire data GPIO %ld\n",
|
|
||||||
PTR_ERR(leds->data_gpio));
|
|
||||||
leds->data_gpio = NULL;
|
|
||||||
return PTR_ERR(leds->data_gpio);
|
|
||||||
}
|
|
||||||
|
|
||||||
gpiod_direction_output(leds->data_gpio, 1);
|
gpiod_direction_output(leds->data_gpio, 1);
|
||||||
if (IS_ERR(leds->data_gpio)) {
|
if (IS_ERR(leds->data_gpio)) {
|
||||||
|
|||||||
@@ -1,30 +1,27 @@
|
|||||||
|
if PACKAGE_icwmp-curl || PACKAGE_icwmp-zstream
|
||||||
|
|
||||||
|
config CWMP_SCRIPTS_FULL
|
||||||
|
bool "Install all icwmp scripts"
|
||||||
|
default y
|
||||||
|
|
||||||
choice
|
choice
|
||||||
prompt "Select ACS sever"
|
prompt "Select ACS sever"
|
||||||
default CWMP_ACS_MULTI
|
default CWMP_ACS_MULTI
|
||||||
depends on PACKAGE_icwmp || \
|
|
||||||
PACKAGE_icwmp-openssl || \
|
|
||||||
PACKAGE_icwmp-wolfssl || \
|
|
||||||
PACKAGE_icwmp-mbedtls
|
|
||||||
|
|
||||||
config CWMP_ACS_MULTI
|
config CWMP_ACS_MULTI
|
||||||
bool "No specific ACS, follow standard"
|
bool "No specific ACS, follow standard"
|
||||||
|
|
||||||
config CWMP_ACS_HDM
|
config CWMP_ACS_HDM
|
||||||
bool "Select HDM as ACS server"
|
bool "HDM"
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
config CWMP_DEBUG
|
config CWMP_DEBUG
|
||||||
bool "Compile with debug options"
|
bool "Compile with debug options"
|
||||||
depends on PACKAGE_icwmp || \
|
|
||||||
PACKAGE_icwmp-openssl || \
|
|
||||||
PACKAGE_icwmp-wolfssl || \
|
|
||||||
PACKAGE_icwmp-mbedtls
|
|
||||||
default y
|
default y
|
||||||
|
|
||||||
config CWMP_DEVEL_DEBUG
|
config CWMP_DEVEL_DEBUG
|
||||||
bool "Compile with development debug options (deprecated)"
|
bool "Compile with development debug options"
|
||||||
depends on PACKAGE_icwmp || \
|
|
||||||
PACKAGE_icwmp-openssl || \
|
|
||||||
PACKAGE_icwmp-wolfssl || \
|
|
||||||
PACKAGE_icwmp-mbedtls
|
|
||||||
default n
|
default n
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
|||||||
311
icwmp/Makefile
311
icwmp/Makefile
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2020-2022 IOPSYS Software Solutions AB
|
# Copyright (C) 2019 iopsys Software Solutions AB
|
||||||
#
|
#
|
||||||
# This is free software, licensed under the GNU General Public License v2.
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
@@ -8,90 +8,167 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=icwmp
|
PKG_NAME:=icwmp
|
||||||
PKG_VERSION:=8.4.8
|
PKG_VERSION:=4.0-2020-06-25
|
||||||
|
PKG_FIXUP:=autoreconf
|
||||||
PKG_SOURCE_PROTO:=git
|
|
||||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
|
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
|
||||||
PKG_SOURCE_VERSION:=00d037ce851495aca6365f2189849c6030f305df
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
PKG_SOURCE_VERSION:=7a6da73ae20abc27baf3aa4c1b2c1c0c0ecac82e
|
||||||
PKG_MIRROR_HASH:=skip
|
|
||||||
|
|
||||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||||
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||||
|
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||||
|
|
||||||
PKG_LICENSE:=GPLv2
|
PKG_LICENSE:=GPLv2
|
||||||
PKG_LICENSE_FILES:=LICENSE
|
PKG_LICENSE_FILES:=COPYING
|
||||||
|
|
||||||
PKG_FIXUP:=autoreconf
|
|
||||||
PKG_CONFIG_DEPENDS:= \
|
PKG_CONFIG_DEPENDS:= \
|
||||||
CONFIG_CWMP_ACS_MULTI \
|
CONFIG_CWMP_ACS_MULTI \
|
||||||
CONFIG_CWMP_ACS_HDM \
|
CONFIG_CWMP_ACS_HDM \
|
||||||
CONFIG_CWMP_DEBUG \
|
CONFIG_CWMP_DEBUG \
|
||||||
CONFIG_CWMP_DEVEL_DEBUG
|
CONFIG_CWMP_DEVEL_DEBUG
|
||||||
|
|
||||||
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
|
||||||
|
|
||||||
|
CWMP_REVISION=$(shell svnversion ./src/ -n|cut -f2 -d:)
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
define Package/icwmp/default
|
define Package/icwmp_stun
|
||||||
SECTION:=utils
|
SECTION:=utils
|
||||||
CATEGORY:=Utilities
|
CATEGORY:=Utilities
|
||||||
SUBMENU:=TRx69
|
TITLE:=TR-069 stun Client
|
||||||
TITLE:=TR069 CWMP client
|
DEPENDS:=+PACKAGE_icwmp_stun:libubus +PACKAGE_icwmp_stun:libuci +PACKAGE_icwmp_stun:libubox +PACKAGE_icwmp_stun:libjson-c +PACKAGE_icwmp_stun:libopenssl +PACKAGE_icwmp_stun:libblobmsg-json
|
||||||
DEPENDS:=+libuci +libubox +libblobmsg-json +libubus +libjson-c +libcurl +mxml
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/icwmp/config
|
define Package/icwmp_xmpp
|
||||||
|
SECTION:=utils
|
||||||
|
CATEGORY:=Utilities
|
||||||
|
TITLE:=TR-069 xmpp feature
|
||||||
|
DEPENDS:=+PACKAGE_icwmp_xmpp:libuci +PACKAGE_icwmp_xmpp:libubox +PACKAGE_icwmp_xmpp:libexpat +PACKAGE_icwmp_xmpp:libstrophe
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/icwmp_twamp
|
||||||
|
SECTION:=utils
|
||||||
|
CATEGORY:=Utilities
|
||||||
|
TITLE:=TR-069 twamp feature
|
||||||
|
DEPENDS:=+PACKAGE_icwmp_twamp:libuci
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/icwmp_udpechoserver
|
||||||
|
SECTION:=utils
|
||||||
|
CATEGORY:=Utilities
|
||||||
|
TITLE:=TR-069 udpechoserver feature
|
||||||
|
DEPENDS:=+PACKAGE_icwmp_udpechoserver:libuci
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/icwmp_bulkdata
|
||||||
|
SECTION:=utils
|
||||||
|
CATEGORY:=Utilities
|
||||||
|
TITLE:=TR-069 BulkData Collection
|
||||||
|
DEPENDS:=+PACKAGE_icwmp_bulkdata:libubus +PACKAGE_icwmp_bulkdata:libuci +PACKAGE_icwmp_bulkdata:libubox +PACKAGE_icwmp_bulkdata:libjson-c +PACKAGE_icwmp_bulkdata:libcurl +PACKAGE_icwmp_bulkdata:curl +PACKAGE_icwmp_bulkdata:libblobmsg-json +PACKAGE_icwmp_bulkdata:libbbfdm
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/icwmp-tr098
|
||||||
|
SECTION:=utils
|
||||||
|
CATEGORY:=Utilities
|
||||||
|
TITLE:=CWMP client for TR-098 Data Model
|
||||||
|
DEPENDS:=+PACKAGE_icwmp-tr098:libuci +PACKAGE_icwmp-tr098:libmicroxml +PACKAGE_icwmp-tr098:libubox +PACKAGE_icwmp-tr098:jshn +PACKAGE_icwmp-tr098:libubus +PACKAGE_icwmp-tr098:libblobmsg-json +PACKAGE_icwmp-tr098:libpthread +PACKAGE_icwmp-tr098:ubusd +PACKAGE_icwmp-tr098:shflags +PACKAGE_icwmp-tr098:getopt +PACKAGE_icwmp-tr098:zlib +PACKAGE_icwmp-tr098:libjson-c +PACKAGE_icwmp-tr098:libopenssl +PACKAGE_icwmp-tr098:curl +PACKAGE_icwmp-tr098:libcurl +PACKAGE_icwmp-tr098:libtr098
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/icwmp/Default
|
||||||
|
SECTION:=utils
|
||||||
|
CATEGORY:=Utilities
|
||||||
|
TITLE:=CWMP client
|
||||||
|
DEPENDS:=+libuci +libmicroxml +libubox +jshn +libubus +libblobmsg-json +libpthread +ubusd +shflags +getopt +zlib +libjson-c +libopenssl +curl +libbbfdm +libbbf_api
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/icwmp/description
|
||||||
|
A free client implementation of CWMP (TR-069) protocol
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/icwmp-curl
|
||||||
|
$(call Package/icwmp/Default)
|
||||||
|
TITLE+= (using libcurl)
|
||||||
|
DEPENDS+= +PACKAGE_icwmp-curl:libcurl
|
||||||
|
VARIANT:=curl
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/icwmp-zstream
|
||||||
|
$(call Package/icwmp/Default)
|
||||||
|
TITLE+= (using libzstream)
|
||||||
|
DEPENDS+= +PACKAGE_icwmp-zstream:libzstream
|
||||||
|
VARIANT:=zstream
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/icwmp-curl/config
|
||||||
source "$(SOURCE)/Config_cwmp.in"
|
source "$(SOURCE)/Config_cwmp.in"
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
|
||||||
|
ifneq ($(USE_LOCAL),)
|
||||||
|
define Build/Prepare
|
||||||
|
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
||||||
|
endef
|
||||||
|
endif
|
||||||
|
|
||||||
TARGET_CFLAGS += \
|
TARGET_CFLAGS += \
|
||||||
-D_GNU_SOURCE \
|
-D_GNU_SOURCE -D_AADJ
|
||||||
"-DCWMP_REVISION=\\\"$(PKG_SOURCE_VERSION)\\\""
|
|
||||||
|
|
||||||
define Package/icwmp
|
ifeq ($(CONFIG_PACKAGE_icwmp-tr098),y)
|
||||||
$(Package/icwmp/default)
|
CONFIGURE_ARGS += \
|
||||||
TITLE += (internal)
|
--enable-icwmp_tr098
|
||||||
VARIANT:=internal
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/icwmp-openssl
|
|
||||||
$(Package/icwmp/default)
|
|
||||||
TITLE += (openssl)
|
|
||||||
DEPENDS += +PACKAGE_icwmp-openssl:libopenssl
|
|
||||||
VARIANT:=openssl
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/icwmp-wolfssl
|
|
||||||
$(Package/icwmp/default)
|
|
||||||
TITLE += (wolfssl)
|
|
||||||
DEPENDS += +PACKAGE_icwmp-wolfssl:libwolfssl
|
|
||||||
CONFLICTS := icwmp-openssl
|
|
||||||
VARIANT:=wolfssl
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/icwmp-mbedtls
|
|
||||||
$(Package/icwmp/default)
|
|
||||||
TITLE += (mbedtls)
|
|
||||||
DEPENDS += +PACKAGE_icwmp-mbedtls:libmbedtls
|
|
||||||
CONFLICTS := icwmp-openssl icwmp-wolfssl
|
|
||||||
VARIANT:=mbedtls
|
|
||||||
DEFAULT_VARIANT:=1
|
|
||||||
endef
|
|
||||||
|
|
||||||
ifeq ($(BUILD_VARIANT),openssl)
|
|
||||||
CONFIGURE_ARGS += --enable-libopenssl
|
|
||||||
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/
|
|
||||||
TARGET_LDFLAGS += "-lssl"
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(BUILD_VARIANT),wolfssl)
|
ifeq ($(CONFIG_PACKAGE_icwmp_xmpp),y)
|
||||||
CONFIGURE_ARGS += --enable-libwolfssl
|
CONFIGURE_ARGS += \
|
||||||
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/wolfssl
|
--enable-icwmp_xmpp
|
||||||
TARGET_LDFLAGS += "-lwolfssl"
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(BUILD_VARIANT),mbedtls)
|
ifeq ($(CONFIG_PACKAGE_icwmp_stun),y)
|
||||||
CONFIGURE_ARGS += --enable-libmbedtls
|
CONFIGURE_ARGS += \
|
||||||
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/
|
--enable-icwmp_stun
|
||||||
TARGET_LDFLAGS += "-lmbedtls"
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_PACKAGE_icwmp_udpechoserver),y)
|
||||||
|
CONFIGURE_ARGS += \
|
||||||
|
--enable-icwmp_udpechoserver
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_PACKAGE_icwmp_twamp),y)
|
||||||
|
CONFIGURE_ARGS += \
|
||||||
|
--enable-icwmp_twamp
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_PACKAGE_icwmp_bulkdata),y)
|
||||||
|
CONFIGURE_ARGS += \
|
||||||
|
--enable-icwmp_bulkdata
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(CWMP_REVISION)_,_)
|
||||||
|
ifneq ($(CWMP_REVISION),exported)
|
||||||
|
ifneq ($(CWMP_REVISION),Unversioned directory)
|
||||||
|
TARGET_CFLAGS += "-DCWMP_REVISION=\\\"$(CWMP_REVISION)\\\""
|
||||||
|
TARGET_LDFLAGS += "-DCWMP_REVISION=\\\"$(CWMP_REVISION)\\\""
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
TARGET_LDFLAGS += \
|
||||||
|
-Wl,-rpath-link=$(STAGING_DIR)/usr/lib
|
||||||
|
|
||||||
|
CONFIGURE_ARGS += \
|
||||||
|
--with-uci-include-path=$(STAGING_DIR)/usr/include \
|
||||||
|
--with-libubox-include-path=$(STAGING_DIR)/usr/include \
|
||||||
|
--with-libubus-include-path=$(STAGING_DIR)/usr/include
|
||||||
|
|
||||||
|
ifeq ($(BUILD_VARIANT),zstream)
|
||||||
|
CONFIGURE_ARGS += \
|
||||||
|
--enable-http=zstream \
|
||||||
|
--with-zstream-include-path=$(STAGING_DIR)/usr/include
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BUILD_VARIANT),curl)
|
||||||
|
CONFIGURE_ARGS += \
|
||||||
|
--enable-http=curl
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_CWMP_ACS_MULTI),y)
|
ifeq ($(CONFIG_CWMP_ACS_MULTI),y)
|
||||||
@@ -114,36 +191,102 @@ CONFIGURE_ARGS += \
|
|||||||
--enable-devel
|
--enable-devel
|
||||||
endif
|
endif
|
||||||
|
|
||||||
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
|
define Package/icwmp-$(BUILD_VARIANT)/install
|
||||||
ifneq ($(USE_LOCAL),)
|
|
||||||
define Build/Prepare
|
|
||||||
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
|
||||||
endef
|
|
||||||
endif
|
|
||||||
|
|
||||||
define Package/icwmp/default/install
|
|
||||||
$(INSTALL_DIR) $(1)/etc/icwmpd
|
$(INSTALL_DIR) $(1)/etc/icwmpd
|
||||||
$(INSTALL_DIR) $(1)/usr/sbin
|
$(INSTALL_DIR) $(1)/usr/sbin
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/bin/icwmpd $(1)/usr/sbin
|
||||||
$(INSTALL_DIR) $(1)/etc/config
|
$(INSTALL_DIR) $(1)/etc/config
|
||||||
|
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/cwmp $(1)/etc/config
|
||||||
|
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/firewall.cwmp $(1)/etc/firewall.cwmp
|
||||||
$(INSTALL_DIR) $(1)/etc/init.d
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init/icwmpd.init $(1)/etc/init.d/icwmpd
|
||||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/icwmpd $(1)/usr/sbin/icwmpd
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uci-defaults/* $(1)/etc/uci-defaults/
|
||||||
$(INSTALL_DATA) ./files/etc/config/cwmp $(1)/etc/config/cwmp
|
ifeq ($(CONFIG_CWMP_SCRIPTS_FULL),y)
|
||||||
$(INSTALL_BIN) ./files/etc/firewall.cwmp $(1)/etc/firewall.cwmp
|
$(INSTALL_DIR) $(1)/usr/share/icwmp
|
||||||
$(INSTALL_BIN) ./files/etc/init.d/icwmpd $(1)/etc/init.d/icwmpd
|
$(CP) $(PKG_BUILD_DIR)/scripts/defaults $(1)/usr/share/icwmp
|
||||||
$(INSTALL_BIN) ./files/etc/uci-defaults/85-cwmp-set-userid $(1)/etc/uci-defaults/
|
$(CP) $(PKG_BUILD_DIR)/scripts/functions $(1)/usr/share/icwmp
|
||||||
$(INSTALL_BIN) ./files/etc/uci-defaults/90-cwmpfirewall $(1)/etc/uci-defaults/
|
$(INSTALL_DIR) $(1)/usr/sbin
|
||||||
$(INSTALL_BIN) ./files/etc/uci-defaults/95-icwmp-generate-ssl $(1)/etc/uci-defaults/
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/icwmp.sh $(1)/usr/sbin/icwmp
|
||||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/icwmp $(1)/lib/upgrade/keep.d/icwmp
|
endif
|
||||||
$(INSTALL_BIN) ./files/etc/icwmpd/update.sh $(1)/etc/icwmpd/update.sh
|
$(CP) ./files/* $(1)/
|
||||||
endef
|
endef
|
||||||
|
|
||||||
Package/icwmp-openssl/install = $(Package/icwmp/default/install)
|
define Package/icwmp-tr098/install
|
||||||
Package/icwmp-wolfssl/install = $(Package/icwmp/default/install)
|
$(INSTALL_DIR) $(1)/usr/sbin
|
||||||
Package/icwmp-mbedtls/install = $(Package/icwmp/default/install)
|
$(CP) $(PKG_BUILD_DIR)/bin/icwmp_tr098d $(1)/usr/sbin
|
||||||
|
endef
|
||||||
|
|
||||||
$(eval $(call BuildPackage,icwmp))
|
define Package/icwmp_stun/install
|
||||||
$(eval $(call BuildPackage,icwmp-openssl))
|
$(INSTALL_DIR) $(1)/usr/sbin
|
||||||
$(eval $(call BuildPackage,icwmp-wolfssl))
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmp_stund $(1)/usr/sbin/icwmp_stund
|
||||||
$(eval $(call BuildPackage,icwmp-mbedtls))
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init/icwmp_stund $(1)/etc/init.d/icwmp_stund
|
||||||
|
$(INSTALL_DIR) $(1)/etc/config
|
||||||
|
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/cwmp_stun $(1)/etc/config
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/icwmp_xmpp/install
|
||||||
|
$(INSTALL_DIR) $(1)/usr/sbin
|
||||||
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmp_xmppd $(1)/usr/sbin/icwmp_xmppd
|
||||||
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init/icwmp_xmppd $(1)/etc/init.d/icwmp_xmppd
|
||||||
|
$(INSTALL_DIR) $(1)/etc/config
|
||||||
|
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/cwmp_xmpp $(1)/etc/config
|
||||||
|
$(CP) ./xmpp-files/* $(1)/
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/icwmp_udpechoserver/install
|
||||||
|
$(INSTALL_DIR) $(1)/usr/sbin
|
||||||
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmp_udpechoserverd $(1)/usr/sbin/icwmp_udpechoserverd
|
||||||
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init/icwmp_udpechoserverd $(1)/etc/init.d/icwmp_udpechoserverd
|
||||||
|
$(INSTALL_DIR) $(1)/etc/config
|
||||||
|
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/cwmp_udpechoserver $(1)/etc/config
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/icwmp_twamp/install
|
||||||
|
$(INSTALL_DIR) $(1)/usr/sbin
|
||||||
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmp_twampd $(1)/usr/sbin/icwmp_twampd
|
||||||
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init/icwmp_twampd $(1)/etc/init.d/icwmp_twampd
|
||||||
|
$(INSTALL_DIR) $(1)/etc/config
|
||||||
|
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/cwmp_twamp $(1)/etc/config
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/icwmp_bulkdata/install
|
||||||
|
$(INSTALL_DIR) $(1)/usr/sbin
|
||||||
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmp_bulkdatad $(1)/usr/sbin/icwmp_bulkdatad
|
||||||
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init/icwmp_bulkdatad $(1)/etc/init.d/icwmp_bulkdatad
|
||||||
|
$(INSTALL_DIR) $(1)/etc/config
|
||||||
|
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/cwmp_bulkdata $(1)/etc/config
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/icwmp-$(BUILD_VARIANT)/postinst
|
||||||
|
#!/bin/sh
|
||||||
|
echo "$(CWMP_BKP_FILE)" >> $${IPKG_INSTROOT}/etc/sysupgrade.conf
|
||||||
|
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||||
|
echo "Enabling rc.d symlink for icwmpd"
|
||||||
|
/etc/init.d/icwmpd enable
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/icwmp-$(BUILD_VARIANT)/prerm
|
||||||
|
#!/bin/sh
|
||||||
|
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||||
|
echo "Disabling rc.d symlink for icwmpd"
|
||||||
|
/etc/init.d/icwmpd disable
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call BuildPackage,icwmp-curl))
|
||||||
|
$(eval $(call BuildPackage,icwmp_stun))
|
||||||
|
$(eval $(call BuildPackage,icwmp_xmpp))
|
||||||
|
$(eval $(call BuildPackage,icwmp_udpechoserver))
|
||||||
|
$(eval $(call BuildPackage,icwmp_twamp))
|
||||||
|
$(eval $(call BuildPackage,icwmp_bulkdata))
|
||||||
|
$(eval $(call BuildPackage,icwmp-tr098))
|
||||||
|
#$(eval $(call BuildPackage,icwmp-zstream))
|
||||||
|
|||||||
@@ -1,43 +0,0 @@
|
|||||||
config acs 'acs'
|
|
||||||
option userid '' #$OUI-$SER
|
|
||||||
option passwd 'iopsys'
|
|
||||||
option periodic_inform_enable 'true'
|
|
||||||
option periodic_inform_interval '1800'
|
|
||||||
option periodic_inform_time '0001-01-01T00:00:00Z'
|
|
||||||
option dhcp_discovery 'enable'
|
|
||||||
# compression possible configs: GZIP, Deflate, Disabled
|
|
||||||
option compression 'Disabled'
|
|
||||||
# possible configs interval :[1:65535]
|
|
||||||
option retry_min_wait_interval '5'
|
|
||||||
# possible configs interval :[1000:65535]
|
|
||||||
option retry_interval_multiplier '2000'
|
|
||||||
option ipv6_enable '0'
|
|
||||||
option ip_version '4'
|
|
||||||
|
|
||||||
config cpe 'cpe'
|
|
||||||
option default_wan_interface 'wan'
|
|
||||||
option log_to_console 'disable'
|
|
||||||
option log_to_file 'disable'
|
|
||||||
# log_severity: INFO (Default)
|
|
||||||
# log_severity possible configs: EMERG, ALERT, CRITIC ,ERROR, WARNING, NOTICE, INFO, DEBUG
|
|
||||||
option log_severity 'INFO'
|
|
||||||
option log_file_name '/var/log/icwmpd.log'
|
|
||||||
option log_max_size '102400'
|
|
||||||
option userid '' #$OUI-$SER
|
|
||||||
option passwd 'iopsys'
|
|
||||||
option port '7547'
|
|
||||||
option provisioning_code ''
|
|
||||||
option amd_version '5'
|
|
||||||
# compression possible configs: InstanceNumber, InstanceAlias
|
|
||||||
option instance_mode 'InstanceNumber'
|
|
||||||
option session_timeout '60'
|
|
||||||
option notification '1'
|
|
||||||
option exec_download '0'
|
|
||||||
option periodic_notify_enable '1'
|
|
||||||
option periodic_notify_interval '10'
|
|
||||||
option incoming_rule 'Port_Only'
|
|
||||||
|
|
||||||
config lwn 'lwn'
|
|
||||||
option enable '1'
|
|
||||||
option hostname ''
|
|
||||||
option port '0'
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
#created by the icwmp package
|
|
||||||
log() {
|
|
||||||
echo "${@}"|logger -t firewall.cwmp -p info
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ ! -f "/var/state/cwmp" ]; then
|
|
||||||
exit 0;
|
|
||||||
fi
|
|
||||||
|
|
||||||
zone_name=$(uci -c /var/state -q get cwmp.acs.zonename)
|
|
||||||
port=$(uci -q get cwmp.cpe.port)
|
|
||||||
ipaddr=$(uci -c /var/state -q get cwmp.acs.ip)
|
|
||||||
ip6addr=$(uci -c /var/state -q get cwmp.acs.ip6)
|
|
||||||
incoming_rule=$(uci -q get cwmp.cpe.incoming_rule|tr 'A-Z' 'a-z')
|
|
||||||
|
|
||||||
if [ -z "${zone_name}" ]; then
|
|
||||||
log "empty firewall zone name"
|
|
||||||
exit 0
|
|
||||||
elif [ "$zone_name" = "icwmp" ]; then
|
|
||||||
iptables -nL zone_icwmp_input 2> /dev/null
|
|
||||||
if [ $? != 0 ]; then
|
|
||||||
iptables -w 1 -N zone_icwmp_input
|
|
||||||
iptables -w 1 -t filter -A INPUT -j zone_icwmp_input
|
|
||||||
iptables -w 1 -I zone_icwmp_input -p tcp --dport $port -j REJECT
|
|
||||||
else
|
|
||||||
iptables -w 1 -F zone_icwmp_input
|
|
||||||
iptables -w 1 -I zone_icwmp_input -p tcp --dport $port -j REJECT
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
iptables -w 1 -F zone_icwmp_input 2> /dev/null
|
|
||||||
iptables -w 1 -t filter -D INPUT -j zone_icwmp_input 2> /dev/null
|
|
||||||
iptables -w 1 -X zone_icwmp_input 2> /dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
cmd="iptables -w 1 -I zone_${zone_name}_input -p tcp"
|
|
||||||
cmd6="ip6tables -w 1 -I zone_${zone_name}_input -p tcp"
|
|
||||||
|
|
||||||
# default incoming rule is Port only
|
|
||||||
if [ -z "${incoming_rule}" ]; then
|
|
||||||
incoming_rule="port_only"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${incoming_rule}" = "ip_only" ]; then
|
|
||||||
if [ -n "${ipaddr}" ]; then
|
|
||||||
cmd="${cmd} -s ${ipaddr}"
|
|
||||||
cmd6="${cmd6} -s ${ip6addr}"
|
|
||||||
fi
|
|
||||||
elif [ "${incoming_rule}" = "port_only" ]; then
|
|
||||||
if [ -n "${port}" ]; then
|
|
||||||
cmd="${cmd} --dport ${port}"
|
|
||||||
cmd6="${cmd6} --dport ${port}"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
if [ -n "${ipaddr}" ]; then
|
|
||||||
cmd="${cmd} -s ${ipaddr}"
|
|
||||||
cmd6="${cmd6} -s ${ip6addr}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "${port}" ]; then
|
|
||||||
cmd="${cmd} --dport ${port}"
|
|
||||||
cmd6="${cmd6} --dport ${port}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo ${cmd}|grep -q "\-\-dport \|\-s "
|
|
||||||
if [ "$?" -eq 0 ]; then
|
|
||||||
cmd="${cmd} -j ACCEPT -m comment --comment=Open_ACS_port"
|
|
||||||
${cmd}
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo ${cmd6}|grep -q "\-\-dport \|\-s "
|
|
||||||
if [ "$?" -eq 0 ]; then
|
|
||||||
cmd6="${cmd6} -j ACCEPT -m comment --comment=Open_ACS_port"
|
|
||||||
${cmd6}
|
|
||||||
fi
|
|
||||||
|
|
||||||
uci -c /var/state -q set cwmp.cpe.firewall_restart="init"
|
|
||||||
uci -c /var/state -q commit cwmp
|
|
||||||
87
icwmp/files/etc/hotplug.d/iface/90-icwmp
Normal file
87
icwmp/files/etc/hotplug.d/iface/90-icwmp
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. /lib/functions/network.sh
|
||||||
|
|
||||||
|
[ "$ACTION" == "ifup" ] || exit 0
|
||||||
|
|
||||||
|
[ -f /etc/config/cwmp ] || exit 0
|
||||||
|
|
||||||
|
handle_icwmp_restart() {
|
||||||
|
[ -f /tmp/switching_mode ] && exit 0
|
||||||
|
[ -f /tmp/wificontrol.txt -a -f /tmp/netmode-conf.pid ] && exit 0
|
||||||
|
|
||||||
|
[ "$INTERFACE" == "loopback" ] && exit 0
|
||||||
|
|
||||||
|
local defwan=$(uci -q get cwmp.cpe.default_wan_interface)
|
||||||
|
[ -n "$defwan" -a "$(uci -q get network.$defwan)" == "interface" -a "$defwan" != "$INTERFACE" ] && exit 0
|
||||||
|
|
||||||
|
local islan="$(uci -q get network.$INTERFACE.is_lan)"
|
||||||
|
[ "$islan" == "1" ] && exit 0
|
||||||
|
|
||||||
|
local proto="$(uci -q get network.$INTERFACE.proto)"
|
||||||
|
[ "$proto" == "none" ] && exit 0
|
||||||
|
|
||||||
|
local ifname="$(uci -q get network.$INTERFACE.ifname)"
|
||||||
|
[ "${ifname:0:1}" == "@" ] && exit 0
|
||||||
|
|
||||||
|
mkdir -p /tmp/ipv4
|
||||||
|
|
||||||
|
network_flush_cache
|
||||||
|
|
||||||
|
local previpaddr=""
|
||||||
|
local curipaddr=""
|
||||||
|
local ipaddrfile=/tmp/ipv4/$INTERFACE-ipaddr
|
||||||
|
previpaddr=$(cat $ipaddrfile 2>/dev/null)
|
||||||
|
network_get_ipaddr curipaddr $INTERFACE
|
||||||
|
[ -n "$curipaddr" ] && echo $curipaddr > $ipaddrfile || rm -f $ipaddrfile
|
||||||
|
|
||||||
|
local prevgateway=""
|
||||||
|
local curgateway=""
|
||||||
|
local gatewayfile=/tmp/ipv4/$INTERFACE-gateway
|
||||||
|
prevgateway=$(cat $gatewayfile 2>/dev/null)
|
||||||
|
network_get_gateway curgateway $INTERFACE
|
||||||
|
[ -n "$curgateway" ] && echo $curgateway > $gatewayfile || rm -f $gatewayfile
|
||||||
|
|
||||||
|
local prevsubnets=""
|
||||||
|
local cursubnets=""
|
||||||
|
local subnetsfile=/tmp/ipv4/$INTERFACE-subnets
|
||||||
|
prevsubnets=$(cat $subnetsfile 2>/dev/null)
|
||||||
|
network_get_subnets cursubnets $INTERFACE
|
||||||
|
[ -n "$cursubnets" ] && echo $cursubnets > $subnetsfile || rm -f $subnetsfile
|
||||||
|
|
||||||
|
local prevdnsservers=""
|
||||||
|
local curdnsservers=""
|
||||||
|
local dnsserverfile=/tmp/ipv4/$INTERFACE-dnsservers
|
||||||
|
prevdnsservers=$(cat $dnsserverfile 2>/dev/null)
|
||||||
|
network_get_dnsserver curdnsservers $INTERFACE
|
||||||
|
[ -n "$curdnsservers" ] && echo $curdnsservers > $dnsserverfile || rm -f $dnsserverfile
|
||||||
|
|
||||||
|
local prevdev=""
|
||||||
|
local curdev=""
|
||||||
|
local devfile=/tmp/ipv4/$INTERFACE-dev
|
||||||
|
prevdev=$(cat $devfile 2>/dev/null)
|
||||||
|
network_get_device curdev $INTERFACE
|
||||||
|
[ -n "$curdev" ] && echo $curdev > $devfile || rm -f $devfile
|
||||||
|
|
||||||
|
local prevopt43url=""
|
||||||
|
local curopt43url=""
|
||||||
|
local opt43urlfile=/tmp/ipv4/$INTERFACE-opt43url
|
||||||
|
prevopt43url=$(cat $opt43urlfile 2>/dev/null)
|
||||||
|
curopt43url="$(uci -P /var/state -q get cwmp.acs.dhcp_url)"
|
||||||
|
[ -n "$curopt43url" ] && echo $curopt43url > $opt43urlfile || rm -f $opt43urlfile
|
||||||
|
|
||||||
|
[ \
|
||||||
|
"$prevdev" == "$curdev" -a \
|
||||||
|
"$previpaddr" = "$curipaddr" -a \
|
||||||
|
"$prevgateway" = "$curgateway" -a \
|
||||||
|
"$prevsubnets" = "$cursubnets" -a \
|
||||||
|
"$prevdnsservers" = "$curdnsservers" \
|
||||||
|
] && {
|
||||||
|
[ "$prevopt43url" = "$curopt43url" ] && exit 0
|
||||||
|
[ -z "$prevopt43url" ] && exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
/etc/init.d/icwmpd reload &
|
||||||
|
}
|
||||||
|
|
||||||
|
handle_icwmp_restart
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
log() {
|
|
||||||
echo "$@" |logger -t cwmp.update -p info
|
|
||||||
}
|
|
||||||
|
|
||||||
handle_icwmp_update() {
|
|
||||||
local defwan vendorspecinf update
|
|
||||||
local fallback_restart
|
|
||||||
|
|
||||||
fallback_restart="${1:-0}"
|
|
||||||
update="0"
|
|
||||||
defwan="$(uci -q get cwmp.cpe.default_wan_interface)"
|
|
||||||
vendorspecinf="$(ifstatus "${defwan}" | jsonfilter -e "@.data.vendorspecinf")"
|
|
||||||
|
|
||||||
log "Handling dhcp option value [${vendorspecinf}]"
|
|
||||||
[ -n "$vendorspecinf" ] && {
|
|
||||||
local url old_url
|
|
||||||
local prov_code old_prov_code
|
|
||||||
local min_wait_interval old_min_wait_interval
|
|
||||||
local retry_interval_multiplier old_retry_interval_multiplier
|
|
||||||
|
|
||||||
old_url="$(uci -q get cwmp.acs.dhcp_url)"
|
|
||||||
old_prov_code="$(uci -q get cwmp.cpe.dhcp_provisioning_code)"
|
|
||||||
old_min_wait_interval="$(uci -q get cwmp.acs.dhcp_retry_min_wait_interval)"
|
|
||||||
old_retry_interval_multiplier="$(uci -q get cwmp.acs.dhcp_retry_interval_multiplier)"
|
|
||||||
|
|
||||||
case $vendorspecinf in
|
|
||||||
http://*|https://*)
|
|
||||||
url="${vendorspecinf}"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
for optval in $vendorspecinf; do
|
|
||||||
case $optval in
|
|
||||||
1=*)
|
|
||||||
url="$(echo "$optval" | cut -d"=" -f2-)"
|
|
||||||
;;
|
|
||||||
2=*)
|
|
||||||
prov_code="$(echo "$optval" | cut -d"=" -f2-)"
|
|
||||||
;;
|
|
||||||
3=*)
|
|
||||||
min_wait_interval="$(echo "$optval" | cut -d"=" -f2-)"
|
|
||||||
;;
|
|
||||||
4=*)
|
|
||||||
retry_interval_multiplier="$(echo "$optval" | cut -d"=" -f2-)"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -n "$url" ]; then
|
|
||||||
if [ "${url}" != "${old_url}" ]; then
|
|
||||||
log "## icwmp url[${old_url}] changed to [${url}]"
|
|
||||||
uci -q set cwmp.acs.dhcp_url="$url"
|
|
||||||
update=1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if [ -n "$prov_code" ]; then
|
|
||||||
if [ "${prov_code}" != "${old_prov_code}" ]; then
|
|
||||||
log "## icwmp prov_code[${old_prov_code}] changed to [${prov_code}]"
|
|
||||||
uci -q set cwmp.cpe.dhcp_provisioning_code="$prov_code"
|
|
||||||
update=1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if [ -n "$min_wait_interval" ]; then
|
|
||||||
if [ "${min_wait_interval}" != "${old_min_wait_interval}" ]; then
|
|
||||||
log "## icwmp min_wait_interval[${old_min_wait_interval}] changed to [${min_wait_interval}]"
|
|
||||||
uci -q set cwmp.acs.dhcp_retry_min_wait_interval="$min_wait_interval"
|
|
||||||
update=1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if [ -n "$retry_interval_multiplier" ]; then
|
|
||||||
if [ "${retry_interval_multiplier}" != "${old_retry_interval_multiplier}" ]; then
|
|
||||||
log "## icwmp retry_interval_multiplier[${old_retry_interval_multiplier}] changed to [${retry_interval_multiplier}]"
|
|
||||||
uci -q set cwmp.acs.dhcp_retry_interval_multiplier="$retry_interval_multiplier"
|
|
||||||
update=1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# In case of update restart icwmp
|
|
||||||
if [ "${update}" -eq "1" ]; then
|
|
||||||
log "CWMP uci changes, reload cwmp with uci commit"
|
|
||||||
ubus call uci commit '{"config":"cwmp"}'
|
|
||||||
else
|
|
||||||
status="$(ubus call tr069 status |jsonfilter -qe '@.last_session.status')"
|
|
||||||
if [ "$status" = "failure" ]; then
|
|
||||||
log "Trigger out of bound inform, since last inform status was failure"
|
|
||||||
ubus -t 10 call tr069 inform >/dev/null 2>&1
|
|
||||||
# Handle timeout
|
|
||||||
if [ "$?" -eq 7 ]; then
|
|
||||||
log "Restarting icwmp tr069 object"
|
|
||||||
/etc/init.d/icwmpd restart
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
handle_icwmp_update $@
|
|
||||||
@@ -1,252 +0,0 @@
|
|||||||
#!/bin/sh /etc/rc.common
|
|
||||||
# Copyright (C) 2015-2019 iopsys Software Solutions AB
|
|
||||||
|
|
||||||
START=99
|
|
||||||
STOP=00
|
|
||||||
|
|
||||||
USE_PROCD=1
|
|
||||||
PROG="/usr/sbin/icwmpd"
|
|
||||||
|
|
||||||
. /lib/functions.sh
|
|
||||||
. /usr/share/libubox/jshn.sh
|
|
||||||
include /lib/network
|
|
||||||
|
|
||||||
log() {
|
|
||||||
echo "${@}"|logger -t cwmp.init -p info
|
|
||||||
}
|
|
||||||
|
|
||||||
enable_dhcp_option43() {
|
|
||||||
local wan="${1}"
|
|
||||||
|
|
||||||
### Ask for DHCP Option 43 only if CWMP is enabled ###
|
|
||||||
local reqopts="$(uci -q get network.$wan.reqopts)"
|
|
||||||
local proto="$(uci -q get network.$wan.proto)"
|
|
||||||
local newreqopts=""
|
|
||||||
local option43_present=0
|
|
||||||
|
|
||||||
for ropt in $reqopts; do
|
|
||||||
case $ropt in
|
|
||||||
43) option43_present=1 ;;
|
|
||||||
*) ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ ${option43_present} -eq 1 ]; then
|
|
||||||
return;
|
|
||||||
fi
|
|
||||||
|
|
||||||
newreqopts="$reqopts 43"
|
|
||||||
if [ "${proto}" == "dhcp" ]; then
|
|
||||||
uci -q set network.$wan.reqopts="$newreqopts"
|
|
||||||
uci commit network
|
|
||||||
ubus call network reload
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
wait_for_resolvfile() {
|
|
||||||
local time=$1
|
|
||||||
local tm=1
|
|
||||||
|
|
||||||
local resolvfile="$(uci -q get dhcp.@dnsmasq[0].resolvfile)"
|
|
||||||
[ -n "$resolvfile" ] || return
|
|
||||||
|
|
||||||
while [ ! -f "$resolvfile" ]; do
|
|
||||||
sleep 1
|
|
||||||
[ "$tm" -ge "$time" ] && break
|
|
||||||
tm=$((tm+1))
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
copy_cwmp_etc_files_to_varstate() {
|
|
||||||
mkdir -p /var/run/icwmpd
|
|
||||||
|
|
||||||
if [ -f /etc/icwmpd/cwmp ]; then
|
|
||||||
uci -q -c /etc/icwmpd delete cwmp.acs
|
|
||||||
uci -q -c /etc/icwmpd commit cwmp
|
|
||||||
cp -f /etc/icwmpd/cwmp /var/state/cwmp
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f /etc/icwmpd/icwmpd_backup_session.xml ]; then
|
|
||||||
cp -f /etc/icwmpd/icwmpd_backup_session.xml /var/run/icwmpd/ 2>/dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f /etc/icwmpd/dm_enabled_notify.xml ]; then
|
|
||||||
cp -f /etc/icwmpd/dm_enabled_notify /var/run/icwmpd/ 2>/dev/null
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
copy_cwmp_varstate_files_to_etc() {
|
|
||||||
if [ -f /var/run/icwmpd/icwmpd_backup_session.xml ]; then
|
|
||||||
cp -f /var/run/icwmpd/icwmpd_backup_session.xml /etc/icwmpd/ 2>/dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f /var/run/icwmpd/dm_enabled_notify.xml ]; then
|
|
||||||
cp -f /var/run/icwmpd/dm_enabled_notify /etc/icwmpd/ 2>/dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f /var/state/cwmp ]; then
|
|
||||||
cp -f /var/state/cwmp /etc/icwmpd/
|
|
||||||
fi
|
|
||||||
|
|
||||||
# move the successful custom notify import marker to persistent storage
|
|
||||||
if [ -f /var/run/icwmpd/icwmpd_notify_import_marker ]; then
|
|
||||||
cp -f /var/run/icwmpd/icwmpd_notify_import_marker /etc/icwmpd/
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
validate_acs_section()
|
|
||||||
{
|
|
||||||
uci_validate_section cwmp acs "acs" \
|
|
||||||
'passwd:string' \
|
|
||||||
'periodic_inform_enable:bool' \
|
|
||||||
'periodic_inform_interval:uinteger' \
|
|
||||||
'periodic_inform_time:string' \
|
|
||||||
'url:string' \
|
|
||||||
'dhcp_discovery:string' \
|
|
||||||
'dhcp_url:string' \
|
|
||||||
'compression:or("GZIP","Deflate","Disabled")' \
|
|
||||||
'retry_min_wait_interval:range(1, 65535)' \
|
|
||||||
'retry_interval_multiplier:range(1000, 65535)' \
|
|
||||||
'ipv6_enable:bool' \
|
|
||||||
'ssl_capath:string'
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
validate_cpe_section()
|
|
||||||
{
|
|
||||||
uci_validate_section cwmp cpe "cpe" \
|
|
||||||
'interface:string' \
|
|
||||||
'default_wan_interface:string' \
|
|
||||||
'log_to_console:or("enable","disable")' \
|
|
||||||
'log_to_file:or("enable","disable")' \
|
|
||||||
'log_severity:or("EMERG", "ALERT", "CRITIC" ,"ERROR", "WARNING", "NOTICE", "INFO", "DEBUG")' \
|
|
||||||
'log_file_name:string' \
|
|
||||||
'log_max_size:uinteger' \
|
|
||||||
'userid:string' \
|
|
||||||
'passwd:string' \
|
|
||||||
'port:uinteger' \
|
|
||||||
'provisioning_code:string:""' \
|
|
||||||
'amd_version:range(1, 6)' \
|
|
||||||
'instance_mode:or("InstanceNumber","InstanceAlias")' \
|
|
||||||
'session_timeout:uinteger' \
|
|
||||||
'notification:bool' \
|
|
||||||
'exec_download:bool' \
|
|
||||||
'periodic_notify_enable:bool' \
|
|
||||||
'enable:bool' \
|
|
||||||
'periodic_notify_interval:uinteger'
|
|
||||||
}
|
|
||||||
|
|
||||||
validate_defaults() {
|
|
||||||
local ssl_capath
|
|
||||||
config_load cwmp
|
|
||||||
|
|
||||||
validate_acs_section || {
|
|
||||||
log "Validation of acs section failed"
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Put the cert pem file in keep list
|
|
||||||
if [ -d "${ssl_capath}" ]; then
|
|
||||||
if ! grep "${ssl_capath}" /lib/upgrade/keep.d/icwmp; then
|
|
||||||
echo "${ssl_capath}"'/*.pem' >> /lib/upgrade/keep.d/icwmp
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ -z "${url}" ] && [ -z "${dhcp_url}" ] && {
|
|
||||||
log "ACS url is empty can't start"
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
validate_cpe_section || {
|
|
||||||
log "Validation of cpe section failed"
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
start_service() {
|
|
||||||
local enable_cwmp
|
|
||||||
local wan_interface
|
|
||||||
local dhcp_discovery
|
|
||||||
local dhcp_url
|
|
||||||
|
|
||||||
config_load cwmp
|
|
||||||
config_get_bool enable_cwmp cpe enable 1
|
|
||||||
config_get dhcp_discovery acs dhcp_discovery "0"
|
|
||||||
config_get dhcp_url acs dhcp_url ''
|
|
||||||
config_get wan_interface cpe default_wan_interface "wan"
|
|
||||||
|
|
||||||
if [ "$enable_cwmp" = "0" ] || [ "$enable_cwmp" = "false" ]; then
|
|
||||||
log "CWMP is not enabled"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set dhcp option 43 if dhcp discovery enabled
|
|
||||||
if [ "${dhcp_discovery}" == "enable" ] || [ "${dhcp_discovery}" == "1" ]; then
|
|
||||||
enable_dhcp_option43 "${wan_interface}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ -f /sbin/netifd ] && log "Waiting for Network to be started ..." && ubus -t 5 wait_for network.interface
|
|
||||||
[ -f /usr/sbin/dnsmasq ] && log "Waiting for DNS Proxy to be started ..." && ubus -t 5 wait_for dnsmasq
|
|
||||||
[ -f /etc/config/dhcp ] && log "Waiting for DNS Server(s) ..." && wait_for_resolvfile 20
|
|
||||||
|
|
||||||
if [ "${dhcp_discovery}" == "enable" ] || [ "${dhcp_discovery}" == "1" ]; then
|
|
||||||
if [ -z "${dhcp_url}" ]; then
|
|
||||||
log "Empty dhcp url, running update script"
|
|
||||||
/etc/icwmpd/update.sh
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
validate_defaults || {
|
|
||||||
log "Validation of defaults failed"
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Copy backup data so that if it restart latter on it gets the info
|
|
||||||
copy_cwmp_etc_files_to_varstate
|
|
||||||
|
|
||||||
procd_open_instance icwmp
|
|
||||||
procd_set_param command "$PROG"
|
|
||||||
procd_append_param command -b
|
|
||||||
procd_set_param respawn \
|
|
||||||
"${respawn_threshold:-5}" \
|
|
||||||
"${respawn_timeout:-10}" "${respawn_retry:-3}"
|
|
||||||
|
|
||||||
procd_set_param watch network.interface
|
|
||||||
procd_close_instance
|
|
||||||
}
|
|
||||||
|
|
||||||
service_stopped()
|
|
||||||
{
|
|
||||||
copy_cwmp_varstate_files_to_etc
|
|
||||||
}
|
|
||||||
|
|
||||||
reload_service() {
|
|
||||||
log "Reloading CWMP client"
|
|
||||||
ubus -t 1 call tr069 command '{"command":"reload"}'
|
|
||||||
if [ "$?" -ne "0" ]; then
|
|
||||||
log "Restarting CWMP client"
|
|
||||||
stop
|
|
||||||
start
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
service_triggers() {
|
|
||||||
procd_add_reload_trigger "cwmp"
|
|
||||||
|
|
||||||
procd_open_trigger
|
|
||||||
json_add_array
|
|
||||||
json_add_string "" "interface.update"
|
|
||||||
json_add_array
|
|
||||||
json_add_array
|
|
||||||
json_add_string "" "run_script"
|
|
||||||
json_add_string "" "/etc/icwmpd/update.sh"
|
|
||||||
json_add_string "" "1"
|
|
||||||
json_close_array
|
|
||||||
json_close_array
|
|
||||||
json_add_int "" "2000"
|
|
||||||
json_close_array
|
|
||||||
procd_close_trigger
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,32 +1,24 @@
|
|||||||
|
|
||||||
# Copy defaults by the factory to the cwmp UCI user section.
|
# Copy defaults by the factory to the cwmp UCI user section.
|
||||||
|
|
||||||
# Get Manufacturer OUI.
|
|
||||||
oui=$(uci -q get cwmp.cpe.manufacturer_oui)
|
|
||||||
if [ -z "${oui}" ]; then
|
|
||||||
oui=$(db -q get device.deviceinfo.ManufacturerOUI)
|
|
||||||
fi
|
|
||||||
|
|
||||||
oui=$(echo "${oui}" | tr 'a-f' 'A-F')
|
# Get factory base MAC.
|
||||||
|
baseMac=$(db -q get hw.board.basemac)
|
||||||
|
|
||||||
|
# Erase colon and space characters.
|
||||||
|
baseMac=${baseMac//:/}
|
||||||
|
baseMac=${baseMac// /}
|
||||||
|
|
||||||
|
# Caseing and fixed length string.
|
||||||
|
mac=$(printf "%12.12X" $((0x$baseMac)))
|
||||||
|
|
||||||
# Get system serial number.
|
# Get system serial number.
|
||||||
serial=$(uci -q get cwmp.cpe.serial_number)
|
serial=$(db -q get hw.board.serial_number)
|
||||||
if [ -z "${serial}" ]; then
|
|
||||||
serial=$(db -q get device.deviceinfo.SerialNumber)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Get userid values
|
uci -q batch <<-EOF
|
||||||
acs_userid=$(uci -q get cwmp.acs.userid)
|
set cwmp.acs.userid="${mac:0:6}-${serial}"
|
||||||
cpe_userid=$(uci -q get cwmp.cpe.userid)
|
set cwmp.cpe.userid="${mac:0:6}-${serial}"
|
||||||
|
EOF
|
||||||
|
|
||||||
# Only set if they are empty
|
|
||||||
if [ -z "$acs_userid" ]
|
|
||||||
then
|
|
||||||
uci -q set cwmp.acs.userid="${oui}-${serial}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$cpe_userid" ]
|
|
||||||
then
|
|
||||||
uci -q set cwmp.cpe.userid="${oui}-${serial}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# No need for commit here, it is done by uci_apply_defaults().
|
# No need for commit here, it is done by uci_apply_defaults().
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
uci -q batch <<-EOT
|
|
||||||
delete firewall.cwmp
|
|
||||||
set firewall.cwmp=include
|
|
||||||
set firewall.cwmp.path=/etc/firewall.cwmp
|
|
||||||
set firewall.cwmp.reload=1
|
|
||||||
commit firewall
|
|
||||||
EOT
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
54
icwmp/files/etc/uci-defaults/90-icwmp-set-dhcp-reqopts
Normal file
54
icwmp/files/etc/uci-defaults/90-icwmp-set-dhcp-reqopts
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. /lib/functions.sh
|
||||||
|
|
||||||
|
set_cwmp_reqopts() {
|
||||||
|
### Ask for DHCP Option 43 only if CWMP is enabled ###
|
||||||
|
local wan=$(uci -q get cwmp.cpe.default_wan_interface)
|
||||||
|
local dhcp_discovery=$(uci -q get cwmp.acs.dhcp_discovery)
|
||||||
|
local discovery=0
|
||||||
|
case $dhcp_discovery in
|
||||||
|
enable|1) discovery=1 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
local newreqopts=
|
||||||
|
local baseopts=
|
||||||
|
local reqopts="$(uci -q get network.$wan.reqopts)"
|
||||||
|
local proto="$(uci -q get network.$wan.proto)"
|
||||||
|
local tropts="43"
|
||||||
|
local oldreqopts="$reqopts"
|
||||||
|
local ropt iopt
|
||||||
|
for ropt in $reqopts; do
|
||||||
|
case $ropt in
|
||||||
|
43) ;;
|
||||||
|
*) baseopts="$baseopts $ropt" ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
ropt=""
|
||||||
|
reqopts="$baseopts $tropts"
|
||||||
|
for ropt in $reqopts; do
|
||||||
|
case $ropt in
|
||||||
|
43) [ $discovery -eq 1 ] && newreqopts="$newreqopts $ropt" ;;
|
||||||
|
*) newreqopts="$newreqopts $ropt" ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
if [ "$proto" == "dhcp" ]; then
|
||||||
|
newreqopts="$(echo $newreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')"
|
||||||
|
oldreqopts="$(echo $oldreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')"
|
||||||
|
[ "$newreqopts" == "$oldreqopts" ] && return
|
||||||
|
uci -q set network.$wan.reqopts="$newreqopts"
|
||||||
|
uci commit network
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
regenerate_ssl_link(){
|
||||||
|
local cert_dir="/etc/ssl/certs"
|
||||||
|
local all_file=$(ls $cert_dir/*.pem)
|
||||||
|
for cfile in $all_file
|
||||||
|
do
|
||||||
|
ln -s $cfile $cert_dir/$(openssl x509 -hash -noout -in $cfile).0
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
set_cwmp_reqopts
|
||||||
|
regenerate_ssl_link
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. /lib/functions.sh
|
|
||||||
|
|
||||||
regenerate_ssl_link_path()
|
|
||||||
{
|
|
||||||
local cert_dir all_file rehash
|
|
||||||
|
|
||||||
cert_dir="${1}"
|
|
||||||
|
|
||||||
all_file=$(ls $cert_dir/*.pem 2>/dev/null)
|
|
||||||
|
|
||||||
[ ! -d "${cert_dir}" ] && return 0;
|
|
||||||
[ ! -f "${all_file}" ] && return 0;
|
|
||||||
|
|
||||||
for cfile in $all_file
|
|
||||||
do
|
|
||||||
rehash="$(openssl x509 -hash -noout -in $cfile)"
|
|
||||||
[ -f ${cert_dir}/${rehash}.0 ] || \
|
|
||||||
ln -s $cfile $cert_dir/${rehash}.0
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
regenerate_ssl_link()
|
|
||||||
{
|
|
||||||
local cwmp_ca_path
|
|
||||||
|
|
||||||
regenerate_ssl_link_path "/etc/ssl/certs"
|
|
||||||
|
|
||||||
cwmp_ca_path=$(uci -q get cwmp.acs.ssl_capath)
|
|
||||||
if [[ "${cwmp_ca_path}" != "/etc/ssl/certs"* ]]; then
|
|
||||||
if [ -n "${cwmp_ca_path}" ]; then
|
|
||||||
regenerate_ssl_link_path "${cwmp_ca_path}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
regenerate_ssl_link
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/var/run/icwmpd/icwmpd_backup_session.xml
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
diff --git a/ssl_utils.c b/ssl_utils.c
|
|
||||||
index db66fea..cb9d0d8 100644
|
|
||||||
--- a/ssl_utils.c
|
|
||||||
+++ b/ssl_utils.c
|
|
||||||
@@ -29,6 +29,7 @@
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
+#include <stdlib.h>
|
|
||||||
|
|
||||||
#include "common.h"
|
|
||||||
#include "log.h"
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
[ -f /etc/config/xmpp ] || exit 0
|
[ -f /etc/config/cwmp_xmpp ] || exit 0
|
||||||
|
|
||||||
[ "$ACTION" == "ifup" ] || exit 0
|
[ "$ACTION" == "ifup" ] || exit 0
|
||||||
[ "$INTERFACE" == "loopback" ] && exit 0
|
[ "$INTERFACE" == "loopback" ] && exit 0
|
||||||
@@ -17,5 +17,5 @@ local proto="$(uci -q get network.$INTERFACE.proto)"
|
|||||||
local ifname="$(uci -q get network.$INTERFACE.ifname)"
|
local ifname="$(uci -q get network.$INTERFACE.ifname)"
|
||||||
[ "${ifname:0:1}" == "@" ] && exit 0
|
[ "${ifname:0:1}" == "@" ] && exit 0
|
||||||
|
|
||||||
/etc/init.d/xmppc reload &
|
/etc/init.d/icwmp_xmppd reload &
|
||||||
|
|
||||||
@@ -1,14 +1,29 @@
|
|||||||
if (PACKAGE_ieee1905)
|
if PACKAGE_ieee1905 || PACKAGE_lib1905al
|
||||||
|
|
||||||
menu "Configurations"
|
menu "developer/debug options"
|
||||||
|
|
||||||
config IEEE1905_EXTENSION_ALLOWED
|
config IEEE1905_MAP_COMPLETE_NETWORK
|
||||||
bool "Allow plugins to extend 1905 CMDUs and/or TLVs"
|
bool "Create network topology for complete network"
|
||||||
default y
|
default n
|
||||||
|
|
||||||
config IEEE1905_PLATFORM_HAS_WIFI
|
config IEEE1905_SPEED_UP_DISCOVERY
|
||||||
bool "Platform has WiFi"
|
bool "Speed up discovery of an AL in network"
|
||||||
default y if PACKAGE_libwifi
|
default y
|
||||||
|
|
||||||
|
config IEEE1905_DO_NOT_ACCEPT_UNAUTHENTICATED_COMMANDS
|
||||||
|
bool "Do not accept M1/M2 messages from unknown AL(s)"
|
||||||
|
default y
|
||||||
|
|
||||||
|
choice
|
||||||
|
prompt "Select ALME support"
|
||||||
|
default IEEE1905_ALME_OVER_UBUS
|
||||||
|
|
||||||
|
config IEEE1905_ALME_OVER_UBUS
|
||||||
|
bool "ALME methods supported over ubus"
|
||||||
|
|
||||||
|
config IEEE1905_ALME_OVER_TCP
|
||||||
|
bool "ALME server over TCP port"
|
||||||
|
|
||||||
|
endchoice
|
||||||
endmenu
|
endmenu
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
if (PACKAGE_map-plugin)
|
|
||||||
|
|
||||||
menu "Configurations"
|
|
||||||
|
|
||||||
config MULTIAP_DYNAMIC_CNTLR_SYNC_CONFIG
|
|
||||||
bool "Sync configuration between dynamic controllers in the network"
|
|
||||||
default n
|
|
||||||
|
|
||||||
config MULTIAP_FUZZ_1905_CMDUS
|
|
||||||
bool "Include support to fuzz 1905 CMDUs for testing purpose"
|
|
||||||
default n
|
|
||||||
|
|
||||||
endmenu
|
|
||||||
endif
|
|
||||||
@@ -1,150 +1,113 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2021 IOPSYS
|
# Copyright (C) 2019 Iopsys
|
||||||
#
|
#
|
||||||
|
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=ieee1905
|
PKG_NAME:=ieee1905
|
||||||
PKG_VERSION:=4.9.0
|
PKG_VERSION:=2.0.18
|
||||||
|
|
||||||
LOCAL_DEV=0
|
LOCAL_DEV:=0
|
||||||
ifneq ($(LOCAL_DEV),1)
|
ifneq ($(LOCAL_DEV),1)
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_VERSION:=69b27e3e1509b9192c529fbba6a329cc0532cfbb
|
PKG_SOURCE_VERSION:=44035a3bb0dd7e9fc1feb037c72c2c0d33692a98
|
||||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ieee1905.git
|
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ieee1905.git
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||||
PKG_MIRROR_HASH:=skip
|
|
||||||
endif
|
endif
|
||||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
|
||||||
|
|
||||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||||
PKG_LICENSE:=BSD-3-Clause
|
|
||||||
PKG_LICENSE_FILES:=LICENSE
|
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
define Package/ieee1905
|
||||||
define Package/ieee1905/Default
|
|
||||||
SECTION:=utils
|
SECTION:=utils
|
||||||
CATEGORY:=Utilities
|
CATEGORY:=Utilities
|
||||||
SUBMENU:=IEEE-1905.1 stack
|
TITLE:=IEEE1905 daemon
|
||||||
|
DEPENDS:= +libuci +libjson-c +lib1905 +ubox +libpcap +libopenssl +libwifi +libeasy
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/ieee1905/config
|
define Package/ieee1905/config
|
||||||
source "$(SOURCE)/Config.in"
|
source "$(SOURCE)/Config.in"
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/libieee1905
|
|
||||||
$(call Package/ieee1905/Default,$(1))
|
|
||||||
TITLE+= (library for CMDU and TLV handling)
|
|
||||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
|
|
||||||
+libjson-c +libblobmsg-json
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/ieee1905
|
|
||||||
$(call Package/ieee1905/Default,$(1))
|
|
||||||
TITLE+= ieee1905d (daemon implementing 1905.1 and provides cli)
|
|
||||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
|
|
||||||
+libjson-c +libblobmsg-json +ubus +libpthread \
|
|
||||||
+libieee1905 +IEEE1905_PLATFORM_HAS_WIFI:libwifi
|
|
||||||
endef
|
|
||||||
|
|
||||||
|
|
||||||
define Package/map-plugin
|
|
||||||
$(call Package/ieee1905/Default,$(1))
|
|
||||||
TITLE:=Multi-AP (Easymesh) plugin
|
|
||||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
|
|
||||||
+libjson-c +libblobmsg-json +ieee1905 +libieee1905
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/map-plugin/config
|
|
||||||
source "$(SOURCE)/Config.map-plugin.in"
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/ieee1905/description
|
define Package/ieee1905/description
|
||||||
This package provides IEEE Std 1905.1 stack.
|
IEEE1905 stack with extended functionalities.
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/libieee1905/description
|
define Package/lib1905
|
||||||
This package provides library functions for IEEE Std 1905.1 stack.
|
SECTION:=utils
|
||||||
|
CATEGORY:=Utilities
|
||||||
|
TITLE:=IEEE1905 cmdu tlv utility library
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/lib1905hle
|
||||||
|
SECTION:=utils
|
||||||
|
CATEGORY:=Utilities
|
||||||
|
TITLE:=IEEE1905 hle stack library
|
||||||
endef
|
endef
|
||||||
|
|
||||||
TARGET_CFLAGS += \
|
TARGET_CFLAGS += \
|
||||||
-I$(STAGING_DIR)/usr/include \
|
-I$(STAGING_DIR)/usr/include \
|
||||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
-D_GNU_SOURCE \
|
||||||
-D_GNU_SOURCE
|
-fstrict-aliasing \
|
||||||
|
-Wall \
|
||||||
|
-Wextra
|
||||||
|
|
||||||
ifeq ($(CONFIG_IEEE1905_PLATFORM_HAS_WIFI),y)
|
ifeq ($(CONFIG_IEEE1905_SPEED_UP_DISCOVERY),y)
|
||||||
TARGET_CFLAGS += -DHAS_WIFI
|
TARGET_CFLAGS += -DSPEED_UP_DISCOVERY
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(CONFIG_IEEE1905_DO_NOT_ACCEPT_UNAUTHENTICATED_COMMANDS),y)
|
||||||
ifeq ($(CONFIG_MULTIAP_DYNAMIC_CNTLR_SYNC_CONFIG),y)
|
TARGET_CFLAGS += -DDO_NOT_ACCEPT_UNAUTHENTICATED_COMMANDS
|
||||||
TARGET_CFLAGS += -DDYNAMIC_CNTLR_SYNC_CONFIG
|
endif
|
||||||
|
ifeq ($(CONFIG_IEEE1905_ALME_OVER_TCP),y)
|
||||||
|
TARGET_CFLAGS += -DALME_OVER_TCP
|
||||||
|
endif
|
||||||
|
ifeq ($(CONFIG_IEEE1905_ALME_OVER_UBUS),y)
|
||||||
|
TARGET_CFLAGS += -DALME_OVER_UBUS
|
||||||
|
endif
|
||||||
|
ifeq ($(CONFIG_IEEE1905_MAP_COMPLETE_NETWORK),y)
|
||||||
|
TARGET_CFLAGS += -DIEEE1905_MAP_COMPLETE_NETWORK
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
MAKE_PATH:=src
|
|
||||||
|
|
||||||
|
|
||||||
define Package/ieee1905/install
|
|
||||||
$(CP) ./files/* $(1)/
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
|
||||||
$(INSTALL_DIR) $(1)/usr/sbin
|
|
||||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ieee1905d $(1)/usr/sbin/
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/libieee1905/install
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/src/libieee1905.so $(1)/usr/lib/
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/src/libmidgen.so $(1)/usr/lib/
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/map-plugin/install
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/libmaputil.so $(1)/usr/lib/libmaputil.so
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/map.so $(1)/usr/lib/ieee1905/map.so
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/InstallDev/map-plugin
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib
|
|
||||||
$(INSTALL_DIR) $(1)/usr/include
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/map2.h $(1)/usr/include/map2.h
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/map_module.h $(1)/usr/include/map_module.h
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/cntlrsync.h $(1)/usr/include/cntlrsync.h
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/map.so $(1)/usr/lib/ieee1905/map.so
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/libmaputil.so $(1)/usr/lib/libmaputil.so
|
|
||||||
endef
|
|
||||||
|
|
||||||
|
|
||||||
define Build/InstallDev/libieee1905
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib
|
|
||||||
$(INSTALL_DIR) $(1)/usr/include
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/src/cmdu.h $(1)/usr/include/
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/src/cmdu_ackq.h $(1)/usr/include/
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/src/1905_tlvs.h $(1)/usr/include/
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/src/i1905_wsc.h $(1)/usr/include/
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/src/bufutil.h $(1)/usr/include/
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/src/timer_impl.h $(1)/usr/include/
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/src/i1905_extension.h $(1)/usr/include/
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/src/libmidgen.so $(1)/usr/lib/
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/src/libieee1905.so $(1)/usr/lib/
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/InstallDev
|
|
||||||
$(call Build/InstallDev/libieee1905,$(1),$(2))
|
|
||||||
$(call Build/InstallDev/map-plugin,$(1),$(2))
|
|
||||||
endef
|
|
||||||
|
|
||||||
ifeq ($(LOCAL_DEV),1)
|
ifeq ($(LOCAL_DEV),1)
|
||||||
define Build/Prepare
|
define Build/Prepare
|
||||||
rsync -r --exclude=.* ~/git/ieee1905/ $(PKG_BUILD_DIR)/
|
$(CP) -rf ~/git/ieee1905/* $(PKG_BUILD_DIR)/
|
||||||
endef
|
endef
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
define Package/ieee1905/install
|
||||||
|
$(INSTALL_DIR) $(1)/etc
|
||||||
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
|
$(INSTALL_DIR) $(1)/etc/config
|
||||||
|
$(INSTALL_DIR) $(1)/usr/
|
||||||
|
$(INSTALL_DIR) $(1)/usr/sbin
|
||||||
|
$(INSTALL_BIN) ./files/etc/init.d/ieee1905 $(1)/etc/init.d/ieee1905
|
||||||
|
$(INSTALL_DATA) ./files/etc/config/ieee1905 $(1)/etc/config/ieee1905
|
||||||
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ieee1905d $(1)/usr/sbin/
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/lib1905hle/install
|
||||||
|
$(INSTALL_DIR) $(1)/usr/lib
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/lib/lib1905hle.so $(1)/usr/lib/lib1905hle.so
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/lib1905/install
|
||||||
|
$(INSTALL_DIR) $(1)/usr/lib
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/lib/lib1905.so $(1)/usr/lib/lib1905.so
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/InstallDev
|
||||||
|
$(INSTALL_DIR) $(1)/usr/include
|
||||||
|
$(INSTALL_DIR) $(1)/usr/include/lib1905
|
||||||
|
$(INSTALL_DIR) $(1)/usr/include/ieee1905
|
||||||
|
$(INSTALL_DIR) $(1)/usr/include/lib1905hle
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/include/*.h $(1)/usr/include/ieee1905/
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/lib1905/include/*.h $(1)/usr/include/lib1905/
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/lib1905hle/include/*.h $(1)/usr/include/lib1905hle/
|
||||||
|
$(INSTALL_DIR) $(1)/usr/lib
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/lib/lib1905.so $(1)/usr/lib
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call BuildPackage,lib1905))
|
||||||
|
$(eval $(call BuildPackage,lib1905hle))
|
||||||
$(eval $(call BuildPackage,ieee1905))
|
$(eval $(call BuildPackage,ieee1905))
|
||||||
$(eval $(call BuildPackage,libieee1905))
|
|
||||||
$(eval $(call BuildPackage,map-plugin))
|
|
||||||
|
|||||||
38
ieee1905/files/etc/config/ieee1905
Executable file → Normal file
38
ieee1905/files/etc/config/ieee1905
Executable file → Normal file
@@ -1,26 +1,20 @@
|
|||||||
config ieee1905 'ieee1905'
|
config ieee1905 'ieee1905'
|
||||||
option enabled '1'
|
option enabled '1'
|
||||||
option extension '1'
|
option debug true
|
||||||
list extmodule 'map'
|
option debug_level 2
|
||||||
option registrar '2 5'
|
option macaddress 'auto'
|
||||||
# option macaddress '0a:1b:2c:3d:4e:50'
|
option registrar 0
|
||||||
|
option cmdu_event 1
|
||||||
|
option map_plugin 0
|
||||||
|
|
||||||
|
config security 'security'
|
||||||
|
list method 'PBC'
|
||||||
|
option ssid ''
|
||||||
|
option encryption ''
|
||||||
|
option key 'TESTPASSWORD'
|
||||||
|
|
||||||
config al-iface
|
config al-iface
|
||||||
option enabled '1'
|
option enabled 1
|
||||||
option ifname 'br-lan'
|
option ifname 'br-lan'
|
||||||
option type 'bridge'
|
option media 'bridge'
|
||||||
|
|
||||||
# ap sections are auto-generated/overwritten during onboarding
|
|
||||||
#
|
|
||||||
config ap
|
|
||||||
option band '2'
|
|
||||||
option ssid 'IOWRT-2.4GHz'
|
|
||||||
option encryption 'sae-mixed'
|
|
||||||
option key '1234567890'
|
|
||||||
|
|
||||||
config ap
|
|
||||||
option band '5'
|
|
||||||
option ssid 'IOWRT-5GHz'
|
|
||||||
option encryption 'sae-mixed'
|
|
||||||
option key '1234567890'
|
|
||||||
|
|
||||||
|
|||||||
120
ieee1905/files/etc/init.d/ieee1905
Executable file → Normal file
120
ieee1905/files/etc/init.d/ieee1905
Executable file → Normal file
@@ -1,100 +1,64 @@
|
|||||||
#!/bin/sh /etc/rc.common
|
#!/bin/sh /etc/rc.common
|
||||||
|
|
||||||
START=96
|
START=99
|
||||||
STOP=21
|
STOP=10
|
||||||
|
|
||||||
USE_PROCD=1
|
USE_PROCD=1
|
||||||
|
PROG=/usr/sbin/ieee1905d
|
||||||
|
|
||||||
IS_CFG_VALID=1
|
validate_ieee1905_section()
|
||||||
|
{
|
||||||
validate_ieee1905_section() {
|
uci_validate_section ieee1905 ieee1905 "${1}" \
|
||||||
uci_validate_section ieee1905 ieee1905 "ieee1905" \
|
'debug:bool:false' \
|
||||||
'enabled:bool:true' \
|
'enabled:bool:false'
|
||||||
'macaddress:or("auto",macaddr)' \
|
|
||||||
'registrar:string' \
|
|
||||||
'extension:bool:false' \
|
|
||||||
'extmodule:list(string)' \
|
|
||||||
|
|
||||||
[ "$?" -ne 0 ] && {
|
|
||||||
logger -s -t "ieee1905" "Validation of ieee1905 section failed"
|
|
||||||
IS_CFG_VALID=0
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
validate_ali_section() {
|
configure_ieee1905()
|
||||||
local section="$1"
|
{
|
||||||
|
local enabled debug
|
||||||
|
|
||||||
uci_validate_section ieee1905 $section "${1}" \
|
validate_ieee1905_section ${1} || {
|
||||||
'ifname:string' \
|
echo "Validation of ieee1905 section failed"
|
||||||
'type:or("bridge",string)'
|
exit 1;
|
||||||
|
|
||||||
[ "$?" -ne 0 ] && {
|
|
||||||
logger -s -t "ieee1905" "Validation of al-iface section $section failed"
|
|
||||||
IS_CFG_VALID=0
|
|
||||||
return 1
|
|
||||||
}
|
}
|
||||||
return 0
|
|
||||||
|
if [ ${debug} -eq 1 ]; then
|
||||||
|
# Forward stdout of the command to logd
|
||||||
|
procd_set_param stdout 1
|
||||||
|
# Same for stderr
|
||||||
|
procd_set_param stderr 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ${enabled} -ne 1 ]; then
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
validate_ap_section() {
|
configure_network()
|
||||||
local section="$1"
|
{
|
||||||
|
ebtables -L FORWARD|grep -iqE "1:80:C2:(0)+:(0)+:13.*-j.*DROP"
|
||||||
uci_validate_section ieee1905 $section "${1}" \
|
if [ "$?" -ne 0 ]; then
|
||||||
'band:or("2", "5", "60")' \
|
echo "Applying drop rule to drop pkts forwared by kernel to 1905.1 multicast mac"
|
||||||
'ssid:string' \
|
ebtables -A FORWARD -d 01:80:c2:00:00:13 -j DROP
|
||||||
'encryption:or("psk2", "sae-mixed", "sae", string)' \
|
fi
|
||||||
'key:string' \
|
|
||||||
'uuid:string' \
|
|
||||||
'manufacturer:string' \
|
|
||||||
'model_name:string' \
|
|
||||||
'device_name:string' \
|
|
||||||
'model_number:string' \
|
|
||||||
'serial_number:string' \
|
|
||||||
'device_type:string' \
|
|
||||||
'os_version:uinteger'
|
|
||||||
|
|
||||||
[ "$?" -ne 0 ] && {
|
|
||||||
logger -s -t "ieee1905" "Validation of ap section $section failed"
|
|
||||||
IS_CFG_VALID=0
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
validate_ieee1905_config() {
|
|
||||||
IS_CFG_VALID=1
|
|
||||||
|
|
||||||
validate_ieee1905_section &&
|
|
||||||
config_foreach validate_ali_section "al-iface" &&
|
|
||||||
config_foreach validate_ap_section ap
|
|
||||||
|
|
||||||
[ "$IS_CFG_VALID" -ne 1 ] && {
|
|
||||||
logger -s -t "ieee1905" "Validation of ieee1905 UCI file failed"
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start_service() {
|
start_service() {
|
||||||
config_load "ieee1905"
|
procd_open_instance ieee1905
|
||||||
validate_ieee1905_config || return 1;
|
procd_set_param command ${PROG}
|
||||||
|
configure_ieee1905 "ieee1905"
|
||||||
procd_open_instance
|
configure_network
|
||||||
procd_set_param command "/usr/sbin/ieee1905d"
|
|
||||||
procd_set_param respawn
|
procd_set_param respawn
|
||||||
# procd_set_param stdout 1
|
|
||||||
# procd_set_param stderr 1
|
|
||||||
procd_close_instance
|
procd_close_instance
|
||||||
}
|
}
|
||||||
|
|
||||||
service_triggers()
|
|
||||||
{
|
|
||||||
procd_add_reload_trigger "ieee1905"
|
|
||||||
}
|
|
||||||
|
|
||||||
reload_service() {
|
reload_service() {
|
||||||
stop
|
stop
|
||||||
start
|
start
|
||||||
}
|
}
|
||||||
|
|
||||||
|
service_triggers() {
|
||||||
|
procd_add_reload_trigger "network"
|
||||||
|
procd_add_reload_trigger "wireless"
|
||||||
|
procd_add_reload_trigger "netmode"
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,16 +5,15 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=imonitor
|
PKG_NAME:=imonitor
|
||||||
PKG_VERSION:=1.0.1
|
PKG_VERSION:=1.0.0
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
PKG_BUILD_PARALLEL:=1
|
PKG_BUILD_PARALLEL:=1
|
||||||
PKG_INSTALL:=1
|
PKG_INSTALL:=1
|
||||||
|
|
||||||
PKG_SOURCE_PROTO=git
|
PKG_SOURCE_PROTO=git
|
||||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/imonitor.git
|
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/imonitor.git
|
||||||
PKG_SOURCE_VERSION:=4beb1d5d6925507f1850a84c0b83aaf12a082f7f
|
PKG_SOURCE_VERSION:=532f4900862bcb45d8cd4bf37555fabda81750b6
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||||
PKG_MIRROR_HASH:=skip
|
|
||||||
PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION}
|
PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION}
|
||||||
PKG_INSTALL:=1
|
PKG_INSTALL:=1
|
||||||
PKG_BUILD_PARALLEL:=1
|
PKG_BUILD_PARALLEL:=1
|
||||||
|
|||||||
@@ -9,14 +9,14 @@ include $(TOPDIR)/rules.mk
|
|||||||
include $(INCLUDE_DIR)/kernel.mk
|
include $(INCLUDE_DIR)/kernel.mk
|
||||||
|
|
||||||
PKG_NAME:=inbd
|
PKG_NAME:=inbd
|
||||||
PKG_VERSION:=1.2.2
|
PKG_VERSION:=1.0.1
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_SOURCE_VERSION:=10f765f3d0fcc226b6ecf0c481598c9e7f76315e
|
PKG_SOURCE_VERSION:=3135944f3357a7a2c1c206be7b65bbb7ac6d1e58
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/inbd
|
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/inbd
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
|
||||||
PKG_MIRROR_HASH:=skip
|
|
||||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
config TARGET_VERSION
|
|
||||||
string
|
|
||||||
prompt "Software Version"
|
|
||||||
|
|
||||||
config TARGET_CUSTOMER
|
|
||||||
string
|
|
||||||
prompt "Customer ID"
|
|
||||||
@@ -24,10 +24,6 @@ define Package/iop/description
|
|||||||
This package contains iopsysWrt SDK utilities
|
This package contains iopsysWrt SDK utilities
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/iop/config
|
|
||||||
source "$(SOURCE)/Config.in"
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/Compile
|
define Build/Compile
|
||||||
true
|
true
|
||||||
endef
|
endef
|
||||||
|
|||||||
297
iop/config
297
iop/config
@@ -1,138 +1,26 @@
|
|||||||
############
|
CONFIG_BUILD_NLS=y
|
||||||
# Generic #
|
CONFIG_BUSYBOX_CUSTOM=y
|
||||||
##########
|
|
||||||
|
|
||||||
# Build #
|
|
||||||
CONFIG_BUILD_LOG=y
|
|
||||||
CONFIG_CCACHE=y
|
CONFIG_CCACHE=y
|
||||||
CONFIG_DEBUG=y
|
CONFIG_DEBUG=y
|
||||||
CONFIG_DEVEL=y
|
CONFIG_DEVEL=y
|
||||||
# CONFIG_USE_SSTRIP is not set
|
|
||||||
CONFIG_USE_STRIP=y
|
|
||||||
# CONFIG_SIGNED_PACKAGES is not set
|
|
||||||
|
|
||||||
# Image #
|
|
||||||
CONFIG_TARGET_CUSTOMER="IOPSYS"
|
|
||||||
CONFIG_TARGET_ROOTFS_TARGZ=y
|
|
||||||
|
|
||||||
# /etc/banner and /etc/device_info #
|
|
||||||
CONFIG_IMAGEOPT=y
|
|
||||||
CONFIG_VERSIONOPT=y
|
|
||||||
CONFIG_VERSION_MANUFACTURER="iopsysWrt"
|
|
||||||
CONFIG_VERSION_MANUFACTURER_URL="https://iopsys.eu/"
|
|
||||||
|
|
||||||
# /lib/preinit #
|
|
||||||
CONFIG_PREINITOPT=y
|
|
||||||
# CONFIG_TARGET_PREINIT_SUPPRESS_STDERR is not set
|
|
||||||
CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE=y
|
|
||||||
CONFIG_TARGET_PREINIT_TIMEOUT=1
|
|
||||||
# CONFIG_TARGET_PREINIT_SHOW_NETMSG is not set
|
|
||||||
# CONFIG_TARGET_PREINIT_SUPPRESS_FAILSAFE_NETMSG is not set
|
|
||||||
CONFIG_TARGET_PREINIT_IFNAME=""
|
|
||||||
CONFIG_TARGET_PREINIT_IP=""
|
|
||||||
CONFIG_TARGET_PREINIT_NETMASK=""
|
|
||||||
CONFIG_TARGET_PREINIT_BROADCAST=""
|
|
||||||
|
|
||||||
# Mirror #
|
|
||||||
CONFIG_LOCALMIRROR="https://download.iopsys.eu/iopsys/mirror/"
|
|
||||||
|
|
||||||
|
|
||||||
##################
|
|
||||||
# IOWRT Add-ons #
|
|
||||||
################
|
|
||||||
|
|
||||||
# EasySoC HAL #
|
|
||||||
CONFIG_PACKAGE_inbd=y
|
|
||||||
CONFIG_PACKAGE_libwifi=y
|
|
||||||
CONFIG_PACKAGE_peripheral_manager=y
|
|
||||||
CONFIG_PACKAGE_port-management=y
|
|
||||||
CONFIG_PACKAGE_wifimngr=y
|
|
||||||
|
|
||||||
# Multi-AP #
|
|
||||||
CONFIG_PACKAGE_ieee1905=y
|
|
||||||
CONFIG_PACKAGE_map-topology=y
|
|
||||||
CONFIG_PACKAGE_wfadatad-collector=y
|
|
||||||
|
|
||||||
# Network #
|
|
||||||
CONFIG_PACKAGE_netmode=y
|
|
||||||
CONFIG_PACKAGE_owsd=m
|
|
||||||
CONFIG_PACKAGE_urlfilter=y
|
|
||||||
|
|
||||||
# System #
|
|
||||||
CONFIG_PACKAGE_imonitor=m
|
|
||||||
CONFIG_PACKAGE_questd=y
|
|
||||||
CONFIG_PACKAGE_rulengd=y
|
|
||||||
|
|
||||||
# TR-x69 #
|
|
||||||
CONFIG_PACKAGE_uspd-mbedtls=y
|
|
||||||
CONFIG_PACKAGE_icwmp-mbedtls=y
|
|
||||||
CONFIG_PACKAGE_obuspa=y
|
|
||||||
CONFIG_PACKAGE_bulkdata=y
|
|
||||||
CONFIG_PACKAGE_periodicstats=y
|
|
||||||
CONFIG_PACKAGE_stunc-mbedtls=m
|
|
||||||
CONFIG_PACKAGE_swmodd=m
|
|
||||||
CONFIG_PACKAGE_twamp=m
|
|
||||||
CONFIG_PACKAGE_udpecho-client=m
|
|
||||||
CONFIG_PACKAGE_udpecho-server=m
|
|
||||||
CONFIG_PACKAGE_xmppc=m
|
|
||||||
|
|
||||||
# WebGUI #
|
|
||||||
CONFIG_PACKAGE_sulu=y
|
|
||||||
|
|
||||||
|
|
||||||
############
|
|
||||||
# Network #
|
|
||||||
##########
|
|
||||||
|
|
||||||
# Protocols #
|
|
||||||
CONFIG_PACKAGE_6in4=y
|
CONFIG_PACKAGE_6in4=y
|
||||||
CONFIG_PACKAGE_6rd=y
|
CONFIG_PACKAGE_6rd=y
|
||||||
CONFIG_PACKAGE_6to4=y
|
CONFIG_PACKAGE_6to4=y
|
||||||
|
CONFIG_PACKAGE_alsa-lib=y
|
||||||
CONFIG_PACKAGE_chat=y
|
CONFIG_PACKAGE_chat=y
|
||||||
CONFIG_PACKAGE_comgt=y
|
CONFIG_PACKAGE_comgt=y
|
||||||
CONFIG_PACKAGE_comgt-directip=y
|
CONFIG_PACKAGE_comgt-directip=y
|
||||||
CONFIG_PACKAGE_comgt-ncm=y
|
CONFIG_PACKAGE_comgt-ncm=y
|
||||||
CONFIG_PACKAGE_ds-lite=y
|
|
||||||
CONFIG_PACKAGE_gre=y
|
|
||||||
CONFIG_PACKAGE_map=y
|
|
||||||
CONFIG_PACKAGE_ntfs-3g=y
|
|
||||||
CONFIG_PACKAGE_ntpd=y
|
|
||||||
CONFIG_PACKAGE_odhcp6c=y
|
|
||||||
CONFIG_PACKAGE_odhcpd=y
|
|
||||||
CONFIG_PACKAGE_ppp-mod-pppoa=y
|
|
||||||
CONFIG_PACKAGE_ppp-mod-pppoe=y
|
|
||||||
CONFIG_PACKAGE_ppp-mod-pppol2tp=y
|
|
||||||
CONFIG_PACKAGE_ppp-mod-pptp=y
|
|
||||||
CONFIG_PACKAGE_ppp-multilink=y
|
|
||||||
# CONFIG_PACKAGE_ppp is not set
|
|
||||||
CONFIG_PACKAGE_relayd=y
|
|
||||||
CONFIG_PACKAGE_umbim=y
|
|
||||||
CONFIG_PACKAGE_uqmi=y
|
|
||||||
CONFIG_PACKAGE_wwan=y
|
|
||||||
CONFIG_PACKAGE_xl2tpd=y
|
|
||||||
|
|
||||||
# Services #
|
|
||||||
CONFIG_PACKAGE_atftp=m
|
|
||||||
CONFIG_PACKAGE_atftpd=m
|
|
||||||
CONFIG_PACKAGE_ddns-scripts=y
|
CONFIG_PACKAGE_ddns-scripts=y
|
||||||
CONFIG_PACKAGE_miniupnpd=y
|
CONFIG_PACKAGE_ds-lite=y
|
||||||
CONFIG_PACKAGE_mosquitto-client-ssl=y
|
|
||||||
CONFIG_PACKAGE_mosquitto-ssl=y
|
|
||||||
CONFIG_PACKAGE_nginx=y
|
|
||||||
CONFIG_PACKAGE_openvpn-easy-rsa=y
|
|
||||||
CONFIG_PACKAGE_openvpn-openssl=y
|
|
||||||
CONFIG_OPENVPN_openssl_ENABLE_IPROUTE2=y
|
|
||||||
# CONFIG_PACKAGE_qos-scripts is not set
|
|
||||||
CONFIG_PACKAGE_rdnssd=y
|
|
||||||
CONFIG_PACKAGE_vsftpd-tls=m
|
|
||||||
|
|
||||||
# Tools and Utilities #
|
|
||||||
CONFIG_PACKAGE_curl=y
|
|
||||||
CONFIG_PACKAGE_libcurl=y
|
|
||||||
CONFIG_LIBCURL_CRYPTO_AUTH=y
|
|
||||||
# CONFIG_LIBCURL_MBEDTLS is not set
|
|
||||||
CONFIG_LIBCURL_OPENSSL=y
|
|
||||||
CONFIG_PACKAGE_ethtool=y
|
CONFIG_PACKAGE_ethtool=y
|
||||||
|
CONFIG_PACKAGE_gdb=m
|
||||||
|
CONFIG_PACKAGE_getopt=y
|
||||||
|
CONFIG_PACKAGE_glib2=y
|
||||||
|
CONFIG_PACKAGE_icwmp-curl=y
|
||||||
|
CONFIG_PACKAGE_imonitor=m
|
||||||
|
CONFIG_PACKAGE_inbd=y
|
||||||
|
CONFIG_PACKAGE_iopupgrade=m
|
||||||
CONFIG_PACKAGE_ip-full=y
|
CONFIG_PACKAGE_ip-full=y
|
||||||
CONFIG_PACKAGE_iperf3=y
|
CONFIG_PACKAGE_iperf3=y
|
||||||
CONFIG_PACKAGE_ipset=y
|
CONFIG_PACKAGE_ipset=y
|
||||||
@@ -140,77 +28,87 @@ CONFIG_PACKAGE_iptables=y
|
|||||||
CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
|
CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
|
||||||
CONFIG_PACKAGE_iptables-mod-filter=y
|
CONFIG_PACKAGE_iptables-mod-filter=y
|
||||||
CONFIG_PACKAGE_iptables-mod-ipopt=y
|
CONFIG_PACKAGE_iptables-mod-ipopt=y
|
||||||
CONFIG_PACKAGE_ndisc6=y
|
|
||||||
CONFIG_PACKAGE_rdisc6=y
|
|
||||||
CONFIG_PACKAGE_resolveip=y
|
|
||||||
CONFIG_PACKAGE_tcpdump=y
|
|
||||||
CONFIG_PACKAGE_traceroute6=y
|
|
||||||
|
|
||||||
|
|
||||||
############
|
|
||||||
# System #
|
|
||||||
##########
|
|
||||||
|
|
||||||
CONFIG_PACKAGE_at=y
|
|
||||||
CONFIG_PACKAGE_getopt=y
|
|
||||||
# CONFIG_PACKAGE_iwatchdog is not set
|
# CONFIG_PACKAGE_iwatchdog is not set
|
||||||
CONFIG_PACKAGE_jq=y
|
CONFIG_PACKAGE_juci=y
|
||||||
CONFIG_PACKAGE_libustream-openssl=y
|
CONFIG_PACKAGE_juci-dnsmasq-dhcp=y
|
||||||
# CONFIG_PACKAGE_libustream-wolfssl is not set
|
CONFIG_PACKAGE_juci-firewall-fw3=y
|
||||||
|
CONFIG_PACKAGE_juci-mod-status=y
|
||||||
|
CONFIG_PACKAGE_juci-mod-system=y
|
||||||
|
CONFIG_PACKAGE_juci-network-device=y
|
||||||
|
CONFIG_PACKAGE_juci-network-dsl=y
|
||||||
|
CONFIG_PACKAGE_juci-network-netifd=y
|
||||||
|
CONFIG_PACKAGE_juci-sysupgrade=y
|
||||||
|
CONFIG_PACKAGE_juci-wireless=y
|
||||||
|
CONFIG_PACKAGE_juci-theme-iopsys=y
|
||||||
|
CONFIG_PACKAGE_libdaemon=y
|
||||||
|
CONFIG_PACKAGE_libgmp=y
|
||||||
|
CONFIG_PACKAGE_libreadline=y
|
||||||
|
CONFIG_PACKAGE_libwifi=y
|
||||||
|
CONFIG_PACKAGE_loop-detector=m
|
||||||
CONFIG_PACKAGE_lscpu=y
|
CONFIG_PACKAGE_lscpu=y
|
||||||
|
CONFIG_PACKAGE_map=y
|
||||||
|
CONFIG_PACKAGE_miniupnpd=y
|
||||||
|
CONFIG_PACKAGE_mwan3=y
|
||||||
CONFIG_PACKAGE_nand-utils=y
|
CONFIG_PACKAGE_nand-utils=y
|
||||||
|
CONFIG_PACKAGE_ndisc6=y
|
||||||
|
CONFIG_PACKAGE_netmode=y
|
||||||
|
CONFIG_PACKAGE_ntfs-3g=y
|
||||||
|
CONFIG_PACKAGE_ntpd=y
|
||||||
|
CONFIG_PACKAGE_obuspa=y
|
||||||
|
CONFIG_PACKAGE_odhcp6c=y
|
||||||
|
CONFIG_PACKAGE_odhcpd=y
|
||||||
CONFIG_PACKAGE_openssl-util=y
|
CONFIG_PACKAGE_openssl-util=y
|
||||||
CONFIG_OPENSSL_WITH_COMPRESSION=y
|
CONFIG_OPENSSL_WITH_COMPRESSION=y
|
||||||
|
CONFIG_PACKAGE_openvpn-easy-rsa=y
|
||||||
|
CONFIG_PACKAGE_openvpn-openssl=y
|
||||||
|
CONFIG_PACKAGE_peripheral_manager=y
|
||||||
|
CONFIG_PACKAGE_port-management=y
|
||||||
|
CONFIG_PACKAGE_ppp-mod-pppoa=y
|
||||||
|
CONFIG_PACKAGE_ppp-mod-pppoe=y
|
||||||
|
CONFIG_PACKAGE_ppp-mod-pppol2tp=y
|
||||||
|
CONFIG_PACKAGE_ppp-mod-pptp=y
|
||||||
|
CONFIG_PACKAGE_ppp-multilink=y
|
||||||
|
# CONFIG_PACKAGE_ppp is not set
|
||||||
|
# CONFIG_PACKAGE_qos-scripts is not set
|
||||||
|
CONFIG_PACKAGE_questd=y
|
||||||
|
CONFIG_PACKAGE_rdisc6=y
|
||||||
|
CONFIG_PACKAGE_rdnssd=y
|
||||||
|
CONFIG_PACKAGE_relayd=y
|
||||||
|
CONFIG_PACKAGE_resolveip=y
|
||||||
CONFIG_PACKAGE_rpcd=y
|
CONFIG_PACKAGE_rpcd=y
|
||||||
CONFIG_PACKAGE_rpcd-mod-rpcsys=y
|
CONFIG_PACKAGE_rpcd-mod-rpcsys=y
|
||||||
CONFIG_PACKAGE_rpcd-mod-rrdns=y
|
CONFIG_PACKAGE_rsync=y
|
||||||
|
CONFIG_PACKAGE_rulengd=y
|
||||||
CONFIG_PACKAGE_strace=y
|
CONFIG_PACKAGE_strace=y
|
||||||
|
CONFIG_PACKAGE_swmodd=m
|
||||||
|
CONFIG_PACKAGE_tc=y
|
||||||
|
CONFIG_PACKAGE_tcpdump=y
|
||||||
CONFIG_PACKAGE_terminfo=y
|
CONFIG_PACKAGE_terminfo=y
|
||||||
CONFIG_PACKAGE_uledd=y
|
CONFIG_PACKAGE_traceroute6=y
|
||||||
# The urandom-seed package is very strange. It seeds urandom with urandom...
|
CONFIG_PACKAGE_umbim=y
|
||||||
# Disable it. Most SoCs nowadays has HW random generators anyway.
|
CONFIG_PACKAGE_uqmi=y
|
||||||
# CONFIG_PACKAGE_urandom-seed is not set
|
|
||||||
# CONFIG_PACKAGE_urngd is not set
|
|
||||||
CONFIG_PACKAGE_usb-modeswitch=y
|
CONFIG_PACKAGE_usb-modeswitch=y
|
||||||
CONFIG_PACKAGE_uuidgen=y
|
CONFIG_PACKAGE_usbreset=y
|
||||||
|
CONFIG_PACKAGE_uspd=y
|
||||||
|
CONFIG_PACKAGE_wget=y
|
||||||
|
CONFIG_PACKAGE_wwan=y
|
||||||
|
CONFIG_PACKAGE_wifimngr=y
|
||||||
|
CONFIG_PACKAGE_xl2tpd=y
|
||||||
CONFIG_PACKAGE_zoneinfo-core=y
|
CONFIG_PACKAGE_zoneinfo-core=y
|
||||||
CONFIG_PACKAGE_zoneinfo-europe=y
|
CONFIG_PACKAGE_zoneinfo-europe=y
|
||||||
|
CONFIG_TARGET_CUSTOMER="IOPSYS"
|
||||||
|
# CONFIG_USE_SSTRIP is not set
|
||||||
################
|
CONFIG_USE_STRIP=y
|
||||||
# LuCI WebGUI #
|
CONFIG_BUILD_LOG=y
|
||||||
##############
|
|
||||||
|
|
||||||
# BEGIN: luci-nginx metapackage with some changes
|
|
||||||
# We do not want libiwinfo-lua on non-WiFi targets, but it is already
|
|
||||||
# depended on by other luci-packages, so no need to take it in explicitly
|
|
||||||
CONFIG_PACKAGE_luci-mod-admin-full=y
|
|
||||||
CONFIG_PACKAGE_luci-app-firewall=y
|
|
||||||
CONFIG_PACKAGE_luci-app-opkg=y
|
|
||||||
CONFIG_PACKAGE_luci-proto-ppp=y
|
|
||||||
CONFIG_PACKAGE_luci-proto-ipv6=y
|
|
||||||
# CONFIG_LUCI_JSMIN is not set
|
|
||||||
# CONFIG_LUCI_CSSTIDY is not set
|
|
||||||
CONFIG_PACKAGE_luci-mod-dashboard=y
|
|
||||||
CONFIG_PACKAGE_luci-theme-openwrt-2020=y
|
|
||||||
CONFIG_PACKAGE_nginx-mod-luci=y
|
|
||||||
|
|
||||||
|
|
||||||
############
|
|
||||||
# BusyBox #
|
|
||||||
##########
|
|
||||||
|
|
||||||
CONFIG_BUSYBOX_CUSTOM=y
|
|
||||||
CONFIG_BUSYBOX_CONFIG_ADDUSER=y
|
CONFIG_BUSYBOX_CONFIG_ADDUSER=y
|
||||||
CONFIG_BUSYBOX_CONFIG_ARPING=y
|
CONFIG_BUSYBOX_CONFIG_ARPING=y
|
||||||
CONFIG_BUSYBOX_CONFIG_ASH_IDLE_TIMEOUT=y
|
|
||||||
CONFIG_BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT=y
|
CONFIG_BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT=y
|
||||||
CONFIG_BUSYBOX_CONFIG_CTTYHACK=y
|
CONFIG_BUSYBOX_CONFIG_CTTYHACK=y
|
||||||
CONFIG_BUSYBOX_CONFIG_DELUSER=y
|
CONFIG_BUSYBOX_CONFIG_DELUSER=y
|
||||||
# CONFIG_BUSYBOX_CONFIG_DEVMEM is not set
|
# CONFIG_BUSYBOX_CONFIG_DEVMEM is not set
|
||||||
CONFIG_BUSYBOX_CONFIG_FEATURE_UDHCP_8021Q=y
|
CONFIG_BUSYBOX_CONFIG_FEATURE_UDHCP_8021Q=y
|
||||||
CONFIG_BUSYBOX_CONFIG_FIRST_SYSTEM_ID=100
|
CONFIG_BUSYBOX_CONFIG_FIRST_SYSTEM_ID=100
|
||||||
# CONFIG_BUSYBOX_CONFIG_HTTPD is not set
|
CONFIG_BUSYBOX_CONFIG_HTTPD=y
|
||||||
# CONFIG_BUSYBOX_CONFIG_INSMOD is not set
|
# CONFIG_BUSYBOX_CONFIG_INSMOD is not set
|
||||||
# CONFIG_BUSYBOX_CONFIG_MODINFO is not set
|
# CONFIG_BUSYBOX_CONFIG_MODINFO is not set
|
||||||
# CONFIG_BUSYBOX_CONFIG_MODPROBE is not set
|
# CONFIG_BUSYBOX_CONFIG_MODPROBE is not set
|
||||||
@@ -220,7 +118,6 @@ CONFIG_BUSYBOX_CONFIG_FEATURE_MODUTILS_ALIAS=y
|
|||||||
CONFIG_BUSYBOX_CONFIG_FEATURE_MODUTILS_SYMBOLS=y
|
CONFIG_BUSYBOX_CONFIG_FEATURE_MODUTILS_SYMBOLS=y
|
||||||
CONFIG_BUSYBOX_CONFIG_DEFAULT_MODULES_DIR="/lib/modules"
|
CONFIG_BUSYBOX_CONFIG_DEFAULT_MODULES_DIR="/lib/modules"
|
||||||
CONFIG_BUSYBOX_CONFIG_DEFAULT_DEPMOD_FILE="modules.dep"
|
CONFIG_BUSYBOX_CONFIG_DEFAULT_DEPMOD_FILE="modules.dep"
|
||||||
# CONFIG_BUSYBOX_CONFIG_IP is not set
|
|
||||||
CONFIG_BUSYBOX_CONFIG_LAST_SYSTEM_ID=999
|
CONFIG_BUSYBOX_CONFIG_LAST_SYSTEM_ID=999
|
||||||
CONFIG_BUSYBOX_CONFIG_LOGIN=y
|
CONFIG_BUSYBOX_CONFIG_LOGIN=y
|
||||||
# CONFIG_BUSYBOX_CONFIG_LSMOD is not set
|
# CONFIG_BUSYBOX_CONFIG_LSMOD is not set
|
||||||
@@ -267,20 +164,36 @@ CONFIG_BUSYBOX_CONFIG_FLOAT_DURATION=y
|
|||||||
CONFIG_BUSYBOX_CONFIG_USLEEP=y
|
CONFIG_BUSYBOX_CONFIG_USLEEP=y
|
||||||
CONFIG_BUSYBOX_CONFIG_REALPATH=y
|
CONFIG_BUSYBOX_CONFIG_REALPATH=y
|
||||||
CONFIG_BUSYBOX_CONFIG_TTY=y
|
CONFIG_BUSYBOX_CONFIG_TTY=y
|
||||||
CONFIG_BUSYBOX_CONFIG_BLOCKDEV=y
|
CONFIG_LIBCURL_CRYPTO_AUTH=y
|
||||||
CONFIG_BUSYBOX_CONFIG_PARTPROBE=y
|
# CONFIG_LIBCURL_MBEDTLS is not set
|
||||||
CONFIG_BUSYBOX_CONFIG_LFS=y
|
CONFIG_LIBCURL_OPENSSL=y
|
||||||
CONFIG_BUSYBOX_CONFIG_FDISK=y
|
CONFIG_OPENVPN_openssl_ENABLE_IPROUTE2=y
|
||||||
CONFIG_BUSYBOX_CONFIG_FDISK_SUPPORT_LARGE_DISKS=y
|
# CONFIG_SIGNED_PACKAGES is not set
|
||||||
CONFIG_BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE=y
|
CONFIG_KERNEL_DEVTMPFS=y
|
||||||
CONFIG_BUSYBOX_CONFIG_FEATURE_GPT_LABEL=y
|
CONFIG_KERNEL_DEVTMPFS_MOUNT=y
|
||||||
CONFIG_BUSYBOX_CONFIG_FEATURE_FDISK_ADVANCED=y
|
# CONFIG_BUSYBOX_CONFIG_IP is not set
|
||||||
CONFIG_BUSYBOX_CONFIG_IONICE=y
|
CONFIG_LOCALMIRROR="http://download.iopsys.eu/iopsys/mirror/"
|
||||||
CONFIG_BUSYBOX_CONFIG_RENICE=y
|
|
||||||
CONFIG_BUSYBOX_CONFIG_FEATURE_VOLUMEID_BTRFS=y
|
# Generation of /etc/banner.
|
||||||
CONFIG_BUSYBOX_CONFIG_FEATURE_VOLUMEID_F2FS=y
|
CONFIG_IMAGEOPT=y
|
||||||
CONFIG_BUSYBOX_CONFIG_FEATURE_VOLUMEID_LINUXSWAP=y
|
CONFIG_VERSIONOPT=y
|
||||||
CONFIG_BUSYBOX_CONFIG_FEATURE_VOLUMEID_SQUASHFS=y
|
CONFIG_VERSION_MANUFACTURER="iopsysWrt"
|
||||||
CONFIG_BUSYBOX_CONFIG_FEATURE_VOLUMEID_UBIFS=y
|
CONFIG_VERSION_MANUFACTURER_URL="https://iopsys.eu/"
|
||||||
CONFIG_BUSYBOX_CONFIG_TIMEOUT=y
|
|
||||||
CONFIG_BUSYBOX_CONFIG_NOHUP=y
|
# Disable as much as possible of OpenWrt messy "pre-init" stuff.
|
||||||
|
CONFIG_PREINITOPT=y
|
||||||
|
# CONFIG_TARGET_PREINIT_SUPPRESS_STDERR is not set
|
||||||
|
CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE=y
|
||||||
|
CONFIG_TARGET_PREINIT_TIMEOUT=1
|
||||||
|
# CONFIG_TARGET_PREINIT_SHOW_NETMSG is not set
|
||||||
|
# CONFIG_TARGET_PREINIT_SUPPRESS_FAILSAFE_NETMSG is not set
|
||||||
|
CONFIG_TARGET_PREINIT_IFNAME=""
|
||||||
|
CONFIG_TARGET_PREINIT_IP=""
|
||||||
|
CONFIG_TARGET_PREINIT_NETMASK=""
|
||||||
|
CONFIG_TARGET_PREINIT_BROADCAST=""
|
||||||
|
|
||||||
|
# The urandom-seed package is very strange. It seeds urandom with urandom...
|
||||||
|
# Disable it. Most SoCs nowadays has HW random generators anyway.
|
||||||
|
# CONFIG_PACKAGE_urandom-seed is not set
|
||||||
|
# CONFIG_PACKAGE_urngd is not set
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ _iop()
|
|||||||
iopcmds="bootstrap cfe_upgrade cfe_upgrade_latest extract_core \
|
iopcmds="bootstrap cfe_upgrade cfe_upgrade_latest extract_core \
|
||||||
feeds_update genconfig generate_tarballs install_key \
|
feeds_update genconfig generate_tarballs install_key \
|
||||||
scp_changes setup_host ssh_install_key status \
|
scp_changes setup_host ssh_install_key status \
|
||||||
update_package update_feed_branches ssh_upgrade smoketest"
|
update_package update_feed_branches ssh_upgrade"
|
||||||
|
|
||||||
if [ $COMP_CWORD -eq 1 ] ; then
|
if [ $COMP_CWORD -eq 1 ] ; then
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ function feeds_update {
|
|||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
git remote -v | grep -qE '(git@|ssh://)' && developer=1
|
git remote -v | grep -q http || developer=1
|
||||||
|
|
||||||
cp .config .genconfig_config_bak
|
cp .config .genconfig_config_bak
|
||||||
|
|
||||||
@@ -32,7 +32,8 @@ function feeds_update {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# targets need to be installed explicitly
|
# targets need to be installed explicitly
|
||||||
for target in $(ls ./feeds/targets)
|
targets="iopsys-brcm63xx-mips iopsys-brcm63xx-arm iopsys-ramips intel_mips iopsys-x86 iopsys-armvirt"
|
||||||
|
for target in $targets
|
||||||
do
|
do
|
||||||
rm -f target/linux/$target
|
rm -f target/linux/$target
|
||||||
./scripts/feeds install -p targets $target
|
./scripts/feeds install -p targets $target
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ function genconfig {
|
|||||||
export IMPORT=1
|
export IMPORT=1
|
||||||
export SRCTREEOVERR=0
|
export SRCTREEOVERR=0
|
||||||
export FILEDIR="files/"
|
export FILEDIR="files/"
|
||||||
|
export THEMEDIR="themes"
|
||||||
CURRENT_CONFIG_FILE=".current_config_file"
|
CURRENT_CONFIG_FILE=".current_config_file"
|
||||||
export CONFIGPATH="package/feeds/iopsys/iop"
|
export CONFIGPATH="package/feeds/iopsys/iop"
|
||||||
CUSTPATH="customerconfigs"
|
CUSTPATH="customerconfigs"
|
||||||
@@ -12,10 +13,11 @@ function genconfig {
|
|||||||
export VERBOSE=0
|
export VERBOSE=0
|
||||||
export DEVELOPER=0
|
export DEVELOPER=0
|
||||||
target="bogus"
|
target="bogus"
|
||||||
target_config_path=""
|
config_path=""
|
||||||
|
brcm63xx_mips="target/linux/iopsys-brcm63xx-mips"
|
||||||
brcm63xx_arm="target/linux/iopsys-brcm63xx-arm"
|
brcm63xx_arm="target/linux/iopsys-brcm63xx-arm"
|
||||||
ramips="target/linux/iopsys-ramips"
|
ramips="target/linux/iopsys-ramips"
|
||||||
econet="target/linux/iopsys-econet"
|
intel_mips="target/linux/intel_mips"
|
||||||
x86="target/linux/iopsys-x86"
|
x86="target/linux/iopsys-x86"
|
||||||
armvirt="target/linux/iopsys-armvirt"
|
armvirt="target/linux/iopsys-armvirt"
|
||||||
|
|
||||||
@@ -101,25 +103,27 @@ function genconfig {
|
|||||||
|
|
||||||
if [ $pfound -eq 1 ]; then
|
if [ $pfound -eq 1 ]; then
|
||||||
target="$(echo $TARGET | tr '-' '_')"
|
target="$(echo $TARGET | tr '-' '_')"
|
||||||
target_config_path="$targetpath/config"
|
config_path="$targetpath/config"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[ -e $brcm63xx_mips/genconfig ] &&
|
||||||
|
iopsys_brcm63xx_mips=$(cd $brcm63xx_mips; ./genconfig)
|
||||||
[ -e $brcm63xx_arm/genconfig ] &&
|
[ -e $brcm63xx_arm/genconfig ] &&
|
||||||
iopsys_brcm63xx_arm=$(cd $brcm63xx_arm; ./genconfig)
|
iopsys_brcm63xx_arm=$(cd $brcm63xx_arm; ./genconfig)
|
||||||
[ -e $ramips/genconfig ] &&
|
[ -e $ramips/genconfig ] &&
|
||||||
iopsys_ramips=$(cd $ramips; ./genconfig)
|
iopsys_ramips=$(cd $ramips; ./genconfig)
|
||||||
[ -e $econet/genconfig ] &&
|
[ -e $intel_mips/genconfig ] &&
|
||||||
iopsys_econet=$(cd $econet; ./genconfig)
|
iopsys_intel_mips=$(cd $intel_mips; ./genconfig)
|
||||||
[ -e $x86/genconfig ] &&
|
[ -e $x86/genconfig ] &&
|
||||||
iopsys_x86=$(cd $x86; ./genconfig)
|
iopsys_x86=$(cd $x86; ./genconfig)
|
||||||
[ -e $armvirt/genconfig ] &&
|
[ -e $armvirt/genconfig ] &&
|
||||||
iopsys_armvirt=$(cd $armvirt; ./genconfig)
|
iopsys_armvirt=$(cd $armvirt; ./genconfig)
|
||||||
|
|
||||||
if [ "$profile" == "LIST" ]; then
|
if [ "$profile" == "LIST" ]; then
|
||||||
for list in iopsys_brcm63xx_arm iopsys_ramips iopsys_econet iopsys_x86 iopsys_armvirt; do
|
for list in iopsys_brcm63xx_mips iopsys_brcm63xx_arm iopsys_ramips iopsys_intel_mips iopsys_x86 iopsys_armvirt; do
|
||||||
echo "$list based boards:"
|
echo "$list based boards:"
|
||||||
for b in ${!list}; do
|
for b in ${!list}; do
|
||||||
echo -e "\t$b"
|
echo -e "\t$b"
|
||||||
@@ -128,10 +132,18 @@ function genconfig {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
for p in $iopsys_brcm63xx_mips; do
|
||||||
|
if [ $p == $profile ]; then
|
||||||
|
target="iopsys_brcm63xx_mips"
|
||||||
|
config_path="$brcm63xx_mips/config"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
for p in $iopsys_brcm63xx_arm; do
|
for p in $iopsys_brcm63xx_arm; do
|
||||||
if [ $p == $profile ]; then
|
if [ $p == $profile ]; then
|
||||||
target="iopsys_brcm63xx_arm"
|
target="iopsys_brcm63xx_arm"
|
||||||
target_config_path="$brcm63xx_arm/config"
|
config_path="$brcm63xx_arm/config"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -139,15 +151,15 @@ function genconfig {
|
|||||||
for p in $iopsys_ramips; do
|
for p in $iopsys_ramips; do
|
||||||
if [ $p == $profile ]; then
|
if [ $p == $profile ]; then
|
||||||
target="iopsys_ramips"
|
target="iopsys_ramips"
|
||||||
target_config_path="$ramips/config"
|
config_path="$ramips/config"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
for p in $iopsys_econet; do
|
for p in $iopsys_intel_mips; do
|
||||||
if [ $p == $profile ]; then
|
if [ $p == $profile ]; then
|
||||||
target="iopsys_econet"
|
target="intel_mips"
|
||||||
target_config_path="$econet/config"
|
config_path="$intel_mips/config"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -155,7 +167,7 @@ function genconfig {
|
|||||||
for p in $iopsys_x86; do
|
for p in $iopsys_x86; do
|
||||||
if [ $p == $profile ]; then
|
if [ $p == $profile ]; then
|
||||||
target="iopsys_x86"
|
target="iopsys_x86"
|
||||||
target_config_path="$x86/config"
|
config_path="$x86/config"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -163,14 +175,25 @@ function genconfig {
|
|||||||
for p in $iopsys_armvirt; do
|
for p in $iopsys_armvirt; do
|
||||||
if [ $p == $profile ]; then
|
if [ $p == $profile ]; then
|
||||||
target="iopsys_armvirt"
|
target="iopsys_armvirt"
|
||||||
target_config_path="$armvirt/config"
|
config_path="$armvirt/config"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
git remote -v | grep -qE '(git@|ssh://)' && {
|
git remote -v | grep -q http || {
|
||||||
DEVELOPER=1
|
DEVELOPER=1
|
||||||
|
|
||||||
|
bcmAllowed=0
|
||||||
|
endptAllowed=0
|
||||||
|
natalieAllowed=0
|
||||||
|
mediatekAllowed=0
|
||||||
|
|
||||||
|
git ls-remote git@dev.iopsys.eu:broadcom/bcmcreator.git -q 2>/dev/null && bcmAllowed=1
|
||||||
|
git ls-remote git@dev.iopsys.eu:mediatek/linux.git -q 2>/dev/null && mediatekAllowed=1
|
||||||
|
git ls-remote git@dev.iopsys.eu:dialog/natalie-dect-12.26.git -q 2>/dev/null && natalieAllowed=1
|
||||||
|
git ls-remote git@dev.iopsys.eu:iopsys/endptmngr.git -q 2>/dev/null && endptAllowed=1
|
||||||
}
|
}
|
||||||
|
|
||||||
v() {
|
v() {
|
||||||
@@ -203,7 +226,7 @@ function genconfig {
|
|||||||
local ALL="$1"
|
local ALL="$1"
|
||||||
local CUSTOMER="$2"
|
local CUSTOMER="$2"
|
||||||
if [ "$CUSTOMER" -a -d "$CUSTCONF/$CUSTOMER" ]; then
|
if [ "$CUSTOMER" -a -d "$CUSTCONF/$CUSTOMER" ]; then
|
||||||
local boards="$(ls -1 "$CUSTCONF/$CUSTOMER" | grep -v common)"
|
local boards="$(ls -1 "$CUSTCONF/$CUSTOMER" | grep -v common | grep -v juci-theme)"
|
||||||
if [ "$boards" ]; then
|
if [ "$boards" ]; then
|
||||||
echo "$CUSTOMER has following boards:"
|
echo "$CUSTOMER has following boards:"
|
||||||
for board in $boards; do
|
for board in $boards; do
|
||||||
@@ -220,7 +243,7 @@ function genconfig {
|
|||||||
if [ "$customers" -a "$ALL" == 1 ]; then
|
if [ "$customers" -a "$ALL" == 1 ]; then
|
||||||
for customer in $customers; do
|
for customer in $customers; do
|
||||||
echo $customer
|
echo $customer
|
||||||
local boards="$(ls -1 $CUSTCONF/$customer | grep -v common)"
|
local boards="$(ls -1 $CUSTCONF/$customer | grep -v common | grep -v juci-theme)"
|
||||||
if [ "$boards" ]; then
|
if [ "$boards" ]; then
|
||||||
for board in $boards; do
|
for board in $boards; do
|
||||||
echo -e "\t$board"
|
echo -e "\t$board"
|
||||||
@@ -274,6 +297,13 @@ function genconfig {
|
|||||||
v "rm -rf $FILEDIR*"
|
v "rm -rf $FILEDIR*"
|
||||||
rm -rf $FILEDIR*
|
rm -rf $FILEDIR*
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "$THEMEDIR" ]; then
|
||||||
|
mkdir -p $THEMEDIR
|
||||||
|
elif [ -d "$THEMEDIR" -a $CLEAN -eq 1 ]; then
|
||||||
|
v "rm -rf $THEMEDIR/*"
|
||||||
|
rm -rf $THEMEDIR/*
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
create_and_copy_files()
|
create_and_copy_files()
|
||||||
@@ -309,25 +339,27 @@ function genconfig {
|
|||||||
v "cp $CONFIGPATH/config .config"
|
v "cp $CONFIGPATH/config .config"
|
||||||
cp $CONFIGPATH/config .config
|
cp $CONFIGPATH/config .config
|
||||||
|
|
||||||
if [ -f $target_config_path/config ]; then
|
if [ -f $config_path/config ]; then
|
||||||
cat $target_config_path/config >> .config
|
cat $config_path/config >> .config
|
||||||
echo "" >> .config
|
|
||||||
fi
|
fi
|
||||||
if [ -f $target_config_path/$BOARDTYPE/config ]; then
|
if [ -f $config_path/$BOARDTYPE/config ]; then
|
||||||
cat $target_config_path/$BOARDTYPE/config >> .config
|
cat $config_path/$BOARDTYPE/config >> .config
|
||||||
echo "" >> .config
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Special handling for targets which use TARGET_DEVICES
|
#special handling for intel_mips/iopsys_ramips which use TARGET_DEVICES
|
||||||
if [ "$target" = "iopsys_ramips" ]; then
|
if [ "$target" = "intel_mips" ]; then
|
||||||
|
subtarget="xrx500"
|
||||||
|
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||||
|
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||||
|
echo "CONFIG_TARGET_MULTI_PROFILE=y" >> .config
|
||||||
|
echo "CONFIG_TARGET_PER_DEVICE_ROOTFS=y" >> .config
|
||||||
|
device=$(echo $BOARDTYPE | tr a-z A-Z)
|
||||||
|
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${device}=y" >> .config
|
||||||
|
elif [ "$target" = "iopsys_ramips" ]; then
|
||||||
subtarget="mt7621"
|
subtarget="mt7621"
|
||||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
echo "CONFIG_TARGET_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||||
elif [ "$target" = "iopsys_econet" ]; then
|
|
||||||
subtarget="en7562"
|
|
||||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
|
||||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
|
||||||
else
|
else
|
||||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||||
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
|
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
|
||||||
@@ -346,29 +378,29 @@ function genconfig {
|
|||||||
v "cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR"
|
v "cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR"
|
||||||
cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR
|
cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR
|
||||||
fi
|
fi
|
||||||
|
if [ -d "$CUSTCONF/$CUSTOMER/juci-theme" ]; then
|
||||||
|
customer="$(echo $CUSTOMER | tr 'A-Z' 'a-z')"
|
||||||
|
v "cp -ar $CUSTCONF/$CUSTOMER/juci-theme $THEMEDIR/juci-theme-$customer"
|
||||||
|
cp -ar $CUSTCONF/$CUSTOMER/juci-theme $THEMEDIR/juci-theme-$customer
|
||||||
|
fi
|
||||||
if [ -e "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
|
if [ -e "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
|
||||||
v "Apply $CUSTCONF/$CUSTOMER/common/common.diff"
|
v "Apply $CUSTCONF/$CUSTOMER/common/common.diff"
|
||||||
cat $CUSTCONF/$CUSTOMER/common/common.diff >> .config
|
cat $CUSTCONF/$CUSTOMER/common/common.diff >> .config
|
||||||
echo "" >> .config
|
|
||||||
fi
|
fi
|
||||||
if [ -e "$CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff" ]; then
|
if [ -e "$CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff" ]; then
|
||||||
v "Apply $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff"
|
v "Apply $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff"
|
||||||
cat $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff >> .config
|
cat $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff >> .config
|
||||||
echo "" >> .config
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set target version
|
# Set target version
|
||||||
local GIT_TAG=$(git describe --abbrev=0 --tags)
|
local GIT_TAG=$(git describe --abbrev=0 --tags)
|
||||||
local GIT_REV=$(git rev-parse --short HEAD)
|
echo "CONFIG_TARGET_VERSION=\"${GIT_TAG}\"" >> .config
|
||||||
local GIT_VER="$GIT_TAG"
|
echo "CONFIG_VERSION_CODE=\"${GIT_TAG}\"" >> .config
|
||||||
git describe --contains $GIT_REV >/dev/null 2>&1 || GIT_VER="${GIT_TAG}_${GIT_REV}"
|
|
||||||
echo "CONFIG_TARGET_VERSION=\"${GIT_VER}\"" >> .config
|
|
||||||
echo "CONFIG_VERSION_CODE=\"${GIT_VER}\"" >> .config
|
|
||||||
echo "CONFIG_VERSION_PRODUCT=\"$BOARDTYPE"\" >> .config
|
echo "CONFIG_VERSION_PRODUCT=\"$BOARDTYPE"\" >> .config
|
||||||
|
|
||||||
# Enable Package source tree override if selected
|
# Enable Pckage source tree override if selected
|
||||||
[ $SRCTREEOVERR -eq 1 ] && echo CONFIG_SRC_TREE_OVERRIDE=y >> .config
|
[ $SRCTREEOVERR -eq 1 ] && echo CONFIG_SRC_TREE_OVERRIDE=y >> .config
|
||||||
|
|
||||||
# developer mode selected ?
|
# developer mode selected ?
|
||||||
@@ -376,8 +408,16 @@ function genconfig {
|
|||||||
if [ $DEVELOPER -eq 1 ]; then
|
if [ $DEVELOPER -eq 1 ]; then
|
||||||
# rewrite url to clone with ssh instead of http
|
# rewrite url to clone with ssh instead of http
|
||||||
echo "CONFIG_GITMIRROR_REWRITE=y" >>.config
|
echo "CONFIG_GITMIRROR_REWRITE=y" >>.config
|
||||||
|
[ $bcmAllowed -eq 0 ] && echo "CONFIG_BCM_OPEN=y" >> .config
|
||||||
|
[ $endptAllowed -eq 0 ] && echo "CONFIG_ENDPT_OPEN=y" >> .config
|
||||||
|
[ $natalieAllowed -eq 0 ] && echo "CONFIG_NATALIE_OPEN=y" >> .config
|
||||||
|
[ $mediatekAllowed -eq 0 ] && echo "CONFIG_MEDIATEK_OPEN=y" >> .config
|
||||||
else
|
else
|
||||||
echo "# CONFIG_GITMIRROR_REWRITE is not set" >>.config
|
echo "# CONFIG_GITMIRROR_REWRITE is not set" >>.config
|
||||||
|
echo "CONFIG_BCM_OPEN=y" >> .config
|
||||||
|
echo "CONFIG_ENDPT_OPEN=y" >> .config
|
||||||
|
echo "CONFIG_NATALIE_OPEN=y" >> .config
|
||||||
|
echo "CONFIG_MEDIATEK_OPEN=y" >> .config
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$BRCM_MAX_JOBS" ]
|
if [ -n "$BRCM_MAX_JOBS" ]
|
||||||
@@ -385,12 +425,15 @@ function genconfig {
|
|||||||
echo "CONFIG_BRCM_MAX_JOBS=\"1\"" >>.config
|
echo "CONFIG_BRCM_MAX_JOBS=\"1\"" >>.config
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Force regeneration of themes
|
||||||
|
touch package/feeds/juci/juci/Makefile
|
||||||
|
|
||||||
# Force regeneration of kernel Makefile
|
# Force regeneration of kernel Makefile
|
||||||
# Needed to disable kmods for iopsys-brcm targets
|
# Needed to disable kmods for iopsys-brcm targets
|
||||||
touch package/kernel/linux/Makefile
|
touch package/kernel/linux/Makefile
|
||||||
|
|
||||||
# we need to signal to bradcom SDK that we have changed the board id
|
# we need to signal to bradcom SDK that we have changed the board id
|
||||||
# currently boardparms.c and boardparms_voice.c is the only place that is depending on boardid name
|
# currently boardparms.c and boardparms_voice.c is the only place that is depending on inteno boardid name
|
||||||
# so just touch that file.
|
# so just touch that file.
|
||||||
[ -d ./build_dir ] && find build_dir/ -name "boardparms*c" -print0 2>/dev/null | xargs -0 touch 2>/dev/null
|
[ -d ./build_dir ] && find build_dir/ -name "boardparms*c" -print0 2>/dev/null | xargs -0 touch 2>/dev/null
|
||||||
|
|
||||||
|
|||||||
@@ -9,12 +9,14 @@ function genconfig_min {
|
|||||||
CUSTPATH="customerconfigs"
|
CUSTPATH="customerconfigs"
|
||||||
export CUSTCONF="customerconfigs/customers"
|
export CUSTCONF="customerconfigs/customers"
|
||||||
export VERBOSE=0
|
export VERBOSE=0
|
||||||
|
#always use the mirror
|
||||||
export DEVELOPER=0
|
export DEVELOPER=0
|
||||||
target="bogus"
|
target="bogus"
|
||||||
target_config_path=""
|
config_path=""
|
||||||
|
brcm63xx_mips="target/linux/iopsys-brcm63xx-mips"
|
||||||
brcm63xx_arm="target/linux/iopsys-brcm63xx-arm"
|
brcm63xx_arm="target/linux/iopsys-brcm63xx-arm"
|
||||||
ramips="target/linux/iopsys-ramips"
|
ramips="target/linux/iopsys-ramips"
|
||||||
econet="target/linux/iopsys-econet"
|
intel_mips="target/linux/intel_mips"
|
||||||
x86="target/linux/iopsys-x86"
|
x86="target/linux/iopsys-x86"
|
||||||
armvirt="target/linux/iopsys-armvirt"
|
armvirt="target/linux/iopsys-armvirt"
|
||||||
|
|
||||||
@@ -78,7 +80,7 @@ function genconfig_min {
|
|||||||
|
|
||||||
# Takes a board name and returns the target name in global var $target
|
# Takes a board name and returns the target name in global var $target
|
||||||
set_target() {
|
set_target() {
|
||||||
local profile=$1
|
local profile=$1
|
||||||
|
|
||||||
[ -n "$profile" ] || return
|
[ -n "$profile" ] || return
|
||||||
|
|
||||||
@@ -100,25 +102,27 @@ function genconfig_min {
|
|||||||
|
|
||||||
if [ $pfound -eq 1 ]; then
|
if [ $pfound -eq 1 ]; then
|
||||||
target="$(echo $TARGET | tr '-' '_')"
|
target="$(echo $TARGET | tr '-' '_')"
|
||||||
target_config_path="$targetpath/config"
|
config_path="$targetpath/config"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[ -e $brcm63xx_mips/genconfig ] &&
|
||||||
|
iopsys_brcm63xx_mips=$(cd $brcm63xx_mips; ./genconfig)
|
||||||
[ -e $brcm63xx_arm/genconfig ] &&
|
[ -e $brcm63xx_arm/genconfig ] &&
|
||||||
iopsys_brcm63xx_arm=$(cd $brcm63xx_arm; ./genconfig)
|
iopsys_brcm63xx_arm=$(cd $brcm63xx_arm; ./genconfig)
|
||||||
[ -e $ramips/genconfig ] &&
|
[ -e $ramips/genconfig ] &&
|
||||||
iopsys_ramips=$(cd $ramips; ./genconfig)
|
iopsys_ramips=$(cd $ramips; ./genconfig)
|
||||||
[ -e $econet/genconfig ] &&
|
[ -e $intel_mips/genconfig ] &&
|
||||||
iopsys_econet=$(cd $econet; ./genconfig)
|
iopsys_intel_mips=$(cd $intel_mips; ./genconfig)
|
||||||
[ -e $x86/genconfig ] &&
|
[ -e $x86/genconfig ] &&
|
||||||
iopsys_x86=$(cd $x86; ./genconfig)
|
iopsys_x86=$(cd $x86; ./genconfig)
|
||||||
[ -e $armvirt/genconfig ] &&
|
[ -e $armvirt/genconfig ] &&
|
||||||
iopsys_armvirt=$(cd $armvirt; ./genconfig)
|
iopsys_armvirt=$(cd $armvirt; ./genconfig)
|
||||||
|
|
||||||
if [ "$profile" == "LIST" ]; then
|
if [ "$profile" == "LIST" ]; then
|
||||||
for list in iopsys_brcm63xx_arm iopsys_ramips iopsys_econet iopsys_x86 iopsys_armvirt; do
|
for list in iopsys_brcm63xx_mips iopsys_brcm63xx_arm iopsys_ramips iopsys_intel_mips iopsys_x86 iopsys_armvirt; do
|
||||||
echo "$list based boards:"
|
echo "$list based boards:"
|
||||||
for b in ${!list}; do
|
for b in ${!list}; do
|
||||||
echo -e "\t$b"
|
echo -e "\t$b"
|
||||||
@@ -127,10 +131,18 @@ function genconfig_min {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
for p in $iopsys_brcm63xx_mips; do
|
||||||
|
if [ $p == $profile ]; then
|
||||||
|
target="iopsys_brcm63xx_mips"
|
||||||
|
config_path="$brcm63xx_mips/config"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
for p in $iopsys_brcm63xx_arm; do
|
for p in $iopsys_brcm63xx_arm; do
|
||||||
if [ $p == $profile ]; then
|
if [ $p == $profile ]; then
|
||||||
target="iopsys_brcm63xx_arm"
|
target="iopsys_brcm63xx_arm"
|
||||||
target_config_path="$brcm63xx_arm/config"
|
config_path="$brcm63xx_arm/config"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -138,15 +150,15 @@ function genconfig_min {
|
|||||||
for p in $iopsys_ramips; do
|
for p in $iopsys_ramips; do
|
||||||
if [ $p == $profile ]; then
|
if [ $p == $profile ]; then
|
||||||
target="iopsys_ramips"
|
target="iopsys_ramips"
|
||||||
target_config_path="$ramips/config"
|
config_path="$ramips/config"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
for p in $iopsys_econet; do
|
for p in $iopsys_intel_mips; do
|
||||||
if [ $p == $profile ]; then
|
if [ $p == $profile ]; then
|
||||||
target="iopsys_econet"
|
target="intel_mips"
|
||||||
target_config_path="$econet/config"
|
config_path="$intel_mips/config"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -154,7 +166,7 @@ function genconfig_min {
|
|||||||
for p in $iopsys_x86; do
|
for p in $iopsys_x86; do
|
||||||
if [ $p == $profile ]; then
|
if [ $p == $profile ]; then
|
||||||
target="iopsys_x86"
|
target="iopsys_x86"
|
||||||
target_config_path="$x86/config"
|
config_path="$x86/config"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -162,19 +174,24 @@ function genconfig_min {
|
|||||||
for p in $iopsys_armvirt; do
|
for p in $iopsys_armvirt; do
|
||||||
if [ $p == $profile ]; then
|
if [ $p == $profile ]; then
|
||||||
target="iopsys_armvirt"
|
target="iopsys_armvirt"
|
||||||
target_config_path="$armvirt/config"
|
config_path="$armvirt/config"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
git remote -v | grep -qE '(git@|ssh://)' && {
|
git remote -v | grep -q http || {
|
||||||
DEVELOPER=1
|
DEVELOPER=1
|
||||||
|
|
||||||
bcmAllowed=0
|
bcmAllowed=0
|
||||||
endptAllowed=0
|
endptAllowed=0
|
||||||
|
natalieAllowed=0
|
||||||
|
mediatekAllowed=0
|
||||||
|
|
||||||
git ls-remote git@dev.iopsys.eu:broadcom/bcmcreator.git -q 2>/dev/null && bcmAllowed=1
|
git ls-remote git@dev.iopsys.eu:broadcom/bcmcreator.git -q 2>/dev/null && bcmAllowed=1
|
||||||
|
git ls-remote git@dev.iopsys.eu:mediatek/linux.git -q 2>/dev/null && mediatekAllowed=1
|
||||||
|
git ls-remote git@dev.iopsys.eu:dialog/natalie-dect-12.26.git -q 2>/dev/null && natalieAllowed=1
|
||||||
git ls-remote git@dev.iopsys.eu:iopsys/endptmngr.git -q 2>/dev/null && endptAllowed=1
|
git ls-remote git@dev.iopsys.eu:iopsys/endptmngr.git -q 2>/dev/null && endptAllowed=1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,8 +214,7 @@ function genconfig_min {
|
|||||||
echo -e " -a|--list-all\t\tList all Customers and their board types"
|
echo -e " -a|--list-all\t\tList all Customers and their board types"
|
||||||
echo -e " -b|--boards\t\tList all board types"
|
echo -e " -b|--boards\t\tList all board types"
|
||||||
echo
|
echo
|
||||||
echo "Example ./iop genconfig eg400 OPERATORX"
|
echo "Example ./iop genconfig dg400prime IOPSYS"
|
||||||
echo "(if no customerconfig is chosen, iopsys config will be used)"
|
|
||||||
echo
|
echo
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
@@ -248,12 +264,12 @@ function genconfig_min {
|
|||||||
|
|
||||||
generate_config()
|
generate_config()
|
||||||
{
|
{
|
||||||
DIFFFILE="$1"
|
DIFFFILE="$1"
|
||||||
MASTERFILE="$2"
|
MASTERFILE="$2"
|
||||||
while read p; do
|
while read p; do
|
||||||
v "$p"
|
v "$p"
|
||||||
sed -r -i "$p" $MASTERFILE
|
sed -r -i "$p" $MASTERFILE
|
||||||
done < $DIFFFILE
|
done < $DIFFFILE
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_dirs()
|
setup_dirs()
|
||||||
@@ -300,25 +316,27 @@ function genconfig_min {
|
|||||||
v "cp $CONFIGPATH/config .config"
|
v "cp $CONFIGPATH/config .config"
|
||||||
cp $CONFIGPATH/config .config
|
cp $CONFIGPATH/config .config
|
||||||
|
|
||||||
if [ -f $target_config_path/config ]; then
|
if [ -f $config_path/config ]; then
|
||||||
cat $target_config_path/config >> .config
|
cat $config_path/config >> .config
|
||||||
echo "" >> .config
|
|
||||||
fi
|
fi
|
||||||
if [ -f $target_config_path/$BOARDTYPE/config ]; then
|
if [ -f $config_path/$BOARDTYPE/config ]; then
|
||||||
cat $target_config_path/$BOARDTYPE/config >> .config
|
cat $config_path/$BOARDTYPE/config >> .config
|
||||||
echo "" >> .config
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Special handling for targets which use TARGET_DEVICES
|
#special handling for intel_mips/iopsys_ramips which use TARGET_DEVICES
|
||||||
if [ "$target" = "iopsys_ramips" ]; then
|
if [ "$target" = "intel_mips" ]; then
|
||||||
|
subtarget="xrx500"
|
||||||
|
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||||
|
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||||
|
echo "CONFIG_TARGET_MULTI_PROFILE=y" >> .config
|
||||||
|
echo "CONFIG_TARGET_PER_DEVICE_ROOTFS=y" >> .config
|
||||||
|
device=$(echo $BOARDTYPE | tr a-z A-Z)
|
||||||
|
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${device}=y" >> .config
|
||||||
|
elif [ "$target" = "iopsys_ramips" ]; then
|
||||||
subtarget="mt7621"
|
subtarget="mt7621"
|
||||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
echo "CONFIG_TARGET_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||||
elif [ "$target" = "iopsys_econet" ]; then
|
|
||||||
subtarget="en7562"
|
|
||||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
|
||||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
|
||||||
else
|
else
|
||||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||||
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
|
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
|
||||||
@@ -340,25 +358,21 @@ function genconfig_min {
|
|||||||
if [ -e "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
|
if [ -e "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
|
||||||
v "Apply $CUSTCONF/$CUSTOMER/common/common.diff"
|
v "Apply $CUSTCONF/$CUSTOMER/common/common.diff"
|
||||||
cat $CUSTCONF/$CUSTOMER/common/common.diff >> .config
|
cat $CUSTCONF/$CUSTOMER/common/common.diff >> .config
|
||||||
echo "" >> .config
|
|
||||||
fi
|
fi
|
||||||
if [ -e "$CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff" ]; then
|
if [ -e "$CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff" ]; then
|
||||||
v "Apply $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff"
|
v "Apply $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff"
|
||||||
cat $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff >> .config
|
cat $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff >> .config
|
||||||
echo "" >> .config
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set target version
|
# Set target version
|
||||||
local GIT_TAG=$(git describe --abbrev=0 --tags)
|
local GIT_TAG=$(git describe --abbrev=0 --tags)
|
||||||
local GIT_REV=$(git rev-parse --short HEAD)
|
echo "CONFIG_TARGET_VERSION=\"${GIT_TAG}\"" >> .config
|
||||||
local GIT_VER="$GIT_TAG"
|
echo "CONFIG_VERSION_CODE=\"${GIT_TAG}\"" >> .config
|
||||||
git describe --contains $GIT_REV >/dev/null 2>&1 || GIT_VER="${GIT_TAG}_${GIT_REV}"
|
|
||||||
echo "CONFIG_TARGET_VERSION=\"${GIT_VER}\"" >> .config
|
|
||||||
echo "CONFIG_VERSION_CODE=\"${GIT_VER}\"" >> .config
|
|
||||||
echo "CONFIG_VERSION_PRODUCT=\"$BOARDTYPE"\" >> .config
|
echo "CONFIG_VERSION_PRODUCT=\"$BOARDTYPE"\" >> .config
|
||||||
|
|
||||||
|
|
||||||
# Enable Package source tree override if selected
|
# Enable Package source tree override if selected
|
||||||
[ $SRCTREEOVERR -eq 1 ] && echo CONFIG_SRC_TREE_OVERRIDE=y >> .config
|
[ $SRCTREEOVERR -eq 1 ] && echo CONFIG_SRC_TREE_OVERRIDE=y >> .config
|
||||||
|
|
||||||
@@ -375,7 +389,7 @@ function genconfig_min {
|
|||||||
touch package/kernel/linux/Makefile
|
touch package/kernel/linux/Makefile
|
||||||
|
|
||||||
# we need to signal to bradcom SDK that we have changed the board id
|
# we need to signal to bradcom SDK that we have changed the board id
|
||||||
# currently boardparms.c and boardparms_voice.c is the only place that is depending on boardid name
|
# currently boardparms.c and boardparms_voice.c is the only place that is depending on inteno boardid name
|
||||||
# so just touch that file.
|
# so just touch that file.
|
||||||
[ -d ./build_dir ] && find build_dir/ -name "boardparms*c" -print0 2>/dev/null | xargs -0 touch 2>/dev/null
|
[ -d ./build_dir ] && find build_dir/ -name "boardparms*c" -print0 2>/dev/null | xargs -0 touch 2>/dev/null
|
||||||
|
|
||||||
@@ -431,8 +445,6 @@ function genconfig_min {
|
|||||||
shift;
|
shift;
|
||||||
done
|
done
|
||||||
|
|
||||||
CUSTREPO="${CUSTREPO:-git@dev.iopsys.eu:consumer/iopsys.git}"
|
|
||||||
|
|
||||||
setup_dirs
|
setup_dirs
|
||||||
create_and_copy_files "$@"
|
create_and_copy_files "$@"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,32 +1,40 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# shellcheck disable=SC2029
|
|
||||||
|
|
||||||
build_bcmkernel_consumer() {
|
build_bcmkernel_consumer() {
|
||||||
local tarfile bcmkernelcommith sdkversion serverpath serverlink
|
local tarfile bcmkernelcommith sdkversion
|
||||||
|
sdkversion=$(grep "CONFIG_BRCM_SDK_VER.*=y" .config | awk -F'[_,=]' '{print$5}')
|
||||||
sdkversion="$(grep "CONFIG_BRCM_SDK_VER.*=y" .config | awk -F'[_,=]' '{print$5}')"
|
sdkversion=${sdkversion:0:4}${sdkversion:(-1)}
|
||||||
sdkversion="${sdkversion:0:4}${sdkversion:(-1)}"
|
bcmkernelcommith=$(grep -w "PKG_SOURCE_VERSION:" $curdir/feeds/broadcom/bcmkernel/${sdkversion:0:5}*.mk | cut -d'=' -f2)
|
||||||
bcmkernelcommith="$(grep -w "PKG_SOURCE_VERSION:" "$curdir/feeds/broadcom/bcmkernel/${sdkversion:0:5}"*".mk" | cut -d'=' -f2)"
|
|
||||||
|
|
||||||
[ -n "$board" ] && [ -n "$bcmkernelcommith" ] || return
|
|
||||||
|
|
||||||
serverpath="$FPATH/bcmopen-$board-$bcmkernelcommith.tar.gz"
|
|
||||||
serverlink="$FPATH/bcmopen-$board-$majver.$minver-latest"
|
|
||||||
|
|
||||||
# do not build bcmopen sdk if it was already built before
|
# do not build bcmopen sdk if it was already built before
|
||||||
# if it was, check if there's a symlink in place and create it if missing
|
[ -n "$board" -a -n "$bcmkernelcommith" ] || return
|
||||||
ssh "$SERVER" "test -f '$serverpath' && { test -L '$serverlink' || ln -sf '$serverpath' '$serverlink'; }" && return
|
ssh $SERVER "test -f $FPATH/bcmopen-$board-$bcmkernelcommith.tar.gz" && return
|
||||||
|
cd ./build_dir/target-*/bcmkernel-*-${sdkversion:0:4}*/bcm963xx/release
|
||||||
cd "./build_dir/target-"*"/bcmkernel-"*"-${sdkversion:0:4}"*"/bcm963xx/release"
|
bash do_consumer_release -p $profile -y -F
|
||||||
bash do_consumer_release -p "$profile" -y -F
|
|
||||||
|
|
||||||
tarfile='out/bcm963xx_*_consumer.tar.gz'
|
tarfile='out/bcm963xx_*_consumer.tar.gz'
|
||||||
[ $(ls -1 $tarfile | wc -l) -ne 1 ] && echo "Too many tar files: '$tarfile'" && return
|
[ $(ls -1 $tarfile |wc -l) -ne 1 ] && echo "Too many tar files: '$tarfile'" && return
|
||||||
|
scp -pv $tarfile $SERVER:$FPATH/bcmopen-$board-$bcmkernelcommith.tar.gz
|
||||||
scp -pv $tarfile "$SERVER":"$serverpath"
|
ssh $SERVER "[ -f $FPATH/bcmopen-$board-$bcmkernelcommith.tar.gz ] && ln -sf $FPATH/bcmopen-$board-$bcmkernelcommith.tar.gz $FPATH/bcmopen-$board-$majver.$minver-latest"
|
||||||
ssh "$SERVER" "test -f '$serverpath' && ln -sf '$serverpath' '$serverlink'"
|
|
||||||
rm -f $tarfile
|
rm -f $tarfile
|
||||||
|
cd "$curdir"
|
||||||
|
}
|
||||||
|
|
||||||
|
build_natalie_consumer() {
|
||||||
|
# create natalie-dect open version tar file
|
||||||
|
local natalieversion nataliecommith
|
||||||
|
grep -q "CONFIG_TARGET_NO_DECT=y" .config && return
|
||||||
|
natalieversion=$(grep -w "PKG_VERSION:" ./feeds/iopsys/natalie-dect/Makefile | cut -d'=' -f2)
|
||||||
|
nataliecommith=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/iopsys/natalie-dect/Makefile | cut -d'=' -f2)
|
||||||
|
[ -n "$profile" -a -n "$natalieversion" -a -n "$nataliecommith" ] || return
|
||||||
|
ssh $SERVER "test -f $FPATH/natalie-dect-$profile-$natalieversion-$nataliecommith.tar.gz" && return
|
||||||
|
cd ./build_dir/target-*/natalie-dect-$natalieversion/
|
||||||
|
mkdir natalie-dect-open-$natalieversion
|
||||||
|
cp -f ipkg-*/natalie-dect/lib/modules/*/extra/dect.ko natalie-dect-open-$natalieversion/dect.ko
|
||||||
|
tar -czv natalie-dect-open-$natalieversion/ -f natalie-dect-$profile-$natalieversion-$nataliecommith.tar.gz
|
||||||
|
scp -pv natalie-dect-$profile-$natalieversion-$nataliecommith.tar.gz $SERVER:$FPATH/
|
||||||
|
cp natalie-dect-$profile-$natalieversion-$nataliecommith.tar.gz $curdir/
|
||||||
|
rm -rf natalie-dect-open-$natalieversion
|
||||||
|
rm -f natalie-dect-$profile-$natalieversion-$nataliecommith.tar.gz
|
||||||
cd "$curdir"
|
cd "$curdir"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,7 +44,7 @@ build_endptmngr_consumer() {
|
|||||||
grep -q "CONFIG_TARGET_NO_VOICE=y" .config && return
|
grep -q "CONFIG_TARGET_NO_VOICE=y" .config && return
|
||||||
endptversion=$(grep -w "PKG_VERSION:" ./feeds/iopsys/endptmngr/Makefile | cut -d'=' -f2)
|
endptversion=$(grep -w "PKG_VERSION:" ./feeds/iopsys/endptmngr/Makefile | cut -d'=' -f2)
|
||||||
endptcommith=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/iopsys/endptmngr/Makefile | cut -d'=' -f2)
|
endptcommith=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/iopsys/endptmngr/Makefile | cut -d'=' -f2)
|
||||||
[ -n "$profile" ] && [ -n "$endptversion" ] && [ -n "$endptcommith" ] || return
|
[ -n "$profile" -a -n "$endptversion" -a -n "$endptcommith" ] || return
|
||||||
ssh $SERVER "test -f $FPATH/endptmngr-$profile-$endptversion-$endptcommith.tar.gz" && return
|
ssh $SERVER "test -f $FPATH/endptmngr-$profile-$endptversion-$endptcommith.tar.gz" && return
|
||||||
cd ./build_dir/target-*/endptmngr-$endptversion/
|
cd ./build_dir/target-*/endptmngr-$endptversion/
|
||||||
mkdir endptmngr-open-$endptversion
|
mkdir endptmngr-open-$endptversion
|
||||||
@@ -51,6 +59,46 @@ build_endptmngr_consumer() {
|
|||||||
cd "$curdir"
|
cd "$curdir"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
build_mediatek_kernel() {
|
||||||
|
local mediatek_commit kernel
|
||||||
|
|
||||||
|
mediatek_commit=$(grep CONFIG_KERNEL_GIT_COMMIT .config | cut -d '=' -f2 | tr -d '"')
|
||||||
|
kernel=linux-git*
|
||||||
|
[ -n "$mediatek_commit" ] || return
|
||||||
|
ssh $SERVER "test -f $FPATH/mediatek-kernel-open-$mediatek_commit.tar.gz" && return
|
||||||
|
echo "Building mediatek kernel tarball from kernel commit:"
|
||||||
|
echo $mediatek_commit
|
||||||
|
cd build_dir/target-mipsel_1004kc*/linux-iopsys-ramips*/linux-git*
|
||||||
|
|
||||||
|
# remove git repo
|
||||||
|
rm -rf .git
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
tar -czv $kernel -f mediatek-kernel-open-$mediatek_commit.tar.gz
|
||||||
|
scp -pv mediatek-kernel-open-$mediatek_commit.tar.gz $SERVER:$FPATH/
|
||||||
|
cd "$curdir"
|
||||||
|
}
|
||||||
|
|
||||||
|
build_mediatek_wifi_consumer() {
|
||||||
|
local ver commit
|
||||||
|
local chip=$1
|
||||||
|
|
||||||
|
ver=$(grep -w "PKG_VERSION:" ./feeds/mediatek/mt${chip}/Makefile | cut -d'=' -f2)
|
||||||
|
commit=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/mediatek/mt${chip}/Makefile | cut -d'=' -f2)
|
||||||
|
[ -n "$ver" -a -n "$commit" ] || return
|
||||||
|
ssh $SERVER "test -f $FPATH/mtk${chip}e-${ver}_${commit}.tar.xz" && return
|
||||||
|
cd build_dir/target-mipsel_1004kc*/linux-iopsys-ramips*/mtk${chip}e-$ver/ipkg-*
|
||||||
|
mkdir -p mtk${chip}e-$ver/src
|
||||||
|
cp -rf kmod-mtk${chip}e/etc mtk${chip}e-$ver/src/
|
||||||
|
cp -rf kmod-mtk${chip}e/lib mtk${chip}e-$ver/src/
|
||||||
|
tar Jcf mtk${chip}e-${ver}_${commit}.tar.xz mtk${chip}e-$ver
|
||||||
|
scp -pv mtk${chip}e-${ver}_${commit}.tar.xz $SERVER:$FPATH/
|
||||||
|
cp mtk${chip}e-${ver}_${commit}.tar.xz $curdir/
|
||||||
|
rm -rf mtk${chip}e-$ver
|
||||||
|
rm -f mtk${chip}e-${ver}_${commit}.tar.xz
|
||||||
|
cd "$curdir"
|
||||||
|
}
|
||||||
|
|
||||||
function print_usage {
|
function print_usage {
|
||||||
echo "Usage: $0 generate_tarballs"
|
echo "Usage: $0 generate_tarballs"
|
||||||
echo " -t <target>"
|
echo " -t <target>"
|
||||||
@@ -64,6 +112,7 @@ function generate_tarballs {
|
|||||||
set -e
|
set -e
|
||||||
git remote -v | grep -q http && return # do not continue if this is an open SDK environment
|
git remote -v | grep -q http && return # do not continue if this is an open SDK environment
|
||||||
|
|
||||||
|
target=$(grep CONFIG_TARGET_BOARD .config | cut -d'=' -f2 | tr -d '"')
|
||||||
board=$(grep CONFIG_TARGET_FAMILY .config | cut -d'=' -f2 | tr -d '"')
|
board=$(grep CONFIG_TARGET_FAMILY .config | cut -d'=' -f2 | tr -d '"')
|
||||||
profile=$(grep CONFIG_BCM_KERNEL_PROFILE .config | cut -d'=' -f2 | tr -d '"')
|
profile=$(grep CONFIG_BCM_KERNEL_PROFILE .config | cut -d'=' -f2 | tr -d '"')
|
||||||
majver=$(grep CONFIG_TARGET_VERSION .config | cut -d'=' -f2 | tr -d '"' | cut -f1 -d .)
|
majver=$(grep CONFIG_TARGET_VERSION .config | cut -d'=' -f2 | tr -d '"' | cut -f1 -d .)
|
||||||
@@ -88,14 +137,19 @@ function generate_tarballs {
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -z "$stk_target" ]; then
|
if [ ! -n "$stk_target" ]; then
|
||||||
print_usage
|
print_usage
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$stk_target" == "broadcom" ]; then
|
if [ "$stk_target" == "broadcom" ]; then
|
||||||
build_bcmkernel_consumer
|
build_bcmkernel_consumer
|
||||||
|
build_natalie_consumer
|
||||||
build_endptmngr_consumer
|
build_endptmngr_consumer
|
||||||
|
elif [ "$stk_target" == "mediatek" ]; then
|
||||||
|
build_mediatek_kernel
|
||||||
|
build_mediatek_wifi_consumer 7603
|
||||||
|
build_mediatek_wifi_consumer 7615
|
||||||
else
|
else
|
||||||
echo "Invalid target: $stk_target"
|
echo "Invalid target: $stk_target"
|
||||||
print_usage
|
print_usage
|
||||||
|
|||||||
@@ -1,29 +1,12 @@
|
|||||||
# this is a developer helper script to install the public ssh key in the created image
|
# this is a developer helper script to install the public ssh key in the created image
|
||||||
|
|
||||||
DROPBEAR_AUTHORIZED_KEYS_FILE=/etc/dropbear/authorized_keys
|
|
||||||
|
|
||||||
function get_ssh_public_keys {
|
|
||||||
(
|
|
||||||
shopt -s nullglob
|
|
||||||
# home directory, not all of those are supported by dropbear,
|
|
||||||
# but let's include them now already to decrease future maintenance
|
|
||||||
cat /dev/null ~/.ssh/{id_rsa,id_dsa,id_ecdsa,id_ecdsa_sk,id_ed25519,id_ed25519_sk,id_xmss}.pub 2> /dev/null
|
|
||||||
# keys added manually or automatically to the build dir
|
|
||||||
cat "files${DROPBEAR_AUTHORIZED_KEYS_FILE}" 2>/dev/null
|
|
||||||
# keys in the agent (useful when using SSH agent forwarding)
|
|
||||||
ssh-add -L 2> /dev/null
|
|
||||||
) | sort | uniq
|
|
||||||
}
|
|
||||||
|
|
||||||
function install_key {
|
function install_key {
|
||||||
local build_dir_dropbear_authorized_keys_file="files${DROPBEAR_AUTHORIZED_KEYS_FILE}"
|
|
||||||
mkdir -p "$(dirname "$build_dir_dropbear_authorized_keys_file")"
|
mkdir -p files/etc/dropbear
|
||||||
get_ssh_public_keys > "$build_dir_dropbear_authorized_keys_file"
|
test -e ~/.ssh/id_dsa.pub && cat ~/.ssh/id_dsa.pub >>files/etc/dropbear/authorized_keys
|
||||||
chmod 0644 "$build_dir_dropbear_authorized_keys_file"
|
test -e ~/.ssh/id_rsa.pub && cat ~/.ssh/id_rsa.pub >>files/etc/dropbear/authorized_keys
|
||||||
echo "Keys in "$build_dir_dropbear_authorized_keys_file" are now:"
|
chmod 0644 files/etc/dropbear/authorized_keys
|
||||||
cat "$build_dir_dropbear_authorized_keys_file"
|
|
||||||
echo
|
|
||||||
echo "Disabling login on serial console..."
|
|
||||||
echo "::sysinit:/etc/init.d/rcS S boot" >files/etc/inittab
|
echo "::sysinit:/etc/init.d/rcS S boot" >files/etc/inittab
|
||||||
echo "::shutdown:/etc/init.d/rcS K shutdown" >>files/etc/inittab
|
echo "::shutdown:/etc/init.d/rcS K shutdown" >>files/etc/inittab
|
||||||
echo "console::askconsolelate:/bin/cttyhack /bin/ash --login" >>files/etc/inittab
|
echo "console::askconsolelate:/bin/cttyhack /bin/ash --login" >>files/etc/inittab
|
||||||
@@ -31,25 +14,4 @@ function install_key {
|
|||||||
echo Done
|
echo Done
|
||||||
}
|
}
|
||||||
|
|
||||||
function ssh_install_key_help() {
|
|
||||||
echo Usage: $0 ssh_install_key HOSTNAME
|
|
||||||
echo
|
|
||||||
echo "Installs SSH public keys to a device's authorized_keys file"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# this is a developer helper script to install the public ssh key on host running dropbear
|
|
||||||
function ssh_install_key {
|
|
||||||
if [ $# -ne 1 ] || [ "$1" == '--help' ]; then
|
|
||||||
ssh_install_key_help
|
|
||||||
[ $# -eq 1 ]; return
|
|
||||||
fi
|
|
||||||
host="$1"
|
|
||||||
local keys="$(get_ssh_public_keys)"
|
|
||||||
echo "Adding the following keys to $DROPBEAR_AUTHORIZED_KEYS_FILE on $host:"
|
|
||||||
echo "$keys"
|
|
||||||
ssh root@$host "echo '$keys' >> '$DROPBEAR_AUTHORIZED_KEYS_FILE'" && echo ok
|
|
||||||
}
|
|
||||||
|
|
||||||
register_command "ssh_install_key" "Install the users public ssh key on host running dropbear"
|
|
||||||
register_command "install_key" "Install the user's public ssh key in the created image"
|
register_command "install_key" "Install the user's public ssh key in the created image"
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ function ssh_upgrade {
|
|||||||
upd_fw_base=""
|
upd_fw_base=""
|
||||||
upd_fw=""
|
upd_fw=""
|
||||||
upd_host="192.168.1.1"
|
upd_host="192.168.1.1"
|
||||||
upd_sysupgrade=1
|
upd_sysupgrade=0
|
||||||
do_dialog=0
|
do_dialog=0
|
||||||
|
|
||||||
while getopts "f:hnxt:iscb" opt; do
|
while getopts "f:hnxt:iscb" opt; do
|
||||||
@@ -280,14 +280,6 @@ function ssh_upgrade {
|
|||||||
set_config_string CONFIG_TARGET_BOARD
|
set_config_string CONFIG_TARGET_BOARD
|
||||||
firmwares=$(cd bin/targets/$CONFIG_TARGET_BOARD/generic/; ls -t *[0-9].y[3])
|
firmwares=$(cd bin/targets/$CONFIG_TARGET_BOARD/generic/; ls -t *[0-9].y[3])
|
||||||
|
|
||||||
# if target uses pkgtb
|
|
||||||
if [ -z "$firmwares"]
|
|
||||||
then
|
|
||||||
# pkgtb files can not be streamed so copy over the file witch scp
|
|
||||||
use_scp=1
|
|
||||||
firmwares=$(cd bin/targets/$CONFIG_TARGET_BOARD/generic/; ls -t last.pkgtb)
|
|
||||||
fi
|
|
||||||
|
|
||||||
for upd_fw_base in $firmwares
|
for upd_fw_base in $firmwares
|
||||||
do
|
do
|
||||||
#echo "firmware $upd_fw"
|
#echo "firmware $upd_fw"
|
||||||
@@ -321,20 +313,10 @@ function ssh_upgrade {
|
|||||||
[ $upd_forceboot -eq 1 ] && extra_args="$extra_args -b"
|
[ $upd_forceboot -eq 1 ] && extra_args="$extra_args -b"
|
||||||
|
|
||||||
file_size_kb=`du -k "$upd_fw" | cut -f1`
|
file_size_kb=`du -k "$upd_fw" | cut -f1`
|
||||||
if [ "$use_scp" == "1" ]
|
cat $upd_fw | pv -s ${file_size_kb}k | ssh root@$upd_host "iopu $extra_args"
|
||||||
then
|
|
||||||
scp $upd_fw root@$upd_host:/tmp/ &&
|
|
||||||
ssh -o ConnectTimeout=60 root@$upd_host "iopu $extra_arg -f /tmp/$upd_fw_base"
|
|
||||||
else
|
|
||||||
cat $upd_fw | pv -s ${file_size_kb}k | ssh root@$upd_host "iopu $extra_args"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
extra_args=""
|
|
||||||
[ $upd_noreboot -eq 1 ] && extra_args="$extra_args -d"
|
|
||||||
[ $upd_keepconf -eq 0 ] && extra_args="$extra_args -n"
|
|
||||||
|
|
||||||
scp $upd_fw root@$upd_host:/tmp/ &&
|
scp $upd_fw root@$upd_host:/tmp/ &&
|
||||||
ssh -o ConnectTimeout=60 root@$upd_host "sysupgrade -v $extra_args /tmp/$upd_fw_base" &&
|
ssh -o ConnectTimeout=60 root@$upd_host "sysupgrade -v $3 /tmp/$upd_fw_base" &&
|
||||||
echo "sysupgrade done!"
|
echo "sysupgrade done!"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
70
iop/scripts/scp_changes.sh
Normal file
70
iop/scripts/scp_changes.sh
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
# this is a developer helper script to SCP changed files to remote host
|
||||||
|
|
||||||
|
ROOT=build_dir/target-mips_uClibc-0.9.33.2/root-iopsys-brcm63xx-mips/
|
||||||
|
ROOT_OLD=tmp/root_old/
|
||||||
|
ROOT_TMP=tmp/root_tmp/
|
||||||
|
|
||||||
|
function scp_changes_reset {
|
||||||
|
{ cd `dirname $0`
|
||||||
|
rm -rf "$ROOT_OLD"
|
||||||
|
mkdir -p "$ROOT_OLD"
|
||||||
|
cp -a "$ROOT"* "$ROOT_OLD"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function scp_changes {
|
||||||
|
if [ -z "$1" ] ; then
|
||||||
|
echo "usage: $0 scp_changes <host/-r(eset)/-p(retend)>"
|
||||||
|
echo "Error: host required"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
{ cd `dirname $0`
|
||||||
|
if [ ! -d $ROOT ]; then
|
||||||
|
echo "$ROOT does not exist"
|
||||||
|
echo "please build the project first"
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
if [ "$1" = "-r" ]; then
|
||||||
|
echo "reset changes"
|
||||||
|
scp_changes_reset
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
if [ ! -d $ROOT_OLD ]; then
|
||||||
|
echo "$ROOT_OLD does not exist"
|
||||||
|
echo "you didn't store state of previous buildroot"
|
||||||
|
#echo "please run ./scp_changes_reset.sh"
|
||||||
|
echo "doing it now"
|
||||||
|
scp_changes_reset
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
FILES=`diff -rq "$ROOT" "$ROOT_OLD" 2>&1 | sed -ne "s?^Files .* and $ROOT_OLD\\(.*\\) differ?\\1?p" -ne "s?^Only in $ROOT\\(.*\\): \\(.*\\)?\\1/\\2?p"`
|
||||||
|
if [ "$1" = "-p" ]; then
|
||||||
|
echo "files that would be copied:"
|
||||||
|
echo $FILES
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
for f in $FILES
|
||||||
|
do
|
||||||
|
mkdir -p "$ROOT_TMP`dirname $f`"
|
||||||
|
cp -af "$ROOT$f" "$ROOT_TMP$f"
|
||||||
|
done
|
||||||
|
if [ -d "$ROOT_TMP" ]; then
|
||||||
|
echo "scp changed files to $1"
|
||||||
|
pushd "$ROOT_TMP" 2>&1 >/dev/null
|
||||||
|
scp -r * root@$1:/
|
||||||
|
RETVAL=$?
|
||||||
|
popd 2>&1 >/dev/null
|
||||||
|
rm -rf "$ROOT_TMP"
|
||||||
|
if [ "$RETVAL" -eq 0 ]; then
|
||||||
|
scp_changes_reset
|
||||||
|
else
|
||||||
|
echo "scp error"
|
||||||
|
exit $RETVAL
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "no change"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
register_command "scp_changes" "<host/-r(eset)/-p(retend)> SCP only changed files to device"
|
||||||
17
iop/scripts/ssh_install_key.sh
Executable file
17
iop/scripts/ssh_install_key.sh
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
# this is a developer helper script to install the public ssh key on host running dropbear
|
||||||
|
|
||||||
|
function ssh_install_key {
|
||||||
|
if [ -e ~/.ssh/id_rsa.pub ]; then
|
||||||
|
echo "Adding public RSA key to $1"
|
||||||
|
KEY=`cat ~/.ssh/id_rsa.pub`
|
||||||
|
elif [ -e ~/.ssh/id_dsa.pub ]; then
|
||||||
|
echo "Adding public DSA key to $1"
|
||||||
|
KEY=`cat ~/.ssh/id_dsa.pub`
|
||||||
|
else
|
||||||
|
echo "No public key found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
ssh root@$1 "echo '$KEY' >> /etc/dropbear/authorized_keys" && echo ok
|
||||||
|
}
|
||||||
|
|
||||||
|
register_command "ssh_install_key" "Install the users public ssh key on host running dropbear"
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
|
|
||||||
# Shorthand command for doing a HIL runtime smoketest on the
|
|
||||||
# latest built image. Does the image boot up correctly?
|
|
||||||
# More info here:
|
|
||||||
# https://dev.iopsys.eu/iopsys/iopsys-taas
|
|
||||||
|
|
||||||
|
|
||||||
#--------------------------------------------------------------
|
|
||||||
function taas-init() {
|
|
||||||
local f
|
|
||||||
|
|
||||||
# Path to TaaS binarys. Try some likely ones.
|
|
||||||
if ! which taas-smoketest >/dev/null; then
|
|
||||||
PATH="${PATH}:${PWD}/../iopsys-taas/bin"
|
|
||||||
PATH="${PATH}:${PWD}/../taas/bin"
|
|
||||||
PATH="${PATH}:${HOME}/iopsys-taas/bin"
|
|
||||||
PATH="${PATH}:${HOME}/taas/bin"
|
|
||||||
PATH="${PATH}:${HOME}/bin"
|
|
||||||
PATH="${PATH}:/opt/iopsys-taas/bin"
|
|
||||||
PATH="${PATH}:/opt/taas/bin"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! which taas-smoketest >/dev/null; then
|
|
||||||
echo "Error; TaaS is missing! Install it with:"
|
|
||||||
echo "git clone git@dev.iopsys.eu:iopsys/iopsys-taas.git ../iopsys-taas"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create a list of all images which might be of use.
|
|
||||||
for f in ${PWD}/bin/targets/iopsys-*/generic/last.*; do
|
|
||||||
[[ -s "$f" ]] && images+=("$f")
|
|
||||||
done
|
|
||||||
|
|
||||||
# Convert Iopsys target name to the TaaS product name format
|
|
||||||
# according to what is available in the remote lab for HIL.
|
|
||||||
# Also find a suitable image.
|
|
||||||
product=$(grep CONFIG_TARGET_PROFILE .config | \
|
|
||||||
tr -s "=\"" " " | cut -d " " -f 2) || exit
|
|
||||||
case "$product" in
|
|
||||||
smarthub3)
|
|
||||||
export product="SmartHub3a"
|
|
||||||
;;
|
|
||||||
dg400prime|eg400|ex600)
|
|
||||||
export product=$(echo -n "$product" | tr [[:lower:]] [[:upper:]])
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Unsupported target; skipping!"
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [[ ${#images[@]} -eq 0 ]]; then
|
|
||||||
echo "No image found"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#--------------------------------------------------------------
|
|
||||||
function taas-smoketest {
|
|
||||||
declare -a images
|
|
||||||
|
|
||||||
taas-init || return
|
|
||||||
echo "Testing a $product with ${images[@]}..."
|
|
||||||
command taas-smoketest "${images[@]}" "$product" "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#--------------------------------------------------------------
|
|
||||||
function taas-bootstrap {
|
|
||||||
declare -a images
|
|
||||||
|
|
||||||
if [[ -n "$1" ]]; then
|
|
||||||
taas-init || return
|
|
||||||
echo "Flashing $1..."
|
|
||||||
command taas-bootstrap "${images[@]}" "$@"
|
|
||||||
else
|
|
||||||
echo "Usage: ./iop taas-bootstrap dutX"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
register_command "taas-bootstrap" "Write image to a remote lab device."
|
|
||||||
register_command "taas-smoketest" "Write image to a remote lab device and test it."
|
|
||||||
|
|
||||||
@@ -492,8 +492,7 @@ check_feeds()
|
|||||||
echo "Now checking if any changes have been done to the feeds."
|
echo "Now checking if any changes have been done to the feeds."
|
||||||
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
|
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
|
||||||
|
|
||||||
feeds="$1"
|
feeds=$(grep -v "^#" feeds.conf| awk '{print $2}')
|
||||||
[ -n "$feeds" ] || feeds=$(grep -v "^#" feeds.conf| awk '{print $2}')
|
|
||||||
for feed in `echo $feeds`
|
for feed in `echo $feeds`
|
||||||
do
|
do
|
||||||
feed_hash=$(feeds_hash $feed)
|
feed_hash=$(feeds_hash $feed)
|
||||||
@@ -553,7 +552,7 @@ check_feeds()
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
is_local_and_remote_same()
|
feeds_at_top()
|
||||||
{
|
{
|
||||||
git remote update 2>/dev/null 1>/dev/null
|
git remote update 2>/dev/null 1>/dev/null
|
||||||
LOCAL=$(git rev-parse @)
|
LOCAL=$(git rev-parse @)
|
||||||
@@ -582,7 +581,7 @@ is_local_and_remote_same()
|
|||||||
usage(){
|
usage(){
|
||||||
echo -e "$0 [flags]"
|
echo -e "$0 [flags]"
|
||||||
echo -e "flags:"
|
echo -e "flags:"
|
||||||
echo -e " -f\tFeed to update"
|
echo -e " -v\tVerbose mode"
|
||||||
echo -e " -h\tShow this help"
|
echo -e " -h\tShow this help"
|
||||||
echo -e " -u\tUpdate package version\n"
|
echo -e " -u\tUpdate package version\n"
|
||||||
}
|
}
|
||||||
@@ -590,7 +589,7 @@ usage(){
|
|||||||
# Exported interface
|
# Exported interface
|
||||||
function update_package {
|
function update_package {
|
||||||
|
|
||||||
UPDATE=0
|
UPDATE=0
|
||||||
|
|
||||||
Color_Off='\033[0m' # Text Reset
|
Color_Off='\033[0m' # Text Reset
|
||||||
|
|
||||||
@@ -604,18 +603,18 @@ function update_package {
|
|||||||
Cyan='\033[0;36m' # Cyan
|
Cyan='\033[0;36m' # Cyan
|
||||||
White='\033[0;37m' # White
|
White='\033[0;37m' # White
|
||||||
|
|
||||||
while getopts "f:hu" opt; do
|
while getopts "v:hu" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
f)
|
v)
|
||||||
feed=$OPTARG
|
verbose=$OPTARG
|
||||||
;;
|
;;
|
||||||
h)
|
h)
|
||||||
usage
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
u)
|
u)
|
||||||
UPDATE=1
|
UPDATE=1
|
||||||
;;
|
;;
|
||||||
\?)
|
\?)
|
||||||
echo "Invalid option: -$OPTARG" >&2
|
echo "Invalid option: -$OPTARG" >&2
|
||||||
exit 1
|
exit 1
|
||||||
@@ -638,9 +637,9 @@ function update_package {
|
|||||||
set -E
|
set -E
|
||||||
trap '[ "$?" -ne 99 ] || exit 99' ERR
|
trap '[ "$?" -ne 99 ] || exit 99' ERR
|
||||||
|
|
||||||
is_local_and_remote_same
|
feeds_at_top
|
||||||
[ -n "$feed" ] || check_packages
|
check_packages
|
||||||
check_feeds $feed
|
check_feeds
|
||||||
}
|
}
|
||||||
|
|
||||||
register_command "update_package" "Publish changes to packages and feeds"
|
register_command "update_package" "Publish changes to packages and feeds"
|
||||||
|
|||||||
58
iopupgrade/Makefile
Normal file
58
iopupgrade/Makefile
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2019 iopsys
|
||||||
|
#
|
||||||
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
|
# See /LICENSE for more information.
|
||||||
|
#
|
||||||
|
|
||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
include $(INCLUDE_DIR)/kernel.mk
|
||||||
|
|
||||||
|
PKG_NAME:=iopupgrade
|
||||||
|
PKG_VERSION:=1.0.0
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
|
PKG_SOURCE_VERSION:=01f2afd6c831d6f9eb2940c7e7af16f7e4d439c2
|
||||||
|
PKG_SOURCE_PROTO:=git
|
||||||
|
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/iopupgrade
|
||||||
|
|
||||||
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
|
||||||
|
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||||
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||||
|
|
||||||
|
PKG_LICENSE:=GPLv2
|
||||||
|
PKG_LICENSE_FILES:=LICENSE
|
||||||
|
|
||||||
|
# support parallel build
|
||||||
|
PKG_BUILD_PARALLEL:=1
|
||||||
|
|
||||||
|
#re create configure scripts if not present.
|
||||||
|
PKG_FIXUP:=autoreconf
|
||||||
|
|
||||||
|
# run install target when cross compiling. basically, make install DESTDIR=$(PKG_INSTALL_DIR)
|
||||||
|
# this way we don't need to pick out the resulting files from the build dir.
|
||||||
|
PKG_INSTALL:=1
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
define Package/iopupgrade
|
||||||
|
CATEGORY:=Utilities
|
||||||
|
TITLE:=Iopsys system upgrade utility
|
||||||
|
URL:=
|
||||||
|
# DEPENDS:=
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/iopupgrade/description
|
||||||
|
Application handling peripheral
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/iopupgrade/install
|
||||||
|
$(CP) ./files/* $(1)/
|
||||||
|
$(INSTALL_DIR) $(1)/etc/
|
||||||
|
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||||
|
$(INSTALL_DIR) $(1)/sbin
|
||||||
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/iopupgrade $(1)/sbin/
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call BuildPackage,iopupgrade))
|
||||||
|
|
||||||
308
iopupgrade/files/sbin/iopu
Executable file
308
iopupgrade/files/sbin/iopu
Executable file
@@ -0,0 +1,308 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Global variables. can be used directly in any function called.
|
||||||
|
cur_vol="" # num,[0/1] Number used for ubifs root filesystem volume name.
|
||||||
|
# eg: rootfs_0 or rootfs_1, currently used
|
||||||
|
upd_vol="" # num,[0/1] Number used for ubifs root filesystem volume name.
|
||||||
|
# eg: rootfs_0 or rootfs_1, the one we want to update
|
||||||
|
cmdline="" # command line settings.
|
||||||
|
cmdline_match="" # Headers to match to the image
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# file local variables. should not be used in imported functions. Can be used
|
||||||
|
# by functions declared in this script
|
||||||
|
chroot_cmdline="" # command line for the iop_chroot command.
|
||||||
|
board="" # string, Board name that is going to be matched
|
||||||
|
# against header of firmware image
|
||||||
|
upd_ubi_id="" # num, UBI volume number for the volume name
|
||||||
|
# "rootfs_$upd_vol", use to know what volume to run
|
||||||
|
# ubiupdatevol on.
|
||||||
|
run_cleanup=0 # if set the cleanup should be run otherwise we skip it.
|
||||||
|
run_mount_cleanup=0 # set if we should run umount in cleanup
|
||||||
|
upd_kernel=0 # set to 1 if system has the kernel in own mtd partition
|
||||||
|
log_stdout=1 # set to 0 to prevent the log to also print to stdout
|
||||||
|
upd_noreboot=0 # set to 1 if we should not reboot after programming
|
||||||
|
upd_forceimage=0 # set this to force upgrade even if image is for wrong board.
|
||||||
|
upd_forceboot=0 # set this to force upgrade of boot loader
|
||||||
|
upd_keepconfig=0 # set this to keep the current configuration.
|
||||||
|
###############################################################################
|
||||||
|
# import external functions
|
||||||
|
source /lib/upgrade/iopsys.sh
|
||||||
|
[ -f /lib/upgrade/iopupgrade ] && source /lib/upgrade/iopupgrade
|
||||||
|
|
||||||
|
# only call function if it exists
|
||||||
|
function_call() {
|
||||||
|
if type "$1" 2>/dev/null >/dev/null
|
||||||
|
then
|
||||||
|
$1 $@
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Cleanup and error handling functions.
|
||||||
|
function log {
|
||||||
|
TIME=$(date)
|
||||||
|
[ $log_stdout -eq 1 ] && echo "$@"
|
||||||
|
echo "[$TIME] $@" >>/tmp/upd_log
|
||||||
|
}
|
||||||
|
|
||||||
|
# we need to handle ctrl-c, segmentation fault, sigpipe and other abnormal
|
||||||
|
# terminations. no printing to stdout/stderr allowed in this function or
|
||||||
|
# anyhting it calls as stdout/stderr might no longer exist
|
||||||
|
function finish {
|
||||||
|
|
||||||
|
if [ $run_cleanup -eq 1 ]
|
||||||
|
then
|
||||||
|
|
||||||
|
function_call upd_cleanup
|
||||||
|
run_cleanup=0
|
||||||
|
log ""
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $run_mount_cleanup -eq 1 ]
|
||||||
|
then
|
||||||
|
log "Cleaning up after mount"
|
||||||
|
umount_newroot
|
||||||
|
fi
|
||||||
|
# always kill the timeout process, will leave the sleep but that is harmless
|
||||||
|
# as long as the kill will nerver be run.
|
||||||
|
if [ -n "$TIMEOUT_PID" ]; then
|
||||||
|
kill $TIMEOUT_PID 2>/dev/null
|
||||||
|
TIMEOUT_PID=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
lock -u /tmp/iopu.lock
|
||||||
|
}
|
||||||
|
|
||||||
|
function ctrl_c {
|
||||||
|
|
||||||
|
# on ctrl-c we remove the exit handler as it is called directly.
|
||||||
|
trap - EXIT
|
||||||
|
|
||||||
|
# call cleanup function
|
||||||
|
finish
|
||||||
|
|
||||||
|
# do not continue program
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
function sig_pipe {
|
||||||
|
log_stdout=0 # stdin,stdout,stderr do not exist anymore
|
||||||
|
log "Got sigpipe. Turning of log printing to stdout"
|
||||||
|
}
|
||||||
|
|
||||||
|
# if a timout happens terminate
|
||||||
|
function timeout {
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Not much that can be done if the mount fails but to try again.
|
||||||
|
# if after 10 seconds there still is errors abort program.
|
||||||
|
# UBIFS has some wierd time intervall after ubiupdatevol where
|
||||||
|
# a mount of the newly written data results in a busy error.
|
||||||
|
function mount_retry {
|
||||||
|
local tries=0
|
||||||
|
|
||||||
|
while [ $tries -lt 10 ]
|
||||||
|
do
|
||||||
|
if mount $@ 2>/dev/null
|
||||||
|
then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
tries=$((tries + 1))
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
|
log "mount failed for command [mount $@] so upgrade failed."
|
||||||
|
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
function mount_newroot {
|
||||||
|
run_mount_cleanup=1
|
||||||
|
mkdir -p /tmp/newroot
|
||||||
|
mkdir -p /tmp/newroot_overlay
|
||||||
|
|
||||||
|
mount_retry -t ubifs ubi0:rootfs_$upd_vol /tmp/newroot
|
||||||
|
|
||||||
|
mount_retry -o noatime,lowerdir=/tmp/newroot,upperdir=/tmp/newroot/overlay,workdir=/tmp/newroot/lib/overlay.tmp -t overlay "overlayfs:/tmp/newroot/overlay" /tmp/newroot_overlay
|
||||||
|
mount_retry --bind /tmp/newroot/ /tmp/newroot_overlay/rom
|
||||||
|
|
||||||
|
mount_retry --bind /dev /tmp/newroot_overlay/dev
|
||||||
|
mount_retry --bind /proc /tmp/newroot_overlay/proc
|
||||||
|
mount_retry --bind /sys /tmp/newroot_overlay/sys
|
||||||
|
mount_retry -t tmpfs -o noatime,mode=0755 root /tmp/newroot_overlay/tmp
|
||||||
|
|
||||||
|
mkdir -p /tmp/newroot_overlay/tmp/oldroot
|
||||||
|
mount_retry --bind / /tmp/newroot_overlay/tmp/oldroot
|
||||||
|
mount_retry --bind /tmp /tmp/newroot_overlay/tmp/oldroot/tmp
|
||||||
|
}
|
||||||
|
|
||||||
|
function umount_newroot {
|
||||||
|
umount /tmp/newroot_overlay/tmp/oldroot/tmp
|
||||||
|
umount /tmp/newroot_overlay/tmp/oldroot
|
||||||
|
umount /tmp/newroot_overlay/tmp
|
||||||
|
umount /tmp/newroot_overlay/sys
|
||||||
|
umount /tmp/newroot_overlay/proc
|
||||||
|
umount /tmp/newroot_overlay/dev
|
||||||
|
umount /tmp/newroot_overlay/rom
|
||||||
|
umount /tmp/newroot_overlay
|
||||||
|
umount /tmp/newroot
|
||||||
|
rmdir /tmp/newroot_overlay /tmp/newroot
|
||||||
|
run_mount_cleanup=0
|
||||||
|
}
|
||||||
|
|
||||||
|
function usage {
|
||||||
|
echo "usage: $0 iopu [opts] "
|
||||||
|
echo ""
|
||||||
|
echo "opts:"
|
||||||
|
echo ""
|
||||||
|
echo " -n Do not do the final reboot of the target board"
|
||||||
|
echo " -c Keep configuration"
|
||||||
|
echo " -x Force install even if firmware is not for this board"
|
||||||
|
echo " -b Force install of bootloader regardless of version installed"
|
||||||
|
echo " -r Jump into chroot env of other system"
|
||||||
|
echo " -C \"command\" Execute command in chroot env of other system"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Execute command in newroot(other system root)
|
||||||
|
function newroot_exec {
|
||||||
|
|
||||||
|
upd_vol=$(get_flashbank_next)
|
||||||
|
mount_newroot
|
||||||
|
(ENV=/sbin/iopu_chroot_env chroot /tmp/newroot_overlay "$@")
|
||||||
|
echo ""
|
||||||
|
umount_newroot
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
# just one instance
|
||||||
|
# this check has to be done before we install handler to avoid removing the
|
||||||
|
# lock even if it was not available.
|
||||||
|
if ! lock -n /tmp/iopu.lock
|
||||||
|
then
|
||||||
|
echo "Another instance of iopu already running"
|
||||||
|
echo "If you are sure this is wrong remove file /tmp/iopu.lock"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
trap finish EXIT
|
||||||
|
trap ctrl_c INT
|
||||||
|
trap timeout SIGALRM
|
||||||
|
trap sig_pipe SIGPIPE
|
||||||
|
|
||||||
|
while getopts "nrxbhcC:" opt; do
|
||||||
|
case $opt in
|
||||||
|
n)
|
||||||
|
upd_noreboot=1
|
||||||
|
;;
|
||||||
|
x)
|
||||||
|
upd_forceimage=1
|
||||||
|
;;
|
||||||
|
b)
|
||||||
|
upd_forceboot=1
|
||||||
|
;;
|
||||||
|
c)
|
||||||
|
upd_keepconfig=1
|
||||||
|
;;
|
||||||
|
r)
|
||||||
|
newroot_exec /bin/sh
|
||||||
|
exit
|
||||||
|
;;
|
||||||
|
C)
|
||||||
|
newroot_exec "${OPTARG}"
|
||||||
|
exit
|
||||||
|
;;
|
||||||
|
h)
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# put a timeout on this if it takes longer than 120 seconds we should abort
|
||||||
|
# and clean up
|
||||||
|
(
|
||||||
|
sleep 120 && kill -ALRM $$ 2>/dev/null # send it a SIGALRM signal
|
||||||
|
)&
|
||||||
|
TIMEOUT_PID=$!
|
||||||
|
|
||||||
|
log "Firmware upgrade started"
|
||||||
|
|
||||||
|
# Should board name be checked
|
||||||
|
if [ $upd_forceimage -eq 0 ]
|
||||||
|
then
|
||||||
|
board=$(db get hw.board.iopVerBoard)
|
||||||
|
cmdline_match="board=$board"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# find out what rootfs volume is active.
|
||||||
|
cur_vol=$(get_flashbank_current)
|
||||||
|
upd_vol=$(get_flashbank_next)
|
||||||
|
|
||||||
|
# convert volume name "rootfs_$upd_vol" into ubi volume id
|
||||||
|
upd_ubi_id=$(ubinfo -d 0 -N rootfs_$upd_vol | awk "/Volume ID:/ {print \$3}")
|
||||||
|
log "installing Root Fileystem into UBI volume rootfs_$upd_vol"
|
||||||
|
|
||||||
|
# prepare to match dsl.
|
||||||
|
function_call upd_conf_dsl
|
||||||
|
|
||||||
|
# prepare to update CFE if it exists
|
||||||
|
function_call upd_conf_cfe
|
||||||
|
|
||||||
|
# prepare to update kernel if it is stored in MTD/JFFS2
|
||||||
|
function_call upd_conf_kernel
|
||||||
|
|
||||||
|
log "now starting writing data to flash with [ iopupgrade $cmdline -M "$cmdline_match" -u ubi0_$upd_ubi_id ]"
|
||||||
|
run_cleanup=1 # When we start to actually write data there might be some
|
||||||
|
# things that need cleanup if we get an error/crash
|
||||||
|
if ! iopupgrade $cmdline -M "$cmdline_match" -u ubi0_$upd_ubi_id; then
|
||||||
|
log "iopupgrade program Failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
log "Firmware programmed to flash."
|
||||||
|
|
||||||
|
# Force upgrade of boot loader
|
||||||
|
[ $upd_forceboot -eq 1 ] && chroot_cmdline="$chroot_cmdline -b"
|
||||||
|
|
||||||
|
if [ $upd_keepconfig -eq 1 ]; then
|
||||||
|
log "Transfering configuration to new system."
|
||||||
|
chroot_cmdline="$chroot_cmdline -c"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mount_newroot
|
||||||
|
if ! chroot /tmp/newroot_overlay /sbin/iopu_chroot $chroot_cmdline; then
|
||||||
|
log "Configuration migration failed!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
umount_newroot
|
||||||
|
|
||||||
|
log "New firmware fully installed."
|
||||||
|
run_cleanup=0
|
||||||
|
|
||||||
|
|
||||||
|
# Now make sure that we actually boot the new system on the next reboot
|
||||||
|
upd_finnish
|
||||||
|
|
||||||
|
# spawn the reboot to a subshell to allow the main program to quit before reset
|
||||||
|
# to avoid any hanged network connection like ssh
|
||||||
|
if [ $upd_noreboot -eq 0 ]
|
||||||
|
then
|
||||||
|
(
|
||||||
|
log_stdout=0 # stdin,stdout,stderr do not exist anymore, we are in a
|
||||||
|
# subshell and then the trap is no longer working.
|
||||||
|
sleep 1
|
||||||
|
log "Rebooting NOW!!!"
|
||||||
|
log ""
|
||||||
|
reboot
|
||||||
|
)&
|
||||||
|
log "Reboot initiated"
|
||||||
|
else
|
||||||
|
log "Skipping reboot"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
71
iopupgrade/files/sbin/iopu_chroot
Executable file
71
iopupgrade/files/sbin/iopu_chroot
Executable file
@@ -0,0 +1,71 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# This program is intended to be run in a chroot environment where the old system
|
||||||
|
# is mounted in /tmp/oldroot
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Global variables. can be used directly in any function called.
|
||||||
|
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# file local variables. should not be used in imported functions. Can be used
|
||||||
|
# by functions declared in this script
|
||||||
|
upd_forceboot=0
|
||||||
|
log_stdout=1 # set to 0 to prevent the log to also print to stdout
|
||||||
|
upd_keepconfig=0 # set this to keep the current configuration.
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# import external functions
|
||||||
|
|
||||||
|
source /lib/upgrade/iopsys.sh
|
||||||
|
[ -f /lib/upgrade/iopupgrade ] && source /lib/upgrade/iopupgrade
|
||||||
|
|
||||||
|
|
||||||
|
# only call function if it exists
|
||||||
|
function_call() {
|
||||||
|
if [ -n "$1" ] && type "$1" 2>/dev/null >/dev/null
|
||||||
|
then
|
||||||
|
$1 "$@" || exit
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
# Cleanup and error handling functions.
|
||||||
|
function log {
|
||||||
|
TIME=$(date)
|
||||||
|
[ $log_stdout -eq 1 ] && echo "$@"
|
||||||
|
echo "[$TIME] $@" >>/root/upd_log
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
while getopts "hbc" opt; do
|
||||||
|
case $opt in
|
||||||
|
h)
|
||||||
|
upd_usage
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
c)
|
||||||
|
upd_keepconfig=1
|
||||||
|
;;
|
||||||
|
b)
|
||||||
|
upd_forceboot=1
|
||||||
|
;;
|
||||||
|
\?)
|
||||||
|
echo "Invalid option: -$OPTARG" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# copy old install log over
|
||||||
|
cp /tmp/oldroot/tmp/upd_log /root/upd_log
|
||||||
|
|
||||||
|
# Upgrade boot loader if needed.
|
||||||
|
function_call upd_program_boot
|
||||||
|
|
||||||
|
# Let the new upgrade do whatever it needs,
|
||||||
|
# such as configuration migration etc.
|
||||||
|
if [ $upd_keepconfig -eq 1 -a -x /lib/upgrade/post-rootfs-fixup ]; then
|
||||||
|
(/lib/upgrade/post-rootfs-fixup /dev/null /tmp/oldroot) || exit
|
||||||
|
fi
|
||||||
|
|
||||||
18
iopupgrade/files/sbin/iopu_chroot_env
Executable file
18
iopupgrade/files/sbin/iopu_chroot_env
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# this is run when "iopr -r" is executed.
|
||||||
|
# intended to just show what environment is actually started.
|
||||||
|
|
||||||
|
cat /etc/banner
|
||||||
|
|
||||||
|
echo "/tmp/oldroot:"
|
||||||
|
echo " Contains the running root filesystem. It is live so files are in use"
|
||||||
|
echo " Anything copying/reading files from there needs to make sure it is done safely."
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
Color_Off='\033[0m' # Text Reset
|
||||||
|
Red='\033[0;31m' # Red
|
||||||
|
|
||||||
|
PS1="${Red}chroot_new${Color_Off}:\w\#"
|
||||||
|
export PS1
|
||||||
|
export Red
|
||||||
|
export Color_Off
|
||||||
@@ -10,7 +10,6 @@ PKG_RELEASE:=1.0.0
|
|||||||
PKG_SOURCE_VERSION:=44b32937a062ec4ffc9f7355841dc94ab6efa50f
|
PKG_SOURCE_VERSION:=44b32937a062ec4ffc9f7355841dc94ab6efa50f
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/json-editor.git
|
PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/json-editor.git
|
||||||
PKG_MIRROR_HASH:=skip
|
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
include $(INCLUDE_DIR)/cmake.mk
|
include $(INCLUDE_DIR)/cmake.mk
|
||||||
|
|||||||
54
libjwt/Makefile
Normal file
54
libjwt/Makefile
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
|
||||||
|
# Copyright (C) 2018 Iopsys
|
||||||
|
#
|
||||||
|
|
||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_NAME:=libjwt
|
||||||
|
PKG_VERSION:=1.0.0
|
||||||
|
|
||||||
|
PKG_SOURCE_PROTO:=git
|
||||||
|
PKG_SOURCE_VERSION:=866607c7741421c8ac99876e7201eb32d9af1b92
|
||||||
|
PKG_SOURCE_URL:=https://github.com/benmcollins/libjwt.git
|
||||||
|
|
||||||
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||||
|
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||||
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||||
|
|
||||||
|
PKG_FIXUP:=autoreconf
|
||||||
|
|
||||||
|
PKG_LICENSE:=LGPLv3
|
||||||
|
PKG_LICENSE_FILES:=COPYING
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
define Package/libjwt
|
||||||
|
CATEGORY:=Libraries
|
||||||
|
DEPENDS:=+libopenssl +jansson
|
||||||
|
TITLE:= libjwt
|
||||||
|
endef
|
||||||
|
|
||||||
|
|
||||||
|
#TARGET_CFLAGS += \
|
||||||
|
# -I$(STAGING_DIR)/usr/include
|
||||||
|
# -I$(STAGING_DIR)/usr/include/libnl3
|
||||||
|
|
||||||
|
#MAKE_FLAGS += \
|
||||||
|
# CFLAGS="$(TARGET_CFLAGS)" \
|
||||||
|
# LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||||
|
# FPIC="$(FPIC)" \
|
||||||
|
# PLATFORM="$(TARGET_PLATFORM)" \
|
||||||
|
# subdirs="$(subdirs)"
|
||||||
|
|
||||||
|
define Build/InstallDev
|
||||||
|
$(INSTALL_DIR) $(1)/usr/include
|
||||||
|
$(INSTALL_DIR) $(1)/usr/lib
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/include/jwt.h $(1)/usr/include/
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/libjwt/.libs/libjwt.so* $(1)/usr/lib/
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/libjwt/install
|
||||||
|
$(INSTALL_DIR) $(1)/usr/lib
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/libjwt/.libs/libjwt.so* $(1)/usr/lib/
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call BuildPackage,libjwt))
|
||||||
@@ -16,7 +16,6 @@ PKG_SOURCE_URL:=https://dev.iopsys.eu/mirror/microxml.git
|
|||||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||||
PKG_SOURCE_VERSION:=72965423184f24cc0b963d91c2d1863cdb01b6aa
|
PKG_SOURCE_VERSION:=72965423184f24cc0b963d91c2d1863cdb01b6aa
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||||
PKG_MIRROR_HASH:=skip
|
|
||||||
PKG_LICENSE:=LGPL-2.0
|
PKG_LICENSE:=LGPL-2.0
|
||||||
PKG_LICENSE_FILES:=COPYING
|
PKG_LICENSE_FILES:=COPYING
|
||||||
|
|
||||||
|
|||||||
@@ -11,14 +11,13 @@ PKG_RELEASE:=1
|
|||||||
PKG_VERSION:=0.3
|
PKG_VERSION:=0.3
|
||||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libpicoevent.git
|
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libpicoevent.git
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_VERSION:=f446f186102539cceedaa15a95a33547ac3c1fd7
|
PKG_SOURCE_VERSION:=f4ab03b22fca57cec6c959fb5c54bcdd64c32467
|
||||||
PKG_NAME:=libpicoevent
|
PKG_NAME:=libpicoevent
|
||||||
|
|
||||||
PKG_LICENSE:=LGPL-2.1-only
|
PKG_LICENSE:=LGPL-2.1-only
|
||||||
PKG_LICENSE_FILES:=LICENSE
|
PKG_LICENSE_FILES:=LICENSE
|
||||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||||
PKG_MIRROR_HASH:=skip
|
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user