mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-24 19:14:05 +08:00
Compare commits
104 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac27b5519d | ||
|
|
cb4830aeb0 | ||
|
|
e5b7fe27d9 | ||
|
|
731cb728f2 | ||
|
|
feac6e8bc4 | ||
|
|
6c28dfe752 | ||
|
|
67228d4f90 | ||
|
|
2a6bfbdbe2 | ||
|
|
613d9f8d94 | ||
|
|
a88ac21e2e | ||
|
|
3169647767 | ||
|
|
5da3f9f82d | ||
|
|
a2df8d6594 | ||
|
|
07f549767e | ||
|
|
9f5d1bec50 | ||
|
|
f10138ab77 | ||
|
|
a5aab9dbf1 | ||
|
|
33b89c0ae7 | ||
|
|
c53ea32d91 | ||
|
|
f371cc2757 | ||
|
|
eaca767e15 | ||
|
|
7e9fa24351 | ||
|
|
22f1cc7569 | ||
|
|
ffe336f658 | ||
|
|
83a96ee602 | ||
|
|
375aa550e5 | ||
|
|
1e8f4fce8f | ||
|
|
7e8b7609cc | ||
|
|
bc34e5de25 | ||
|
|
75ed0959dd | ||
|
|
b24a7960ac | ||
|
|
1cf1b9e3b0 | ||
|
|
b5c88429a6 | ||
|
|
f8ecf6648b | ||
|
|
065449503c | ||
|
|
0602ccee21 | ||
|
|
9ca99f440d | ||
|
|
48948ede9b | ||
|
|
fd7e0a080e | ||
|
|
526c90911f | ||
|
|
a81928ce17 | ||
|
|
549826df1b | ||
|
|
44175caeb6 | ||
|
|
2c1c53e924 | ||
|
|
bf349c1436 | ||
|
|
5fa417b933 | ||
|
|
edd3d1652d | ||
|
|
b0f9ecbd13 | ||
|
|
de2631da4c | ||
|
|
a80498c137 | ||
|
|
261fb56475 | ||
|
|
8fd1f1b04f | ||
|
|
b840fb1fa5 | ||
|
|
8423ec95eb | ||
|
|
09258992ee | ||
|
|
432cb96b9c | ||
|
|
353fa426d2 | ||
|
|
924650e448 | ||
|
|
0db2e87bdc | ||
|
|
4c1277ec8a | ||
|
|
bcfc2335ff | ||
|
|
6ec3726ae6 | ||
|
|
63e0733c04 | ||
|
|
cc7fd5fcee | ||
|
|
a64fec1a35 | ||
|
|
8768c06dc9 | ||
|
|
01f8ba48e8 | ||
|
|
fc5f5cec8e | ||
|
|
ee621bf006 | ||
|
|
55321785a2 | ||
|
|
9435275d68 | ||
|
|
9e77c0ea88 | ||
|
|
887fbafd1c | ||
|
|
6542588fcf | ||
|
|
e616238c53 | ||
|
|
82a187a0c9 | ||
|
|
62af5545e0 | ||
|
|
7615130db2 | ||
|
|
127f88ba85 | ||
|
|
b796fc3293 | ||
|
|
c4d3f2d82e | ||
|
|
b4df9fa184 | ||
|
|
2484d38415 | ||
|
|
3ea4036d4a | ||
|
|
d1c7b1f0c5 | ||
|
|
e7019bf759 | ||
|
|
bc0af9746d | ||
|
|
c22499fa58 | ||
|
|
5daa2811d9 | ||
|
|
7f009d785a | ||
|
|
84093637e7 | ||
|
|
a90a982b77 | ||
|
|
0bfdb66148 | ||
|
|
b6ea95712a | ||
|
|
f9f652077e | ||
|
|
0a0c8aac05 | ||
|
|
6d269e8e08 | ||
|
|
33b0257e1a | ||
|
|
4e62f579bc | ||
|
|
b3536c8538 | ||
|
|
520b059e7b | ||
|
|
6ffef3c757 | ||
|
|
e159a19adc | ||
|
|
9250fe2302 |
@@ -24,7 +24,6 @@ PKG_SOURCE_PROTO:=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_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
if PACKAGE_libbbfdm
|
||||
|
||||
config BBF_VENDOR_EXTENSION
|
||||
bool "Enable Vendor Extension"
|
||||
default y
|
||||
|
||||
config BBF_VENDOR_LIST
|
||||
string "Vendor List"
|
||||
default "iopsys"
|
||||
|
||||
config BBF_VENDOR_PREFIX
|
||||
string "Vendor Prefix"
|
||||
default "X_IOPSYS_EU_"
|
||||
config LIBBBFDM_VENDOR_PREFIX
|
||||
string "Vendor Prefix"
|
||||
default "X_IOPSYS_EU_"
|
||||
|
||||
config BBF_TR181
|
||||
bool "Enable TR-181 Data Model Support"
|
||||
bool "Compile with tr181 device features"
|
||||
default y
|
||||
|
||||
config BBF_TR104
|
||||
bool "Enable TR-104 Data Model Support"
|
||||
bool "Compile with tr104 voice features"
|
||||
default y
|
||||
|
||||
config BBF_TR143
|
||||
bool "Enable TR-143 Data Model Support"
|
||||
bool "Compile with tr143 diagnostics features"
|
||||
default y
|
||||
|
||||
config BBF_TR157
|
||||
bool "Compile with tr157 bulkdata collector features"
|
||||
default y
|
||||
|
||||
config BBF_TR064
|
||||
bool "Compile with tr064 features"
|
||||
default n
|
||||
|
||||
endif
|
||||
|
||||
53
bbf/Makefile
53
bbf/Makefile
@@ -1,18 +1,17 @@
|
||||
#
|
||||
# Copyright (C) 2021 IOPSYS
|
||||
# Copyright (C) 2019 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libbbfdm
|
||||
PKG_VERSION:=6.0.6
|
||||
PKG_VERSION:=1.2-2020-05-12
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bbf.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=9842552d421adb529b8771b8f9dc41ddc89f5b62
|
||||
PKG_SOURCE_VERSION:=80652051f58e5070cd047594599ae4a82257d18f
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
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)
|
||||
@@ -25,7 +24,6 @@ include $(INCLUDE_DIR)/package.mk
|
||||
define Package/libbbf_api
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
SUBMENU:=BBF
|
||||
TITLE:=Library for libbbfdm API
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c
|
||||
endef
|
||||
@@ -33,9 +31,8 @@ endef
|
||||
define Package/libbbfdm
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
SUBMENU:=BBF
|
||||
TITLE:=Library for broadband-forum data model
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libtrace +libbbf_api +libopenssl +libcurl
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libtrace +libbbf_api +libopenssl +libmbedtls
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/config
|
||||
@@ -47,7 +44,7 @@ define Package/libbbf_api/description
|
||||
endef
|
||||
|
||||
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
|
||||
|
||||
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
|
||||
@@ -57,9 +54,10 @@ define Build/Prepare
|
||||
endef
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += -DCUSTOM_PREFIX=\\\"$(CONFIG_LIBBBFDM_VENDOR_PREFIX)\\\"
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE \
|
||||
-Wall -Werror \
|
||||
-D_GNU_SOURCE -D_AADJ
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR181),y)
|
||||
CONFIGURE_ARGS += \
|
||||
@@ -76,20 +74,25 @@ CONFIGURE_ARGS += \
|
||||
--enable-tr143
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR157),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-tr157
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR064),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-tr064
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_libopenssl),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-libopenssl
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBF_VENDOR_EXTENSION),y)
|
||||
ifeq ($(CONFIG_PACKAGE_libmbedtls),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-vendor-extension
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
BBF_VENDOR_LIST="$(CONFIG_BBF_VENDOR_LIST)" \
|
||||
BBF_VENDOR_PREFIX="$(CONFIG_BBF_VENDOR_PREFIX)"
|
||||
|
||||
endif ##CONFIG_BBF_VENDOR_EXTENSION
|
||||
--enable-libmbedtls
|
||||
endif
|
||||
|
||||
define Package/libbbf_api/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
@@ -99,24 +102,20 @@ endef
|
||||
define Package/libbbfdm/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.so* $(1)/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/share/bbfdm
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/* $(1)/usr/share/bbfdm
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/dmmap
|
||||
$(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
|
||||
|
||||
define Package/libbbfdm/prerm
|
||||
#!/bin/sh
|
||||
rm -rf /etc/bbfdm/*
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/libbbfdm
|
||||
$(INSTALL_DIR) $(1)/usr/include/libbbf_api
|
||||
$(CP) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/libbbfdm/
|
||||
$(CP) $(PKG_BUILD_DIR)/dmtree/tr181/*.h $(1)/usr/include/libbbfdm/
|
||||
$(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/
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2020 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:=1.0.2
|
||||
|
||||
PKG_SOURCE_VERSION:=150eb3122c969d1646c8ca8c8152154990f91823
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bulkdata.git
|
||||
|
||||
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)
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
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 +curl +libblobmsg-json +libbbfdm +libbbf_api
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
BBF BulkData Collection
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
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)/*.so $(1)/usr/lib/bbfdm
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
@@ -1,43 +0,0 @@
|
||||
|
||||
config bulkdata 'bulkdata'
|
||||
option enable '0'
|
||||
#Log levels: Critical=0, Warning=1, Notice=2, Info=3, Debug=4
|
||||
option log_level '3'
|
||||
|
||||
config profile
|
||||
option profile_id '1'
|
||||
option enable '0'
|
||||
option name ''
|
||||
option nbre_of_retained_failed_reports '0'
|
||||
option protocol 'http'
|
||||
option encoding_type ''
|
||||
option reporting_interval '86400'
|
||||
option time_reference '0'
|
||||
option csv_encoding_field_separator ','
|
||||
option csv_encoding_row_separator ' '
|
||||
option csv_encoding_escape_character '"'
|
||||
option csv_encoding_report_format 'column'
|
||||
option csv_encoding_row_time_stamp 'unix'
|
||||
option json_encoding_report_format 'objecthierarchy'
|
||||
option json_encoding_report_time_stamp 'unix'
|
||||
option http_url ''
|
||||
option http_username ''
|
||||
option http_password ''
|
||||
option http_compression 'none'
|
||||
option http_method 'post'
|
||||
option http_use_date_header '1'
|
||||
option http_retry_enable '0'
|
||||
option http_retry_minimum_wait_interval '5'
|
||||
option http_retry_interval_multiplier '2000'
|
||||
option http_persist_across_reboot '0'
|
||||
|
||||
config profile_parameter
|
||||
option profile_id '1'
|
||||
option name ''
|
||||
option reference ''
|
||||
|
||||
config profile_http_request_uri_parameter
|
||||
option profile_id '1'
|
||||
option name ''
|
||||
option reference ''
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Bulkdata Software
|
||||
# Copyright (C) 2020 iopsys Software Solutions AB
|
||||
# Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
|
||||
START=99
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
PROG="/usr/sbin/bulkdatad"
|
||||
|
||||
start_service() {
|
||||
local bulkdata_enable=`uci -q get bulkdata.bulkdata.enable`
|
||||
if [ "$bulkdata_enable" = "1" ]; then
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG"
|
||||
procd_set_param respawn "3" "7" "0"
|
||||
procd_close_instance
|
||||
fi
|
||||
}
|
||||
|
||||
boot() {
|
||||
start
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger bulkdata
|
||||
}
|
||||
@@ -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
|
||||
#
|
||||
# Copyright (C) 2015 inteno.org
|
||||
#
|
||||
|
||||
START=71
|
||||
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);
|
||||
@@ -27,7 +27,7 @@ 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 set system.crashlog.server="crash.inteno.se"
|
||||
/sbin/uci commit
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ 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 set system.corelog.server="crash.inteno.se"
|
||||
/sbin/uci commit
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ 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@iopsys
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwn9RaDAzxW1dTmIhXgFBnpi1lhj8xhYpCVQiPxxdk9IEmH8zjo4y9j3sPkqKOlRnkwjpZIpLEKBnpQTwVIMCU/AG7nDJX3OH9RfS9mLJQLfFL8HyGCyqDezFWldbyovhJZvdUeK4tAXJWv2W3OVHiz2L8IlncBgP/E9DJElsyhhQHsM96UE6tBkXsvXkoDbMSYXFcLbgiUwBKfmM2BF/aPDL45iznGur7/2j9v95PwJ0gtMu9jjNRq+pXCXhTh3bsnczm0MpZC1aiRc9nJAeGIMmhrf15E4jBKgTnrstzJxGVAdajKeR954KcNsS33cS2Wmui2YjmPbBXjqf1frzJ log@inteno
|
||||
----------
|
||||
|
||||
The public key should be just one line. Add that line to the
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=crun
|
||||
PKG_VERSION:=0.20
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/containers/crun.git
|
||||
PKG_SOURCE_DATE:=2021-06-07
|
||||
PKG_SOURCE_VERSION:=8d6a8b5ab80461cfed19f020a36584af13c32038
|
||||
PKG_MIRROR_HASH:=9ca1f0e530b33ce8820bd03329eb6731c5050d6e7f35bd2463d9a81cc00382e0
|
||||
|
||||
PKG_BUILD_DEPENDS:=argp-standalone
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_INSTALL:=1
|
||||
|
||||
PKG_MAINTAINER:=Oskari Rauta <oskari.rauta@gmail.com>
|
||||
PKG_LICENSE:=GPL-2.0-or-later
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/crun
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=crun
|
||||
URL:=https://github.com/containers/crun
|
||||
DEPENDS:=@!arc +libseccomp +libcap
|
||||
endef
|
||||
|
||||
define Package/crun/description
|
||||
A fast and low-memory footprint OCI Container Runtime fully written in C.
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS+= \
|
||||
--disable-systemd \
|
||||
--enable-embedded-yajl \
|
||||
--enable-caps \
|
||||
--enable-dl \
|
||||
--enable-seccomp \
|
||||
--enable-bpf
|
||||
|
||||
define Build/Prepare
|
||||
$(call Build/Prepare/Default)
|
||||
$(SED) '/#include <git-version.h>/d' $(PKG_BUILD_DIR)/src/crun.c
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
$(call Build/Configure/Default)
|
||||
|
||||
$(SED) '/#define PACKAGE \"/d' $(PKG_BUILD_DIR)/config.h
|
||||
$(SED) '/#define VERSION \"/d' $(PKG_BUILD_DIR)/config.h
|
||||
$(SED) '/#define GIT_VERSION \"/d' $(PKG_BUILD_DIR)/config.h
|
||||
$(SED) '/#define PACKAGE_BUGREPORT \"/d' $(PKG_BUILD_DIR)/config.h
|
||||
$(SED) '/#define PACKAGE_NAME \"/d' $(PKG_BUILD_DIR)/config.h
|
||||
$(SED) '/#define PACKAGE_STRING \"/d' $(PKG_BUILD_DIR)/config.h
|
||||
$(SED) '/#define PACKAGE_TARNAME \"/d' $(PKG_BUILD_DIR)/config.h
|
||||
$(SED) '/#define PACKAGE_VERSION \"/d' $(PKG_BUILD_DIR)/config.h
|
||||
|
||||
echo "#define PACKAGE \"$(PKG_NAME)\"" >> $(PKG_BUILD_DIR)/config.h
|
||||
echo "#define VERSION \"$(PKG_VERSION)\"" >> $(PKG_BUILD_DIR)/config.h
|
||||
echo "#define PACKAGE_NAME \"$(PKG_NAME)\"" >> $(PKG_BUILD_DIR)/config.h
|
||||
echo "#define PACKAGE_VERSION \"$(PKG_VERSION)\"" >> $(PKG_BUILD_DIR)/config.h
|
||||
echo "#define PACKAGE_STRING \"$(PKG_NAME) $(PKG_VERSION)\"" >> $(PKG_BUILD_DIR)/config.h
|
||||
echo "#define PACKAGE_TARNAME \"$(PKG_NAME)\"" >> $(PKG_BUILD_DIR)/config.h
|
||||
echo "#define PACKAGE_BUGREPORT \"bugs@openwrt.org\"" >> $(PKG_BUILD_DIR)/config.h
|
||||
echo "#define GIT_VERSION \"$(PKG_SOURCE_VERSION)\"" >> $(PKG_BUILD_DIR)/config.h
|
||||
endef
|
||||
|
||||
define Package/crun/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/crun $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcrun.* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,crun))
|
||||
@@ -1,62 +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.1.18
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=0e937cfb839f845cf28922c4dde0572ec2842f85
|
||||
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
|
||||
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
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -av --exclude=.* ~/git/voip/dectmngr/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
MAKE_FLAGS += \
|
||||
CFLAGS+="-Wall"
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/app/dectmngr $(1)/usr/sbin/
|
||||
$(STRIP) $(1)/usr/sbin/dectmngr
|
||||
$(CP) ./files/etc/* $(1)/etc/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
@@ -1,2 +0,0 @@
|
||||
config dect 'global'
|
||||
option log_dect_cmbs '0'
|
||||
Binary file not shown.
@@ -1,86 +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=
|
||||
|
||||
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)
|
||||
# Setting model_id to 0x010203 is a workaround to reduce synchronisation time of some handset
|
||||
# TODO: remove below line and uncomment the line above to get value from db when the problem is solved
|
||||
model_id="01.02.03"
|
||||
[ -n "$model_id" -a ${#model_id} -eq 8 ] && opt_ext="$opt_ext -model $model_id"
|
||||
|
||||
config_load dect
|
||||
config_get_bool log_dect_cmbs global log_dect_cmbs 0
|
||||
|
||||
procd_open_instance
|
||||
if [ $log_dect_cmbs -eq 0 ]; then
|
||||
echo "Starting dectmngr with cmbs logging disabled"
|
||||
procd_set_param command $PROG -comname ttyH0 $opt_ext
|
||||
rm -f $LOG_PATH/*
|
||||
else
|
||||
echo "Starting dectmngr with cmbs logging enabled"
|
||||
procd_set_param command $PROG -comname ttyH0 -log $LOG_PATH/dect-cmbs.log $opt_ext
|
||||
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() {
|
||||
stop_and_wait_dectmngr
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger asterisk dect
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
PKG_NAME:=dslmngr
|
||||
PKG_VERSION:=1.1.2
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=bb754ae620a9fc66fd6fc0745f0fead0708c7a17
|
||||
PKG_SOURCE_VERSION:=fcad1331eb134b5f0cc05526aa897df61fc4fec0
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dslmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
@@ -26,7 +25,9 @@ PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_mips),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
|
||||
TARGET_PLATFORM=MEDIATEK
|
||||
@@ -44,7 +45,7 @@ define Package/dslmngr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=XDSL status and configration utility
|
||||
DEPENDS:=+libdsl +libuci +libubox +ubus +libpthread +libnl-genl +libeasy
|
||||
DEPENDS:=+libdsl +libuci +libubox +ubus +libpthread +libnl-genl
|
||||
endef
|
||||
|
||||
define Package/dslmngr/description
|
||||
|
||||
@@ -19,7 +19,7 @@ define Package/easy-qos
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Easy QoS
|
||||
DEPENDS:=@(TARGET_intel_mips||TARGET_iopsys_brcm63xx_arm)
|
||||
DEPENDS:=@(TARGET_intel_mips||TARGET_iopsys_brcm63xx_arm||TARGET_iopsys_brcm63xx_mips)
|
||||
endef
|
||||
|
||||
define Package/easy-qos/description
|
||||
|
||||
@@ -5,50 +5,30 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=easy-soc-events
|
||||
PKG_VERSION:=1.1
|
||||
PKG_VERSION:=1.0
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/easy-soc-events.git
|
||||
PKG_SOURCE_VERSION:=5c582b0165b574dc94e4865f82e0bb91fa561754
|
||||
PKG_SOURCE_VERSION:=f340418462d0aa119f8009d4321f18dc9c4e47b1
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/easy-soc-events-$(PKG_VERSION)
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
-include $(TOPDIR)/.config
|
||||
|
||||
ifneq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),)
|
||||
LINUX_DIR=$(BUILD_DIR)/bcmkernel/bcm963xx/kernel/linux-4.1
|
||||
LINUX_VERSION := 4.1.52
|
||||
LINUXINCLUDE=-Iarch/$(LINUX_KARCH)/mach-bcm963xx/include
|
||||
BCM_BS_PROFILE := $(patsubst "%",%,$(CONFIG_BCM_KERNEL_PROFILE))
|
||||
FS_DIR := $(BUILD_DIR)/bcmkernel/bcm963xx/targets/$(BCM_BS_PROFILE)/fs
|
||||
MODULES_SUBDIR:=lib/modules/$(LINUX_VERSION)/extra
|
||||
TARGET_MODULES_DIR:=/$(MODULES_SUBDIR)
|
||||
LINUX_DIR=$(BUILD_DIR)/bcmkernel/bcm963xx/kernel/linux-4.1
|
||||
LINUXINCLUDE=-Iarch/$(LINUX_KARCH)/mach-bcm963xx/include
|
||||
endif
|
||||
|
||||
|
||||
define KernelPackage/easy-soc-events/default
|
||||
SUBMENU:=Other modules
|
||||
endef
|
||||
|
||||
define KernelPackage/easy-soc-events
|
||||
$(KernelPackage/easy-soc-events/default)
|
||||
SUBMENU:=Other modules
|
||||
TITLE:=Helper module for netlink event notification
|
||||
FILES:=$(PKG_BUILD_DIR)/easyevent.ko
|
||||
AUTOLOAD:=$(call AutoLoad,11,easyevent)
|
||||
AUTOLOAD:=$(call AutoProbe,easyevent)
|
||||
endef
|
||||
|
||||
define KernelPackage/easy-soc-events-test
|
||||
$(KernelPackage/easy-soc-events/default)
|
||||
TITLE:=Test module for event notification through easyevent
|
||||
DEPENDS+=+kmod-easy-soc-events
|
||||
FILES+=$(PKG_BUILD_DIR)/test/testevent.ko
|
||||
endef
|
||||
|
||||
|
||||
define KernelPackage/easy-soc-events/description
|
||||
This is a helper module to generate and pass netlink events from
|
||||
kernel to user applications.
|
||||
@@ -56,10 +36,6 @@ endef
|
||||
|
||||
#NOSTDINC_FLAGS :=
|
||||
|
||||
ifdef CONFIG_PACKAGE_kmod-easy-soc-events
|
||||
PKG_MAKE_FLAGS += CONFIG_EASYEVENT=y
|
||||
endif
|
||||
|
||||
LINUXINCLUDE += \
|
||||
-I$(LINUX_DIR)/include -I$(LINUX_DIR)/include/$(LINUX_UAPI_DIR) \
|
||||
-Iarch/$(LINUX_KARCH)/include \
|
||||
@@ -77,34 +53,18 @@ endef
|
||||
define Build/Compile
|
||||
$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
|
||||
$(KERNEL_MAKE_FLAGS) V=1 \
|
||||
$(PKG_MAKE_FLAGS) \
|
||||
NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
|
||||
LINUXINCLUDE="$(LINUXINCLUDE)" \
|
||||
SUBDIRS="$(PKG_BUILD_DIR)" \
|
||||
modules
|
||||
endef
|
||||
|
||||
|
||||
ifneq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),)
|
||||
define KernelPackage/easy-soc-events/install-extra
|
||||
cp $(PKG_BUILD_DIR)/easyevent.ko $(FS_DIR)/lib/modules/$(LINUX_VERSION)/extra
|
||||
endef
|
||||
endif
|
||||
|
||||
define KernelPackage/easy-soc-events/install
|
||||
$(call KernelPackage/easy-soc-events/install-extra)
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(STAGING_DIR)/usr/include
|
||||
#$(INSTALL_DIR) $(STAGING_DIR)/usr/include/linux
|
||||
#$(CP) $(PKG_BUILD_DIR)/easysoc-event.h $(STAGING_DIR)/usr/include/linux/
|
||||
#$(CP) $(PKG_BUILD_DIR)/easysoc-event.h $(LINUX_DIR)/include/linux/
|
||||
$(CP) $(PKG_BUILD_DIR)/easyevent.h $(STAGING_DIR)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/wifievent.h $(STAGING_DIR)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/easyevent.h $(LINUX_DIR)/include/generated/uapi
|
||||
$(CP) $(PKG_BUILD_DIR)/wifievent.h $(LINUX_DIR)/include/generated/uapi
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,easy-soc-events-test))
|
||||
$(eval $(call KernelPackage,easy-soc-events))
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
# libeasy configuration
|
||||
if (PACKAGE_libwifi || PACKAGE_libdsl || PACKAGE_libethernet)
|
||||
menu "configurations"
|
||||
|
||||
config LIBWIFI_USE_CTRL_IFACE
|
||||
bool "Use UNIX sockets"
|
||||
config IOP_LLA_LIBS_DEBUG
|
||||
bool "Enable debugging support"
|
||||
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
|
||||
|
||||
PKG_NAME:=easy-soc-libs
|
||||
PKG_VERSION:=6.4.5
|
||||
PKG_VERSION:=3.1.6
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=23028753fdfc5f4a0e8da33fb6b813e21c5d6c23
|
||||
PKG_SOURCE_VERSION:=0a9c1df3d0b75c434473a351103a9283de87190c
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/easy-soc-libs.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
@@ -30,52 +29,73 @@ include $(INCLUDE_DIR)/package.mk
|
||||
define Package/easy-soc-libs
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=IOPSYS Easy SoC libraries
|
||||
SUBMENU:=IOPSYS Easy SoC libraries
|
||||
TITLE:=IOPSYS easy SoC libraries
|
||||
SUBMENU:=IOPSYS easy SoC libraries
|
||||
DEPENDS:=+libopenssl
|
||||
MENU:=1
|
||||
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+=+TARGET_iopsys_ramips:swconfig
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_mips),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
CHIP_ID=$(patsubst "%",%,$(CONFIG_BCM_CHIP_ID))
|
||||
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/userspace/public/include
|
||||
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCONFIG_BCM963138 \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx
|
||||
KERNEL_DIR:=$(BUILD_DIR)/bcmkernel/bcm963xx
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCONFIG_BCM963138 \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
|
||||
TARGET_PLATFORM=MEDIATEK
|
||||
TARGET_CFLAGS +=-DIOPSYS_MEDIATEK
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_x86),y)
|
||||
TARGET_PLATFORM=TEST
|
||||
TARGET_CFLAGS +=-DIOPSYS_TEST
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_armvirt),y)
|
||||
TARGET_PLATFORM=TEST
|
||||
TARGET_CFLAGS +=-DIOPSYS_TEST
|
||||
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
|
||||
$(info Unexpected CONFIG_TARGET, use default MAC80211)
|
||||
TARGET_PLATFORM=MAC80211
|
||||
TARGET_CFLAGS +=-DIOPSYS_MAC80211
|
||||
$(info Unexpected CONFIG_TARGET)
|
||||
endif
|
||||
|
||||
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 := \
|
||||
$(if $(CONFIG_PACKAGE_libeasy),libeasy) \
|
||||
$(if $(CONFIG_PACKAGE_libwifi),libwifi) \
|
||||
$(if $(CONFIG_PACKAGE_libdsl),libdsl) \
|
||||
$(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
|
||||
$(if $(CONFIG_PACKAGE_libethernet),libethernet)
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
@@ -95,36 +115,78 @@ define Build/Prepare
|
||||
endef
|
||||
endif
|
||||
|
||||
include easy.mk
|
||||
include wifi.mk
|
||||
include dsl.mk
|
||||
include ethernet.mk
|
||||
include qos.mk
|
||||
|
||||
ifneq ($(wildcard $(PKG_BUILD_DIR)/.config_*),\
|
||||
$(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_*)
|
||||
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/libeasy*.so* $(1)/usr/lib/
|
||||
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
|
||||
$(Build/Compile/rebuild)
|
||||
touch $(PKG_BUILD_DIR)/.config_$(CONFIG_TARGET_PROFILE)
|
||||
$(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
|
||||
|
||||
define Build/InstallDev
|
||||
$(foreach dir,$(subdirs),$(call Build/InstallDev/$(dir),$(1),$(2));)
|
||||
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
|
||||
:
|
||||
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
|
||||
|
||||
PKG_NAME:=endptmngr
|
||||
PKG_VERSION:=0.5
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/endptmngr.git
|
||||
PKG_SOURCE_VERSION:=debfc47348d6e1fc1c8b126ad50a7f5f8db3e19d
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=0.3
|
||||
PKG_SOURCE_VERSION:=afbfc4e8976fbcf9d4284338289d9d143664caa6
|
||||
PKG_LICENSE:=MIT
|
||||
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
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
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_504002
|
||||
export CONFIG_BCM_CHIP_ID
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@@ -41,24 +40,27 @@ endef
|
||||
|
||||
define Package/endptmngr
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Broadcom Voice Endpoint Manager
|
||||
TITLE:=Brcmslic
|
||||
URL:=
|
||||
DEPENDS:= +libubox +ubus +libpicoevent +uci +bcmkernel @TARGET_HAS_VOICE @BCM_VOICE
|
||||
DEPENDS:= +libubox +ubus +libpicoevent +bcmkernel @TARGET_HAS_VOICE
|
||||
endef
|
||||
|
||||
define Package/endptmngr/description
|
||||
endptmngr
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -av --exclude=.* ~/git/endptmngr/* $(PKG_BUILD_DIR)/
|
||||
ifeq ($(CONFIG_ENDPT_OPEN),y)
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
endif
|
||||
|
||||
|
||||
define Package/endptmngr/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(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/
|
||||
endef
|
||||
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=68
|
||||
STOP=12
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=endptmngr
|
||||
|
||||
start_service() {
|
||||
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
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2020 Iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ethmngr
|
||||
PKG_VERSION:=2.0.1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=5a0ff3bc7c49dcb05129f423ef8e0c4929f6aa03
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ethmngr.git
|
||||
|
||||
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_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/ethmngr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Ethernet status and configration utility
|
||||
DEPENDS:=+libethernet +libuci +libubox +ubus +libpthread +libnl-genl
|
||||
endef
|
||||
|
||||
define Package/ethmngr/description
|
||||
This package can be used to configure and provide status about
|
||||
the ethernet interfaces and ports through UBUS.
|
||||
It uses APIs from the libethernet.so library.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
define Package/ethmngr/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d $(1)/usr/sbin
|
||||
$(INSTALL_BIN) ./files/ethmngr.init $(1)/etc/init.d/ethmngr
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ethmngr $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ethmngr))
|
||||
@@ -1,51 +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:=45575262de7a9690bcb2c760f35e2c74e88e1176
|
||||
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
|
||||
|
||||
MAKE_FLAGS += \
|
||||
CFLAGS+="-Wall"
|
||||
|
||||
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)))
|
||||
54
fping/Makefile
Normal file
54
fping/Makefile
Normal file
@@ -0,0 +1,54 @@
|
||||
#
|
||||
# Copyright (C) 2016 Nikil Mehta <nikil.mehta@gmail.com>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fping
|
||||
PKG_VERSION:=4.0
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://fping.org/dist/
|
||||
PKG_HASH:=67eb4152b98ad34f99d2eec4e1098a0bb52caf13c0c89cd147349d08190fe8ce
|
||||
|
||||
PKG_MAINTAINER:=Nikil Mehta <nikil.mehta@gmail.com>
|
||||
PKG_LICENSE:=BSD-4-Clause
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/fping
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=sends ICMP ECHO_REQUEST packets to network hosts
|
||||
URL:=http://fping.org/
|
||||
endef
|
||||
|
||||
|
||||
define Package/fping/description
|
||||
fping is a ping like program which uses the Internet Control Message Protocol
|
||||
(ICMP) echo request to determine if a target host is responding. fping
|
||||
differs from ping in that you can specify any number of targets on the command
|
||||
line, or specify a file containing the lists of targets to ping. Instead of
|
||||
sending to one target until it times out or replies, fping will send out a
|
||||
ping packet and move on to the next target in a round-robin fashion.
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS+= \
|
||||
--enable-ipv4 \
|
||||
--enable-ipv6
|
||||
|
||||
TARGET_CFLAGS += -std=gnu99
|
||||
|
||||
define Package/fping/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fping $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,fping))
|
||||
@@ -43,18 +43,12 @@
|
||||
static ssize_t get_led_color(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
/* [ln] todo: dummy implementation */
|
||||
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, "%02x%02x%02x\n", sk9822->led_colors[0].r, sk9822->led_colors[0].g, sk9822->led_colors[0].b);
|
||||
len = sprintf(buf, "%d\n", 123);
|
||||
if (len <= 0) {
|
||||
dev_err(dev, "sk9822: Invalid sprintf len: %d\n", len);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
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 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[] = {
|
||||
&dev_attr_led_color.attr,
|
||||
&dev_attr_led_brightness.attr,
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -196,8 +129,6 @@ static int canyon_led_probe(struct platform_device *pdev)
|
||||
if (ret < 0) {
|
||||
dev_warn(&pdev->dev, "Could not read led-count property\n");
|
||||
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,
|
||||
@@ -209,7 +140,7 @@ static int canyon_led_probe(struct platform_device *pdev)
|
||||
|
||||
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);
|
||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
|
||||
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");
|
||||
exit(1);
|
||||
#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);
|
||||
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);
|
||||
}
|
||||
|
||||
#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);
|
||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
|
||||
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");
|
||||
exit(1);
|
||||
#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);
|
||||
if (IS_ERR(leds->data_gpio)) {
|
||||
|
||||
46
icgroupd/Makefile
Normal file
46
icgroupd/Makefile
Normal file
@@ -0,0 +1,46 @@
|
||||
#
|
||||
# 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:=icgroupd
|
||||
PKG_VERSION:=1.0
|
||||
PKG_RELEASE:=0
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_LICENSE_FILES:=
|
||||
|
||||
PKG_MAINTAINER:=Inteno Broadband AB
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/icgroupd
|
||||
SECTION:=base
|
||||
CATEGORY:=Base system
|
||||
TITLE:=Inteno cgroup daemon
|
||||
DEPENDS:=+uci +busybox
|
||||
endef
|
||||
|
||||
define Package/icgroupd/description
|
||||
This package contains Intenos cgroup daemon and associated
|
||||
configuration and startup scripts.
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
true
|
||||
endef
|
||||
|
||||
define Package/icgroupd/install
|
||||
$(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d $(1)/etc/config
|
||||
|
||||
$(INSTALL_CONF) ./files/cgroups.config $(1)/etc/config/cgroups
|
||||
$(INSTALL_BIN) ./files/cgroups.init $(1)/etc/init.d/cgroups
|
||||
$(INSTALL_BIN) ./files/cgroupd $(1)/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,icgroupd))
|
||||
|
||||
76
icgroupd/files/cgroupd
Executable file
76
icgroupd/files/cgroupd
Executable file
@@ -0,0 +1,76 @@
|
||||
#!/bin/sh
|
||||
|
||||
CGBASEDIR=$1
|
||||
CGCONFIG=$2
|
||||
[ -n "$CGBASEDIR" -a -n "$CGCONFIG" ] || exit 1
|
||||
|
||||
[ -r /lib/functions.sh ] || exit 1
|
||||
. /lib/functions.sh
|
||||
|
||||
CGPROCMAP=/tmp/cgprocmap
|
||||
CGPERIOD=3s
|
||||
|
||||
DBGLOG=/tmp/cgroupd.log
|
||||
DEBUG=0
|
||||
|
||||
|
||||
add_to_procmap () {
|
||||
local name_grp=$1
|
||||
local name grp
|
||||
|
||||
name=$(echo $name_grp |awk -F= '{print $1}')
|
||||
grp=$(echo $name_grp |awk -F= '{print $2}')
|
||||
|
||||
echo "($name) $grp" >> $CGPROCMAP
|
||||
}
|
||||
|
||||
# Read configuration file and create process:group look-up table
|
||||
# in /tmp file
|
||||
read_config () {
|
||||
local enab
|
||||
|
||||
config_load $CGCONFIG
|
||||
|
||||
config_get enab cgroups enabled "1"
|
||||
[ $enab -eq 0 ] && exit 1
|
||||
|
||||
config_get CGDEFGROUP cgroups defgroup "_undef_"
|
||||
[ "$CGDEFGROUP" == "_undef_" ] && exit 1
|
||||
[ "$DEBUG" == "1" ] && echo "default $CGDEFGROUP" >> $DBGLOG
|
||||
|
||||
echo -n '' > $CGPROCMAP
|
||||
config_list_foreach procmap procmap add_to_procmap
|
||||
[ "$DEBUG" == "1" ] && cat $CGPROCMAP >> $DBGLOG
|
||||
}
|
||||
|
||||
# Move all process except init from cgroup root to cgroups according
|
||||
# to /tmp look-up table
|
||||
move_wild_procs () {
|
||||
local wild_procs=$(cat $CGBASEDIR/cgroup.procs)
|
||||
local pid name grp
|
||||
|
||||
for pid in $wild_procs; do
|
||||
|
||||
[ $pid -eq 1 ] && continue
|
||||
if [ -d /proc/$pid ]; then
|
||||
|
||||
name=$(awk '{print $2}' /proc/$pid/stat)
|
||||
grp=$(awk "\$1==\"$name\" {print \$2}" $CGPROCMAP)
|
||||
|
||||
[ "$grp" == "." ] && continue
|
||||
[ -n "$grp" ] || grp=$CGDEFGROUP
|
||||
|
||||
[ "$DEBUG" == "1" ] && \
|
||||
echo "Moving proc $pid $name to $grp" >> $DBGLOG
|
||||
echo $pid > $CGBASEDIR/$grp/cgroup.procs
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
[ "$DEBUG" == "1" ] && echo "$0 started $(date)" >> $DBGLOG
|
||||
read_config
|
||||
while true; do
|
||||
move_wild_procs
|
||||
sleep $CGPERIOD
|
||||
done
|
||||
48
icgroupd/files/cgroups.config
Normal file
48
icgroupd/files/cgroups.config
Normal file
@@ -0,0 +1,48 @@
|
||||
config cgroups cgroups
|
||||
option enabled 1
|
||||
option defgroup iopsys/normal
|
||||
|
||||
config cgroup _root_
|
||||
# list option cpu.rt_runtime_us=50000
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config cgroup iopsys
|
||||
list option cpu.shares=4096
|
||||
# list option cpu.rt_runtime_us=40000
|
||||
list option memory.limit_in_bytes=-1
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config cgroup iopsys_normal
|
||||
list option cpu.shares=1024
|
||||
# list option cpu.rt_runtime_us=10000
|
||||
list option memory.limit_in_bytes=-1
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config cgroup iopsys_high
|
||||
list option cpu.shares=4096
|
||||
# list option cpu.rt_runtime_us=30000
|
||||
list option memory.limit_in_bytes=-1
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config cgroup 3prt
|
||||
list option cpu.shares=1024
|
||||
# list option cpu.rt_runtime_us=10000
|
||||
list option memory.limit_in_bytes=75M
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config cgroup 3prt_normal
|
||||
list option cpu.shares=1024
|
||||
# list option cpu.rt_runtime_us=2500
|
||||
list option memory.limit_in_bytes=75M
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config cgroup 3prt_high
|
||||
list option cpu.shares=4096
|
||||
# list option cpu.rt_runtime_us=7500
|
||||
list option memory.limit_in_bytes=75M
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config procmap procmap
|
||||
list procmap kthreadd=.
|
||||
list procmap minidlna=3prt/normal
|
||||
|
||||
93
icgroupd/files/cgroups.init
Executable file
93
icgroupd/files/cgroups.init
Executable file
@@ -0,0 +1,93 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=01
|
||||
USE_PROCD=1
|
||||
PROCD_DEBUG=1
|
||||
NAME=cgroupd
|
||||
|
||||
CGBASEDIR=/sys/fs/cgroup
|
||||
CGCONFIG="cgroups"
|
||||
|
||||
DBGLOG=/tmp/cginit.log
|
||||
DEBUG=0
|
||||
|
||||
|
||||
cgroupinit_set_knob_value () {
|
||||
local knob_val=$1
|
||||
local dir=$2
|
||||
local knob val
|
||||
|
||||
knob=$(echo $knob_val |awk -F= '{print $1}')
|
||||
val=$(echo $knob_val |awk -F= '{print $2}')
|
||||
/bin/echo $val > $CGBASEDIR/$dir/$knob
|
||||
[ "$DEBUG" == "1" ] && \
|
||||
echo "/bin/echo $val > $CGBASEDIR/$dir/$knob (ret=$?)" >> $DBGLOG
|
||||
}
|
||||
|
||||
cgroupinit_create_group () {
|
||||
local cgrp=$1
|
||||
local dir
|
||||
|
||||
[ "$DEBUG" == "1" ] && echo "Create group $cgrp:" >> $DBGLOG
|
||||
if [ "$cgrp" == "_root_" ]; then
|
||||
dir=.
|
||||
else
|
||||
dir=$(echo $cgrp |tr '_' '/')
|
||||
|
||||
if [ ! -d $CGBASEDIR/$dir ]; then
|
||||
mkdir $CGBASEDIR/$dir
|
||||
[ "$DEBUG" == "1" ] && \
|
||||
echo "mkdir $CGBASEDIR/$dir (ret=$?)" >> $DBGLOG
|
||||
fi
|
||||
fi
|
||||
|
||||
config_list_foreach $cgrp option cgroupinit_set_knob_value $dir
|
||||
}
|
||||
|
||||
cgroupinit_configure_cgroups () {
|
||||
local enab defgrp
|
||||
|
||||
[ "$DEBUG" == "1" ] && echo "$0 started $(date)" >> $DBGLOG
|
||||
config_load $CGCONFIG
|
||||
|
||||
config_get enab cgroups enabled "1"
|
||||
[ $enab -eq 0 ] && return 1
|
||||
|
||||
config_get defgrp cgroups defgroup "_undef_"
|
||||
[ "$defgrp" == "_undef_" ] && return 1
|
||||
|
||||
if ! grep -q " $CGBASEDIR cgroup " /proc/mounts; then
|
||||
mount -t cgroup -o nodev,noexec,nosuid cgroup $CGBASEDIR
|
||||
[ $? -eq 0 ] || return 1
|
||||
fi
|
||||
|
||||
config_foreach cgroupinit_create_group cgroup
|
||||
return 0
|
||||
}
|
||||
|
||||
start_service () {
|
||||
cgroupinit_configure_cgroups
|
||||
[ $? -eq 0 ] || return
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command /sbin/cgroupd $CGBASEDIR $CGCONFIG
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop_service () {
|
||||
local cgdir procs prc
|
||||
|
||||
for cgdir in $(find $CGBASEDIR -type d -mindepth 1 -depth); do
|
||||
procs=$(cat $cgdir/cgroup.procs)
|
||||
for prc in $procs; do
|
||||
echo $prc > $CGBASEDIR/cgroup.procs
|
||||
done
|
||||
rmdir $cgdir
|
||||
done
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger $CGCONFIG
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
if PACKAGE_icwmp
|
||||
if PACKAGE_icwmp-curl || PACKAGE_icwmp-zstream
|
||||
|
||||
config CWMP_SCRIPTS_FULL
|
||||
bool "Install all icwmp scripts"
|
||||
default y
|
||||
|
||||
choice
|
||||
prompt "Select ACS sever"
|
||||
@@ -18,6 +22,6 @@ config CWMP_DEBUG
|
||||
config CWMP_DEVEL_DEBUG
|
||||
bool "Compile with development debug options"
|
||||
default n
|
||||
|
||||
|
||||
endif
|
||||
|
||||
|
||||
244
icwmp/Makefile
244
icwmp/Makefile
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2020 iopsys Software Solutions AB
|
||||
# Copyright (C) 2019 iopsys Software Solutions AB
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
@@ -8,14 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=8.2.0-2021-10-05
|
||||
PKG_VERSION:=4.0-2020-05-08
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=ab875277578d851a9f8eed57883ca05c886b127d
|
||||
PKG_SOURCE_VERSION:=d0eae460525c9dc735b12649ea338d1b81dc44bb
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
@@ -27,23 +26,80 @@ PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_CWMP_DEBUG \
|
||||
CONFIG_CWMP_DEVEL_DEBUG
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
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
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
define Package/icwmp_stun
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=CWMP client
|
||||
DEPENDS:=+libuci +libmicroxml +libubox +jshn +libubus +libblobmsg-json +libpthread +ubusd +shflags +getopt +zlib +libjson-c +libopenssl +curl +libcurl
|
||||
TITLE:=TR-069 stun 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
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
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
|
||||
endef
|
||||
|
||||
define Package/icwmp/description
|
||||
A free client implementation of CWMP (TR-069) protocol
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
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"
|
||||
endef
|
||||
|
||||
@@ -55,8 +111,65 @@ endef
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE \
|
||||
"-DCWMP_REVISION=\\\"$(PKG_SOURCE_VERSION)\\\""
|
||||
-D_GNU_SOURCE -D_AADJ
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_icwmp-tr098),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-icwmp_tr098
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_icwmp_xmpp),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-icwmp_xmpp
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_icwmp_stun),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-icwmp_stun
|
||||
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
|
||||
|
||||
ifeq ($(CONFIG_CWMP_ACS_MULTI),y)
|
||||
CONFIGURE_ARGS += \
|
||||
@@ -78,23 +191,102 @@ CONFIGURE_ARGS += \
|
||||
--enable-devel
|
||||
endif
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
define Package/icwmp-$(BUILD_VARIANT)/install
|
||||
$(INSTALL_DIR) $(1)/etc/icwmpd
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/icwmpd $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
|
||||
$(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/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmpd $(1)/usr/sbin/icwmpd
|
||||
$(INSTALL_DATA) ./files/etc/config/cwmp $(1)/etc/config/cwmp
|
||||
$(INSTALL_BIN) ./files/etc/firewall.cwmp $(1)/etc/firewall.cwmp
|
||||
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/90-icwmp $(1)/etc/hotplug.d/iface/90-icwmp
|
||||
$(INSTALL_BIN) ./files/etc/init.d/icwmpd $(1)/etc/init.d/icwmpd
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/85-cwmp-set-userid $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/90-cwmpfirewall $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/90-icwmp-set-dhcp-reqopts $(1)/etc/uci-defaults/
|
||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/icwmp $(1)/lib/upgrade/keep.d/icwmp
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init/icwmpd.init $(1)/etc/init.d/icwmpd
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uci-defaults/* $(1)/etc/uci-defaults/
|
||||
ifeq ($(CONFIG_CWMP_SCRIPTS_FULL),y)
|
||||
$(INSTALL_DIR) $(1)/usr/share/icwmp
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/defaults $(1)/usr/share/icwmp
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/functions $(1)/usr/share/icwmp
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/icwmp.sh $(1)/usr/sbin/icwmp
|
||||
endif
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
define Package/icwmp-tr098/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/icwmp_tr098d $(1)/usr/sbin
|
||||
endef
|
||||
|
||||
define Package/icwmp_stun/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmp_stund $(1)/usr/sbin/icwmp_stund
|
||||
$(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,47 +0,0 @@
|
||||
config acs 'acs'
|
||||
option url ''
|
||||
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 ParameterKey ''
|
||||
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 https_ssl_capath ''
|
||||
option ipv6_enable '0'
|
||||
option ip_version '4'
|
||||
|
||||
config cpe 'cpe'
|
||||
option interface 'eth0.1'
|
||||
option default_wan_interface 'wan'
|
||||
option log_to_console 'disable'
|
||||
option log_to_file 'enable'
|
||||
# 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,71 +0,0 @@
|
||||
#created by the icwmp package
|
||||
|
||||
if [ ! -f "/var/state/cwmp" ]; then
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
zone_name=$(uci -c /var/state -q get cwmp.acs.zonename)
|
||||
port=$(uci -c /var/state -q get cwmp.acs.port)
|
||||
ipaddr=$(uci -c /var/state -q get cwmp.acs.ip)
|
||||
ipv6enable=$(uci -c /var/state -q get cwmp.acs.ipv6_enable)
|
||||
incoming_rule=$(uci -q get cwmp.cpe.incoming_rule|tr [A-Z] [a-z])
|
||||
|
||||
if [ "$zone_name" = "" ]; then
|
||||
exit 0
|
||||
elif [ "$zone_name" = "icwmp" ]; then
|
||||
iptables -nL zone_icwmp_input 2> /dev/null
|
||||
if [ $? != 0 ]; then
|
||||
iptables -N zone_icwmp_input
|
||||
iptables -t filter -A INPUT -j zone_icwmp_input
|
||||
iptables -I zone_icwmp_input -p tcp --dport $port -j REJECT
|
||||
else
|
||||
iptables -F zone_icwmp_input
|
||||
iptables -I zone_icwmp_input -p tcp --dport $port -j REJECT
|
||||
fi
|
||||
else
|
||||
iptables -F zone_icwmp_input 2> /dev/null
|
||||
iptables -t filter -D INPUT -j zone_icwmp_input 2> /dev/null
|
||||
iptables -X zone_icwmp_input 2> /dev/null
|
||||
fi
|
||||
|
||||
cmd=""
|
||||
|
||||
if [ "${ipv6enable}" = "1" ]; then
|
||||
cmd="ip6tables"
|
||||
else
|
||||
cmd="iptables"
|
||||
fi
|
||||
|
||||
cmd="${cmd} -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}"
|
||||
fi
|
||||
elif [ "${incoming_rule}" = "port_only" ]; then
|
||||
if [ -n "${port}" ]; then
|
||||
cmd="${cmd} --dport ${port}"
|
||||
fi
|
||||
else
|
||||
if [ -n "${ipaddr}" ]; then
|
||||
cmd="${cmd} -s ${ipaddr}"
|
||||
fi
|
||||
|
||||
if [ -n "${port}" ]; then
|
||||
cmd="${cmd} --dport ${port}"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo ${cmd}|grep -q "\-\-dport \|\-s "
|
||||
if [ "$?" -ne 0 ]; then
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
cmd="${cmd} -j ACCEPT -m comment --comment=Open_ACS_port"
|
||||
|
||||
${cmd}
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
. /lib/functions/network.sh
|
||||
|
||||
|
||||
[ "$ACTION" == "ifup" ] || exit 0
|
||||
|
||||
[ -f /etc/config/cwmp ] || exit 0
|
||||
@@ -24,7 +23,7 @@ handle_icwmp_restart() {
|
||||
|
||||
local ifname="$(uci -q get network.$INTERFACE.ifname)"
|
||||
[ "${ifname:0:1}" == "@" ] && exit 0
|
||||
|
||||
|
||||
mkdir -p /tmp/ipv4
|
||||
|
||||
network_flush_cache
|
||||
@@ -64,41 +63,11 @@ handle_icwmp_restart() {
|
||||
network_get_device curdev $INTERFACE
|
||||
[ -n "$curdev" ] && echo $curdev > $devfile || rm -f $devfile
|
||||
|
||||
local wan_iface=`uci get cwmp.cpe.default_wan_interface`
|
||||
local vendorspecinf=`ubus call network.interface.wan status | jsonfilter -e "@.data.vendorspecinf"`
|
||||
[ -n "$vendorspecinf" ] && {
|
||||
local url=""
|
||||
case $vendorspecinf in
|
||||
http://*|https://*)
|
||||
url="$vendorspecinf"
|
||||
;;
|
||||
*)
|
||||
for optval in $vendorspecinf; do
|
||||
case $optval in
|
||||
1=*)
|
||||
url="$(echo $optval | cut -d"=" -f2-)"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
;;
|
||||
esac
|
||||
if [ ! -f /var/state/cwmp ]; then
|
||||
touch /var/state/cwmp
|
||||
fi
|
||||
uci -q -c /var/state/ get cwmp.acs
|
||||
if [ "$?" -ne 0 ]; then
|
||||
unnamed=`uci -q -c /var/state/ add cwmp acs`
|
||||
uci -c /var/state/ -q rename cwmp.$unnamed='acs'
|
||||
fi
|
||||
[ -n "$url" ] && uci -c /var/state -q set cwmp.acs.dhcp_url="$url"
|
||||
uci -c /var/state commit cwmp
|
||||
}
|
||||
|
||||
local prevopt43url=""
|
||||
local curopt43url=""
|
||||
local opt43urlfile=/tmp/ipv4/$INTERFACE-opt43url
|
||||
prevopt43url=$(cat $opt43urlfile 2>/dev/null)
|
||||
curopt43url="$(uci -c /var/state -q get cwmp.acs.dhcp_url)"
|
||||
curopt43url="$(uci -P /var/state -q get cwmp.acs.dhcp_url)"
|
||||
[ -n "$curopt43url" ] && echo $curopt43url > $opt43urlfile || rm -f $opt43urlfile
|
||||
|
||||
[ \
|
||||
@@ -112,8 +81,6 @@ handle_icwmp_restart() {
|
||||
[ -z "$prevopt43url" ] && exit 0
|
||||
}
|
||||
|
||||
echo "Restarting icwmp"|logger -t cwmp.hotplug -p info
|
||||
|
||||
/etc/init.d/icwmpd reload &
|
||||
}
|
||||
|
||||
|
||||
@@ -1,203 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2015-2019 iopsys Software Solutions AB
|
||||
|
||||
. /lib/functions.sh
|
||||
include /lib/network
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
START=99
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
PROG="/usr/sbin/icwmpd"
|
||||
|
||||
EXTRA_HELP=" start [GetRPCMethods] Start icwmpd service and send GetRPCMethods"
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t cwmp.init -p info
|
||||
}
|
||||
|
||||
validate_url() {
|
||||
# SCHEMA_LIST: contain list of possible schemas that could be present in the acs url
|
||||
# Example: SCHEMA_LIST="http https"
|
||||
SCHEMA_LIST="http"
|
||||
|
||||
for schema in $SCHEMA_LIST; do
|
||||
dest=`echo $1 | sed 's/$schema:\/\///g' | cut -f1 -d \/ | cut -f1 -d:`
|
||||
if [ "_$dest" != "_" ]; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
get_acs_url() {
|
||||
local default_acs="http://10.10.1.6:8000/openacs/acs"
|
||||
local acs_dhcp_discovery="$(uci -q get cwmp.acs.dhcp_discovery)"
|
||||
local url="$(uci -q get cwmp.acs.url)"
|
||||
local dhcp_url="$(uci -c /var/state -q get cwmp.acs.dhcp_url)"
|
||||
|
||||
if [ "$acs_dhcp_discovery" == "enable" -a -n "$dhcp_url" -o -z "$url" ]; then
|
||||
url="$dhcp_url"
|
||||
log "ACS URL from DHCP server: $url"
|
||||
[ -n "$url" ] && uci -c /var/state -q set cwmp.acs.url="$url" || url="$default_acs"
|
||||
elif [ -n "$url" ];then
|
||||
url="$(uci -q get cwmp.acs.url)"
|
||||
log "ACS URL from configuration: $url"
|
||||
else
|
||||
url="$default_acs"
|
||||
log "Using default ACS URL: $url"
|
||||
[ -n "$url" ] && uci -c /var/state -q set cwmp.acs.url="$url"
|
||||
fi
|
||||
|
||||
validate_url "$url"
|
||||
if [ "$?" != "0" ];then
|
||||
echo "Invalid ACS URL: $url"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
enable_dhcp_option43() {
|
||||
local wan=$1
|
||||
local discovery=0
|
||||
case $2 in
|
||||
enable|1) discovery=1 ;;
|
||||
esac
|
||||
|
||||
### Ask for DHCP Option 43 only if CWMP is enabled ###
|
||||
local enabled
|
||||
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
|
||||
ubus call network reload
|
||||
fi
|
||||
########################################################
|
||||
}
|
||||
|
||||
wait_for_option43() {
|
||||
local time=$1
|
||||
local default_wan_interface dhcp_discovery url
|
||||
|
||||
config_get default_wan_interface cpe default_wan_interface "wan"
|
||||
config_get dhcp_discovery acs dhcp_discovery "0"
|
||||
config_get url acs url
|
||||
|
||||
enable_dhcp_option43 $default_wan_interface $dhcp_discovery
|
||||
|
||||
local tm=0
|
||||
|
||||
if [ "$dhcp_discovery" == "enable" -o "$dhcp_discovery" == "1" ]
|
||||
then
|
||||
log "Waiting for discovery of ACS URL from dhcp server ..."
|
||||
while [ $tm -le $time ]
|
||||
do
|
||||
acs_url=`uci -c /var/state -q get cwmp.acs.dhcp_url`
|
||||
if [ "$acs_url" != "" ]
|
||||
then
|
||||
break
|
||||
else
|
||||
sleep 1
|
||||
fi
|
||||
tm=$((tm+1))
|
||||
done
|
||||
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
|
||||
}
|
||||
|
||||
set_wan_interface() {
|
||||
local l3_device=""
|
||||
local default_wan_interface=""
|
||||
|
||||
config_get default_wan_interface cpe default_wan_interface "wan"
|
||||
json_load "$(ifstatus $default_wan_interface)"
|
||||
json_get_var l3_device l3_device
|
||||
if [ "$l3_device" != "" ];then
|
||||
uci -q set cwmp.cpe.interface="$l3_device"
|
||||
uci -q commit cwmp
|
||||
fi
|
||||
}
|
||||
|
||||
service_running() {
|
||||
ubus wait_for usp.raw
|
||||
}
|
||||
|
||||
start_service() {
|
||||
if [ ! -f /tmp/.icwmpd_boot ]; then
|
||||
touch /etc/icwmpd/.icwmpd_boot
|
||||
touch /tmp/.icwmpd_boot
|
||||
else
|
||||
[ -f /sbin/netifd ] && log "Waiting for Network to be started ..." && ubus -t 5 wait_for network.interface
|
||||
[ -f /etc/config/wireless ] && log "Waiting for WiFi to be started ..." && ubus -t 5 wait_for network.wireless
|
||||
[ -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
|
||||
[ -f /usr/sbin/asterisk ] && log "Waiting for Voice to be started ..." && ubus -t 5 wait_for asterisk
|
||||
|
||||
log "Waiting for usp.raw to be started"
|
||||
ubus wait_for usp.raw
|
||||
|
||||
config_load cwmp
|
||||
set_wan_interface
|
||||
wait_for_option43 20
|
||||
get_acs_url
|
||||
|
||||
procd_open_instance icwmp
|
||||
procd_set_param command "$PROG"
|
||||
if [ "$1" = "GetRPCMethods" ];then
|
||||
procd_append_param command -g
|
||||
elif [ -f /etc/icwmpd/.icwmpd_boot ]; then
|
||||
procd_append_param command -b
|
||||
fi
|
||||
procd_set_param respawn \
|
||||
${respawn_threshold:-5} \
|
||||
${respawn_timeout:-10} ${respawn_retry:-3}
|
||||
|
||||
procd_close_instance
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_config_trigger "config.change" "cwmp" /etc/init.d/icwmpd reload
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
# Copy defaults by the factory to the cwmp UCI user section.
|
||||
|
||||
|
||||
@@ -14,19 +15,10 @@ mac=$(printf "%12.12X" $((0x$baseMac)))
|
||||
# Get system serial number.
|
||||
serial=$(db -q get hw.board.serial_number)
|
||||
|
||||
# Get userid values
|
||||
acs_userid=$(uci -q get cwmp.acs.userid)
|
||||
cpe_userid=$(uci -q get cwmp.cpe.userid)
|
||||
uci -q batch <<-EOF
|
||||
set cwmp.acs.userid="${mac:0:6}-${serial}"
|
||||
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="${mac:0:6}-${serial}"
|
||||
fi
|
||||
|
||||
if [ -z "$cpe_userid" ]
|
||||
then
|
||||
uci -q set cwmp.cpe.userid="${mac:0:6}-${serial}"
|
||||
fi
|
||||
|
||||
# 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
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
/etc/icwmpd/.icwmpd_backup_session.xml
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -f /etc/config/xmpp ] || exit 0
|
||||
[ -f /etc/config/cwmp_xmpp ] || exit 0
|
||||
|
||||
[ "$ACTION" == "ifup" ] || 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)"
|
||||
[ "${ifname:0:1}" == "@" ] && exit 0
|
||||
|
||||
/etc/init.d/xmppc reload &
|
||||
/etc/init.d/icwmp_xmppd reload &
|
||||
|
||||
@@ -1,10 +1,38 @@
|
||||
if (PACKAGE_ieee1905)
|
||||
if PACKAGE_ieee1905 || PACKAGE_lib1905al
|
||||
|
||||
menu "Configurations"
|
||||
menu "developer/debug options"
|
||||
|
||||
config IEEE1905_EXTENSION_ALLOWED
|
||||
bool "Allow plugins to extend 1905 CMDUs and/or TLVs"
|
||||
default y
|
||||
config IEEE1905_SEND_EMPTY_TLVS
|
||||
bool "Allow sending of empty TLVs"
|
||||
default y
|
||||
|
||||
config IEEE1905_FIX_BROKEN_TLVS
|
||||
bool "Allow reception of missing TLVs"
|
||||
default y
|
||||
|
||||
config IEEE1905_SPEED_UP_DISCOVERY
|
||||
bool "Speed up discovery of an AL in network"
|
||||
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
|
||||
|
||||
config IEEE1905_REGISTER_EXTENSION_BBF
|
||||
bool "Enable BBF extensions"
|
||||
default n
|
||||
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -1,129 +1,135 @@
|
||||
#
|
||||
# Copyright (C) 2021 IOPSYS
|
||||
# Copyright (C) 2019 Iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=4.0.1
|
||||
PKG_VERSION:=2.0.15
|
||||
|
||||
LOCAL_DEV=0
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=c4e6275434c65d64a90edbefa225f582f2ce356e
|
||||
PKG_SOURCE_VERSION:=223e41d6d21ba519b8c14c9f6a4e65c57dc5cda2
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ieee1905.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
endif
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
||||
define Package/ieee1905/Default
|
||||
define Package/ieee1905
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=IEEE-1905.1 stack
|
||||
TITLE:=IEEE1905 daemon
|
||||
DEPENDS:= +libuci +libjson-c +lib1905al +lib1905ubus
|
||||
endef
|
||||
|
||||
define Package/ieee1905/config
|
||||
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 +libwifi \
|
||||
+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 +libwifi \
|
||||
+libjson-c +libblobmsg-json +libwifi +ubus +libpthread \
|
||||
+libnl-genl +libieee1905
|
||||
endef
|
||||
|
||||
|
||||
define Package/map-plugin
|
||||
$(call Package/ieee1905/Default,$(1))
|
||||
TITLE:=Multi-AP (Easymesh) plugin
|
||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl +libwifi \
|
||||
+libjson-c +libblobmsg-json +ieee1905 +libieee1905
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Package/ieee1905/description
|
||||
This package provides IEEE Std 1905.1 stack.
|
||||
IEEE1905 stack with extended functionalities.
|
||||
endef
|
||||
|
||||
define Package/libieee1905/description
|
||||
This package provides library functions for IEEE Std 1905.1 stack.
|
||||
define Package/lib1905al
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=IEEE1905 stack library
|
||||
DEPENDS:= +libpcap +libopenssl +libwifi +libeasy +libuci
|
||||
endef
|
||||
|
||||
define Package/lib1905ubus
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=IEEE1905 ubus library
|
||||
DEPENDS:= +ubox +libjson-c
|
||||
endef
|
||||
|
||||
define Package/lib1905hle
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=IEEE1905 hle stack library
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-D_GNU_SOURCE
|
||||
-D_GNU_SOURCE \
|
||||
-fstrict-aliasing \
|
||||
-Wall \
|
||||
-Wextra
|
||||
|
||||
MAKE_PATH:=src
|
||||
ifeq ($(CONFIG_IEEE1905_SEND_EMPTY_TLVS),y)
|
||||
TARGET_CFLAGS += -DSEND_EMPTY_TLVS
|
||||
endif
|
||||
ifeq ($(CONFIG_IEEE1905_FIX_BROKEN_TLVS),y)
|
||||
TARGET_CFLAGS += -DFIX_BROKEN_TLVS
|
||||
endif
|
||||
ifeq ($(CONFIG_IEEE1905_SPEED_UP_DISCOVERY),y)
|
||||
TARGET_CFLAGS += -DSPEED_UP_DISCOVERY
|
||||
endif
|
||||
ifeq ($(CONFIG_IEEE1905_DO_NOT_ACCEPT_UNAUTHENTICATED_COMMANDS),y)
|
||||
TARGET_CFLAGS += -DDO_NOT_ACCEPT_UNAUTHENTICATED_COMMANDS
|
||||
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_REGISTER_EXTENSION_BBF),y)
|
||||
TARGET_CFLAGS += -DREGISTER_EXTENSION_BBF
|
||||
endif
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/ieee1905/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/ieee1905/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
||||
$(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) $(PKG_BUILD_DIR)/src/ieee1905d $(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/libieee1905/install
|
||||
define Package/lib1905hle/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/
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/lib1905hle.so $(1)/usr/lib/lib1905hle.so
|
||||
endef
|
||||
|
||||
define Package/map-plugin/install
|
||||
define Package/lib1905al/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
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/lib1905al.so $(1)/usr/lib/lib1905al.so
|
||||
endef
|
||||
|
||||
define Build/InstallDev/map-plugin
|
||||
define Package/lib1905ubus/install
|
||||
$(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/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/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/libmidgen.so $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/libieee1905.so $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/lib1905ubus.so $(1)/usr/lib/lib1905ubus.so
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(call Build/InstallDev/libieee1905,$(1),$(2))
|
||||
$(call Build/InstallDev/map-plugin,$(1),$(2))
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/include/lib1905al
|
||||
$(INSTALL_DIR) $(1)/usr/include/lib1905hle
|
||||
$(INSTALL_DIR) $(1)/usr/include/lib1905ubus
|
||||
$(CP) $(PKG_BUILD_DIR)/lib1905al/include/*.h $(1)/usr/include/lib1905al/
|
||||
$(CP) $(PKG_BUILD_DIR)/lib1905ubus/include/*.h $(1)/usr/include/lib1905ubus/
|
||||
$(CP) $(PKG_BUILD_DIR)/lib1905hle/include/*.h $(1)/usr/include/lib1905hle/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/lib1905al.so $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/lib1905ubus.so $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/lib1905hle.so $(1)/usr/lib
|
||||
endef
|
||||
|
||||
|
||||
$(eval $(call BuildPackage,lib1905al))
|
||||
$(eval $(call BuildPackage,lib1905ubus))
|
||||
$(eval $(call BuildPackage,lib1905hle))
|
||||
$(eval $(call BuildPackage,ieee1905))
|
||||
$(eval $(call BuildPackage,libieee1905))
|
||||
$(eval $(call BuildPackage,map-plugin))
|
||||
|
||||
36
ieee1905/files/etc/config/ieee1905
Executable file → Normal file
36
ieee1905/files/etc/config/ieee1905
Executable file → Normal file
@@ -1,22 +1,20 @@
|
||||
config ieee1905 'ieee1905'
|
||||
option enabled '1'
|
||||
option extension '1'
|
||||
list extmodule 'map'
|
||||
option registrar '2 5'
|
||||
config ieee1905
|
||||
option enabled '1'
|
||||
option debug true
|
||||
|
||||
config ap
|
||||
option band '2'
|
||||
option ssid 'TestSSID.2'
|
||||
option encryption 'psk2'
|
||||
option key '5555500000'
|
||||
|
||||
config ap
|
||||
option band '5'
|
||||
option ssid 'TestSSID.5'
|
||||
option encryption 'psk2'
|
||||
option key '2222200000'
|
||||
config al
|
||||
option enabled '1'
|
||||
option basemacint 'wan'
|
||||
# option almac ''
|
||||
option mapall true
|
||||
# option registrar true
|
||||
option debug_level 2
|
||||
# option alme_port 8888
|
||||
option cmdu_event true
|
||||
option discovery_timer 60
|
||||
option map_plugin false
|
||||
|
||||
config al-iface
|
||||
option enabled 1
|
||||
option ifname 'br-lan'
|
||||
option type 'bridge'
|
||||
option enabled '0'
|
||||
option ifname 'br-lan'
|
||||
option media 'bridge'
|
||||
|
||||
308
ieee1905/files/etc/init.d/ieee1905
Executable file → Normal file
308
ieee1905/files/etc/init.d/ieee1905
Executable file → Normal file
@@ -1,25 +1,311 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=96
|
||||
STOP=21
|
||||
START=99
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/ieee1905d
|
||||
AL_CONF=/tmp/ieee1905.config
|
||||
INTERFACE=""
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/ieee1905d"
|
||||
procd_set_param respawn
|
||||
# procd_set_param stdout 1
|
||||
# procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
validate_ieee1905_section()
|
||||
{
|
||||
uci_validate_section ieee1905 ieee1905 "${1}" \
|
||||
'debug:bool:false' \
|
||||
'enabled:bool:false'
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
get_device_name() {
|
||||
local device
|
||||
# Get wan L3 interface
|
||||
ubus list |grep -iq network.interface.${1}
|
||||
if [ "$?" -eq 0 ]; then
|
||||
json_load "$(ubus -t 2 call network.interface.${1} status)"
|
||||
json_get_var device device
|
||||
echo ${device}
|
||||
fi
|
||||
}
|
||||
|
||||
get_interface_mac() {
|
||||
local l3 basemac
|
||||
l3=$(get_device_name ${1})
|
||||
if [ -n ${l3} ]; then
|
||||
json_load "$(ubus -t 2 call network.device status "{\"name\":\"${l3}\"}")"
|
||||
json_get_var basemac macaddr
|
||||
fi
|
||||
local first=0x$(echo $basemac |cut -d : -f 1)
|
||||
local rest=$(echo $basemac |cut -d : -f 2-)
|
||||
# Set local bit
|
||||
first=$((first|2))
|
||||
first=$(printf "%02x" $first)
|
||||
basemac="${first}:${rest}"
|
||||
echo ${basemac}
|
||||
}
|
||||
|
||||
validate_al_iface_section()
|
||||
{
|
||||
procd_add_reload_trigger "ieee1905"
|
||||
uci_validate_section ieee1905 al-iface "${1}" \
|
||||
'enabled:bool:false' \
|
||||
'ifname:string:br-lan' \
|
||||
'media:string:bridge' \
|
||||
'manufacturer_name:string' \
|
||||
'model_name:string' \
|
||||
'model_number:string:000000' \
|
||||
'device_name:string' \
|
||||
'serial_number:string'
|
||||
}
|
||||
|
||||
get_ifindex()
|
||||
{
|
||||
local ifname=${1}
|
||||
local ifindex=$(cat /sys/class/net/${ifname}/upper_*/ifindex 2>/dev/null)
|
||||
if [ -z ${ifindex} ]; then
|
||||
ifindex=$(cat /sys/class/net/${ifname}/ifindex)
|
||||
fi
|
||||
echo ${ifindex}
|
||||
}
|
||||
|
||||
get_wlan_passkey()
|
||||
{
|
||||
local ifname=${1}
|
||||
local pass=""
|
||||
local count=0
|
||||
|
||||
while true
|
||||
do
|
||||
local devname=$(uci get wireless.@wifi-iface[${count}].ifname 2>/dev/null)
|
||||
if [ $? -ne 0 ]; then
|
||||
break;
|
||||
fi
|
||||
if [ "${devname}"=="${ifname}" ]; then
|
||||
pass=$(uci get wireless.@wifi-iface[${count}].key 2>/dev/null)
|
||||
break;
|
||||
fi
|
||||
count=$((count+1))
|
||||
done
|
||||
echo ${pass}
|
||||
}
|
||||
|
||||
configure_interface()
|
||||
{
|
||||
local ifname media enabled manufacturer_name model_name model_number device_name serial_number
|
||||
local uuid ifindex
|
||||
|
||||
validate_al_iface_section ${1} || {
|
||||
echo "Validation of al-iface sec failed"
|
||||
exit 1;
|
||||
}
|
||||
|
||||
if [ ${enabled} -eq 0 ]; then
|
||||
return;
|
||||
fi
|
||||
|
||||
# Only continue if interface exists
|
||||
ifconfig ${ifname} 2>/dev/null 1>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
return;
|
||||
fi
|
||||
|
||||
if [ -z ${INTERFACE} ]; then
|
||||
INTERFACE=${ifname}
|
||||
else
|
||||
INTERFACE="${INTERFACE},${ifname}"
|
||||
fi
|
||||
|
||||
if [ -z ${manufacturer_name} ]; then
|
||||
manufacturer_name=$(db get hw.board.iopVerCustomer)
|
||||
fi
|
||||
|
||||
if [ -z ${model_name} ]; then
|
||||
model_name=$(db get hw.board.model_name)
|
||||
fi
|
||||
|
||||
if [ -z ${device_name} ]; then
|
||||
device_name=$(db get hw.board.model_name)
|
||||
fi
|
||||
|
||||
if [ -z ${serial_number} ]; then
|
||||
serial_number=$(db get hw.board.serial_number)
|
||||
fi
|
||||
|
||||
if [ "${media}"=="bridge" ]; then
|
||||
echo "Get interfaces from bridge"
|
||||
local lower=$(ls -1 /sys/class/net/${ifname}/|grep lower_|tr '_' ' '|awk '{printf $2" "}')
|
||||
for intf in ${lower}
|
||||
do
|
||||
ubus list wifi.ap.${intf} 2>/dev/null 1>/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
INTERFACE="${INTERFACE},${intf}"
|
||||
uuid=$(cat /proc/sys/kernel/random/uuid)
|
||||
ifindex=$(get_ifindex ${intf})
|
||||
local key=$(get_wlan_passkey ${ifname})
|
||||
json_add_object
|
||||
json_add_string ifname ${intf}
|
||||
json_add_string media "wifi"
|
||||
json_add_string network_key ${key}
|
||||
json_add_string manufacturer_name ${manufacturer_name}
|
||||
json_add_string model_name ${model_name}
|
||||
json_add_string model_number ${model_number}
|
||||
json_add_string device_name ${device_name}
|
||||
json_add_string serial_number ${serial_number}
|
||||
json_add_string uuid ${uuid}
|
||||
json_add_int ifindex ${ifindex}
|
||||
json_close_object
|
||||
fi
|
||||
done
|
||||
fi
|
||||
uuid=$(cat /proc/sys/kernel/random/uuid)
|
||||
ifindex=$(get_ifindex ${ifname})
|
||||
|
||||
json_add_object
|
||||
json_add_string ifname ${ifname}
|
||||
|
||||
if [ "${media}"=="bridge" ]; then
|
||||
json_add_string media "eth"
|
||||
elif [ "${media}"=="wifi" ]; then
|
||||
local key=$(get_wlan_passkey ${ifname})
|
||||
json_add_string media "wifi"
|
||||
json_add_string network_key ${key}
|
||||
else
|
||||
json_add_string media ${media}
|
||||
fi
|
||||
|
||||
json_add_string manufacturer_name ${manufacturer_name}
|
||||
json_add_string model_name ${model_name}
|
||||
json_add_string model_number ${model_number}
|
||||
json_add_string device_name ${device_name}
|
||||
json_add_string serial_number ${serial_number}
|
||||
json_add_string uuid ${uuid}
|
||||
json_add_int ifindex ${ifindex}
|
||||
json_close_object
|
||||
}
|
||||
|
||||
validate_al_section()
|
||||
{
|
||||
uci_validate_section ieee1905 meshcomms "${1}" \
|
||||
'enabled:bool:false' \
|
||||
'basemacint:string:wan' \
|
||||
'almac:string' \
|
||||
'registrar:bool:false' \
|
||||
'mapall:bool:true' \
|
||||
'debug_level:uinteger:1' \
|
||||
'alme_port:port:8888' \
|
||||
'cmdu_event:bool:true' \
|
||||
'discovery_timer:uinteger:60' \
|
||||
'map_plugin:bool:false'
|
||||
}
|
||||
|
||||
|
||||
configure_al_entity()
|
||||
{
|
||||
local enabled almac basemacint mapall debug_level alme_port l3device basemac intf
|
||||
local registrar cmdu_event discovery_timer map_plugin
|
||||
|
||||
validate_al_section ${1} || {
|
||||
echo "Validation of al section failed"
|
||||
exit 1;
|
||||
}
|
||||
|
||||
if [ -z ${almac} ]; then
|
||||
basemac=$(get_interface_mac ${basemacint})
|
||||
else
|
||||
basemac=${almac}
|
||||
fi
|
||||
|
||||
|
||||
local fname cname model cUrl
|
||||
fname=$(db get hw.board.boardId)
|
||||
cname=$(db get hw.board.iopVerCustomer)
|
||||
model=$(db get hw.board.routerModel)
|
||||
# get ip from lan bridge first
|
||||
cUrl=$(ifconfig br-lan 2>/dev/null|grep "inet addr:"|tr ':' ' '|awk '{printf $3}')
|
||||
if [ -z ${cUrl} ]; then
|
||||
cUrl=$(ifconfig br-wan 2>/dev/null|grep "inet addr:"|tr ':' ' '|awk '{printf $3}')
|
||||
fi
|
||||
if [ -z ${cUrl} ]; then
|
||||
cUrl="http://192.168.1.1"
|
||||
fi
|
||||
|
||||
json_init
|
||||
# fill the al-iface info
|
||||
json_add_array al-iface
|
||||
config_foreach configure_interface al-iface
|
||||
json_close_array
|
||||
|
||||
json_add_object deviceInfo
|
||||
json_add_string friendly_name ${fname}
|
||||
json_add_string manufacturer_name ${cname}
|
||||
json_add_string model ${model}
|
||||
json_add_string control_url ${cUrl}
|
||||
json_close_object
|
||||
|
||||
json_add_object al
|
||||
json_add_int enabled ${enabled}
|
||||
json_add_string mac ${basemac}
|
||||
json_add_string interfaces ${INTERFACE}
|
||||
json_add_int map ${mapall}
|
||||
json_add_int registrar ${registrar}
|
||||
json_add_int debug_level ${debug_level}
|
||||
json_add_int alme_port ${alme_port}
|
||||
json_add_int cmdu_event ${cmdu_event}
|
||||
json_add_int discovery_timer ${discovery_timer}
|
||||
json_add_int map_plugin ${map_plugin}
|
||||
json_close_object
|
||||
|
||||
json_dump >${AL_CONF}
|
||||
sync
|
||||
}
|
||||
|
||||
configure_ieee1905()
|
||||
{
|
||||
local enabled debug
|
||||
|
||||
validate_ieee1905_section ${1} || {
|
||||
echo "Validation of ieee1905 section failed"
|
||||
exit 1;
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
configure_network() {
|
||||
[ -f ${AL_CONF} ] && rm ${AL_CONF}
|
||||
|
||||
ebtables -L FORWARD|grep -iqE "1:80:C2:(0)+:(0)+:13.*-j.*DROP"
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "Applying drop rule to drop pkts forwared by kernel to 1905.1 multicast mac"
|
||||
ebtables -A FORWARD -d 01:80:c2:00:00:13 -j DROP
|
||||
fi
|
||||
|
||||
config_load ieee1905
|
||||
config_foreach configure_ieee1905 ieee1905
|
||||
config_foreach configure_al_entity al
|
||||
}
|
||||
|
||||
start_service() {
|
||||
procd_open_instance ieee1905
|
||||
procd_set_param command ${PROG}
|
||||
configure_network
|
||||
# procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "network"
|
||||
procd_add_reload_trigger "wireless"
|
||||
procd_add_reload_trigger "netmode"
|
||||
}
|
||||
|
||||
55
ifbt/Makefile
Normal file
55
ifbt/Makefile
Normal file
@@ -0,0 +1,55 @@
|
||||
#
|
||||
# Copyright (C) 2018 iopsys Software Solutions AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=ifbt
|
||||
PKG_VERSION:=0.3
|
||||
|
||||
PKG_SOURCE_VERSION:=c9a7db18b15a59b03b756d00a0a630e98d9541c5
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ifbt.git
|
||||
|
||||
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:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=README
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_mips),y)
|
||||
TARGET_PLATFORM:=-DIOPSYS_BROADCOM
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
||||
TARGET_PLATFORM:=-DIOPSYS_BROADCOM
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_linksys),y)
|
||||
TARGET_PLATFORM:=-DIOPSYS_MARVELL
|
||||
else ifeq ($(CONFIG_TARGET_intel_mips),y)
|
||||
TARGET_PLATFORM:=-DIOPSYS_INTEL
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
|
||||
TARGET_PLATFORM:=-DIOPSYS_MEDIATEK
|
||||
else
|
||||
$(info (UNEXPECTED CONFIG TARGET))
|
||||
endif
|
||||
|
||||
export TARGET_PLATFORM
|
||||
|
||||
define Package/ifbt
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libwifi +libjson-c
|
||||
TITLE:=Fast BSS Transition
|
||||
endef
|
||||
|
||||
define Package/ifbt/description
|
||||
ifbt is Iopsys application for fast BSS transition
|
||||
endef
|
||||
|
||||
define Package/ifbt/install
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ifbt $(1)/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ifbt))
|
||||
@@ -5,16 +5,15 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=imonitor
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
PKG_SOURCE_PROTO=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_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION}
|
||||
PKG_INSTALL:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
@@ -9,14 +9,14 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=inbd
|
||||
PKG_VERSION:=1.2.2
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=10f765f3d0fcc226b6ecf0c481598c9e7f76315e
|
||||
PKG_SOURCE_VERSION:=53ca7f58edb87976b5897ccaf487bb0cbbf39d07
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/inbd
|
||||
|
||||
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_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
|
||||
88
iop/config
88
iop/config
@@ -6,28 +6,23 @@ CONFIG_DEVEL=y
|
||||
CONFIG_PACKAGE_6in4=y
|
||||
CONFIG_PACKAGE_6rd=y
|
||||
CONFIG_PACKAGE_6to4=y
|
||||
CONFIG_PACKAGE_at=y
|
||||
CONFIG_PACKAGE_atftp=m
|
||||
CONFIG_PACKAGE_atftpd=m
|
||||
CONFIG_PACKAGE_bulkdata=y
|
||||
CONFIG_PACKAGE_alsa-lib=y
|
||||
CONFIG_PACKAGE_chat=y
|
||||
CONFIG_PACKAGE_comgt=y
|
||||
CONFIG_PACKAGE_comgt-directip=y
|
||||
CONFIG_PACKAGE_comgt-ncm=y
|
||||
CONFIG_PACKAGE_crashlog=y
|
||||
CONFIG_PACKAGE_ddns-scripts=y
|
||||
CONFIG_PACKAGE_ds-lite=y
|
||||
CONFIG_PACKAGE_ethtool=y
|
||||
CONFIG_PACKAGE_gdb=m
|
||||
CONFIG_PACKAGE_getopt=y
|
||||
CONFIG_PACKAGE_glib2=y
|
||||
CONFIG_PACKAGE_gre=y
|
||||
CONFIG_PACKAGE_icwmp=y
|
||||
CONFIG_PACKAGE_ieee1905=y
|
||||
CONFIG_PACKAGE_map-topology=y
|
||||
CONFIG_PACKAGE_mosquitto-client-ssl=y
|
||||
CONFIG_PACKAGE_mosquitto-ssl=y
|
||||
CONFIG_PACKAGE_wfadatad=y
|
||||
CONFIG_PACKAGE_icwmp-curl=y
|
||||
CONFIG_PACKAGE_ifbt=m
|
||||
CONFIG_PACKAGE_imonitor=m
|
||||
CONFIG_PACKAGE_inbd=y
|
||||
CONFIG_PACKAGE_iopupgrade=y
|
||||
CONFIG_PACKAGE_ip-full=y
|
||||
CONFIG_PACKAGE_iperf3=y
|
||||
CONFIG_PACKAGE_ipset=y
|
||||
@@ -36,16 +31,21 @@ CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
|
||||
CONFIG_PACKAGE_iptables-mod-filter=y
|
||||
CONFIG_PACKAGE_iptables-mod-ipopt=y
|
||||
# CONFIG_PACKAGE_iwatchdog is not set
|
||||
CONFIG_PACKAGE_jq=y
|
||||
CONFIG_PACKAGE_libreswan=m
|
||||
CONFIG_PACKAGE_libwifi=y
|
||||
CONFIG_PACKAGE_lscpu=y
|
||||
CONFIG_PACKAGE_luci-nginx=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_map=y
|
||||
CONFIG_PACKAGE_juci=y
|
||||
CONFIG_PACKAGE_juci-dnsmasq-dhcp=y
|
||||
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-netifd=y
|
||||
CONFIG_PACKAGE_juci-wireless=y
|
||||
CONFIG_PACKAGE_juci-theme-iopsys=y
|
||||
CONFIG_PACKAGE_libdaemon=y
|
||||
CONFIG_PACKAGE_libffmpeg-mini=m
|
||||
CONFIG_PACKAGE_libgmp=y
|
||||
CONFIG_PACKAGE_libreadline=y
|
||||
CONFIG_PACKAGE_loop-detector=m
|
||||
CONFIG_PACKAGE_minidlna=m
|
||||
CONFIG_PACKAGE_miniupnpd=y
|
||||
CONFIG_PACKAGE_mwan3=y
|
||||
CONFIG_PACKAGE_nand-utils=y
|
||||
@@ -60,8 +60,6 @@ CONFIG_PACKAGE_openssl-util=y
|
||||
CONFIG_OPENSSL_WITH_COMPRESSION=y
|
||||
CONFIG_PACKAGE_openvpn-easy-rsa=y
|
||||
CONFIG_PACKAGE_openvpn-openssl=y
|
||||
CONFIG_PACKAGE_owsd=y
|
||||
CONFIG_PACKAGE_periodicstats=y
|
||||
CONFIG_PACKAGE_peripheral_manager=y
|
||||
CONFIG_PACKAGE_port-management=y
|
||||
CONFIG_PACKAGE_ppp-mod-pppoa=y
|
||||
@@ -77,24 +75,25 @@ CONFIG_PACKAGE_rdnssd=y
|
||||
CONFIG_PACKAGE_relayd=y
|
||||
CONFIG_PACKAGE_resolveip=y
|
||||
CONFIG_PACKAGE_rpcd=y
|
||||
CONFIG_PACKAGE_rpcd-mod-rpcsys=y
|
||||
CONFIG_PACKAGE_rsync=y
|
||||
CONFIG_PACKAGE_rulengd=y
|
||||
CONFIG_PACKAGE_samba3=m
|
||||
CONFIG_PACKAGE_samba3-nmbd=m
|
||||
CONFIG_PACKAGE_strace=y
|
||||
CONFIG_PACKAGE_sulu=y
|
||||
CONFIG_PACKAGE_swmodd=m
|
||||
CONFIG_PACKAGE_tc=y
|
||||
CONFIG_PACKAGE_tcpdump=y
|
||||
CONFIG_PACKAGE_terminfo=y
|
||||
CONFIG_PACKAGE_traceroute6=y
|
||||
CONFIG_PACKAGE_uledd=y
|
||||
CONFIG_PACKAGE_umbim=y
|
||||
CONFIG_PACKAGE_uqmi=y
|
||||
CONFIG_PACKAGE_urlfilter=y
|
||||
CONFIG_PACKAGE_usb-modeswitch=y
|
||||
CONFIG_PACKAGE_usbreset=y
|
||||
CONFIG_PACKAGE_uspd=y
|
||||
CONFIG_PACKAGE_vsftpd-tls=m
|
||||
CONFIG_PACKAGE_wget=y
|
||||
CONFIG_PACKAGE_wwan=y
|
||||
CONFIG_PACKAGE_libwifi=y
|
||||
CONFIG_PACKAGE_wifilife=y
|
||||
CONFIG_PACKAGE_wifimngr=y
|
||||
CONFIG_PACKAGE_uuidgen=y
|
||||
CONFIG_PACKAGE_xl2tpd=y
|
||||
CONFIG_PACKAGE_zoneinfo-core=y
|
||||
CONFIG_PACKAGE_zoneinfo-europe=y
|
||||
@@ -104,14 +103,13 @@ CONFIG_USE_STRIP=y
|
||||
CONFIG_BUILD_LOG=y
|
||||
CONFIG_BUSYBOX_CONFIG_ADDUSER=y
|
||||
CONFIG_BUSYBOX_CONFIG_ARPING=y
|
||||
CONFIG_BUSYBOX_CONFIG_ASH_IDLE_TIMEOUT=y
|
||||
CONFIG_BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT=y
|
||||
CONFIG_BUSYBOX_CONFIG_CTTYHACK=y
|
||||
CONFIG_BUSYBOX_CONFIG_DELUSER=y
|
||||
# CONFIG_BUSYBOX_CONFIG_DEVMEM is not set
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_UDHCP_8021Q=y
|
||||
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_MODINFO is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_MODPROBE is not set
|
||||
@@ -167,32 +165,16 @@ CONFIG_BUSYBOX_CONFIG_FLOAT_DURATION=y
|
||||
CONFIG_BUSYBOX_CONFIG_USLEEP=y
|
||||
CONFIG_BUSYBOX_CONFIG_REALPATH=y
|
||||
CONFIG_BUSYBOX_CONFIG_TTY=y
|
||||
CONFIG_BUSYBOX_CONFIG_BLOCKDEV=y
|
||||
CONFIG_BUSYBOX_CONFIG_PARTPROBE=y
|
||||
CONFIG_BUSYBOX_CONFIG_LFS=y
|
||||
CONFIG_BUSYBOX_CONFIG_FDISK=y
|
||||
CONFIG_BUSYBOX_CONFIG_FDISK_SUPPORT_LARGE_DISKS=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_GPT_LABEL=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_FDISK_ADVANCED=y
|
||||
CONFIG_BUSYBOX_CONFIG_IONICE=y
|
||||
CONFIG_BUSYBOX_CONFIG_RENICE=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_VOLUMEID_BTRFS=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_VOLUMEID_F2FS=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_VOLUMEID_LINUXSWAP=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_VOLUMEID_SQUASHFS=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_VOLUMEID_UBIFS=y
|
||||
CONFIG_BUSYBOX_CONFIG_TIMEOUT=y
|
||||
CONFIG_BUSYBOX_CONFIG_NOHUP=y
|
||||
CONFIG_LIBCURL_CRYPTO_AUTH=y
|
||||
# CONFIG_LIBCURL_MBEDTLS is not set
|
||||
CONFIG_LIBCURL_OPENSSL=y
|
||||
CONFIG_OPENVPN_openssl_ENABLE_IPROUTE2=y
|
||||
# CONFIG_SAMBA3_CONFIG_NO_PRINTING is not set
|
||||
# CONFIG_SIGNED_PACKAGES is not set
|
||||
CONFIG_KERNEL_DEVTMPFS=y
|
||||
CONFIG_KERNEL_DEVTMPFS_MOUNT=y
|
||||
# CONFIG_BUSYBOX_CONFIG_IP is not set
|
||||
CONFIG_LOCALMIRROR="https://download.iopsys.eu/iopsys/mirror/"
|
||||
CONFIG_LOCALMIRROR="http://download.iopsys.eu/iopsys/mirror/"
|
||||
|
||||
# Generation of /etc/banner.
|
||||
CONFIG_IMAGEOPT=y
|
||||
@@ -212,14 +194,8 @@ CONFIG_TARGET_PREINIT_IP=""
|
||||
CONFIG_TARGET_PREINIT_NETMASK=""
|
||||
CONFIG_TARGET_PREINIT_BROADCAST=""
|
||||
|
||||
# Generate rootfs tar file
|
||||
CONFIG_TARGET_ROOTFS_TARGZ=y
|
||||
|
||||
# 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
|
||||
|
||||
# We use OpenSSL, no need to ship multiple TLS libraries
|
||||
CONFIG_PACKAGE_libustream-openssl=y
|
||||
# CONFIG_PACKAGE_libustream-wolfssl is not set
|
||||
|
||||
@@ -35,7 +35,7 @@ _iop()
|
||||
iopcmds="bootstrap cfe_upgrade cfe_upgrade_latest extract_core \
|
||||
feeds_update genconfig generate_tarballs install_key \
|
||||
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
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ function feeds_update {
|
||||
done
|
||||
|
||||
|
||||
git remote -v | grep -qE '(git@|ssh://)' && developer=1
|
||||
git remote -v | grep -q http || developer=1
|
||||
|
||||
cp .config .genconfig_config_bak
|
||||
|
||||
@@ -32,7 +32,7 @@ function feeds_update {
|
||||
fi
|
||||
|
||||
# targets need to be installed explicitly
|
||||
targets="iopsys-brcm63xx-arm iopsys-ramips intel_mips iopsys-x86 iopsys-armvirt iopsys-bcm27xx iopsys-mediatek iopsys-econet"
|
||||
targets="iopsys-brcm63xx-mips iopsys-brcm63xx-arm iopsys-ramips intel_mips"
|
||||
for target in $targets
|
||||
do
|
||||
rm -f target/linux/$target
|
||||
@@ -57,3 +57,6 @@ function feeds_update {
|
||||
|
||||
register_command "feeds_update" "Update feeds to point to commit hashes from feeds.conf"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ function genconfig {
|
||||
export IMPORT=1
|
||||
export SRCTREEOVERR=0
|
||||
export FILEDIR="files/"
|
||||
export THEMEDIR="themes"
|
||||
CURRENT_CONFIG_FILE=".current_config_file"
|
||||
export CONFIGPATH="package/feeds/iopsys/iop"
|
||||
CUSTPATH="customerconfigs"
|
||||
@@ -12,15 +13,11 @@ function genconfig {
|
||||
export VERBOSE=0
|
||||
export DEVELOPER=0
|
||||
target="bogus"
|
||||
target_config_path=""
|
||||
bcm27xx="target/linux/iopsys-bcm27xx"
|
||||
config_path=""
|
||||
brcm63xx_mips="target/linux/iopsys-brcm63xx-mips"
|
||||
brcm63xx_arm="target/linux/iopsys-brcm63xx-arm"
|
||||
ramips="target/linux/iopsys-ramips"
|
||||
mediatek="target/linux/iopsys-mediatek"
|
||||
econet="target/linux/iopsys-econet"
|
||||
intel_mips="target/linux/intel_mips"
|
||||
x86="target/linux/iopsys-x86"
|
||||
armvirt="target/linux/iopsys-armvirt"
|
||||
|
||||
Red='\033[0;31m' # Red
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
@@ -82,53 +79,20 @@ function genconfig {
|
||||
|
||||
# Takes a board name and returns the target name in global var $target
|
||||
set_target() {
|
||||
local profile=$1
|
||||
local profile=$1
|
||||
|
||||
[ -n "$profile" ] || return
|
||||
|
||||
if [ -n "$TARGET" -a -d "./target/linux/$TARGET" ]; then
|
||||
local targetpath="./target/linux/$TARGET"
|
||||
local profiles=
|
||||
local pfound=0
|
||||
|
||||
if [ -e "$targetpath/genconfig" ]; then
|
||||
profiles=$(cd $targetpath; ./genconfig)
|
||||
|
||||
for p in $profiles; do
|
||||
if [ $p == $profile ]; then
|
||||
pfound=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ $pfound -eq 1 ]; then
|
||||
target="$(echo $TARGET | tr '-' '_')"
|
||||
target_config_path="$targetpath/config"
|
||||
fi
|
||||
|
||||
return
|
||||
fi
|
||||
|
||||
[ -e $brcm63xx_mips/genconfig ] &&
|
||||
iopsys_brcm63xx_mips=$(cd $brcm63xx_mips; ./genconfig)
|
||||
[ -e $brcm63xx_arm/genconfig ] &&
|
||||
iopsys_brcm63xx_arm=$(cd $brcm63xx_arm; ./genconfig)
|
||||
[ -e $ramips/genconfig ] &&
|
||||
iopsys_ramips=$(cd $ramips; ./genconfig)
|
||||
[ -e $mediatek/genconfig ] &&
|
||||
iopsys_mediatek=$(cd $mediatek; ./genconfig)
|
||||
[ -e $econet/genconfig ] &&
|
||||
iopsys_econet=$(cd $econet; ./genconfig)
|
||||
[ -e $intel_mips/genconfig ] &&
|
||||
iopsys_intel_mips=$(cd $intel_mips; ./genconfig)
|
||||
[ -e $x86/genconfig ] &&
|
||||
iopsys_x86=$(cd $x86; ./genconfig)
|
||||
[ -e $armvirt/genconfig ] &&
|
||||
iopsys_armvirt=$(cd $armvirt; ./genconfig)
|
||||
[ -e $bcm27xx/genconfig ] &&
|
||||
iopsys_bcm27xx=$(cd $bcm27xx; ./genconfig)
|
||||
|
||||
if [ "$profile" == "LIST" ]; then
|
||||
for list in iopsys_brcm63xx_arm iopsys_ramips iopsys_mediatek iopsys_econet iopsys_intel_mips iopsys_x86 iopsys_armvirt iopsys_bcm27xx; do
|
||||
for list in iopsys_brcm63xx_mips iopsys_brcm63xx_arm iopsys_ramips iopsys_intel_mips; do
|
||||
echo "$list based boards:"
|
||||
for b in ${!list}; do
|
||||
echo -e "\t$b"
|
||||
@@ -137,10 +101,18 @@ function genconfig {
|
||||
return
|
||||
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
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_brcm63xx_arm"
|
||||
target_config_path="$brcm63xx_arm/config"
|
||||
config_path="$brcm63xx_arm/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
@@ -148,23 +120,7 @@ function genconfig {
|
||||
for p in $iopsys_ramips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_ramips"
|
||||
target_config_path="$ramips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_mediatek; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_mediatek"
|
||||
target_config_path="$mediatek/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_econet; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_econet"
|
||||
target_config_path="$econet/config"
|
||||
config_path="$ramips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
@@ -172,39 +128,27 @@ function genconfig {
|
||||
for p in $iopsys_intel_mips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="intel_mips"
|
||||
target_config_path="$intel_mips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_x86; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_x86"
|
||||
target_config_path="$x86/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_armvirt; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_armvirt"
|
||||
target_config_path="$armvirt/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_bcm27xx; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_bcm27xx"
|
||||
target_config_path="$bcm27xx/config"
|
||||
config_path="$intel_mips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
git remote -v | grep -qE '(git@|ssh://)' && {
|
||||
git remote -v | grep -q http || {
|
||||
DEVELOPER=1
|
||||
|
||||
bcmAllowed=0
|
||||
endptAllowed=0
|
||||
natalieAllowed=0
|
||||
mediatekAllowed=0
|
||||
wifilifeAllowed=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
|
||||
git ls-remote git@dev.iopsys.eu:iopsys/wifilife.git -q 2>/dev/null && wifilifeAllowed=1
|
||||
}
|
||||
|
||||
v() {
|
||||
@@ -218,7 +162,6 @@ function genconfig {
|
||||
echo -e " -c|--clean\t\tRemove all files under ./files and import from config "
|
||||
echo -e " -v|--verbose\t\tVerbose"
|
||||
echo -e " -n|--no-update\tDo NOT! Update customer config before applying"
|
||||
echo -e " -t|--target\t\tExplicitly specify the linux target to build the board profile from"
|
||||
echo -e " -s|--override\t\tEnable 'Package source tree override'"
|
||||
echo -e " -S|--brcmsingle\tForce build of bcmkernel to use only one thread"
|
||||
echo -e " -h|--help\t\tShow this message"
|
||||
@@ -226,7 +169,7 @@ function genconfig {
|
||||
echo -e " -a|--list-all\t\tList all Customers and their board types"
|
||||
echo -e " -b|--boards\t\tList all board types"
|
||||
echo
|
||||
echo "Example ./iop genconfig eg400 OPERATORX"
|
||||
echo "Example ./iop genconfig dg200 TELIA"
|
||||
echo "(if no customerconfig is chosen, iopsys config will be used)"
|
||||
echo
|
||||
exit 0
|
||||
@@ -237,7 +180,7 @@ function genconfig {
|
||||
local ALL="$1"
|
||||
local CUSTOMER="$2"
|
||||
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
|
||||
echo "$CUSTOMER has following boards:"
|
||||
for board in $boards; do
|
||||
@@ -254,7 +197,7 @@ function genconfig {
|
||||
if [ "$customers" -a "$ALL" == 1 ]; then
|
||||
for customer in $customers; do
|
||||
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
|
||||
for board in $boards; do
|
||||
echo -e "\t$board"
|
||||
@@ -277,12 +220,12 @@ function genconfig {
|
||||
|
||||
generate_config()
|
||||
{
|
||||
DIFFFILE="$1"
|
||||
MASTERFILE="$2"
|
||||
while read p; do
|
||||
v "$p"
|
||||
sed -r -i "$p" $MASTERFILE
|
||||
done < $DIFFFILE
|
||||
DIFFFILE="$1"
|
||||
MASTERFILE="$2"
|
||||
while read p; do
|
||||
v "$p"
|
||||
sed -r -i "$p" $MASTERFILE
|
||||
done < $DIFFFILE
|
||||
}
|
||||
|
||||
setup_dirs()
|
||||
@@ -308,6 +251,13 @@ function genconfig {
|
||||
v "rm -rf $FILEDIR*"
|
||||
rm -rf $FILEDIR*
|
||||
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()
|
||||
@@ -343,41 +293,22 @@ function genconfig {
|
||||
v "cp $CONFIGPATH/config .config"
|
||||
cp $CONFIGPATH/config .config
|
||||
|
||||
if [ -f $target_config_path/config ]; then
|
||||
cat $target_config_path/config >> .config
|
||||
echo "" >> .config
|
||||
if [ -f $config_path/config ]; then
|
||||
cat $config_path/config >> .config
|
||||
fi
|
||||
if [ -f $target_config_path/$BOARDTYPE/config ]; then
|
||||
cat $target_config_path/$BOARDTYPE/config >> .config
|
||||
echo "" >> .config
|
||||
if [ -f $config_path/$BOARDTYPE/config ]; then
|
||||
cat $config_path/$BOARDTYPE/config >> .config
|
||||
fi
|
||||
|
||||
#special handling for intel_mips/iopsys_ramips which use TARGET_DEVICES
|
||||
#special handling for intel_mips which use TARGET_DEVICES
|
||||
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"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
elif [ "$target" = "iopsys_mediatek" ]; then
|
||||
subtarget="mt7622"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=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
|
||||
elif [ "$target" = "iopsys_bcm27xx" ]; then
|
||||
subtarget="iopsys_bcm2711"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
else
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
|
||||
@@ -396,29 +327,29 @@ function genconfig {
|
||||
v "cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR"
|
||||
cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR
|
||||
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
|
||||
v "Apply $CUSTCONF/$CUSTOMER/common/common.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/common/common.diff >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
if [ -e "$CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff" ]; then
|
||||
v "Apply $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Set target version
|
||||
local GIT_TAG=$(git describe --abbrev=0 --tags)
|
||||
local GIT_REV=$(git rev-parse --short HEAD)
|
||||
local GIT_VER="$GIT_TAG"
|
||||
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_TARGET_VERSION=\"${GIT_TAG}\"" >> .config
|
||||
echo "CONFIG_VERSION_CODE=\"${GIT_TAG}\"" >> .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
|
||||
|
||||
# developer mode selected ?
|
||||
@@ -426,8 +357,18 @@ function genconfig {
|
||||
if [ $DEVELOPER -eq 1 ]; then
|
||||
# rewrite url to clone with ssh instead of http
|
||||
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
|
||||
[ $wifilifeAllowed -eq 0 ] && echo "CONFIG_WIFILIFE_OPEN=y" >> .config
|
||||
else
|
||||
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
|
||||
echo "CONFIG_WIFILIFE_OPEN=y" >> .config
|
||||
fi
|
||||
|
||||
if [ -n "$BRCM_MAX_JOBS" ]
|
||||
@@ -435,12 +376,15 @@ function genconfig {
|
||||
echo "CONFIG_BRCM_MAX_JOBS=\"1\"" >>.config
|
||||
fi
|
||||
|
||||
# Force regeneration of themes
|
||||
touch package/feeds/juci/juci/Makefile
|
||||
|
||||
# Force regeneration of kernel Makefile
|
||||
# Needed to disable kmods for iopsys-brcm targets
|
||||
touch package/kernel/linux/Makefile
|
||||
|
||||
# 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.
|
||||
[ -d ./build_dir ] && find build_dir/ -name "boardparms*c" -print0 2>/dev/null | xargs -0 touch 2>/dev/null
|
||||
|
||||
@@ -477,7 +421,6 @@ function genconfig {
|
||||
-c|--clean) export CLEAN=1;;
|
||||
-n|--no-update) export IMPORT=0;;
|
||||
-v|--verbose) export VERBOSE="$(($VERBOSE + 1))";;
|
||||
-t|--target) export TARGET="$2"; shift;;
|
||||
-p|--profile) export PROFILE="$2"; shift;;
|
||||
-r|--repo) export CUSTREPO="$2"; shift;;
|
||||
-s|--override) export SRCTREEOVERR=1;;
|
||||
|
||||
@@ -9,17 +9,14 @@ function genconfig_min {
|
||||
CUSTPATH="customerconfigs"
|
||||
export CUSTCONF="customerconfigs/customers"
|
||||
export VERBOSE=0
|
||||
#always use the mirror
|
||||
export DEVELOPER=0
|
||||
target="bogus"
|
||||
target_config_path=""
|
||||
bcm27xx="target/linux/iopsys-bcm27xx"
|
||||
config_path=""
|
||||
brcm63xx_mips="target/linux/iopsys-brcm63xx-mips"
|
||||
brcm63xx_arm="target/linux/iopsys-brcm63xx-arm"
|
||||
ramips="target/linux/iopsys-ramips"
|
||||
mediatek="target/linux/iopsys-mediatek"
|
||||
econet="target/linux/iopsys-econet"
|
||||
intel_mips="target/linux/intel_mips"
|
||||
x86="target/linux/iopsys-x86"
|
||||
armvirt="target/linux/iopsys-armvirt"
|
||||
|
||||
Red='\033[0;31m' # Red
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
@@ -81,53 +78,19 @@ function genconfig_min {
|
||||
|
||||
# Takes a board name and returns the target name in global var $target
|
||||
set_target() {
|
||||
local profile=$1
|
||||
|
||||
[ -n "$profile" ] || return
|
||||
|
||||
if [ -n "$TARGET" -a -d "./target/linux/$TARGET" ]; then
|
||||
local targetpath="./target/linux/$TARGET"
|
||||
local profiles=
|
||||
local pfound=0
|
||||
|
||||
if [ -e "$targetpath/genconfig" ]; then
|
||||
profiles=$(cd $targetpath; ./genconfig)
|
||||
|
||||
for p in $profiles; do
|
||||
if [ $p == $profile ]; then
|
||||
pfound=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ $pfound -eq 1 ]; then
|
||||
target="$(echo $TARGET | tr '-' '_')"
|
||||
target_config_path="$targetpath/config"
|
||||
fi
|
||||
|
||||
return
|
||||
fi
|
||||
local profile=$1
|
||||
|
||||
[ -e $brcm63xx_mips/genconfig ] &&
|
||||
iopsys_brcm63xx_mips=$(cd $brcm63xx_mips; ./genconfig)
|
||||
[ -e $brcm63xx_arm/genconfig ] &&
|
||||
iopsys_brcm63xx_arm=$(cd $brcm63xx_arm; ./genconfig)
|
||||
[ -e $ramips/genconfig ] &&
|
||||
iopsys_ramips=$(cd $ramips; ./genconfig)
|
||||
[ -e $mediatek/genconfig ] &&
|
||||
iopsys_mediatek=$(cd $mediatek; ./genconfig)
|
||||
[ -e $econet/genconfig ] &&
|
||||
iopsys_econet=$(cd $econet; ./genconfig)
|
||||
[ -e $intel_mips/genconfig ] &&
|
||||
iopsys_intel_mips=$(cd $intel_mips; ./genconfig)
|
||||
[ -e $x86/genconfig ] &&
|
||||
iopsys_x86=$(cd $x86; ./genconfig)
|
||||
[ -e $armvirt/genconfig ] &&
|
||||
iopsys_armvirt=$(cd $armvirt; ./genconfig)
|
||||
[ -e $bcm27xx/genconfig ] &&
|
||||
iopsys_bcm27xx=$(cd $bcm27xx; ./genconfig)
|
||||
|
||||
if [ "$profile" == "LIST" ]; then
|
||||
for list in iopsys_brcm63xx_arm iopsys_ramips iopsys_mediatek iopsys_econet iopsys_intel_mips iopsys_x86 iopsys_armvirt iopsys_bcm27xx; do
|
||||
for list in iopsys_brcm63xx_mips iopsys_brcm63xx_arm iopsys_ramips iopsys_intel_mips; do
|
||||
echo "$list based boards:"
|
||||
for b in ${!list}; do
|
||||
echo -e "\t$b"
|
||||
@@ -136,10 +99,18 @@ function genconfig_min {
|
||||
return
|
||||
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
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_brcm63xx_arm"
|
||||
target_config_path="$brcm63xx_arm/config"
|
||||
config_path="$brcm63xx_arm/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
@@ -147,23 +118,7 @@ function genconfig_min {
|
||||
for p in $iopsys_ramips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_ramips"
|
||||
target_config_path="$ramips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_mediatek; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_mediatek"
|
||||
target_config_path="$mediatek/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_econet; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_econet"
|
||||
target_config_path="$econet/config"
|
||||
config_path="$ramips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
@@ -171,45 +126,11 @@ function genconfig_min {
|
||||
for p in $iopsys_intel_mips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="intel_mips"
|
||||
target_config_path="$intel_mips/config"
|
||||
config_path="$intel_mips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_x86; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_x86"
|
||||
target_config_path="$x86/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_armvirt; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_armvirt"
|
||||
target_config_path="$armvirt/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_bcm27xx; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_bcm27xx"
|
||||
target_config_path="$bcm27xx/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
git remote -v | grep -qE '(git@|ssh://)' && {
|
||||
DEVELOPER=1
|
||||
|
||||
bcmAllowed=0
|
||||
endptAllowed=0
|
||||
|
||||
git ls-remote git@dev.iopsys.eu:broadcom/bcmcreator.git -q 2>/dev/null && bcmAllowed=1
|
||||
git ls-remote git@dev.iopsys.eu:iopsys/endptmngr.git -q 2>/dev/null && endptAllowed=1
|
||||
}
|
||||
|
||||
v() {
|
||||
@@ -220,10 +141,7 @@ function genconfig_min {
|
||||
echo
|
||||
echo 1>&2 "Usage: $0 [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]"
|
||||
echo
|
||||
echo -e " -c|--clean\t\tRemove all files under ./files and import from config "
|
||||
echo -e " -v|--verbose\t\tVerbose"
|
||||
echo -e " -n|--no-update\tDo NOT! Update customer config before applying"
|
||||
echo -e " -t|--target\t\tExplicitly specify the linux target to build the board profile from"
|
||||
echo -e " -s|--override\t\tEnable 'Package source tree override'"
|
||||
echo -e " -S|--brcmsingle\tForce build of bcmkernel to use only one thread"
|
||||
echo -e " -h|--help\t\tShow this message"
|
||||
@@ -231,8 +149,7 @@ function genconfig_min {
|
||||
echo -e " -a|--list-all\t\tList all Customers and their board types"
|
||||
echo -e " -b|--boards\t\tList all board types"
|
||||
echo
|
||||
echo "Example ./iop genconfig eg400 OPERATORX"
|
||||
echo "(if no customerconfig is chosen, iopsys config will be used)"
|
||||
echo "Example ./iop genconfig dg400prime IOPSYS"
|
||||
echo
|
||||
exit 0
|
||||
}
|
||||
@@ -282,12 +199,12 @@ function genconfig_min {
|
||||
|
||||
generate_config()
|
||||
{
|
||||
DIFFFILE="$1"
|
||||
MASTERFILE="$2"
|
||||
while read p; do
|
||||
v "$p"
|
||||
sed -r -i "$p" $MASTERFILE
|
||||
done < $DIFFFILE
|
||||
DIFFFILE="$1"
|
||||
MASTERFILE="$2"
|
||||
while read p; do
|
||||
v "$p"
|
||||
sed -r -i "$p" $MASTERFILE
|
||||
done < $DIFFFILE
|
||||
}
|
||||
|
||||
setup_dirs()
|
||||
@@ -334,43 +251,22 @@ function genconfig_min {
|
||||
v "cp $CONFIGPATH/config .config"
|
||||
cp $CONFIGPATH/config .config
|
||||
|
||||
if [ -f $target_config_path/config ]; then
|
||||
cat $target_config_path/config >> .config
|
||||
echo "" >> .config
|
||||
if [ -f $config_path/config ]; then
|
||||
cat $config_path/config >> .config
|
||||
fi
|
||||
if [ -f $target_config_path/$BOARDTYPE/config ]; then
|
||||
cat $target_config_path/$BOARDTYPE/config >> .config
|
||||
echo "" >> .config
|
||||
if [ -f $config_path/$BOARDTYPE/config ]; then
|
||||
cat $config_path/$BOARDTYPE/config >> .config
|
||||
fi
|
||||
|
||||
#special handling for intel_mips/iopsys_ramips which use TARGET_DEVICES
|
||||
#special handling for intel_mips which use TARGET_DEVICES
|
||||
if [ "$target" = "intel_mips" ]; then
|
||||
subtarget="xrx500"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=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"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
elif [ "$target" = "iopsys_mediatek" ]; then
|
||||
subtarget="mt7622"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=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
|
||||
elif [ "$target" = "iopsys_bcm27xx" ]; then
|
||||
subtarget="iopsys_bcm2711"
|
||||
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
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
device=$(echo $BOARDTYPE | tr a-z A-Z)
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${device}=y" >> .config
|
||||
else
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
|
||||
@@ -382,7 +278,8 @@ function genconfig_min {
|
||||
if [ -n "$CUSTOMERS" ]; then
|
||||
for CUSTOMER in $CUSTOMERS; do
|
||||
if [ -d "$CUSTCONF/$CUSTOMER/common/fs" ]; then
|
||||
v "cp -ar $CUSTCONF/$CUSTOMER/common/fs/* $FILEDIR"
|
||||
v "cp -ar $CUSTCONF/$CUSTOMER/common/fs/* $FILEDIR" CUSTREPO="${CUSTREPO:-}"
|
||||
|
||||
cp -ar $CUSTCONF/$CUSTOMER/common/fs/* $FILEDIR
|
||||
fi
|
||||
if [ -d "$CUSTCONF/$CUSTOMER/$BOARDTYPE/fs" ]; then
|
||||
@@ -392,25 +289,21 @@ function genconfig_min {
|
||||
if [ -e "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
|
||||
v "Apply $CUSTCONF/$CUSTOMER/common/common.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/common/common.diff >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
if [ -e "$CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff" ]; then
|
||||
v "Apply $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Set target version
|
||||
local GIT_TAG=$(git describe --abbrev=0 --tags)
|
||||
local GIT_REV=$(git rev-parse --short HEAD)
|
||||
local GIT_VER="$GIT_TAG"
|
||||
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_TARGET_VERSION=\"${GIT_TAG}\"" >> .config
|
||||
echo "CONFIG_VERSION_CODE=\"${GIT_TAG}\"" >> .config
|
||||
echo "CONFIG_VERSION_PRODUCT=\"$BOARDTYPE"\" >> .config
|
||||
|
||||
|
||||
# Enable Package source tree override if selected
|
||||
[ $SRCTREEOVERR -eq 1 ] && echo CONFIG_SRC_TREE_OVERRIDE=y >> .config
|
||||
|
||||
@@ -427,7 +320,7 @@ function genconfig_min {
|
||||
touch package/kernel/linux/Makefile
|
||||
|
||||
# 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.
|
||||
[ -d ./build_dir ] && find build_dir/ -name "boardparms*c" -print0 2>/dev/null | xargs -0 touch 2>/dev/null
|
||||
|
||||
@@ -461,10 +354,7 @@ function genconfig_min {
|
||||
while [ -n "$1" ]; do
|
||||
case "$1" in
|
||||
|
||||
-c|--clean) export CLEAN=1;;
|
||||
-n|--no-update) export IMPORT=0;;
|
||||
-v|--verbose) export VERBOSE="$(($VERBOSE + 1))";;
|
||||
-t|--target) export TARGET="$2"; shift;;
|
||||
-p|--profile) export PROFILE="$2"; shift;;
|
||||
-r|--repo) export CUSTREPO="$2"; shift;;
|
||||
-s|--override) export SRCTREEOVERR=1;;
|
||||
@@ -483,8 +373,6 @@ function genconfig_min {
|
||||
shift;
|
||||
done
|
||||
|
||||
CUSTREPO="${CUSTREPO:-git@dev.iopsys.eu:consumer/iopsys.git}"
|
||||
|
||||
setup_dirs
|
||||
create_and_copy_files "$@"
|
||||
fi
|
||||
|
||||
@@ -1,32 +1,40 @@
|
||||
#!/bin/bash
|
||||
# shellcheck disable=SC2029
|
||||
|
||||
|
||||
build_bcmkernel_consumer() {
|
||||
local tarfile bcmkernelcommith sdkversion serverpath serverlink
|
||||
|
||||
sdkversion="$(grep "CONFIG_BRCM_SDK_VER.*=y" .config | awk -F'[_,=]' '{print$5}')"
|
||||
sdkversion="${sdkversion:0:4}${sdkversion:(-1)}"
|
||||
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"
|
||||
|
||||
local tarfile bcmkernelcommith sdkversion
|
||||
sdkversion=$(grep "CONFIG_BRCM_SDK_VER.*=y" .config | awk -F'[_,=]' '{print$5}')
|
||||
sdkversion=${sdkversion:0:4}${sdkversion:(-1)}
|
||||
bcmkernelcommith=$(grep -w "PKG_SOURCE_VERSION:" $curdir/feeds/broadcom/bcmkernel/${sdkversion:0:5}*.mk | cut -d'=' -f2)
|
||||
# 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
|
||||
ssh "$SERVER" "test -f '$serverpath' && { test -L '$serverlink' || ln -sf '$serverpath' '$serverlink'; }" && return
|
||||
|
||||
cd "./build_dir/target-"*"/bcmkernel-"*"-${sdkversion:0:4}"*"/bcm963xx/release"
|
||||
bash do_consumer_release -p "$profile" -y -F
|
||||
|
||||
[ -n "$board" -a -n "$bcmkernelcommith" ] || return
|
||||
ssh $SERVER "test -f $FPATH/bcmopen-$board-$bcmkernelcommith.tar.gz" && return
|
||||
cd ./build_dir/target-*/bcmkernel-*-${sdkversion:0:4}*/bcm963xx/release
|
||||
bash do_consumer_release -p $profile -y -F
|
||||
tarfile='out/bcm963xx_*_consumer.tar.gz'
|
||||
[ $(ls -1 $tarfile | wc -l) -ne 1 ] && echo "Too many tar files: '$tarfile'" && return
|
||||
|
||||
scp -pv $tarfile "$SERVER":"$serverpath"
|
||||
ssh "$SERVER" "test -f '$serverpath' && ln -sf '$serverpath' '$serverlink'"
|
||||
[ $(ls -1 $tarfile |wc -l) -ne 1 ] && echo "Too many tar files: '$tarfile'" && return
|
||||
scp -pv $tarfile $SERVER:$FPATH/bcmopen-$board-$bcmkernelcommith.tar.gz
|
||||
ssh $SERVER "[ -f $FPATH/bcmopen-$board-$bcmkernelcommith.tar.gz ] && ln -sf $FPATH/bcmopen-$board-$bcmkernelcommith.tar.gz $FPATH/bcmopen-$board-$majver.$minver-latest"
|
||||
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"
|
||||
}
|
||||
|
||||
@@ -36,7 +44,7 @@ build_endptmngr_consumer() {
|
||||
grep -q "CONFIG_TARGET_NO_VOICE=y" .config && return
|
||||
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)
|
||||
[ -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
|
||||
cd ./build_dir/target-*/endptmngr-$endptversion/
|
||||
mkdir endptmngr-open-$endptversion
|
||||
@@ -51,6 +59,70 @@ build_endptmngr_consumer() {
|
||||
cd "$curdir"
|
||||
}
|
||||
|
||||
build_wifilife_consumer() {
|
||||
local target="$1"
|
||||
local ver commit
|
||||
ver=$(grep -w "PKG_VERSION:" ./feeds/iopsys/wifilife/Makefile | cut -d'=' -f2)
|
||||
commit=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/iopsys/wifilife/Makefile | cut -d'=' -f2)
|
||||
[ -n "$ver" -a -n "$commit" ] || return
|
||||
ssh $SERVER "test -f $FPATH/wifilife-$target-${ver}_${commit}.tar.xz" && return
|
||||
if [ "$target" == "iopsys-ramips" ]; then
|
||||
cd ./build_dir/target-mipsel_1004kc_musl/wifilife-$ver/ipkg-*
|
||||
elif [ "$target" == "iopsys-brcm63xx-arm" ]; then
|
||||
cd ./build_dir/target-arm_xscale_musl_eabi/wifilife-$ver/ipkg-*
|
||||
else
|
||||
return
|
||||
fi
|
||||
mkdir -p wifilife-$ver/src
|
||||
cp -rf wifilife/usr/sbin/* wifilife-$ver/src/
|
||||
tar Jcf wifilife-${target}-${ver}_${commit}.tar.xz wifilife-$ver
|
||||
scp -pv wifilife-$target-${ver}_${commit}.tar.xz $SERVER:$FPATH/
|
||||
cp wifilife-${target}-${ver}_${commit}.tar.xz $curdir/
|
||||
rm -rf wifilife-$ver
|
||||
rm -f wifilife-${target}-${ver}_${commit}.tar.xz
|
||||
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 {
|
||||
echo "Usage: $0 generate_tarballs"
|
||||
echo " -t <target>"
|
||||
@@ -64,6 +136,7 @@ function generate_tarballs {
|
||||
set -e
|
||||
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 '"')
|
||||
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 .)
|
||||
@@ -88,14 +161,21 @@ function generate_tarballs {
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$stk_target" ]; then
|
||||
if [ ! -n "$stk_target" ]; then
|
||||
print_usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$stk_target" == "broadcom" ]; then
|
||||
build_bcmkernel_consumer
|
||||
build_natalie_consumer
|
||||
build_endptmngr_consumer
|
||||
build_wifilife_consumer "$target"
|
||||
elif [ "$stk_target" == "mediatek" ]; then
|
||||
build_mediatek_kernel
|
||||
build_mediatek_wifi_consumer 7603
|
||||
build_mediatek_wifi_consumer 7615
|
||||
build_wifilife_consumer "$target"
|
||||
else
|
||||
echo "Invalid target: $stk_target"
|
||||
print_usage
|
||||
|
||||
@@ -1,29 +1,12 @@
|
||||
# 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 {
|
||||
local build_dir_dropbear_authorized_keys_file="files${DROPBEAR_AUTHORIZED_KEYS_FILE}"
|
||||
mkdir -p "$(dirname "$build_dir_dropbear_authorized_keys_file")"
|
||||
get_ssh_public_keys > "$build_dir_dropbear_authorized_keys_file"
|
||||
chmod 0644 "$build_dir_dropbear_authorized_keys_file"
|
||||
echo "Keys in "$build_dir_dropbear_authorized_keys_file" are now:"
|
||||
cat "$build_dir_dropbear_authorized_keys_file"
|
||||
echo
|
||||
echo "Disabling login on serial console..."
|
||||
|
||||
mkdir -p files/etc/dropbear
|
||||
test -e ~/.ssh/id_dsa.pub && cat ~/.ssh/id_dsa.pub >>files/etc/dropbear/authorized_keys
|
||||
test -e ~/.ssh/id_rsa.pub && cat ~/.ssh/id_rsa.pub >>files/etc/dropbear/authorized_keys
|
||||
chmod 0644 files/etc/dropbear/authorized_keys
|
||||
|
||||
echo "::sysinit:/etc/init.d/rcS S boot" >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
|
||||
@@ -31,25 +14,4 @@ function install_key {
|
||||
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"
|
||||
|
||||
@@ -230,7 +230,7 @@ function ssh_upgrade {
|
||||
upd_fw_base=""
|
||||
upd_fw=""
|
||||
upd_host="192.168.1.1"
|
||||
upd_sysupgrade=1
|
||||
upd_sysupgrade=0
|
||||
do_dialog=0
|
||||
|
||||
while getopts "f:hnxt:iscb" opt; do
|
||||
@@ -280,14 +280,6 @@ function ssh_upgrade {
|
||||
set_config_string CONFIG_TARGET_BOARD
|
||||
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
|
||||
do
|
||||
#echo "firmware $upd_fw"
|
||||
@@ -321,20 +313,10 @@ function ssh_upgrade {
|
||||
[ $upd_forceboot -eq 1 ] && extra_args="$extra_args -b"
|
||||
|
||||
file_size_kb=`du -k "$upd_fw" | cut -f1`
|
||||
if [ "$use_scp" == "1" ]
|
||||
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
|
||||
cat $upd_fw | pv -s ${file_size_kb}k | ssh root@$upd_host "iopu $extra_args"
|
||||
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/ &&
|
||||
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!"
|
||||
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 -e "${Green}_______________________________________________________________________________${Color_Off}"
|
||||
|
||||
feeds="$1"
|
||||
[ -n "$feeds" ] || feeds=$(grep -v "^#" feeds.conf| awk '{print $2}')
|
||||
feeds=$(grep -v "^#" feeds.conf| awk '{print $2}')
|
||||
for feed in `echo $feeds`
|
||||
do
|
||||
feed_hash=$(feeds_hash $feed)
|
||||
@@ -553,7 +552,7 @@ check_feeds()
|
||||
done
|
||||
}
|
||||
|
||||
is_local_and_remote_same()
|
||||
feeds_at_top()
|
||||
{
|
||||
git remote update 2>/dev/null 1>/dev/null
|
||||
LOCAL=$(git rev-parse @)
|
||||
@@ -582,7 +581,7 @@ is_local_and_remote_same()
|
||||
usage(){
|
||||
echo -e "$0 [flags]"
|
||||
echo -e "flags:"
|
||||
echo -e " -f\tFeed to update"
|
||||
echo -e " -v\tVerbose mode"
|
||||
echo -e " -h\tShow this help"
|
||||
echo -e " -u\tUpdate package version\n"
|
||||
}
|
||||
@@ -590,7 +589,7 @@ usage(){
|
||||
# Exported interface
|
||||
function update_package {
|
||||
|
||||
UPDATE=0
|
||||
UPDATE=0
|
||||
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
|
||||
@@ -604,18 +603,18 @@ function update_package {
|
||||
Cyan='\033[0;36m' # Cyan
|
||||
White='\033[0;37m' # White
|
||||
|
||||
while getopts "f:hu" opt; do
|
||||
while getopts "v:hu" opt; do
|
||||
case $opt in
|
||||
f)
|
||||
feed=$OPTARG
|
||||
v)
|
||||
verbose=$OPTARG
|
||||
;;
|
||||
h)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
u)
|
||||
UPDATE=1
|
||||
;;
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
u)
|
||||
UPDATE=1
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
exit 1
|
||||
@@ -638,9 +637,9 @@ function update_package {
|
||||
set -E
|
||||
trap '[ "$?" -ne 99 ] || exit 99' ERR
|
||||
|
||||
is_local_and_remote_same
|
||||
[ -n "$feed" ] || check_packages
|
||||
check_feeds $feed
|
||||
feeds_at_top
|
||||
check_packages
|
||||
check_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_PROTO:=git
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/json-editor.git
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
105
libcgroup/Makefile
Normal file
105
libcgroup/Makefile
Normal file
@@ -0,0 +1,105 @@
|
||||
#
|
||||
# Copyright (C) 2016 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libcgroup
|
||||
PKG_VERSION:=0.41
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_LICENSE:=LGPL-2.1
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
PKG_SOURCE_VERSION:=2186c97f60df7efe86ddadd5e3d9d36dd4923b98
|
||||
|
||||
PKG_SOURCE_URL:=git://git.code.sf.net/p/libcg/libcg
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)+git$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
#PKG_BUILD_PARALLEL:=1
|
||||
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/libcgroup
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
DEPENDS:=+libpthread
|
||||
TITLE:=Control group configuration library
|
||||
URL:=https://sourceforge.net/p/libcg/
|
||||
endef
|
||||
|
||||
define Package/libcgroup/description
|
||||
Control groups, a new kernel feature in Linux 2.6.24 provides a file system
|
||||
interface to manipulate and control the details on task grouping including
|
||||
creation of new task groups (control groups), permission handling and task
|
||||
assignment.
|
||||
endef
|
||||
|
||||
define Package/libcgroup-daemon
|
||||
SECTION:=base
|
||||
CATEGORY:=Base system
|
||||
DEPENDS:=+libcgroup +librt
|
||||
TITLE:=Control group management daemon
|
||||
URL:=https://sourceforge.net/p/libcg/
|
||||
endef
|
||||
|
||||
define Package/libcgroup-utils
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=+libcgroup
|
||||
TITLE:=Control group configuration utilities
|
||||
URL:=https://sourceforge.net/p/libcg/
|
||||
endef
|
||||
|
||||
#define Package/libcgroup/conffiles
|
||||
# /etc/config/cgroups
|
||||
#endef
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--disable-bindings \
|
||||
--disable-pam \
|
||||
--enable-static \
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/libcgroup
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/libcgroup/*.h $(1)/usr/include/libcgroup/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib $(1)/usr/lib/pkgconfig
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libcgroup.* $(1)/usr/lib/
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libcgroup.pc $(1)/usr/lib/pkgconfig/
|
||||
endef
|
||||
|
||||
define Package/libcgroup/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libcgroup.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libcgroup-daemon/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin
|
||||
|
||||
# move to its own package?
|
||||
$(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d
|
||||
$(INSTALL_CONF) ./files/cgroups.config $(1)/etc/config/cgroups
|
||||
$(INSTALL_BIN) ./files/cgroups.init $(1)/etc/init.d/cgroups
|
||||
endef
|
||||
|
||||
define Package/libcgroup-utils/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
|
||||
endef
|
||||
|
||||
#$(eval $(call BuildPackage,libcgroup))
|
||||
#$(eval $(call BuildPackage,libcgroup-daemon))
|
||||
#$(eval $(call BuildPackage,libcgroup-utils))
|
||||
40
libcgroup/files/cgroups.config
Normal file
40
libcgroup/files/cgroups.config
Normal file
@@ -0,0 +1,40 @@
|
||||
config cgroups cgroups
|
||||
option enabled 1
|
||||
option defgroup iopsys/normal
|
||||
|
||||
config cgroup _root_
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config cgroup iopsys
|
||||
list option cpu.shares=4096
|
||||
list option memory.limit_in_bytes=-1
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config cgroup iopsys_normal
|
||||
list option cpu.shares=1024
|
||||
list option memory.limit_in_bytes=-1
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config cgroup iopsys_high
|
||||
list option cpu.shares=4096
|
||||
list option memory.limit_in_bytes=-1
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config cgroup 3prt
|
||||
list option cpu.shares=1024
|
||||
list option memory.limit_in_bytes=75M
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config cgroup 3prt_normal
|
||||
list option cpu.shares=1024
|
||||
list option memory.limit_in_bytes=75M
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config cgroup 3prt_high
|
||||
list option cpu.shares=4096
|
||||
list option memory.limit_in_bytes=75M
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config procmap procmap
|
||||
list procmap minidlna=3prt/normal
|
||||
|
||||
123
libcgroup/files/cgroups.init
Executable file
123
libcgroup/files/cgroups.init
Executable file
@@ -0,0 +1,123 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=01
|
||||
USE_PROCD=1
|
||||
#PROCD_DEBUG=1
|
||||
NAME=cgrulesengd
|
||||
|
||||
CGBASEDIR=/sys/fs/cgroup
|
||||
CGCONFIG="cgroups"
|
||||
|
||||
CGRULESCONF=/tmp/cgrules.conf
|
||||
CGCONFIGCONF=/tmp/cgconfig.conf
|
||||
|
||||
|
||||
cgroupinit_add_knob_val_to_list () {
|
||||
CG_KNOB_VAL_LIST="$CG_KNOB_VAL_LIST
|
||||
$1"
|
||||
}
|
||||
|
||||
cgroupinit_create_group () {
|
||||
local cgrp=$1
|
||||
local dir curr
|
||||
|
||||
if [ "$cgrp" == "_root_" ]; then
|
||||
dir=.
|
||||
else
|
||||
dir=$(echo $cgrp |tr '_' '/')
|
||||
fi
|
||||
|
||||
echo -e "group $dir {" >> $CGCONFIGCONF
|
||||
|
||||
CG_KNOB_VAL_LIST=
|
||||
config_list_foreach $cgrp option cgroupinit_add_knob_val_to_list
|
||||
CG_KNOB_VAL_LIST=$(echo "$CG_KNOB_VAL_LIST" |sort)
|
||||
curr="_none_"
|
||||
|
||||
for knob_val in $CG_KNOB_VAL_LIST ; do
|
||||
local ctrlr knob val
|
||||
|
||||
knob=$(echo $knob_val |awk -F= '{print $1}')
|
||||
ctrlr=$(echo $knob |awk -F. '{print $1}')
|
||||
val=$(echo $knob_val |awk -F= '{print $2}')
|
||||
|
||||
if [ "$curr" != "$ctrlr" ]; then
|
||||
[ "$curr" == "_none_" ] || echo -e "\t}" >> $CGCONFIGCONF
|
||||
curr=$ctrlr
|
||||
echo -e "\t$curr {" >> $CGCONFIGCONF
|
||||
fi
|
||||
|
||||
echo -e "\t\t$knob = \"$val\";" >> $CGCONFIGCONF
|
||||
done
|
||||
|
||||
[ "$curr" == "_none_" ] || echo -e "\t}" >> $CGCONFIGCONF
|
||||
echo -e "}\n" >> $CGCONFIGCONF
|
||||
}
|
||||
|
||||
cgroupinit_add_to_rules () {
|
||||
local name_grp=$1
|
||||
local name grp
|
||||
|
||||
name=$(echo $name_grp |awk -F= '{print $1}')
|
||||
grp=$(echo $name_grp |awk -F= '{print $2}')
|
||||
|
||||
echo -e "*:$name\t*\t$grp" >> $CGRULESCONF
|
||||
}
|
||||
|
||||
cgroupinit_generate_config () {
|
||||
local enab defgrp
|
||||
|
||||
config_load $CGCONFIG
|
||||
|
||||
config_get enab cgroups enabled "1"
|
||||
[ $enab -eq 0 ] && return 1
|
||||
|
||||
config_get defgrp cgroups defgroup "_undef_"
|
||||
[ "$defgrp" == "_undef_" ] && return 1
|
||||
|
||||
# mount here instead of in cgconfigparser to get all options right
|
||||
# mounting without any controllers listed means mount all available
|
||||
if ! grep -q " $CGBASEDIR cgroup " /proc/mounts; then
|
||||
mount -t cgroup -o nodev,noexec,nosuid cgroup $CGBASEDIR
|
||||
[ $? -eq 0 ] || return 1
|
||||
fi
|
||||
|
||||
echo -n '' > $CGCONFIGCONF
|
||||
config_foreach cgroupinit_create_group cgroup
|
||||
|
||||
echo -n '' > $CGRULESCONF
|
||||
config_list_foreach procmap procmap cgroupinit_add_to_rules
|
||||
echo -e "*\t*\t$defgrp" >> $CGRULESCONF
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# cgrulesengd has hardcoded paths for configuration files
|
||||
# use symlinks to point to generated config files
|
||||
cgroupinit_cgrulesengd_fixup () {
|
||||
[ -r /etc/cgrules.conf ] || ln -s $CGRULESCONF /etc/cgrules.conf
|
||||
[ -r /etc/cgconfig.conf ] || ln -s $CGCONFIGCONF /etc/cgconfig.conf
|
||||
[ -d /etc/cgconfig.d ] || mkdir /etc/cgconfig.d
|
||||
}
|
||||
|
||||
start_service () {
|
||||
cgroupinit_generate_config
|
||||
[ $? -eq 0 ] || return
|
||||
|
||||
cgroupinit_cgrulesengd_fixup
|
||||
/usr/sbin/cgconfigparser -l $CGCONFIGCONF || return
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command /usr/sbin/cgrulesengd --nodaemon --syslog
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop_service () {
|
||||
/usr/sbin/cgclear
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger $CGCONFIG
|
||||
}
|
||||
|
||||
@@ -12,11 +12,10 @@ PKG_VERSION:=2012-06-11
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/mirror/microxml.git
|
||||
PKG_SOURCE_URL:=git://dev.freecwmp.org/microxml
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=72965423184f24cc0b963d91c2d1863cdb01b6aa
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_LICENSE:=LGPL-2.0
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
|
||||
@@ -11,14 +11,13 @@ PKG_RELEASE:=1
|
||||
PKG_VERSION:=0.3
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libpicoevent.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=f446f186102539cceedaa15a95a33547ac3c1fd7
|
||||
PKG_SOURCE_VERSION:=f4ab03b22fca57cec6c959fb5c54bcdd64c32467
|
||||
PKG_NAME:=libpicoevent
|
||||
|
||||
PKG_LICENSE:=LGPL-2.1-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ PKG_SOURCE_VERSION:=e4b4c5cce35a52da152776a00532aa0b80879c5b
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
50
logrotate/Makefile
Normal file
50
logrotate/Makefile
Normal file
@@ -0,0 +1,50 @@
|
||||
#
|
||||
# Copyright (C) 2006 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
# $Id$
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=logrotate
|
||||
PKG_VERSION:=3.7.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
|
||||
PKG_SOURCE_URL:=http://ftp.de.debian.org/debian/pool/main/l/logrotate
|
||||
PKG_MD5SUM:=552639142e163745f6bcd4f1f3816d8a
|
||||
PKG_CAT:=zcat
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/logrotate
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=+libpopt
|
||||
TITLE:=rotates, compresses, and mails system logs
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(call Build/Compile/Default, \
|
||||
RPM_OPT_FLAGS="$(TARGET_CFLAGS) $(EXTRA_CPPFLAGS)" \
|
||||
LDFLAGS="$(EXTRA_LDFLAGS)" \
|
||||
logrotate \
|
||||
)
|
||||
endef
|
||||
|
||||
define Package/logrotate/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) ${PKG_BUILD_DIR}/logrotate $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(CP) ./files/logrotate.conf $(1)/etc/
|
||||
$(INSTALL_DIR) $(1)/etc/logrotate.d
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,logrotate))
|
||||
30
logrotate/files/logrotate.conf
Normal file
30
logrotate/files/logrotate.conf
Normal file
@@ -0,0 +1,30 @@
|
||||
# rotate log files weekly
|
||||
weekly
|
||||
#daily
|
||||
|
||||
# keep 4 weeks worth of backlogs
|
||||
rotate 4
|
||||
|
||||
# create new (empty) log files after rotating old ones
|
||||
create
|
||||
|
||||
notifempty
|
||||
nomail
|
||||
#olddir /var/log/backup/
|
||||
missingok
|
||||
#dateext
|
||||
|
||||
# uncomment this if you want your log files compressed
|
||||
#compress
|
||||
|
||||
# packages can drop log rotation information into this directory
|
||||
include /etc/logrotate.d
|
||||
|
||||
# no packages own lastlog or wtmp -- we'll rotate them here
|
||||
#/var/log/wtmp {
|
||||
# monthly
|
||||
# create 0664 root utmp
|
||||
# rotate 1
|
||||
#}
|
||||
|
||||
# system-specific logs may be also be configured here.
|
||||
433
logrotate/patches/01-dateext_maxage.patch
Normal file
433
logrotate/patches/01-dateext_maxage.patch
Normal file
@@ -0,0 +1,433 @@
|
||||
diff -u -ruN logrotate-3.7.1.orig/config.c logrotate-3.7.1/config.c
|
||||
--- logrotate-3.7.1.orig/config.c 2003-08-07 07:13:14.000000000 -0400
|
||||
+++ logrotate-3.7.1/config.c 2005-05-24 12:21:09.000000000 -0400
|
||||
@@ -511,6 +511,14 @@
|
||||
newlog->flags &= ~LOG_FLAG_IFEMPTY;
|
||||
|
||||
*endtag = oldchar, start = endtag;
|
||||
+ } else if (!strcmp(start, "dateext")) {
|
||||
+ newlog->flags |= LOG_FLAG_DATEEXT;
|
||||
+
|
||||
+ *endtag = oldchar, start = endtag;
|
||||
+ } else if (!strcmp(start, "nodateext")) {
|
||||
+ newlog->flags &= ~LOG_FLAG_DATEEXT;
|
||||
+
|
||||
+ *endtag = oldchar, start = endtag;
|
||||
} else if (!strcmp(start, "noolddir")) {
|
||||
newlog->oldDir = NULL;
|
||||
|
||||
@@ -670,6 +678,21 @@
|
||||
}
|
||||
*endtag = oldchar, start = endtag;
|
||||
}
|
||||
+ } else if (!strcmp(start, "maxage")) {
|
||||
+ *endtag = oldchar, start = endtag;
|
||||
+
|
||||
+ if (!isolateValue(configFile, lineNum, "maxage count", &start,
|
||||
+ &endtag)) {
|
||||
+ oldchar = *endtag, *endtag = '\0';
|
||||
+
|
||||
+ newlog->rotateAge = strtoul(start, &chptr, 0);
|
||||
+ if (*chptr || newlog->rotateAge < 0) {
|
||||
+ message(MESS_ERROR, "%s:%d bad maximum age '%s'\n",
|
||||
+ configFile, lineNum, start);
|
||||
+ return 1;
|
||||
+ }
|
||||
+ *endtag = oldchar, start = endtag;
|
||||
+ }
|
||||
} else if (!strcmp(start, "errors")) {
|
||||
message(MESS_DEBUG, "%s: %d: the errors directive is deprecated and no longer used.\n",
|
||||
configFile, lineNum);
|
||||
diff -u -ruN logrotate-3.7.1.orig/logrotate.8 logrotate-3.7.1/logrotate.8
|
||||
--- logrotate-3.7.1.orig/logrotate.8 2003-08-07 07:13:14.000000000 -0400
|
||||
+++ logrotate-3.7.1/logrotate.8 2005-05-24 12:21:09.000000000 -0400
|
||||
@@ -200,6 +200,11 @@
|
||||
Log files are rotated every day.
|
||||
|
||||
.TP
|
||||
+\fBdateext\fR
|
||||
+Archive old versions of log files adding a daily extension like YYYYMMDD
|
||||
+instead of simply adding a number.
|
||||
+
|
||||
+.TP
|
||||
\fBdelaycompress\fR
|
||||
Postpone compression of the previous log file to the next rotation cycle.
|
||||
This has only effect when used in combination with \fBcompress\fR.
|
||||
@@ -246,6 +251,12 @@
|
||||
instead of the just-rotated file (this is the default).
|
||||
|
||||
.TP
|
||||
+\fBmaxage\fR \fIcount\fR
|
||||
+Remove rotated logs older than <count> days. The age is only checked
|
||||
+if the logfile is to be rotated. The files are mailed to the
|
||||
+configured address if \fBmaillast\fR and \fBmail\fR are configured.
|
||||
+
|
||||
+.TP
|
||||
\fBmissingok\fR
|
||||
If the log file is missing, go on to the next one without issuing an error
|
||||
message. See also \fBnomissingok\fR.
|
||||
diff -u -ruN logrotate-3.7.1.orig/logrotate.c logrotate-3.7.1/logrotate.c
|
||||
--- logrotate-3.7.1.orig/logrotate.c 2004-10-19 17:41:24.000000000 -0400
|
||||
+++ logrotate-3.7.1/logrotate.c 2005-05-24 12:21:09.000000000 -0400
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <sys/wait.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
+#include <glob.h>
|
||||
|
||||
#ifdef WITH_SELINUX
|
||||
#include <selinux/selinux.h>
|
||||
@@ -22,6 +23,10 @@
|
||||
#include "log.h"
|
||||
#include "logrotate.h"
|
||||
|
||||
+#if !defined(GLOB_ABORTED) && defined(GLOB_ABEND)
|
||||
+#define GLOB_ABORTED GLOB_ABEND
|
||||
+#endif
|
||||
+
|
||||
typedef struct {
|
||||
char * fn;
|
||||
struct tm lastRotated; /* only tm.mon, tm_mday, tm_year are good! */
|
||||
@@ -42,6 +47,14 @@
|
||||
char * mailCommand = DEFAULT_MAIL_COMMAND;
|
||||
time_t nowSecs = 0;
|
||||
|
||||
+static int globerr(const char * pathname, int theerr) {
|
||||
+ message(MESS_ERROR, "error accessing %s: %s\n", pathname,
|
||||
+ strerror(theerr));
|
||||
+
|
||||
+ /* We want the glob operation to continue, so return 0 */
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
static logState * findState(const char * fn, struct stateSet * sip) {
|
||||
int i;
|
||||
logState * states = sip->states;
|
||||
@@ -49,9 +62,11 @@
|
||||
struct tm now = *localtime(&nowSecs);
|
||||
time_t lr_time;
|
||||
|
||||
+ /* find the filename fn in the statesPtr list */
|
||||
for (i = 0; i < numStates; i++)
|
||||
if (!strcmp(fn, states[i].fn)) break;
|
||||
|
||||
+ /* not in statesPtr list, so add new entry */
|
||||
if (i == numStates) {
|
||||
i = numStates++;
|
||||
states = realloc(states, sizeof(*states) * numStates);
|
||||
@@ -121,6 +136,17 @@
|
||||
return rc;
|
||||
}
|
||||
|
||||
+static int removeLogFile(char * name) {
|
||||
+ message(MESS_DEBUG, "removing old log %s\n", name);
|
||||
+
|
||||
+ if (!debug && unlink(name)) {
|
||||
+ message(MESS_ERROR, "Failed to remove old log %s: %s\n",
|
||||
+ name, strerror(errno));
|
||||
+ return 1;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int compressLogFile(char * name, logInfo * log, struct stat *sb) {
|
||||
char * compressedName;
|
||||
const char ** fullCommand;
|
||||
@@ -265,6 +291,25 @@
|
||||
return rc;
|
||||
}
|
||||
|
||||
+static int mailLogWrapper (char * mailFilename, char * mailCommand, int logNum, logInfo * log) {
|
||||
+ /* if the log is compressed (and we're not mailing a
|
||||
+ * file whose compression has been delayed), we need
|
||||
+ * to uncompress it */
|
||||
+ if ((log->flags & LOG_FLAG_COMPRESS) &&
|
||||
+ !((log->flags & LOG_FLAG_DELAYCOMPRESS) &&
|
||||
+ (log->flags & LOG_FLAG_MAILFIRST))) {
|
||||
+ if (mailLog(mailFilename, mailCommand,
|
||||
+ log->uncompress_prog, log->logAddress,
|
||||
+ log->files[logNum]))
|
||||
+ return 1;
|
||||
+ } else {
|
||||
+ if (mailLog(mailFilename, mailCommand, NULL,
|
||||
+ log->logAddress, mailFilename))
|
||||
+ return 1;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int copyTruncate(char * currLog, char * saveLog, struct stat * sb, int flags) {
|
||||
char buf[BUFSIZ];
|
||||
int fdcurr = -1, fdsave = -1;
|
||||
@@ -479,6 +524,9 @@
|
||||
char * baseName;
|
||||
char * dirName;
|
||||
char * firstRotated;
|
||||
+ char * glob_pattern;
|
||||
+ glob_t globResult;
|
||||
+ int rc;
|
||||
size_t alloc_size;
|
||||
int rotateCount = log->rotateCount ? log->rotateCount : 1;
|
||||
int logStart = (log->logStart == -1) ? 1 : log->logStart;
|
||||
@@ -509,7 +557,7 @@
|
||||
|
||||
alloc_size = strlen(dirName) + strlen(baseName) +
|
||||
strlen(log->files[logNum]) + strlen(fileext) +
|
||||
- strlen(compext) + 10;
|
||||
+ strlen(compext) + 18;
|
||||
|
||||
oldName = alloca(alloc_size);
|
||||
newName = alloca(alloc_size);
|
||||
@@ -531,16 +579,116 @@
|
||||
/* First compress the previous log when necessary */
|
||||
if (log->flags & LOG_FLAG_COMPRESS &&
|
||||
log->flags & LOG_FLAG_DELAYCOMPRESS) {
|
||||
- struct stat sbprev;
|
||||
-
|
||||
- sprintf(oldName, "%s/%s.%d%s", dirName, baseName, logStart, fileext);
|
||||
- if (stat(oldName, &sbprev)) {
|
||||
- message(MESS_DEBUG, "previous log %s does not exist\n",
|
||||
- oldName);
|
||||
- } else {
|
||||
- hasErrors = compressLogFile(oldName, log, &sbprev);
|
||||
+ if (log->flags & LOG_FLAG_DATEEXT) {
|
||||
+ /* glob for uncompressed files with our pattern */
|
||||
+ glob_pattern = malloc(strlen(dirName) + strlen(baseName)
|
||||
+ + strlen(fileext) + 44 );
|
||||
+ sprintf(glob_pattern,
|
||||
+ "%s/%s-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]%s",
|
||||
+ dirName, baseName, fileext);
|
||||
+ rc = glob(glob_pattern, 0, globerr, &globResult);
|
||||
+ if (!rc && globResult.gl_pathc > 0) {
|
||||
+ for (i = 0; i < globResult.gl_pathc && !hasErrors; i++) {
|
||||
+ struct stat sbprev;
|
||||
+ sprintf(oldName,"%s",(globResult.gl_pathv)[i]);
|
||||
+ if (stat(oldName, &sbprev)) {
|
||||
+ message(MESS_DEBUG, "previous log %s does not exist\n", oldName);
|
||||
+ } else {
|
||||
+ hasErrors = compressLogFile(oldName, log, &sbprev);
|
||||
+ }
|
||||
+ }
|
||||
+ } else {
|
||||
+ message (MESS_DEBUG, "glob finding logs to compress failed\n");
|
||||
+ /* fallback to old behaviour */
|
||||
+ sprintf(oldName, "%s/%s.%d%s", dirName, baseName, logStart, fileext);
|
||||
+ }
|
||||
+ globfree(&globResult);
|
||||
+ free(glob_pattern);
|
||||
+ } else {
|
||||
+ struct stat sbprev;
|
||||
+
|
||||
+ sprintf(oldName, "%s/%s.%d%s", dirName, baseName, logStart, fileext);
|
||||
+ if (stat(oldName, &sbprev)) {
|
||||
+ message(MESS_DEBUG, "previous log %s does not exist\n",
|
||||
+ oldName);
|
||||
+ } else {
|
||||
+ hasErrors = compressLogFile(oldName, log, &sbprev);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
+
|
||||
+ firstRotated = alloca(strlen(dirName) + strlen(baseName) +
|
||||
+ strlen(fileext) + strlen(compext) + 30);
|
||||
+
|
||||
+ if(log->flags & LOG_FLAG_DATEEXT) {
|
||||
+ /* glob for compressed files with our pattern
|
||||
+ * and compress ext */
|
||||
+ glob_pattern = malloc(strlen(dirName)+strlen(baseName)
|
||||
+ +strlen(fileext)+strlen(compext)+44);
|
||||
+ sprintf(glob_pattern,
|
||||
+ "%s/%s-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]%s%s",
|
||||
+ dirName, baseName, fileext, compext);
|
||||
+ rc = glob(glob_pattern, 0, globerr, &globResult);
|
||||
+ if (!rc) {
|
||||
+ /* search for files to drop, if we find one remember it,
|
||||
+ * if we find another one mail and remove the first and
|
||||
+ * remember the second and so on */
|
||||
+ struct stat fst_buf;
|
||||
+ int mail_out = -1;
|
||||
+ /* remove the first (n - rotateCount) matches
|
||||
+ * no real rotation needed, since the files have
|
||||
+ * the date in their name */
|
||||
+ for (i = 0; i < globResult.gl_pathc; i++) {
|
||||
+ if( !stat((globResult.gl_pathv)[i],&fst_buf) ) {
|
||||
+ if ((i <= ((int)globResult.gl_pathc - rotateCount))
|
||||
+ || ((log->rotateAge > 0)
|
||||
+ && (((nowSecs - fst_buf.st_mtime)/60/60/24)
|
||||
+ > log->rotateAge))) {
|
||||
+ if ( mail_out != -1 ) {
|
||||
+ if (!hasErrors && log->logAddress) {
|
||||
+ char * mailFilename = (globResult.gl_pathv)[mail_out];
|
||||
+ hasErrors = mailLogWrapper(mailFilename, mailCommand, logNum, log);
|
||||
+ if (!hasErrors)
|
||||
+ hasErrors = removeLogFile(mailFilename);
|
||||
+ }
|
||||
+ }
|
||||
+ mail_out = i;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ if ( mail_out != -1 ) {
|
||||
+ /* oldName is oldest Backup found (for unlink later) */
|
||||
+ sprintf(oldName, "%s", (globResult.gl_pathv)[mail_out]);
|
||||
+ strcpy(disposeName, oldName);
|
||||
+ } else
|
||||
+ disposeName = NULL;
|
||||
+ } else {
|
||||
+ message (MESS_DEBUG, "glob finding old rotated logs failed\n");
|
||||
+ disposeName = NULL;
|
||||
+ }
|
||||
+ /* firstRotated is most recently created/compressed rotated log */
|
||||
+ sprintf(firstRotated, "%s/%s-%04d%02d%02d%s%s",
|
||||
+ dirName, baseName, now.tm_year+1900,
|
||||
+ now.tm_mon+1, now.tm_mday, fileext, compext);
|
||||
+ globfree(&globResult);
|
||||
+ free(glob_pattern);
|
||||
+ } else {
|
||||
+ if ( log->rotateAge ) {
|
||||
+ struct stat fst_buf;
|
||||
+ for (i=1; i <= rotateCount; i++) {
|
||||
+ sprintf(oldName, "%s/%s.%d%s%s", dirName, baseName,
|
||||
+ rotateCount + 1, fileext, compext);
|
||||
+ if(!stat(oldName,&fst_buf)
|
||||
+ && (((nowSecs - fst_buf.st_mtime)/60/60/24)
|
||||
+ > log->rotateAge)) {
|
||||
+ char * mailFilename = (globResult.gl_pathv)[i];
|
||||
+ if (!hasErrors && log->logAddress)
|
||||
+ hasErrors = mailLogWrapper(mailFilename, mailCommand, logNum, log);
|
||||
+ if (!hasErrors)
|
||||
+ hasErrors = removeLogFile(mailFilename);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
|
||||
sprintf(oldName, "%s/%s.%d%s%s", dirName, baseName,
|
||||
logStart + rotateCount, fileext, compext);
|
||||
@@ -548,8 +696,6 @@
|
||||
|
||||
strcpy(disposeName, oldName);
|
||||
|
||||
- firstRotated = alloca(strlen(dirName) + strlen(baseName) +
|
||||
- strlen(fileext) + strlen(compext) + 30);
|
||||
sprintf(firstRotated, "%s/%s.%d%s%s", dirName, baseName,
|
||||
logStart, fileext,
|
||||
(log->flags & LOG_FLAG_DELAYCOMPRESS) ? "" : compext);
|
||||
@@ -600,12 +746,27 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
-
|
||||
+ } /* !LOG_FLAG_DATEEXT */
|
||||
+
|
||||
finalName = oldName;
|
||||
-
|
||||
- /* note: the gzip extension is *not* used here! */
|
||||
- sprintf(finalName, "%s/%s.%d%s", dirName, baseName, logStart, fileext);
|
||||
-
|
||||
+
|
||||
+ if(log->flags & LOG_FLAG_DATEEXT) {
|
||||
+ char * destFile = alloca(strlen(dirName) + strlen(baseName) +
|
||||
+ strlen(fileext) + strlen(compext) + 30);
|
||||
+ struct stat fst_buf;
|
||||
+ sprintf(finalName, "%s/%s-%04d%02d%02d%s",
|
||||
+ dirName, baseName, now.tm_year+1900,
|
||||
+ now.tm_mon+1, now.tm_mday, fileext);
|
||||
+ sprintf(destFile, "%s%s", finalName, compext);
|
||||
+ if(!stat(destFile,&fst_buf)) {
|
||||
+ message (MESS_DEBUG, "destination %s already exists, skipping rotation\n", firstRotated);
|
||||
+ hasErrors = 1;
|
||||
+ }
|
||||
+ } else {
|
||||
+ /* note: the gzip extension is *not* used here! */
|
||||
+ sprintf(finalName, "%s/%s.%d%s", dirName, baseName, logStart, fileext);
|
||||
+ }
|
||||
+
|
||||
/* if the last rotation doesn't exist, that's okay */
|
||||
if (!debug && access(disposeName, F_OK)) {
|
||||
message(MESS_DEBUG, "log %s doesn't exist -- won't try to "
|
||||
@@ -613,9 +774,6 @@
|
||||
disposeName = NULL;
|
||||
}
|
||||
|
||||
- free(dirName);
|
||||
- free(baseName);
|
||||
-
|
||||
if (!hasErrors) {
|
||||
if (log->pre && !(log->flags & LOG_FLAG_SHAREDSCRIPTS)) {
|
||||
message(MESS_DEBUG, "running prerotate script\n");
|
||||
@@ -722,33 +880,12 @@
|
||||
else
|
||||
mailFilename = disposeName;
|
||||
|
||||
- if (mailFilename) {
|
||||
- /* if the log is compressed (and we're not mailing a
|
||||
- file whose compression has been delayed), we need
|
||||
- to uncompress it */
|
||||
- if ((log->flags & LOG_FLAG_COMPRESS) &&
|
||||
- !((log->flags & LOG_FLAG_DELAYCOMPRESS) &&
|
||||
- (log->flags & LOG_FLAG_MAILFIRST))) {
|
||||
- if (mailLog(mailFilename, mailCommand,
|
||||
- log->uncompress_prog, log->logAddress,
|
||||
- log->files[logNum]))
|
||||
- hasErrors = 1;
|
||||
- } else {
|
||||
- if (mailLog(mailFilename, mailCommand, NULL,
|
||||
- log->logAddress, mailFilename))
|
||||
- hasErrors = 1;
|
||||
- }
|
||||
- }
|
||||
+ if (mailFilename)
|
||||
+ hasErrors = mailLogWrapper(mailFilename, mailCommand, logNum, log);
|
||||
}
|
||||
|
||||
if (!hasErrors && disposeName) {
|
||||
- message(MESS_DEBUG, "removing old log %s\n", disposeName);
|
||||
-
|
||||
- if (!debug && unlink(disposeName)) {
|
||||
- message(MESS_ERROR, "Failed to remove old log %s: %s\n",
|
||||
- disposeName, strerror(errno));
|
||||
- hasErrors = 1;
|
||||
- }
|
||||
+ hasErrors = removeLogFile(disposeName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -761,6 +898,8 @@
|
||||
}
|
||||
}
|
||||
#endif
|
||||
+ free(dirName);
|
||||
+ free(baseName);
|
||||
return hasErrors;
|
||||
}
|
||||
|
||||
@@ -1047,7 +1186,9 @@
|
||||
|
||||
int main(int argc, const char ** argv) {
|
||||
logInfo defConfig = { NULL, NULL, 0, NULL, ROT_SIZE,
|
||||
- /* threshHold */ 1024 * 1024, 0,
|
||||
+ /* threshHold */ 1024 * 1024,
|
||||
+ /* rotateCount */ 0,
|
||||
+ /* rotateAge */ 0,
|
||||
/* log start */ -1,
|
||||
/* pre, post */ NULL, NULL,
|
||||
/* first, last */ NULL, NULL,
|
||||
diff -u -ruN logrotate-3.7.1.orig/logrotate.h logrotate-3.7.1/logrotate.h
|
||||
--- logrotate-3.7.1.orig/logrotate.h 2003-08-07 07:13:14.000000000 -0400
|
||||
+++ logrotate-3.7.1/logrotate.h 2005-05-24 12:21:09.000000000 -0400
|
||||
@@ -15,6 +15,7 @@
|
||||
#define LOG_FLAG_MAILFIRST (1 << 6)
|
||||
#define LOG_FLAG_SHAREDSCRIPTS (1 << 7)
|
||||
#define LOG_FLAG_COPY (1 << 8)
|
||||
+#define LOG_FLAG_DATEEXT (1 << 9)
|
||||
|
||||
#define NO_FORCE_ROTATE 0
|
||||
#define FORCE_ROTATE 1
|
||||
@@ -34,6 +35,7 @@
|
||||
enum { ROT_DAYS, ROT_WEEKLY, ROT_MONTHLY, ROT_SIZE, ROT_FORCE } criterium;
|
||||
unsigned int threshhold;
|
||||
int rotateCount;
|
||||
+ int rotateAge;
|
||||
int logStart;
|
||||
char * pre, * post, * first, * last;
|
||||
char * logAddress;
|
||||
12
logrotate/patches/02-datehack.patch
Normal file
12
logrotate/patches/02-datehack.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff -u -ruN logrotate-3.7.1.orig/logrotate.c logrotate-3.7.1/logrotate.c
|
||||
--- logrotate-3.7.1.orig/logrotate.c 2004-10-19 17:41:24.000000000 -0400
|
||||
+++ logrotate-3.7.1/logrotate.c 2005-05-24 12:12:26.000000000 -0400
|
||||
@@ -1002,7 +1002,7 @@
|
||||
}
|
||||
|
||||
/* Hack to hide earlier bug */
|
||||
- if ((year != 1900) && (year < 1996 || year > 2100)) {
|
||||
+ if ((year != 1900) && (year < 1970 || year > 2100)) {
|
||||
message(MESS_ERROR, "bad year %d for file %s in state file %s\n",
|
||||
year, argv[0], stateFilename);
|
||||
fclose(f);
|
||||
14
logrotate/patches/03-ignore_hidden.patch
Normal file
14
logrotate/patches/03-ignore_hidden.patch
Normal file
@@ -0,0 +1,14 @@
|
||||
--- logrotate-3.7/config.c.orig 2005-04-26 22:57:53.000000000 -0400
|
||||
+++ logrotate-3.7/config.c 2005-04-26 22:59:36.000000000 -0400
|
||||
@@ -142,6 +142,11 @@
|
||||
(!fname[1] || (fname[1] == '.' && !fname[2])))
|
||||
return 0;
|
||||
|
||||
+ /* Don't include 'hidden' files either; this breaks Gentoo
|
||||
+ portage config file management http://bugs.gentoo.org/87683 */
|
||||
+ if (fname[0] == '.')
|
||||
+ return 0;
|
||||
+
|
||||
/* Check if fname is ending in a taboo-extension; if so, return
|
||||
false */
|
||||
for (i = 0; i < tabooCount; i++) {
|
||||
54
logrotate/patches/04-no_tmpdir.patch
Normal file
54
logrotate/patches/04-no_tmpdir.patch
Normal file
@@ -0,0 +1,54 @@
|
||||
diff -u -ruN logrotate-3.7.1-cur/logrotate.c logrotate-3.7.1/logrotate.c
|
||||
--- logrotate-3.7.1-cur/logrotate.c 2005-05-25 18:20:41.000000000 -0400
|
||||
+++ logrotate-3.7.1/logrotate.c 2005-05-25 18:21:10.000000000 -0400
|
||||
@@ -90,10 +90,7 @@
|
||||
}
|
||||
|
||||
static int runScript(char * logfn, char * script) {
|
||||
- int fd;
|
||||
- char *filespec;
|
||||
int rc;
|
||||
- char buf[256];
|
||||
|
||||
if (debug) {
|
||||
message(MESS_DEBUG, "running script with arg %s: \"%s\"\n",
|
||||
@@ -101,38 +98,12 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
- filespec = buf;
|
||||
- snprintf(buf, sizeof(buf), "%s/logrotate.XXXXXX", getenv("TMPDIR") ?: "/tmp");
|
||||
- fd = -1;
|
||||
- if (!filespec || (fd = mkstemp(filespec)) < 0 || fchmod(fd, 0700)) {
|
||||
- message(MESS_DEBUG, "error creating %s: %s\n", filespec,
|
||||
- strerror(errno));
|
||||
- if (fd >= 0) {
|
||||
- close(fd);
|
||||
- unlink(filespec);
|
||||
- }
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
- if (write(fd, "#!/bin/sh\n\n", 11) != 11 ||
|
||||
- write(fd, script, strlen(script)) != strlen(script)) {
|
||||
- message(MESS_DEBUG, "error writing %s\n", filespec);
|
||||
- close(fd);
|
||||
- unlink(filespec);
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
- close(fd);
|
||||
-
|
||||
if (!fork()) {
|
||||
- execlp(filespec, filespec, logfn, NULL);
|
||||
+ execl("/bin/sh", "sh", "-c", script, NULL);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
wait(&rc);
|
||||
-
|
||||
- unlink(filespec);
|
||||
-
|
||||
return rc;
|
||||
}
|
||||
|
||||
12
logrotate/patches/05-taboo_to_debug.patch
Normal file
12
logrotate/patches/05-taboo_to_debug.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff -u -ruN logrotate-3.7.1.orig/config.c logrotate-3.7.1/config.c
|
||||
--- logrotate-3.7.1.orig/config.c 2003-08-07 07:13:14.000000000 -0400
|
||||
+++ logrotate-3.7.1/config.c 2005-05-24 12:13:41.000000000 -0400
|
||||
@@ -147,7 +147,7 @@
|
||||
for (i = 0; i < tabooCount; i++) {
|
||||
if (!strcmp(fname + strlen(fname) - strlen(tabooExts[i]),
|
||||
tabooExts[i])) {
|
||||
- message(MESS_ERROR, "Ignoring %s, because of %s "
|
||||
+ message(MESS_DEBUG, "Ignoring %s, because of %s "
|
||||
"ending\n", fname, tabooExts[i]);
|
||||
|
||||
return 0;
|
||||
22
logrotate/patches/06-weekly.patch
Normal file
22
logrotate/patches/06-weekly.patch
Normal file
@@ -0,0 +1,22 @@
|
||||
--- logrotate-3.7.1-old/logrotate.c 2004-10-19 23:41:24.000000000 +0200
|
||||
+++ logrotate-3.7.1-new/logrotate.c 2005-10-02 17:29:22.380767321 +0200
|
||||
@@ -424,12 +424,15 @@ int findNeedRotating(logInfo * log, int
|
||||
switch (log->criterium) {
|
||||
case ROT_WEEKLY:
|
||||
/* rotate if:
|
||||
- 1) the current weekday is before the weekday of the
|
||||
- last rotation
|
||||
+ 1) the day of the week is the same as the day of the week of
|
||||
+ the previous rotation but not the same day of the year
|
||||
+ this will rotate it on the same day every week, but not
|
||||
+ twice a day.
|
||||
2) more then a week has passed since the last
|
||||
rotation */
|
||||
- state->doRotate = ((now.tm_wday < state->lastRotated.tm_wday) ||
|
||||
- ((mktime(&now) - mktime(&state->lastRotated)) >
|
||||
+ state->doRotate = ((now.tm_wday == state->lastRotated.tm_wday &&
|
||||
+ now.tm_yday != state->lastRotated.tm_yday) ||
|
||||
+ ((mktime(&now) - mktime(&state->lastRotated)) >
|
||||
(7 * 24 * 3600)));
|
||||
break;
|
||||
case ROT_MONTHLY:
|
||||
@@ -14,7 +14,6 @@ PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/loop-detector
|
||||
|
||||
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)
|
||||
|
||||
|
||||
87
map-1905/Makefile
Normal file
87
map-1905/Makefile
Normal file
@@ -0,0 +1,87 @@
|
||||
#
|
||||
# Copyright (C) 2019 Iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-1905
|
||||
PKG_VERSION:=0.0.5
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=c525f73488a4b5da178cfc6968a9bde73cf8edb7
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/map-1905.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/map-1905
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:= MultiAP Stack
|
||||
DEPENDS:= +libuci +libjson-c +ubox +libpcap +libopenssl +libwifi +libeasy +libuci
|
||||
endef
|
||||
|
||||
define Package/map-1905/description
|
||||
MultiAP plugin for ieee1905d based on Wifi alliance's MAP-r2 specification
|
||||
endef
|
||||
|
||||
define Package/libmaputils
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=WFA MultiAP utility library
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-D_GNU_SOURCE \
|
||||
-fstrict-aliasing \
|
||||
-Wall \
|
||||
-Wextra
|
||||
|
||||
TARGET_CFLAGS += -DSEND_EMPTY_TLVS
|
||||
TARGET_CFLAGS += -DFIX_BROKEN_TLVS
|
||||
TARGET_CFLAGS += -DSPEED_UP_DISCOVERY
|
||||
TARGET_CFLAGS += -DDO_NOT_ACCEPT_UNAUTHENTICATED_COMMANDS
|
||||
TARGET_CFLAGS += -DALME_OVER_UBUS
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/map-1905/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/map-1905/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifimap-2.so $(1)/usr/lib/
|
||||
$(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/ieee1905d $(1)/usr/sbin/
|
||||
$(CP) $(PKG_BUILD_DIR)/ieee1905d/lib/lib1905.so $(1)/usr/lib/lib1905.so
|
||||
endef
|
||||
|
||||
define Package/libmaputils/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libmaputils.so $(1)/usr/lib/libmaputils.so
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/include/map1905
|
||||
$(CP) $(PKG_BUILD_DIR)/include/*.h $(1)/usr/include/map1905/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifimap-2.so $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libmaputils.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libmaputils))
|
||||
$(eval $(call BuildPackage,map-1905))
|
||||
17
map-1905/files/etc/config/ieee1905
Normal file
17
map-1905/files/etc/config/ieee1905
Normal file
@@ -0,0 +1,17 @@
|
||||
config ieee1905
|
||||
option enabled '1'
|
||||
option debug true
|
||||
|
||||
config al
|
||||
option enabled '1'
|
||||
option basemacint 'wan'
|
||||
option mapall 0
|
||||
# option registrar true
|
||||
option debug_level 2
|
||||
option cmdu_event false
|
||||
option map_plugin 1
|
||||
|
||||
config al-iface
|
||||
option enabled '1'
|
||||
option ifname 'br-lan'
|
||||
option media 'bridge'
|
||||
276
map-1905/files/etc/init.d/ieee1905
Normal file
276
map-1905/files/etc/init.d/ieee1905
Normal file
@@ -0,0 +1,276 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/ieee1905d
|
||||
AL_CONF=/tmp/ieee1905.config
|
||||
INTERFACE=""
|
||||
|
||||
validate_ieee1905_section()
|
||||
{
|
||||
uci_validate_section ieee1905 ieee1905 "${1}" \
|
||||
'debug:bool:false' \
|
||||
'enabled:bool:false'
|
||||
}
|
||||
|
||||
get_device_name() {
|
||||
local device
|
||||
# Get wan L3 interface
|
||||
ubus list |grep -iq network.interface.${1}
|
||||
if [ "$?" -eq 0 ]; then
|
||||
json_load "$(ubus -t 2 call network.interface.${1} status)"
|
||||
json_get_var device device
|
||||
echo ${device}
|
||||
fi
|
||||
}
|
||||
|
||||
get_interface_mac() {
|
||||
local l3 basemac
|
||||
l3=$(get_device_name ${1})
|
||||
if [ -n ${l3} ]; then
|
||||
json_load "$(ubus -t 2 call network.device status "{\"name\":\"${l3}\"}")"
|
||||
json_get_var basemac macaddr
|
||||
fi
|
||||
local first=0x$(echo $basemac |cut -d : -f 1)
|
||||
local rest=$(echo $basemac |cut -d : -f 2-)
|
||||
# Set local bit
|
||||
first=$((first|2))
|
||||
first=$(printf "%02x" $first)
|
||||
basemac="${first}:${rest}"
|
||||
echo ${basemac}
|
||||
}
|
||||
|
||||
validate_al_iface_section()
|
||||
{
|
||||
uci_validate_section ieee1905 al-iface "${1}" \
|
||||
'enabled:bool:false' \
|
||||
'ifname:string:br-lan' \
|
||||
'media:string:bridge'
|
||||
}
|
||||
|
||||
get_ifindex()
|
||||
{
|
||||
local ifname=${1}
|
||||
local ifindex=$(cat /sys/class/net/${ifname}/upper_*/ifindex 2>/dev/null)
|
||||
if [ -z ${ifindex} ]; then
|
||||
ifindex=$(cat /sys/class/net/${ifname}/ifindex)
|
||||
fi
|
||||
echo ${ifindex}
|
||||
}
|
||||
|
||||
get_wlan_passkey()
|
||||
{
|
||||
local ifname=${1}
|
||||
local pass=""
|
||||
local count=0
|
||||
|
||||
while true
|
||||
do
|
||||
local devname=$(uci get wireless.@wifi-iface[${count}].ifname 2>/dev/null)
|
||||
if [ $? -ne 0 ]; then
|
||||
break;
|
||||
fi
|
||||
if [ "${devname}"=="${ifname}" ]; then
|
||||
pass=$(uci get wireless.@wifi-iface[${count}].key 2>/dev/null)
|
||||
break;
|
||||
fi
|
||||
count=$((count+1))
|
||||
done
|
||||
echo ${pass}
|
||||
}
|
||||
|
||||
configure_interface()
|
||||
{
|
||||
local ifname media enabled manufacturer_name model_name model_number device_name serial_number
|
||||
local uuid ifindex
|
||||
|
||||
validate_al_iface_section ${1} || {
|
||||
echo "Validation of al-iface sec failed"
|
||||
exit 1;
|
||||
}
|
||||
|
||||
if [ ${enabled} -eq 0 ]; then
|
||||
return;
|
||||
fi
|
||||
|
||||
# Only continue if interface exists
|
||||
ifconfig ${ifname} 2>/dev/null 1>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
return;
|
||||
fi
|
||||
|
||||
if [ -z ${INTERFACE} ]; then
|
||||
INTERFACE=${ifname}
|
||||
else
|
||||
INTERFACE="${INTERFACE},${ifname}"
|
||||
fi
|
||||
|
||||
if [ "${media}" = "bridge" ]; then
|
||||
echo "Get interfaces from bridge">/dev/console
|
||||
local lower=$(ls -1 /sys/class/net/${ifname}/|grep lower_|tr '_' ' '|awk '{printf $2" "}')
|
||||
for intf in ${lower}
|
||||
do
|
||||
ubus list wifi.ap.${intf} 2>/dev/null 1>/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
INTERFACE="${INTERFACE},${intf}"
|
||||
uuid=$(cat /proc/sys/kernel/random/uuid)
|
||||
ifindex=$(get_ifindex ${intf})
|
||||
local key=$(get_wlan_passkey ${ifname})
|
||||
json_add_object
|
||||
json_add_string ifname ${intf}
|
||||
json_add_string media "wifi"
|
||||
json_add_string network_key ${key}
|
||||
json_close_object
|
||||
fi
|
||||
done
|
||||
fi
|
||||
uuid=$(cat /proc/sys/kernel/random/uuid)
|
||||
ifindex=$(get_ifindex ${ifname})
|
||||
|
||||
json_add_object
|
||||
json_add_string ifname ${ifname}
|
||||
|
||||
if [ "${media}"=="bridge" ]; then
|
||||
json_add_string media "eth"
|
||||
elif [ "${media}"=="wifi" ]; then
|
||||
local key=$(get_wlan_passkey ${ifname})
|
||||
json_add_string media "wifi"
|
||||
json_add_string network_key ${key}
|
||||
else
|
||||
json_add_string media ${media}
|
||||
fi
|
||||
|
||||
json_close_object
|
||||
}
|
||||
|
||||
validate_al_section()
|
||||
{
|
||||
uci_validate_section ieee1905 meshcomms "${1}" \
|
||||
'enabled:bool:false' \
|
||||
'basemacint:string:wan' \
|
||||
'almac:string' \
|
||||
'registrar:bool:false' \
|
||||
'mapall:bool:true' \
|
||||
'debug_level:uinteger:1' \
|
||||
'alme_port:port:8888' \
|
||||
'cmdu_event:bool:true' \
|
||||
'discovery_timer:uinteger:60' \
|
||||
'map_plugin:bool:false'
|
||||
}
|
||||
|
||||
|
||||
configure_al_entity()
|
||||
{
|
||||
local enabled almac basemacint mapall debug_level alme_port l3device basemac intf
|
||||
local registrar cmdu_event discovery_timer map_plugin
|
||||
|
||||
validate_al_section ${1} || {
|
||||
echo "Validation of al section failed"
|
||||
exit 1;
|
||||
}
|
||||
|
||||
if [ -z ${almac} ]; then
|
||||
basemac=$(get_interface_mac ${basemacint})
|
||||
else
|
||||
basemac=${almac}
|
||||
fi
|
||||
|
||||
|
||||
local fname cname model cUrl
|
||||
fname=$(db get hw.board.boardId)
|
||||
cname=$(db get hw.board.iopVerCustomer)
|
||||
model=$(db get hw.board.routerModel)
|
||||
# get ip from lan bridge first
|
||||
cUrl=$(ifconfig br-lan 2>/dev/null|grep "inet addr:"|tr ':' ' '|awk '{printf $3}')
|
||||
if [ -z ${cUrl} ]; then
|
||||
cUrl=$(ifconfig br-wan 2>/dev/null|grep "inet addr:"|tr ':' ' '|awk '{printf $3}')
|
||||
fi
|
||||
if [ -z ${cUrl} ]; then
|
||||
cUrl="http://192.168.1.1"
|
||||
fi
|
||||
|
||||
json_init
|
||||
# fill the al-iface info
|
||||
json_add_array al-iface
|
||||
config_foreach configure_interface al-iface
|
||||
json_close_array
|
||||
|
||||
json_add_object deviceInfo
|
||||
json_add_string friendly_name ${fname}
|
||||
json_add_string manufacturer_name ${cname}
|
||||
json_add_string model ${model}
|
||||
json_add_string control_url ${cUrl}
|
||||
json_close_object
|
||||
|
||||
json_add_object al
|
||||
json_add_int enabled ${enabled}
|
||||
json_add_string mac ${basemac}
|
||||
json_add_string interfaces ${INTERFACE}
|
||||
json_add_int map ${mapall}
|
||||
json_add_int registrar ${registrar}
|
||||
json_add_int debug_level ${debug_level}
|
||||
json_add_int alme_port ${alme_port}
|
||||
json_add_int cmdu_event ${cmdu_event}
|
||||
json_add_int discovery_timer ${discovery_timer}
|
||||
json_add_int map_plugin ${map_plugin}
|
||||
json_close_object
|
||||
|
||||
json_dump >${AL_CONF}
|
||||
sync
|
||||
}
|
||||
|
||||
configure_ieee1905()
|
||||
{
|
||||
local enabled debug
|
||||
|
||||
validate_ieee1905_section ${1} || {
|
||||
echo "Validation of ieee1905 section failed"
|
||||
exit 1;
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
configure_network() {
|
||||
[ -f ${AL_CONF} ] && rm ${AL_CONF}
|
||||
|
||||
ebtables -L FORWARD|grep -iqE "1:80:C2:(0)+:(0)+:13.*-j.*DROP"
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "Applying drop rule to drop pkts forwared by kernel to 1905.1 multicast mac"
|
||||
ebtables -A FORWARD -d 01:80:c2:00:00:13 -j DROP
|
||||
fi
|
||||
|
||||
config_load ieee1905
|
||||
config_foreach configure_ieee1905 ieee1905
|
||||
config_foreach configure_al_entity al
|
||||
}
|
||||
|
||||
start_service() {
|
||||
procd_open_instance ieee1905
|
||||
procd_set_param command ${PROG}
|
||||
configure_network
|
||||
# procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "network"
|
||||
procd_add_reload_trigger "wireless"
|
||||
procd_add_reload_trigger "netmode"
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
config agent 'agent'
|
||||
option enabled '1'
|
||||
option debug '6'
|
||||
option profile '2'
|
||||
option al_bridge 'br-lan'
|
||||
|
||||
#config fh-iface
|
||||
# option ifname 'wl0'
|
||||
# option steer 'rssi bssload'
|
||||
# list exclude '00:11:22:33:44:55'
|
||||
# list exclude_btm '00:aa:bb:cc:dd:ee'
|
||||
# list assoc_ctrl '00:10:20:30:40:50'
|
||||
# option btm_retry '3'
|
||||
# option btm_retry_secs '180'
|
||||
# option fallback_legacy '1'
|
||||
# option steer_legacy_reassoc_secs '30'
|
||||
# option steer_legacy_retry_secs '3600'
|
||||
# option assoc_ctrl_secs '30'
|
||||
# option band '2'
|
||||
|
||||
#config fh-iface
|
||||
# option ifname 'wl1'
|
||||
# option steer 'rssi bssload'
|
||||
# list exclude '00:11:22:33:44:55'
|
||||
# list exclude_btm '00:aa:bb:cc:dd:ee'
|
||||
# option band '5'
|
||||
|
||||
#config bk-iface
|
||||
# option ifname 'apclii0'
|
||||
# option enabled '1'
|
||||
# option onboarded '0'
|
||||
# option disallow_bsta '1 # bitmap, 1 for disallow p1, 2 to disallow p2, 3 to disallow both (probably never applicable)
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
wan=$(db -q get hw.board.ethernetWanPort)
|
||||
|
||||
[ -z "$wan" ] && exit 1 # no configuration
|
||||
[ "$PORT" != "$wan" ] && exit 0
|
||||
|
||||
update_bstas() {
|
||||
local section="$1"
|
||||
local action="$2"
|
||||
local ifname onboarded
|
||||
|
||||
config_get ifname "$section" ifname
|
||||
config_get_bool onboarded "$section" onboarded 0
|
||||
|
||||
[ "$onboarded" -eq 0 ] && return
|
||||
|
||||
wpa_cli -i "$ifname" "$action" > /dev/null 2>&1
|
||||
}
|
||||
|
||||
if [ "$LINK" = "up" ]; then
|
||||
touch /tmp/map.agent.bsta_global_disable
|
||||
config_load "mapagent"
|
||||
config_foreach update_bstas bk-iface disconnect
|
||||
else
|
||||
rm -f /tmp/map.agent.bsta_global_disable
|
||||
config_load "mapagent"
|
||||
config_foreach update_bstas bk-iface reconnect
|
||||
fi
|
||||
@@ -1,46 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
[ "$LINK" == "up" ] || exit 0
|
||||
[ "$PORT" == "" ] && exit 1
|
||||
|
||||
ubus list ieee1905 > /dev/null 2>&1
|
||||
|
||||
rc="$?"
|
||||
|
||||
[ "$rc" != 0 ] && exit 1
|
||||
|
||||
issue_discovery() {
|
||||
local iface="$1"
|
||||
|
||||
res=$(ubus -t5 call ieee1905 buildcmdu "{\"type\":0, \"ifname\":\"${iface}\"}")
|
||||
json_load "$res" > /dev/null 2>&1
|
||||
json_get_var data data
|
||||
|
||||
[ "$data" == "" ] && return
|
||||
|
||||
ubus call ieee1905 cmdu "{\"dst\":\"01:80:c2:00:00:13\", \"type\":0, \"data\":\"${data}\"}"
|
||||
}
|
||||
|
||||
process_vlans() {
|
||||
section="$1"
|
||||
|
||||
config_get ifname "$section" ifname
|
||||
config_get name "$section" name
|
||||
|
||||
[ "$2" == "$ifname" ] || return
|
||||
[ "$name" == "" ] && return
|
||||
|
||||
issue_discovery $name
|
||||
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
# find and publish over any vlans
|
||||
config_load network
|
||||
config_foreach process_vlans interface $PORT
|
||||
config_foreach process_vlans device $PORT
|
||||
|
||||
issue_discovery $PORT
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user