mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-24 19:14:05 +08:00
Compare commits
52 Commits
controller
...
kernel-cc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc743ec3a7 | ||
|
|
2cd8e830b4 | ||
|
|
0c8fe5219e | ||
|
|
7149ff400b | ||
|
|
cb51d61097 | ||
|
|
4b603feaf7 | ||
|
|
28a699ace1 | ||
|
|
ecb30c14a7 | ||
|
|
4df1883bc0 | ||
|
|
ad7561290b | ||
|
|
72c80e7255 | ||
|
|
eeae7ce03a | ||
|
|
e660f7eb4e | ||
|
|
e25330b763 | ||
|
|
db18c12c03 | ||
|
|
3c3534e5e6 | ||
|
|
7493d71ea8 | ||
|
|
847f109800 | ||
|
|
3113657a5f | ||
|
|
1e14f810b0 | ||
|
|
d8788edffa | ||
|
|
ec152f8f9f | ||
|
|
ca278a1871 | ||
|
|
209ea5b025 | ||
|
|
dd375f2a18 | ||
|
|
cd49a9c30f | ||
|
|
66706c7995 | ||
|
|
551f885344 | ||
|
|
527a104ef5 | ||
|
|
840130ec14 | ||
|
|
c466667e3d | ||
|
|
b83cb84ff9 | ||
|
|
0bef3a9e5a | ||
|
|
6ee6b3675f | ||
|
|
e8f90b0d41 | ||
|
|
46eb21a677 | ||
|
|
3161fbde1c | ||
|
|
43ea4d028a | ||
|
|
c908ea3e7c | ||
|
|
75299f0ea2 | ||
|
|
dc6ef2b53e | ||
|
|
6badb49fd9 | ||
|
|
4a670745ca | ||
|
|
eda680f4cf | ||
|
|
8bb1b8e147 | ||
|
|
9cdc86c8e8 | ||
|
|
ba02924ce5 | ||
|
|
ee679f8258 | ||
|
|
13b7f7e363 | ||
|
|
293b0835b1 | ||
|
|
54395dd359 | ||
|
|
bbc05c7c79 |
188
alleato-base/Makefile
Normal file
188
alleato-base/Makefile
Normal file
@@ -0,0 +1,188 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=alleato-base
|
||||
|
||||
PKG_VERSION:=14.49.2
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE_URL:=git@iopsys.inteno.se:alleato_base.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=8314aed451255410a2cd4fa43ac3235504e8f018
|
||||
|
||||
PKG_MAINTAINER:=Martin Assarsson, ALLEATO
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
######################################################
|
||||
|
||||
define Package/alleato3
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Alleato
|
||||
DEPENDS:=+python
|
||||
TITLE:=Alleato python libraries
|
||||
endef
|
||||
|
||||
define Package/zwaved
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Alleato
|
||||
DEPENDS:=+jansson
|
||||
TITLE:=Alleato zwave daemon
|
||||
endef
|
||||
|
||||
define Package/zwave-mgr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Alleato
|
||||
DEPENDS:=+alleato3
|
||||
TITLE:=Alleato zwave manager
|
||||
endef
|
||||
|
||||
define Package/zwave-profiler
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Alleato
|
||||
DEPENDS:=+alleato3
|
||||
TITLE:=Alleato zwave profiler
|
||||
endef
|
||||
|
||||
define Package/alleato-scheduler
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Alleato
|
||||
DEPENDS:=+alleato3
|
||||
TITLE:=Alleato scheduler
|
||||
endef
|
||||
|
||||
define Package/alleato-boxconfig
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Alleato
|
||||
DEPENDS:=+alleato3
|
||||
TITLE:=Alleato boxconfig
|
||||
endef
|
||||
|
||||
define Package/all-omc
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Alleato
|
||||
DEPENDS:=+alleato3 +screen
|
||||
TITLE:=Alleato remote tunnel
|
||||
endef
|
||||
|
||||
define Package/ubus-kicker
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Alleato
|
||||
DEPENDS:=
|
||||
TITLE:=Alleato ubus-kicker
|
||||
endef
|
||||
|
||||
define Package/mqttnagios
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Alleato
|
||||
DEPENDS:=
|
||||
TITLE:=Alleato mqttnagios
|
||||
endef
|
||||
|
||||
define Package/all4-alleato-tools
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Alleato
|
||||
DEPENDS:=
|
||||
TITLE:=Alleato tools
|
||||
endef
|
||||
|
||||
######################################################
|
||||
|
||||
define Package/alleato3/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/python2.7/
|
||||
$(CP) -r $(PKG_BUILD_DIR)/python-2.7/* $(1)/usr/lib/python2.7/
|
||||
endef
|
||||
|
||||
define Package/zwaved/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init.d/zwaved $(1)/etc/init.d/zwaved
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/binaries/zwaved $(1)/usr/sbin/zwaved
|
||||
endef
|
||||
|
||||
define Package/zwave-mgr/install
|
||||
$(INSTALL_DIR) $(1)/usr/mqttrules $(1)/etc/init.d $(1)/etc/alleato/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init.d/zwave-mgr $(1)/etc/init.d/zwave-mgr
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/binaries/zwave_mgr $(1)/usr/mqttrules/zwave_mgr
|
||||
endef
|
||||
|
||||
define Package/zwave-profiler/install
|
||||
$(INSTALL_DIR) $(1)/usr/mqttrules $(1)/etc/init.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init.d/zwave-profiler $(1)/etc/init.d/zwave-profiler
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/binaries/zwave-profiler $(1)/usr/mqttrules/zwave-profiler
|
||||
endef
|
||||
|
||||
define Package/alleato-scheduler/install
|
||||
$(INSTALL_DIR) $(1)/usr/mqttrules $(1)/etc/init.d $(1)/etc/crontabs/sched
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init.d/scheduler $(1)/etc/init.d/scheduler
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/binaries/scheduler $(1)/usr/mqttrules/scheduler
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/data/schedule $(1)/etc/crontabs/sched/schedule
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/data/schedule $(1)/etc/crontabs/schedule
|
||||
endef
|
||||
|
||||
define Package/alleato-boxconfig/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin $(1)/usr/bin $(1)/etc/init.d $(1)/etc/alleato $(1)/home/mosquitto
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init.d/boxconfig $(1)/etc/init.d/boxconfig
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/binaries/boxconfig $(1)/usr/bin/boxconfig
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/binaries/genmosquittoconf $(1)/usr/bin/genmosquittoconf
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/binaries/check_client_id $(1)/usr/sbin/check_client_id
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/data/boxconfig.conf $(1)/etc/boxconfig.conf
|
||||
endef
|
||||
|
||||
define Package/all-omc/install
|
||||
$(INSTALL_DIR) $(1)/root $(1)/etc/init.d $(1)/etc/config $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init.d/omc $(1)/etc/init.d/omc
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/root/ssh_key $(1)/root/ssh_key
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/data/alleato.config $(1)/etc/config/alleato
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/binaries/omc $(1)/usr/bin/omc
|
||||
endef
|
||||
|
||||
define Package/ubus-kicker/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init.d/ubus-kicker $(1)/etc/init.d/ubus-kicker
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/binaries/ubus-kicker $(1)/usr/sbin/ubus-kicker
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/binaries/akick $(1)/usr/sbin/akick
|
||||
endef
|
||||
|
||||
define Package/mqttnagios/install
|
||||
$(INSTALL_DIR) $(1)/etc/nagios.d $(1)/usr/bin $(1)/etc/crontabs $(1)/etc/init.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init.d/mqttnagios $(1)/etc/init.d/mqttnagios
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/binaries/send_mqtt_nag $(1)/usr/bin/send_mqtt_nag
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/nagios.d/dropbear $(1)/etc/nagios.d/dropbear.nag
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/nagios.d/mosquitto $(1)/etc/nagios.d/mosquitto.nag
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/nagios.d/ssh $(1)/etc/nagios.d/ssh.nag
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/nagios.d/zwaved $(1)/etc/nagios.d/zwaved.nag
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/data/mqttnagios $(1)/etc/crontabs/mqttnagios
|
||||
echo '/5 * * * * /usr/sbin/check_client_id' >> $(1)/etc/crontabs/root
|
||||
endef
|
||||
|
||||
define Package/all4-alleato-tools/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin $(1)/etc/init.d $(1)/opt/alleato
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init.d/house $(1)/etc/init.d/house
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init.d/rulesd $(1)/etc/init.d/rulesd
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/binaries/alleato_tools $(1)/usr/bin/alleato_tools
|
||||
endef
|
||||
|
||||
######################################################
|
||||
|
||||
$(eval $(call BuildPackage,alleato3))
|
||||
$(eval $(call BuildPackage,zwaved))
|
||||
$(eval $(call BuildPackage,zwave-mgr))
|
||||
$(eval $(call BuildPackage,zwave-profiler))
|
||||
$(eval $(call BuildPackage,alleato-scheduler))
|
||||
$(eval $(call BuildPackage,alleato-boxconfig))
|
||||
$(eval $(call BuildPackage,all-omc))
|
||||
$(eval $(call BuildPackage,ubus-kicker))
|
||||
$(eval $(call BuildPackage,mqttnagios))
|
||||
$(eval $(call BuildPackage,all4-alleato-tools))
|
||||
7
anyfi/Config.in
Normal file
7
anyfi/Config.in
Normal file
@@ -0,0 +1,7 @@
|
||||
config ANYFI_CONTROLLER
|
||||
string "Controller IP or FQDN"
|
||||
depends on PACKAGE_anyfi
|
||||
help
|
||||
The default IP address or fully qualified domain name (FQDN)
|
||||
of the Controller that should manage the Anyfi.net software.
|
||||
|
||||
61
anyfi/Makefile
Normal file
61
anyfi/Makefile
Normal file
@@ -0,0 +1,61 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
ANYFI_TARGET := $(ARCH)-linux-$(subst C,c,$(LIBC))-$(LIBCV)
|
||||
|
||||
PKG_NAME := anyfi
|
||||
PKG_VERSION := 1.3.9
|
||||
PKG_RELEASE := 1
|
||||
|
||||
PKG_SOURCE := anyfimac-$(PKG_VERSION)-$(ANYFI_TARGET).tar.bz2
|
||||
PKG_SOURCE_URL := http://anyfi.net/download
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/anyfimac-$(PKG_VERSION)-$(ANYFI_TARGET)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION := net
|
||||
CATEGORY := Network
|
||||
TITLE := Anyfi.net - Free SDWN Data Plane for IEEE 802.11
|
||||
URL := http://anyfi.net
|
||||
DEPENDS := +kmod-tun +librt +wl-anyfi
|
||||
MAINTAINER := Anyfi Networks <eng@anyfinetworks.com>
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
Anyfi.net is a free Software-Defined Wirless Networking (SDWN)
|
||||
forwarding data plane implementation for IEEE 802.11.
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
echo "config anyfi controller" > $(PKG_BUILD_DIR)/anyfi.conf
|
||||
echo " option 'hostname' $(CONFIG_ANYFI_CONTROLLER)" >> \
|
||||
$(PKG_BUILD_DIR)/anyfi.conf
|
||||
echo "config anyfi optimizer" >> $(PKG_BUILD_DIR)/anyfi.conf
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
@echo "Nothing to do - Anyfi.net software comes pre-built."
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/conffiles
|
||||
/etc/config/anyfi
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/anyfi.conf $(1)/etc/config/anyfi
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/anyfimac $(1)/sbin
|
||||
$(LN) anyfimac $(1)/sbin/anyfid
|
||||
$(LN) anyfimac $(1)/sbin/myfid
|
||||
$(INSTALL_DIR) $(1)/bin
|
||||
$(LN) ../sbin/anyfimac $(1)/bin/anyfidctl
|
||||
$(LN) ../sbin/anyfimac $(1)/bin/myfidctl
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
558
anyfi/files/lib/network/anyfi.sh
Normal file
558
anyfi/files/lib/network/anyfi.sh
Normal file
@@ -0,0 +1,558 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2013-2014 Anyfi Networks AB.
|
||||
#
|
||||
# Overview of the Integration
|
||||
# ===========================
|
||||
#
|
||||
# Anyfi.net software consists of two user space daemons; the radio daemon
|
||||
# anyfid and the tunnel termination daemon myfid. They communicate with each
|
||||
# other and with a Controller [1] over UDP/IP.
|
||||
#
|
||||
# The radio daemon anyfid provides guests with access to remote Wi-Fi networks.
|
||||
# It needs a Wi-Fi monitor interface to detect when guest devices come within
|
||||
# range and a pool of virtual access points to serve them. The integration is
|
||||
# responsible for creating the monitor interface and the pool of virtual access
|
||||
# points; anyfid handles the rest.
|
||||
#
|
||||
# The tunnel termination daemon myfid provides remote access to the local Wi-Fi
|
||||
# network. It is up to the integration to configure myfid to authenticate remote
|
||||
# devices in the same way that devices are authenticated when connecting
|
||||
# locally.
|
||||
#
|
||||
# Myfid is also responsible for telling the controller the MAC address of
|
||||
# devices that connect locally, so that they can later be offered seamless
|
||||
# remote access whenever they come close to another access point running anyfid.
|
||||
# However, when the user changes the WPA passphrase all such associations
|
||||
# between previously connected devices and the local Wi-Fi network should be
|
||||
# removed. The integration does so by passing myfid the --reset flag.
|
||||
#
|
||||
# Below is the integration logic in pseudo code. If you need to integrate
|
||||
# Anyfi.net software in your own firmware build environment you can find step
|
||||
# by step instructions at http://anyfi.net/integration.
|
||||
#
|
||||
# 1. A Community Edition of the Controller is available for download at
|
||||
# http://www.anyfinetworks.com/download. You can also use the public
|
||||
# demonstration controller at "demo.anyfi.net".
|
||||
#
|
||||
#
|
||||
# Integration Logic in Pseudo Code
|
||||
# ================================
|
||||
#
|
||||
# After enabling a Wi-Fi device:
|
||||
# IF a controller is configured AND Anyfi.net is not disabled
|
||||
# ALLOCATE monitor interface and virtual access point pool for anyfid
|
||||
# START anyfid
|
||||
#
|
||||
# FOREACH Wi-Fi interface of this device
|
||||
# IF a controller is configured AND Anyfi.net is not disabled
|
||||
# GENERATE a config file for myfid
|
||||
#
|
||||
# IF the WPA passphrase has changed
|
||||
# ADD the --reset flag to myfid arguments
|
||||
#
|
||||
# START myfid on the Wi-Fi interface
|
||||
#
|
||||
# After disabling a Wi-Fi device:
|
||||
# STOP anyfid
|
||||
#
|
||||
# FOREACH Wi-Fi interface of this device
|
||||
# STOP myfid on the Wi-Fi interface
|
||||
#
|
||||
# NOTE 1: The integration provides remote access to all Wi-Fi interfaces on the
|
||||
# system that have anyfi_disabled set to 0. Each interface will have
|
||||
# its own myfid daemon. There should however only be one anyfid daemon
|
||||
# per radio.
|
||||
#
|
||||
# NOTE 2: On concurrent dual band routers each radio should have its own anyfid
|
||||
# daemon.
|
||||
#
|
||||
#
|
||||
# Anyfi.net UCI data model
|
||||
# ========================
|
||||
#
|
||||
# Anyfi.net global parameters:
|
||||
#
|
||||
# Name Type Default Description
|
||||
# controller
|
||||
# .hostname IP or FQDN demo.anyfi.net Controller IP or FQDN
|
||||
# .key path - Controller public key PEM file
|
||||
# optimizer
|
||||
# .key path - Optimizer public key PEM file
|
||||
#
|
||||
# Wi-Fi device parameters:
|
||||
#
|
||||
# Name Type Default Description
|
||||
# anyfi_disabled boolean 0 Enable/disable guest access on this radio
|
||||
# anyfi_iface port - Bind anyfid to a WAN interface IP address
|
||||
# anyfi_port number - Bind anyfid to a SDWN UDP port
|
||||
# anyfi_floor percent 5 Min backhaul and spectrum allocation
|
||||
# anyfi_ceiling percent 75 Max backhaul and spectrum allocation
|
||||
# anyfi_uplink integer - WAN uplink capacity in bits per second
|
||||
# anyfi_downlink integer - WAN downlink capacity in bits per second
|
||||
# anyfi_bssids integer - Max number of virtual interfaces to use
|
||||
# anyfi_clients integer - Max number of concurrent guest users
|
||||
#
|
||||
# Wi-Fi interface parameters:
|
||||
#
|
||||
# Name Type Default Description
|
||||
# anyfi_disabled boolean 0 Enable remote access on this network
|
||||
# anyfi_iface string - Bind myfid to a WAN interface IP
|
||||
# address
|
||||
# anyfi_port port - Bind myfid to a SDWN UDP port
|
||||
# anyfi_autz_server IP - RADIUS authorization server IP
|
||||
# anyfi_autz_port port 1812 RADIUS authorization server UDP port
|
||||
# anyfi_autz_secret string - RADIUS authorization server shared
|
||||
# secret
|
||||
# anyfi_acct_server IP - RADIUS extra accounting server IP
|
||||
# anyfi_acct_port port 1813 RADIUS extra accounting server UDP port
|
||||
# anyfi_acct_secret string - RADIUS extra accounting server shared
|
||||
# secret
|
||||
|
||||
append ENABLE_HOOKS anyfi_enable
|
||||
append DISABLE_HOOKS anyfi_disable
|
||||
|
||||
# Daemon run dir for temporary files.
|
||||
RUNDIR=/var/run
|
||||
|
||||
# Config file dir for persistent configuration files.
|
||||
CONFDIR=/etc
|
||||
|
||||
##### Wi-Fi device handling ##################################################
|
||||
|
||||
# Get the channel for Wi-Fi device.
|
||||
# anyfi_dev_get_channel <device>
|
||||
anyfi_dev_get_channel() {
|
||||
local device="$1"
|
||||
local hwmode channel
|
||||
|
||||
config_get hwmode "$device" hwmode
|
||||
config_get channel "$device" channel
|
||||
|
||||
if [ "$channel" = auto -o "$channel" = 0 ]; then
|
||||
case "$hwmode" in
|
||||
auto)
|
||||
channel=auto
|
||||
;;
|
||||
|
||||
*b*|*g*)
|
||||
channel=auto2
|
||||
;;
|
||||
|
||||
*a*)
|
||||
channel=auto5
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
echo "$channel"
|
||||
}
|
||||
|
||||
# Get the WLAN interface list for a WLAN device.
|
||||
# anyfi_get_vifs <device>
|
||||
anyfi_get_vifs() {
|
||||
local device=$1
|
||||
local vifs=""
|
||||
local cfg
|
||||
|
||||
for cfg in $CONFIG_SECTIONS; do
|
||||
local type dev
|
||||
config_get type "$cfg" TYPE
|
||||
config_get dev "$cfg" device
|
||||
|
||||
if [ "$type" = wifi-iface ] && [ "$dev" = "$device" ]; then
|
||||
append vifs "$cfg"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "$vifs"
|
||||
}
|
||||
|
||||
# Start the Anyfi.net radio head daemon anyfid on a device.
|
||||
# anyfi_dev_start <device> <type> <controller> <controller_key>
|
||||
anyfi_dev_start()
|
||||
{
|
||||
local device="$1"
|
||||
local type="$2"
|
||||
local controller="$3"
|
||||
local controller_key="$4"
|
||||
local nvifs bssids monitor iflist
|
||||
|
||||
# Determine how many virtual interfaces we should use
|
||||
config_get bssids "$device" anyfi_bssids
|
||||
nvifs=$(anyfi_get_vifs "$device" | wc -w)
|
||||
|
||||
if [ -n "$bssids" ]; then
|
||||
# Limit the number of virtual interfaces to 32
|
||||
[ "$bssids" -lt 32 ] || bssids=32
|
||||
elif [ $nvifs -lt 4 ]; then
|
||||
# Don't use more that 8 interfaces in total if possible...
|
||||
bssids=$((8 - $nvifs))
|
||||
else
|
||||
# ...but try to allocate at least 4 interfaces for anyfid.
|
||||
bssids=4
|
||||
fi
|
||||
|
||||
# ALLOCATE monitor and pool of virtual access points
|
||||
if monitor=$(anyfi_${type}_alloc_monitor "$device") && \
|
||||
iflist=$(anyfi_${type}_alloc_iflist "$device" $bssids)
|
||||
then
|
||||
local args=""
|
||||
local wanif port floor ceiling uplink downlink clients
|
||||
|
||||
config_get wanif "$device" anyfi_iface
|
||||
config_get port "$device" anyfi_port
|
||||
config_get floor "$device" anyfi_floor
|
||||
config_get ceiling "$device" anyfi_ceiling
|
||||
config_get uplink "$device" anyfi_uplink
|
||||
config_get downlink "$device" anyfi_downlink
|
||||
config_get clients "$device" anyfi_clients
|
||||
|
||||
# If there are no interfaces on this device then
|
||||
# anyfid controls channel
|
||||
if [ "$nvifs" -eq 0 ]; then
|
||||
args="$args --channel=$(anyfi_dev_get_channel $device)"
|
||||
fi
|
||||
|
||||
[ -n "$wanif" ] && args="$args --bind-if=$wanif"
|
||||
[ -n "$port" ] && args="$args --bind-port=$port"
|
||||
[ -n "$floor" ] && args="$args --floor=$floor"
|
||||
[ -n "$ceiling" ] && args="$args --ceiling=$ceiling"
|
||||
[ -n "$uplink" ] && args="$args --uplink=$uplink"
|
||||
[ -n "$downlink" ] && args="$args --downlink=$downlink"
|
||||
[ -n "$clients" ] && args="$args --max-clients=$clients"
|
||||
[ -n "$controller_key" ] && \
|
||||
args="$args --controller-key=$controller_key"
|
||||
|
||||
# START anyfid
|
||||
echo "$device: starting anyfid"
|
||||
/sbin/anyfid --accept-license -C "$controller" -B \
|
||||
-P $RUNDIR/anyfid_$device.pid $args \
|
||||
$monitor $iflist
|
||||
else
|
||||
echo "$device: failed to allocate anyfid interfaces" 1>&2
|
||||
fi
|
||||
}
|
||||
|
||||
##### Wi-Fi interface handling ###############################################
|
||||
|
||||
# Get the printable name of an interface.
|
||||
anyfi_vif_get_name() {
|
||||
local ifname
|
||||
config_get ifname "$1" ifname
|
||||
echo "${ifname:-$1}"
|
||||
}
|
||||
|
||||
# Generate the config file for myfid from UCI variables.
|
||||
# anyfi_vif_gen_config <vif>
|
||||
anyfi_vif_gen_config() {
|
||||
local vif="$1"
|
||||
local name="$(anyfi_vif_get_name $1)"
|
||||
local device net ssid enc key isolate ifname
|
||||
|
||||
config_get device "$vif" device
|
||||
config_get net "$vif" network
|
||||
config_get ssid "$vif" ssid
|
||||
config_get enc "$vif" encryption
|
||||
config_get key "$vif" key
|
||||
config_get isolate "$vif" isolate
|
||||
config_get ifname "$vif" ifname
|
||||
|
||||
# Check basic settings before proceeding
|
||||
[ -n "$net" ] || [ -n "$ssid" ] || return 1
|
||||
|
||||
local auth_proto auth_mode auth_cache group_rekey
|
||||
local ciphers wpa_ciphers rsn_ciphers passphrase
|
||||
local auth_server auth_port auth_secret
|
||||
local autz_server autz_port autz_secret
|
||||
local acct_server acct_port acct_secret
|
||||
local acct2_server acct2_port acct2_secret
|
||||
local radius_nasid
|
||||
|
||||
# Resolve explicit cipher overrides (tkip, ccmp or tkip+ccmp)
|
||||
case "$enc" in
|
||||
*+tkip+ccmp|*+tkip+aes)
|
||||
ciphers=tkip+ccmp
|
||||
;;
|
||||
|
||||
*+ccmp|*+aes)
|
||||
ciphers=ccmp
|
||||
;;
|
||||
|
||||
*+tkip)
|
||||
ciphers=tkip
|
||||
;;
|
||||
esac
|
||||
|
||||
# Resolve authentication protocol (WPA or WPA2)
|
||||
case "$enc" in
|
||||
psk-mixed*|wpa-mixed*|mixed-psk*|mixed-wpa*)
|
||||
auth_proto=wpa+rsn
|
||||
wpa_ciphers=$ciphers
|
||||
rsn_ciphers=$ciphers
|
||||
;;
|
||||
|
||||
psk2*|wpa2*)
|
||||
auth_proto=rsn
|
||||
rsn_ciphers=$ciphers
|
||||
;;
|
||||
|
||||
psk*|wpa*)
|
||||
auth_proto=wpa
|
||||
wpa_ciphers=$ciphers
|
||||
;;
|
||||
|
||||
none)
|
||||
echo "$name: no remote access for security reasons (open network)" 1>&2
|
||||
return 1
|
||||
;;
|
||||
|
||||
wep*)
|
||||
echo "$name: no remote access for security reasons (wep is insecure)" 1>&2
|
||||
return 1
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "$name: unrecognized encryption type $enc" 1>&2
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Resolve authenticator mode (PSK or 802.1X)
|
||||
case "$enc" in
|
||||
psk*)
|
||||
auth_mode=psk
|
||||
passphrase=$key
|
||||
[ -n "$passphrase" ] || return 1
|
||||
;;
|
||||
|
||||
wpa*)
|
||||
auth_mode=eap
|
||||
|
||||
config_get auth_server "$vif" radius_server
|
||||
config_get auth_port "$vif" radius_port
|
||||
config_get auth_secret "$vif" radius_secret
|
||||
|
||||
config_get acct_server "$vif" acct_server
|
||||
config_get acct_port "$vif" acct_port
|
||||
config_get acct_secret "$vif" acct_secret
|
||||
|
||||
config_get auth_cache "$vif" auth_cache
|
||||
config_get group_rekey "$vif" wpa_group_rekey
|
||||
|
||||
[ -n "$auth_server" ] || return 1
|
||||
[ -n "$auth_secret" ] || auth_secret="$key"
|
||||
[ -n "$acct_server" -a -z "$acct_secret" ] && acct_secret="$key"
|
||||
;;
|
||||
|
||||
none)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "$name: no remote access ('encryption' not configured)" 1>&2
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Optional RADIUS authorization and accounting for Anyfi.net
|
||||
config_get autz_server "$vif" anyfi_autz_server
|
||||
config_get autz_port "$vif" anyfi_autz_port
|
||||
config_get autz_secret "$vif" anyfi_autz_secret
|
||||
|
||||
config_get acct2_server "$vif" anyfi_acct_server
|
||||
config_get acct2_port "$vif" anyfi_acct_port
|
||||
config_get acct2_secret "$vif" anyfi_acct_secret
|
||||
|
||||
config_get radius_nasid "$vif" radius_nasid
|
||||
|
||||
# Generate common config file options
|
||||
cat <<EOF
|
||||
ssid = '$ssid'
|
||||
bridge = br-$net
|
||||
auth_proto = $auth_proto
|
||||
EOF
|
||||
|
||||
# Generate dependent config file options
|
||||
[ "$isolate" = 1 ] && echo "isolation = 1"
|
||||
[ -n "$ifname" ] && echo "local_ap = $ifname"
|
||||
[ -n "$auth_mode" ] && echo "auth_mode = $auth_mode"
|
||||
[ -n "$auth_cache" ] && echo "auth_cache = $auth_cache"
|
||||
[ -n "$rsn_ciphers" ] && echo "rsn_ciphers = $rsn_ciphers"
|
||||
[ -n "$wpa_ciphers" ] && echo "wpa_ciphers = $wpa_ciphers"
|
||||
[ -n "$group_rekey" ] && echo "group_rekey = $group_rekey"
|
||||
[ -n "$passphrase" ] && echo "passphrase = '$passphrase'"
|
||||
[ -n "$radius_nasid" ] && echo "radius_nas_id = $radius_nas_id"
|
||||
if [ -n "$auth_server" ] && [ -n "$auth_secret" ]; then
|
||||
echo "radius_auth_server = $auth_server"
|
||||
echo "radius_auth_port = ${auth_port:-1812}"
|
||||
echo "radius_auth_secret = $auth_secret"
|
||||
fi
|
||||
if [ -n "$acct_server" ] && [ -n "$acct_secret" ]; then
|
||||
echo "radius_acct_server = $acct_server"
|
||||
echo "radius_acct_port = ${acct_port:-1813}"
|
||||
echo "radius_acct_secret = $acct_secret"
|
||||
fi
|
||||
if [ -n "$autz_server" ] && [ -n "$autz_secret" ]; then
|
||||
echo "radius_autz_server = $autz_server"
|
||||
echo "radius_autz_port = ${autz_port:-1812}"
|
||||
echo "radius_autz_secret = $autz_secret"
|
||||
fi
|
||||
if [ -n "$acct2_server" ] && [ -n "$acct2_secret" ]; then
|
||||
echo "radius_acct2_server = $acct2_server"
|
||||
echo "radius_acct2_port = ${acct2_port:-1813}"
|
||||
echo "radius_acct2_secret = $acct2_secret"
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
# Get the current value from a myfid configuration file.
|
||||
# anyfi_vif_get_config <file> <config>
|
||||
anyfi_vif_get_config() {
|
||||
local file="$1"
|
||||
local key="$2"
|
||||
|
||||
[ -e "$file" ] || return 1
|
||||
|
||||
# Assume the format is exactly "key = value",
|
||||
# where value may or may not be in ''
|
||||
grep "$key = " $file | cut -d '=' -f2- | cut -b2- | \
|
||||
sed -e "/^'.*'$/s/^'\\(.*\\)'$/\\1/"
|
||||
}
|
||||
|
||||
# Start the Anyfi.net tunnel-termination daemon myfid on an interface.
|
||||
# anyfi_vif_start <vif> <controller> <controller_key> <optimizer_key>
|
||||
anyfi_vif_start()
|
||||
{
|
||||
local vif="$1"
|
||||
local controller="$2"
|
||||
local controller_key="$3"
|
||||
local optimizer_key="$4"
|
||||
|
||||
local name="$(anyfi_vif_get_name $vif)"
|
||||
local pid_file="$RUNDIR/myfid_$name.pid"
|
||||
local conf_file="$CONFDIR/myfid_$name.conf"
|
||||
local new_conf_file="$RUNDIR/myfid_$name.conf"
|
||||
|
||||
# GENERATE a config file for myfid
|
||||
if (anyfi_vif_gen_config $vif) > $new_conf_file; then
|
||||
local controller_key optimizer_key
|
||||
local key old_key wanif port
|
||||
local args=""
|
||||
|
||||
config_get key "$vif" key
|
||||
config_get wanif "$vif" anyfi_iface
|
||||
config_get port "$vif" anyfi_port
|
||||
|
||||
# ADD optional arguments
|
||||
[ -n "$wanif" ] && args="$args --bind-if=$wanif"
|
||||
[ -n "$port" ] && args="$args --bind-port=$port"
|
||||
[ -n "$controller_key" ] && \
|
||||
args="$args --controller-key=$controller_key"
|
||||
[ -n "$optimizer_key" ] && \
|
||||
args="$args --optimizer-key=$optimizer_key"
|
||||
|
||||
# ADD the --reset flag to myfid arguments if the passphrase
|
||||
# has changed or myfid is started for the first time
|
||||
old_key="$(anyfi_vif_get_config $conf_file passphrase)"
|
||||
[ "$key" == "$old_key" ] || args="$args --reset"
|
||||
|
||||
# Update the myfid config file in flash only if needed
|
||||
if ! cmp -s $new_conf_file $conf_file; then
|
||||
mv $new_conf_file $conf_file
|
||||
else
|
||||
rm -f $new_conf_file
|
||||
fi
|
||||
|
||||
# START myfid
|
||||
echo "$name: starting myfid"
|
||||
/sbin/myfid --accept-license -C "$controller" -B -P $pid_file \
|
||||
$args $conf_file
|
||||
fi
|
||||
}
|
||||
|
||||
# Stop an Anyfi.net daemon gracefully
|
||||
# anyfi_stop_daemon <pidfile>
|
||||
anyfi_stop_daemon() {
|
||||
local pidfile="$1"
|
||||
|
||||
kill -TERM $(cat $pidfile)
|
||||
for t in $(seq 0 5); do
|
||||
[ -e $pidfile ] || return 0
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "Timeout waiting for daemon assocated with $pidfile to exit" 1>&2
|
||||
kill -KILL $(cat $pidfile)
|
||||
rm -f $pidfile
|
||||
return 1
|
||||
}
|
||||
|
||||
# Enable Anyfi.net for a Wi-Fi device.
|
||||
# Run from ENABLE_HOOKS
|
||||
anyfi_enable()
|
||||
{
|
||||
local device="$1"
|
||||
local controller
|
||||
local type vif vifs
|
||||
|
||||
# A controller IP or FQDN is required
|
||||
controller="$(uci get anyfi.controller.hostname 2>/dev/null)"
|
||||
[ -n "$controller" ] || return 0
|
||||
|
||||
# Optional controller and optimizer public keys
|
||||
controller_key="$(uci get anyfi.controller.key 2>/dev/null)"
|
||||
optimizer_key="$(uci get anyfi.optimizer.key 2>/dev/null)"
|
||||
|
||||
# Reload the wireless config to get the assigned ifnames right
|
||||
config_load wireless
|
||||
config_get type "$device" type
|
||||
vifs=$(anyfi_get_vifs "$device")
|
||||
|
||||
# START anyfid on this device
|
||||
if [ "$(config_get $device anyfi_disabled)" != 1 ] && \
|
||||
/sbin/anyfi-probe "$type"
|
||||
then
|
||||
anyfi_dev_start $device $type "$controller" "$controller_key"
|
||||
fi
|
||||
|
||||
# FOREACH Wi-Fi interface of this device
|
||||
for vif in $vifs; do
|
||||
if [ "$(config_get $vif disabled)" != 1 ] && \
|
||||
[ "$(config_get $vif anyfi_disabled)" != 1 ]
|
||||
then
|
||||
anyfi_vif_start $vif "$controller" \
|
||||
"$controller_key" "$optimizer_key"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# Disable Anyfi.net for a Wi-Fi device.
|
||||
# Run from DISABLE_HOOKS
|
||||
anyfi_disable()
|
||||
{
|
||||
local device="$1"
|
||||
local type vif vifs
|
||||
|
||||
# Reload the wireless config to get the assigned ifnames right
|
||||
config_load wireless
|
||||
config_get type "$device" type
|
||||
vifs=$(anyfi_get_vifs "$device")
|
||||
|
||||
# STOP anyfid on this device (if anyfid is running)
|
||||
if [ -e $RUNDIR/anyfid_$device.pid ]; then
|
||||
echo "$device: stopping anyfid"
|
||||
anyfi_stop_daemon $RUNDIR/anyfid_$device.pid
|
||||
anyfi_${type}_release_iflist $device
|
||||
anyfi_${type}_release_monitor $device
|
||||
fi
|
||||
|
||||
# FOREACH Wi-Fi interface of this device (with myfid running)
|
||||
for vif in $vifs; do
|
||||
local name="$(anyfi_vif_get_name $vif)"
|
||||
local pidfile="$RUNDIR/myfid_$name.pid"
|
||||
|
||||
if [ -e $pidfile ]; then
|
||||
echo "$name: stopping myfid"
|
||||
anyfi_stop_daemon $pidfile
|
||||
fi
|
||||
done
|
||||
}
|
||||
86
anyfi/files/lib/network/anyfi_broadcom.sh
Normal file
86
anyfi/files/lib/network/anyfi_broadcom.sh
Normal file
@@ -0,0 +1,86 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2013-2014 Anyfi Networks AB.
|
||||
# Anyfi.net setup functions for Broadcom wl driver.
|
||||
|
||||
# Get monitor name interface based for a device.
|
||||
# anyfi_dev_monitor_name <device>
|
||||
anyfi_broadcom_name_monitor() {
|
||||
local device="$1"
|
||||
|
||||
# Map wlX => radiotapX
|
||||
echo "$device" | sed 's/^.*\([0-9]\)$/radiotap\1/'
|
||||
}
|
||||
|
||||
# Get BSS index of the last wl interface that is used (=up)
|
||||
# wl0.2 => 2
|
||||
# wl0 => (empty)
|
||||
anyfi_broadcom_get_wlindex() {
|
||||
ifconfig | grep -o "^$1\..." | cut -d'.' -f2 | sort -n | tail -n 1
|
||||
}
|
||||
|
||||
# Allocate virtual Wi-Fi interfaces for anyfid.
|
||||
# anyfi_broadcom_alloc_iflist <device> <bssids>
|
||||
anyfi_broadcom_alloc_iflist() {
|
||||
local device="$1"
|
||||
local bssids="$2"
|
||||
local count=0
|
||||
local wlindex num
|
||||
|
||||
# Enable MBSS mode if not already enabled
|
||||
if [ "$(wlctl -i $device mbss)" = 0 ]; then
|
||||
wlctl -i $device down
|
||||
wlctl -i $device mbss 1
|
||||
wlctl -i $device up
|
||||
fi
|
||||
|
||||
wlindex=$(anyfi_broadcom_get_wlindex $device)
|
||||
|
||||
# Create WLAN interfaces and let the driver assign the BSSIDs
|
||||
for num in $(seq $bssids); do
|
||||
local idx=$(($wlindex + $num))
|
||||
local wlif=$device.$idx
|
||||
|
||||
# Do the 'wlctl' dance to make the driver assign proper BSSIDs
|
||||
wlctl -i $device bss -C $idx up > /dev/null || break
|
||||
wlctl -i $device ssid -C $idx "dummy" > /dev/null
|
||||
wlctl -i $device bss -C $idx up > /dev/null
|
||||
wlctl -i $device bss -C $idx down > /dev/null
|
||||
wlctl -i $device ssid -C $idx "" > /dev/null
|
||||
|
||||
local bssid=$(wlctl -i $wlif cur_etheraddr | cut -d' ' -f2)
|
||||
ifconfig $wlif hw ether $bssid > /dev/null
|
||||
count=$(($count + 1))
|
||||
done
|
||||
|
||||
[ "$count" -gt 0 ] && echo $device.$(($wlindex + 1))/$count
|
||||
}
|
||||
|
||||
# Release virtual Wi-Fi interfaces allocated for anyfid.
|
||||
# anyfi_broadcom_release_iflist <device>
|
||||
anyfi_broadcom_release_iflist() {
|
||||
true
|
||||
}
|
||||
|
||||
# Allocate a monitor interface for anyfid.
|
||||
# anyfi_broadcom_alloc_monitor <device>
|
||||
anyfi_broadcom_alloc_monitor() {
|
||||
local device="$1"
|
||||
local monitor=$(anyfi_broadcom_name_monitor $device)
|
||||
|
||||
wlctl -i $device monitor 0 || return 1
|
||||
wlctl -i $device monitor 3 || return 1
|
||||
ifconfig $monitor down || return 1
|
||||
ifconfig $monitor up || return 1
|
||||
echo $monitor
|
||||
}
|
||||
|
||||
# Release the monitor interface for anyfid.
|
||||
# anyfi_broadcom_release_monitor <device>
|
||||
anyfi_broadcom_release_monitor() {
|
||||
local device="$1"
|
||||
local monitor=$(anyfi_broadcom_name_monitor $device)
|
||||
|
||||
ifconfig $monitor down 2> /dev/null
|
||||
wlctl -i $device monitor 0 2> /dev/null
|
||||
}
|
||||
58
anyfi/files/sbin/anyfi-probe
Executable file
58
anyfi/files/sbin/anyfi-probe
Executable file
@@ -0,0 +1,58 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Check if a WLAN driver type is supported by Anyfi.net radio software."
|
||||
echo "Usage: $0 {mac80211|...}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
number() {
|
||||
echo $2 | sed -e 's/[^0-9]/ /g' | cut -d' ' -f $1
|
||||
}
|
||||
|
||||
major() {
|
||||
number 1 $1
|
||||
}
|
||||
|
||||
minor() {
|
||||
number 2 $1
|
||||
}
|
||||
|
||||
case $1 in
|
||||
mac80211)
|
||||
COMPAT_VER=$(opkg list-installed kmod-mac80211 | cut -d'+' -f2)
|
||||
KERNEL_VER=$(uname -r)
|
||||
|
||||
# Future kernels > 3.x are OK
|
||||
[ "$(major $KERNEL_VER)" -gt 3 ] && return 0
|
||||
|
||||
# The required commit 86c228a7627f3f2776893da47592234140fbfba8
|
||||
# for mac80211 support was introduced in kernel 3.12.
|
||||
[ "$(major $KERNEL_VER)" -eq 3 ] && \
|
||||
[ "$(minor $KERNEL_VER)" -ge 12 ] && return 0
|
||||
|
||||
[ "$(major $COMPAT_VER)" -gt 2013 ] && return 0
|
||||
[ "$(major $COMPAT_VER)" -eq 2013 ] && \
|
||||
[ "$(minor $COMPAT_VER)" -ge 11 ] && return 0
|
||||
|
||||
cat <<EOF
|
||||
Support for mac80211 requires Linux kernel >= 3.12 or
|
||||
compat-wireless >= 2013-11-05. Please update your system.
|
||||
EOF
|
||||
;;
|
||||
|
||||
broadcom)
|
||||
return 0
|
||||
;;
|
||||
|
||||
*)
|
||||
cat<<EOF
|
||||
WLAN driver \"$1\" is not supported by the Anyfi.net radio software.
|
||||
Improved drivers with Anyfi.net support are available for Broadcom,
|
||||
Qualcomm Atheros, Ralink and Realtek chipsets. Please contact
|
||||
support@anyfi.net for updated drivers, reference integrations and
|
||||
commercial integration services.
|
||||
EOF
|
||||
;;
|
||||
esac
|
||||
exit 1
|
||||
@@ -1,78 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2019 iopsys Software Solutions AB. All rights reserved.
|
||||
#
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# version 2 as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=ated
|
||||
PKG_VERSION:=1.2.2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=f614cba983d827d5185c60a6a5a35530621d44d2
|
||||
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)
|
||||
|
||||
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/ated
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Daemon for handling wifi calibration
|
||||
URL:=
|
||||
DEPENDS:= libc
|
||||
endef
|
||||
|
||||
define Package/ated/description
|
||||
Daemon for handling wifi calibration
|
||||
endef
|
||||
|
||||
#TARGET_CFLAGS += -I$(LINUX_DIR)/include -I$(LINUX_DIR)/arch/mips/include
|
||||
|
||||
MAKE_FLAGS += \
|
||||
v=2 \
|
||||
m=3
|
||||
|
||||
|
||||
#TARGET_CPPFLAGS := \
|
||||
# -I$(STAGING_DIR)/usr/include/bcm963xx/shared/opensource/include/bcm963xx \
|
||||
# -I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
|
||||
# $(TARGET_CPPFLAGS)
|
||||
|
||||
# we donot wwant to have any install.
|
||||
define Build/Install/Default
|
||||
endef
|
||||
|
||||
define Package/ated/install
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ated $(1)/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ated))
|
||||
@@ -1,65 +0,0 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bashdb
|
||||
PKG_VERSION:=4.4-0.92
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
#PKG_SOURCE_URL:=http://sourceforge.net/projects/bashdb/files/bashdb/$(PKG_VERSION)
|
||||
PKG_SOURCE_URL:=@SF/bashdb/
|
||||
PKG_MD5SUM:=b72c17870bfab2fd791b1f6de4d79f9e
|
||||
#PKG_CAT:=zcat
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=none
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Bash script debugging utility.
|
||||
URL:=http://sourceforge.net/projects/bashdb/
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
Bash script debugging utility.
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
CFLAGS="$(TARGET_CFLAGS) -DLINUX $(TARGET_CPPFLAGS) \
|
||||
-I./src" \
|
||||
LIBS="$(TARGET_LDFLAGS)" \
|
||||
DESTDIR="$(PKG_INSTALL_DIR)"
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bashdb $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/usr/share
|
||||
$(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/*.sh $(1)/usr/share/$(PKG_NAME)/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/*.inc $(1)/usr/share/$(PKG_NAME)/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/init
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/init/*.sh $(1)/usr/share/$(PKG_NAME)/init/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/command
|
||||
$(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/command/show_sub
|
||||
$(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/command/set_sub
|
||||
$(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/command/info_sub
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/command/*.sh $(1)/usr/share/$(PKG_NAME)/command/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/command/show_sub/*.sh $(1)/usr/share/$(PKG_NAME)/command/show_sub/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/command/set_sub/*.sh $(1)/usr/share/$(PKG_NAME)/command/set_sub/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/command/info_sub/*.sh $(1)/usr/share/$(PKG_NAME)/command/info_sub/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/lib
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/lib/*.sh $(1)/usr/share/$(PKG_NAME)/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,bashdb))
|
||||
@@ -1,27 +0,0 @@
|
||||
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 BBF_TR181
|
||||
bool "Enable TR-181 Data Model Support"
|
||||
default y
|
||||
|
||||
config BBF_TR104
|
||||
bool "Enable TR-104 Data Model Support"
|
||||
default y
|
||||
|
||||
config BBF_TR143
|
||||
bool "Enable TR-143 Data Model Support"
|
||||
default y
|
||||
|
||||
endif
|
||||
133
bbf/Makefile
133
bbf/Makefile
@@ -1,133 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2021 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libbbfdm
|
||||
PKG_VERSION:=4.1.2
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bbf.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=3034c1b324937fdccafa92e706e5986dc7a78df7
|
||||
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)
|
||||
|
||||
PKG_LICENSE:=LGPL-2.1
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
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
|
||||
|
||||
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 +libmbedtls +libcurl
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/config
|
||||
source "$(SOURCE)/Config_bbfdm.in"
|
||||
endef
|
||||
|
||||
define Package/libbbf_api/description
|
||||
Library contains the API(UCI, UBUS, JSON, CLI and Browse) of libbbfdm
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/description
|
||||
Library contains the data model tree. It includes TR181, TR104 and TR143 data models
|
||||
endef
|
||||
|
||||
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
|
||||
ifneq ($(USE_LOCAL),)
|
||||
define Build/Prepare
|
||||
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += -DBBF_VENDOR_LIST=\\\"$(CONFIG_BBF_VENDOR_LIST)\\\"
|
||||
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(CONFIG_BBF_VENDOR_PREFIX)\\\"
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE -D_AADJ
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR181),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-tr181
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR104),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-tr104
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR143),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-tr143
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_libopenssl),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-libopenssl
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_libmbedtls),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-libmbedtls
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBF_VENDOR_EXTENSION),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-vendor-extension
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
BBF_VENDOR_LIST="$(CONFIG_BBF_VENDOR_LIST)"
|
||||
|
||||
endif ##CONFIG_BBF_VENDOR_EXTENSION
|
||||
|
||||
define Package/libbbf_api/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbf_api.so* $(1)/lib/
|
||||
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_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)/libbbf_api/*.h $(1)/usr/include/libbbf_api/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.{a,so*} $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbf_api.{a,so*} $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libbbf_api))
|
||||
$(eval $(call BuildPackage,libbbfdm))
|
||||
@@ -1,42 +0,0 @@
|
||||
#
|
||||
# Copright (C) 2018 The Internet Foundation In Sweden
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bbk_cli
|
||||
PKG_SOURCE_VERSION:=7b810a696c78b746185c11282bdbe3fb7f8c5d4b
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/dotse/bbk.git
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/bbk_cli
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=+libpthread +libstdcpp
|
||||
TITLE:=Bredbandskollen CLI - A bandwidth measurement tool
|
||||
endef
|
||||
|
||||
define Package/bbk_cli/description
|
||||
To measure connection speed in an environment that is missing a web browser,
|
||||
for example, in a server, you can use our command line interface bbk_cli,
|
||||
which is available for some of the most common operating systems.
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C $(PKG_BUILD_DIR)/src/cli CROSS_COMPILE="$(TARGET_CROSS)"
|
||||
endef
|
||||
|
||||
define Package/bbk_cli/install
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/cli/cli $(1)/sbin/bbk_cli
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,bbk_cli))
|
||||
@@ -1,25 +0,0 @@
|
||||
diff --git a/src/framework/engine.h b/src/framework/engine.h
|
||||
index 57a48ad..9e1bc36 100644
|
||||
--- a/src/framework/engine.h
|
||||
+++ b/src/framework/engine.h
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
+#include <sys/select.h>
|
||||
|
||||
#include "logger.h"
|
||||
|
||||
diff --git a/src/framework/mk.inc b/src/framework/mk.inc
|
||||
index 793e211..13275be 100644
|
||||
--- a/src/framework/mk.inc
|
||||
+++ b/src/framework/mk.inc
|
||||
@@ -7,7 +7,7 @@ OS:=$(shell uname)
|
||||
CXXFLAGS += -O2 -W -Wall -I$(DIRLEVEL)
|
||||
|
||||
ifeq ($(OS),Linux)
|
||||
-CXX = g++
|
||||
+CXX = $(CROSS_COMPILE)g++
|
||||
endif
|
||||
|
||||
ifeq ($(OS),Darwin)
|
||||
@@ -1,46 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2007-2011 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bootchart2
|
||||
PKG_VERSION:=0.14.7
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/mmeeks/bootchart.git
|
||||
PKG_SOURCE_VERSION:=3ab81137cafe25c2ca4bc3a5f322a63646f9ce8d
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=none
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/bootchart2
|
||||
SECTION:=base
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Bootchart2
|
||||
URL:=https://github.com/mmeeks/bootchart
|
||||
endef
|
||||
|
||||
define Package/bootchart2/description
|
||||
Bootchart is a tool for performance analysis and visualization of the GNU/Linux boot process.
|
||||
endef
|
||||
|
||||
define Package/bootchart2/install
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bootchart-collector $(1)/sbin
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
|
||||
|
||||
|
||||
$(eval $(call BuildPackage,bootchart2))
|
||||
@@ -1,10 +0,0 @@
|
||||
|
||||
do_bootchart()
|
||||
{
|
||||
[ -f /dev/null ] || mknod /dev/null c 1 3
|
||||
mkdir -p /lib/bootchart/tmpfs
|
||||
echo "starting bootchart"
|
||||
/sbin/bootchart_run_preinit boot &
|
||||
}
|
||||
|
||||
boot_hook_add preinit_essential do_bootchart
|
||||
@@ -1,7 +0,0 @@
|
||||
|
||||
bootchart_rootfs_pivot()
|
||||
{
|
||||
mount -o move /rom/lib/bootchart/tmpfs /lib/bootchart/tmpfs
|
||||
}
|
||||
|
||||
boot_hook_add preinit_mount_root bootchart_rootfs_pivot
|
||||
@@ -1,59 +0,0 @@
|
||||
#! /bin/sh
|
||||
# this is intended to be started in preinit.
|
||||
# 11_bootchart, starts it
|
||||
# 72_bootchart, fixup mount point after pivot
|
||||
#
|
||||
# program can be killed early with
|
||||
# bootchart_run_preinit stop
|
||||
|
||||
trap "stop; exit 0;" SIGINT SIGTERM
|
||||
|
||||
STOP_AFTER=250
|
||||
HZ=50
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "you need to specify start or stop"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
start()
|
||||
{
|
||||
/sbin/bootchart-collector $HZ &
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
echo "bootchart DUMP"
|
||||
|
||||
mkdir /tmp/bootchart
|
||||
/sbin/bootchart-collector --dump /tmp/bootchart
|
||||
cd /tmp/bootchart
|
||||
tar -zcf /tmp/bootchart.tgz header *.log
|
||||
cd /
|
||||
rm -rf /tmp/bootchart
|
||||
}
|
||||
|
||||
case $1 in
|
||||
boot) # secret option for preinit
|
||||
start
|
||||
sleep $STOP_AFTER
|
||||
# test to see if someone has manually killed us
|
||||
if [ -f /tmp/bootchart.tgz ]
|
||||
then
|
||||
exit 0
|
||||
fi
|
||||
stop
|
||||
;;
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
*)
|
||||
echo "you need to specify start or stop, not $1"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
diff --git a/pybootchartgui/draw.py b/pybootchartgui/draw.py
|
||||
index 7c3f60c..5c9f046 100644
|
||||
--- a/pybootchartgui/draw.py
|
||||
+++ b/pybootchartgui/draw.py
|
||||
@@ -63,6 +63,7 @@ AXIS_FONT_SIZE = 11
|
||||
LEGEND_FONT_SIZE = 12
|
||||
|
||||
# CPU load chart color.
|
||||
+CPU_SYS_COLOR = (0.65, 0.13, 0.36, 1.0)
|
||||
CPU_COLOR = (0.40, 0.55, 0.70, 1.0)
|
||||
# IO wait chart color.
|
||||
IO_COLOR = (0.76, 0.48, 0.48, 0.5)
|
||||
@@ -300,21 +301,19 @@ def render_charts(ctx, options, clip, trace, curr_y, w, h, sec_w):
|
||||
# render bar legend
|
||||
ctx.set_font_size(LEGEND_FONT_SIZE)
|
||||
|
||||
- draw_legend_box(ctx, "CPU (user+sys)", CPU_COLOR, off_x, curr_y+20, leg_s)
|
||||
- draw_legend_box(ctx, "I/O (wait)", IO_COLOR, off_x + 120, curr_y+20, leg_s)
|
||||
+ draw_legend_box(ctx, "CPU (user)", CPU_COLOR, off_x, curr_y+20, leg_s)
|
||||
+ draw_legend_box(ctx, "CPU (sys)", CPU_SYS_COLOR, off_x + 120, curr_y+20, leg_s)
|
||||
+ draw_legend_box(ctx, "I/O (wait)", IO_COLOR, off_x + 120 + 120 , curr_y+20, leg_s)
|
||||
|
||||
# render I/O wait
|
||||
chart_rect = (off_x, curr_y+30, w, bar_h)
|
||||
if clip_visible (clip, chart_rect):
|
||||
draw_box_ticks (ctx, chart_rect, sec_w)
|
||||
draw_annotations (ctx, proc_tree, trace.times, chart_rect)
|
||||
- draw_chart (ctx, IO_COLOR, True, chart_rect, \
|
||||
- [(sample.time, sample.user + sample.sys + sample.io) for sample in trace.cpu_stats], \
|
||||
- proc_tree, None)
|
||||
+ draw_chart (ctx, IO_COLOR, True, chart_rect, [(sample.time, sample.user + sample.sys + sample.io) for sample in trace.cpu_stats], proc_tree, None)
|
||||
# render CPU load
|
||||
- draw_chart (ctx, CPU_COLOR, True, chart_rect, \
|
||||
- [(sample.time, sample.user + sample.sys) for sample in trace.cpu_stats], \
|
||||
- proc_tree, None)
|
||||
+ draw_chart (ctx, CPU_SYS_COLOR, True, chart_rect, [(sample.time, sample.user + sample.sys) for sample in trace.cpu_stats], proc_tree, None)
|
||||
+ draw_chart (ctx, CPU_COLOR, True, chart_rect, [(sample.time, sample.user ) for sample in trace.cpu_stats], proc_tree, None)
|
||||
|
||||
curr_y = curr_y + 30 + bar_h
|
||||
|
||||
@@ -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.1
|
||||
|
||||
PKG_SOURCE_VERSION:=e4f39d1bf4678fc05b9d02e81b194c70719909e4
|
||||
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,40 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2018 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:=catv
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=none
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/catv
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=CATV
|
||||
endef
|
||||
|
||||
define Package/catv/description
|
||||
CATV configuration utility
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
$(CP) ./files/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/catv/install
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,catv))
|
||||
@@ -1,4 +0,0 @@
|
||||
|
||||
config service 'catv'
|
||||
option enable 'no'
|
||||
option filter '3'
|
||||
@@ -1,27 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=71
|
||||
USE_PROCD=1
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
start_service() {
|
||||
local enable=0
|
||||
local filter=0
|
||||
|
||||
config_load catv
|
||||
config_get_bool enable catv enable 0
|
||||
config_get filter catv filter
|
||||
if [ $enable -eq 0 ]; then
|
||||
ubus call catv set-enable "{\"enable\":\"off\"}"
|
||||
else
|
||||
ubus call catv set-enable "{\"enable\":\"on\"}"
|
||||
fi
|
||||
ubus call catv set-filter "{\"filter\":\"$filter\"}"
|
||||
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger catv
|
||||
}
|
||||
|
||||
@@ -1,18 +1,10 @@
|
||||
#
|
||||
# Copyright (C) 2019 iopsys Software Solutions AB
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=crashlog
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=none
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
||||
@@ -4,15 +4,16 @@ START=99
|
||||
|
||||
send_log()
|
||||
{
|
||||
nr=$(db get hw.board.serial_number)
|
||||
hw=$(db get hw.board.model_name)
|
||||
fam=$(db get hw.board.iopVerFam)
|
||||
nr=$(db get hw.board.serialNumber)
|
||||
hw=$(db get hw.board.hardware)
|
||||
hwv=$(db get hw.board.hardwareVersion)
|
||||
bid=$(db get hw.board.boardId)
|
||||
sw=$(db get hw.board.iopVersion)
|
||||
server=$(/sbin/uci get system.crashlog.server)
|
||||
|
||||
while true
|
||||
do
|
||||
scp -S /usr/sbin/logssh /proc/last_kmsg log@${server}:log/${fam}_${hw}_${sw}_${nr}
|
||||
scp -S /usr/sbin/logssh /proc/last_kmsg log@${server}:log/${bid}_${hwv}_${hw}_${sw}_${nr}
|
||||
if [ $? == 0 ]
|
||||
then
|
||||
break;
|
||||
@@ -27,7 +28,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
|
||||
}
|
||||
|
||||
@@ -50,11 +50,12 @@ cat >$TMP_CORE
|
||||
# more memory to work with. normally this would do nothing.
|
||||
cat >/dev/null
|
||||
|
||||
nr=$(db get hw.board.serial_number)
|
||||
hw=$(db get hw.board.model_name)
|
||||
fam=$(hw.board.iopVerFam)
|
||||
nr=$(db get hw.board.serialNumber)
|
||||
hw=$(db get hw.board.hardware)
|
||||
hwv=$(db get hw.board.hardwareVersion)
|
||||
bid=$(db get hw.board.boardId)
|
||||
sw=$(db get hw.board.iopVersion)
|
||||
|
||||
scp -S /usr/sbin/logssh $TMP_CORE log@${server}:log/core_${1}_${2}_${fam}_${hw}_${sw}_${nr}
|
||||
scp -S /usr/sbin/logssh $TMP_CORE log@${server}:log/core_${1}_${2}_${bid}_${hwv}_${hw}_${sw}_${nr}
|
||||
rm $TMP_CORE
|
||||
|
||||
|
||||
@@ -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,82 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=crun
|
||||
PKG_VERSION:=0.18
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/containers/crun.git
|
||||
PKG_SOURCE_DATE:=2021-03-18
|
||||
PKG_SOURCE_VERSION:=496e81bdd69f117f10e4477e4204e4611a94b68f
|
||||
PKG_MIRROR_HASH:=26941b0d84bbeabeb5e982af48d131f55d0aa16f4a2f2ca3279a5c812cdeea8b
|
||||
|
||||
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/bin $(1)/usr/lib
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/crun $(1)/usr/bin/
|
||||
$(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.0.12
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=db155c063a9875026e573bbd292dec484fc3f103
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
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:=DECT Manager
|
||||
DEPENDS:= +libubox +ubus
|
||||
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,66 +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
|
||||
|
||||
# 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 rfpi=
|
||||
local opt_rfpi=
|
||||
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_rfpi="-rfpi $rfpi"
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command $PROG -comname ttyH0 -log $LOG_PATH/dect-cmbs.log $opt_rfpi
|
||||
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
|
||||
}
|
||||
|
||||
boot() {
|
||||
echo 14 > /sys/class/gpio/export
|
||||
echo out > /sys/class/gpio/gpio14/direction
|
||||
|
||||
[ ! -d $LOG_PATH ] && mkdir -p $LOG_PATH
|
||||
start
|
||||
}
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2018 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:=dslmngr
|
||||
PKG_VERSION:=1.1.0
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=d17c699c1fc9588303d6da35ac2250903bf17cd8
|
||||
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)
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
|
||||
TARGET_PLATFORM=MEDIATEK
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_linksys),y)
|
||||
TARGET_PLATFORM=MARVELL
|
||||
else ifeq ($(CONFIG_TARGET_intel_mips),y)
|
||||
TARGET_PLATFORM=INTEL
|
||||
else
|
||||
$(info Unexpected CONFIG_TARGET)
|
||||
endif
|
||||
|
||||
export TARGET_PLATFORM
|
||||
|
||||
define Package/dslmngr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=XDSL status and configration utility
|
||||
DEPENDS:=+libdsl +libuci +libubox +ubus +libpthread +libnl-genl +libeasy
|
||||
endef
|
||||
|
||||
define Package/dslmngr/description
|
||||
This package can be used to configure and provide status about
|
||||
the XDSL subsystem through UBUS.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-I$(STAGING_DIR)/usr/include/xdsl \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
MAKE_FLAGS += \
|
||||
CFLAGS="$(TARGET_CFLAGS)" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
FPIC="$(FPIC)"
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -r --exclude=.* ~/git/dslmngr/ $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Build/Compile
|
||||
+$(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS)
|
||||
endef
|
||||
|
||||
define Package/dslmngr/install
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/dslmngr $(1)/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,dslmngr))
|
||||
@@ -1,51 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2019 iopsys Software Solutions AB
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=easy-qos
|
||||
PKG_VERSION:=1.1
|
||||
PKG_RELEASE:=0
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=none
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/easy-qos
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Easy QoS
|
||||
DEPENDS:=@(TARGET_intel_mips||TARGET_iopsys_brcm63xx_arm)
|
||||
endef
|
||||
|
||||
define Package/easy-qos/description
|
||||
This package contains Easy QoS utility
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
$(CP) ./files/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/easy-qos/install
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(CP) ./files/etc/config/easy_qos $(1)/etc/config/
|
||||
ifeq ($(CONFIG_TARGET_intel_mips),y)
|
||||
$(CP) ./files/etc/init.d/easy_qos.classcfg $(1)/etc/init.d/easy_qos
|
||||
else
|
||||
$(CP) ./files/etc/init.d/easy_qos.iptables $(1)/etc/init.d/easy_qos
|
||||
endif
|
||||
$(CP) ./files/etc/uci-defaults/* $(1)/etc/uci-defaults/
|
||||
$(CP) ./files/etc/firewall.easyqos $(1)/etc/firewall.easyqos
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,easy-qos))
|
||||
@@ -1 +0,0 @@
|
||||
/etc/init.d/easy_qos reload
|
||||
@@ -1,301 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
RULE_LIST="/tmp/easy_qos_rule.list"
|
||||
CLIENT_LIST="/tmp/easy_qos_class_client.list"
|
||||
BRIDGE_INTF=""
|
||||
|
||||
[ -f /etc/profile.d/intel.sh ] && {
|
||||
. /etc/profile.d/intel.sh
|
||||
sh /etc/profile.d/intel.sh
|
||||
}
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t easy_qos_class -p debug
|
||||
}
|
||||
|
||||
exec_log() {
|
||||
${@}
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
log "Failed to create ${@}";
|
||||
fi
|
||||
}
|
||||
|
||||
exec_class_log() {
|
||||
${@} |grep -i successful
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
log "Failed to create ${@}";
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
get_priority() {
|
||||
local prio=$(echo $1|tr [A-Z] [a-z]);
|
||||
case "${prio}" in
|
||||
"lowest")
|
||||
echo 8;;
|
||||
"low")
|
||||
echo 7;;
|
||||
"besteffort")
|
||||
echo 6;;
|
||||
"normal")
|
||||
echo 5;;
|
||||
"video")
|
||||
echo 4;;
|
||||
"medium")
|
||||
echo 3;;
|
||||
"high")
|
||||
echo 2;;
|
||||
"highest")
|
||||
echo 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
get_mark() {
|
||||
local prio=$(echo $1|tr [A-Z] [a-z]);
|
||||
case "${prio}" in
|
||||
"lowest")
|
||||
echo "0x41/0x3df";;
|
||||
"low")
|
||||
echo "0x82/0x3df";;
|
||||
"besteffort")
|
||||
echo "0xc3/0x3df";;
|
||||
"normal")
|
||||
echo "0x104/0x3df";;
|
||||
"video")
|
||||
echo "0x145/0x3df";;
|
||||
"medium")
|
||||
echo "0x186/0x3df";;
|
||||
"high")
|
||||
echo "0x1c7/0x3df";;
|
||||
"highest")
|
||||
echo "0x208/0x3df";;
|
||||
esac
|
||||
}
|
||||
|
||||
clean_client_entries() {
|
||||
[ -f ${CLIENT_LIST} ] && rm ${CLIENT_LIST}
|
||||
}
|
||||
|
||||
map_client_entries() {
|
||||
local clients ip mac host
|
||||
|
||||
json_load "$(ubus call router.network 'clients')"
|
||||
json_get_keys keys
|
||||
|
||||
for key in ${keys};
|
||||
do
|
||||
json_select ${key}
|
||||
json_get_vars ipaddr macaddr hostname
|
||||
clients="${macaddr} ${ipaddr} ${hostname};${clients}"
|
||||
json_select ..
|
||||
done
|
||||
|
||||
json_init
|
||||
|
||||
IFS=";"
|
||||
for client in ${clients};
|
||||
do
|
||||
macaddr=$(echo ${client} | cut -d" " -f1)
|
||||
json_add_object "${macaddr//:/_}"
|
||||
json_add_string "ip" "$(echo ${client} | cut -d" " -f2)"
|
||||
json_add_string "macaddr" "$(echo ${client} | cut -d" " -f1)"
|
||||
json_add_string "host" "$(echo ${client} | cut -d" " -f3)"
|
||||
json_close_object
|
||||
done
|
||||
|
||||
IFS=' '
|
||||
echo `json_dump` > ${CLIENT_LIST}
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
# Find the IP of a corresponding mac from arp table
|
||||
get_ipaddress() {
|
||||
local clients ip mac host
|
||||
|
||||
json_load "$(cat ${CLIENT_LIST})"
|
||||
json_get_keys keys
|
||||
|
||||
# jshn seems a bit iffy on having : in key, replace by _
|
||||
json_select "${1//:/_}" 2 > /dev/null
|
||||
json_get_var ip ip
|
||||
|
||||
echo "$ip"
|
||||
}
|
||||
|
||||
check_and_create() {
|
||||
iptables -t mangle -C PREROUTING ${@} 2>/dev/null
|
||||
# Create rule if not exists
|
||||
if [ ${?} -ne 0 ]; then
|
||||
exec_log iptables -t mangle -A PREROUTING ${@}
|
||||
else
|
||||
log "Rule exists for ${@}"
|
||||
fi
|
||||
}
|
||||
|
||||
create_ip_rule() {
|
||||
local proto=$1; shift
|
||||
local src_ip=$1; shift
|
||||
local mark=$1; shift
|
||||
local ports=$1;
|
||||
local cmd="";
|
||||
|
||||
cmd="-j EXTMARK --set-mark ${mark}";
|
||||
if [ "${proto}" != "icmp" ]; then
|
||||
if [ -n "${ports}" ]; then
|
||||
cmd="--match multiport --dports ${ports} ${cmd}";
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${proto}" == "icmp" ]; then
|
||||
cmd="-p icmp -m icmp --icmp-type 8 $cmd"
|
||||
elif [ "${proto}" == "all" ]; then
|
||||
cmd="-p all $cmd"
|
||||
else
|
||||
cmd="-p ${proto} -m ${proto} $cmd"
|
||||
fi
|
||||
cmd="-s ${src_ip} $cmd"
|
||||
|
||||
check_and_create ${cmd}
|
||||
}
|
||||
|
||||
is_lan_bridge() {
|
||||
local _section=$1
|
||||
local _type
|
||||
local _is_lan
|
||||
|
||||
config_get _type "$section" "type"
|
||||
config_get _is_lan "$section" "is_lan"
|
||||
|
||||
if [ "${_type}" == "bridge" -a "${_is_lan}" == "1" ]; then
|
||||
BRIDGE_INTF="br-${_section}"
|
||||
fi
|
||||
}
|
||||
|
||||
get_bridge_interface() {
|
||||
config_load network
|
||||
config_foreach is_lan_bridge interface
|
||||
}
|
||||
|
||||
validate_rule_section()
|
||||
{
|
||||
uci_validate_section easy_qos rule "${1}" \
|
||||
'priority:string' \
|
||||
'macaddr:string' \
|
||||
'proto:string:none' \
|
||||
'port:list(uinteger)' \
|
||||
'comment:string:none'
|
||||
}
|
||||
|
||||
# Clear existing rules before applying new rules
|
||||
clear_existing_rules() {
|
||||
# execute the delete rules written onto a file then delete the file
|
||||
[ -f ${RULE_LIST} ] || return 0
|
||||
|
||||
while read line
|
||||
do
|
||||
log "Deleting old classification rules"
|
||||
exec_class_log classcfg -D ${line} -i ${BRIDGE_INTF}
|
||||
done <${RULE_LIST}
|
||||
|
||||
local rule=$(iptables -t mangle -S PREROUTING|grep -m 1 EXTMARK |sed 's/-A/-D/1')
|
||||
while [ -n "${rule}" ]; do
|
||||
exec_log iptables -t mangle ${rule}
|
||||
rule=$(iptables -t mangle -S PREROUTING|grep -m 1 EXTMARK |sed 's/-A/-D/1')
|
||||
done
|
||||
sync
|
||||
|
||||
[ -f ${RULE_LIST} ] && rm ${RULE_LIST}
|
||||
}
|
||||
|
||||
# classcfg -M local_dhcp -i lo -p udp --dport 67:67 --dport 68:68 -j mark --mark 1
|
||||
create_rule() {
|
||||
local proto=$1; shift
|
||||
local mac_addr=$1; shift
|
||||
local mark=$1; shift
|
||||
local ports=$1;
|
||||
local cmd="";
|
||||
# Rule name is uniqe, so we take hash of all the input as rule_name
|
||||
local rule_name="$(echo ${mac_addr}${proto}${mark}${ports} |md5sum |head -c 30)"
|
||||
|
||||
cmd="-j mark --mark ${mark}";
|
||||
|
||||
if [ "${mac_addr}" != "none" ]; then
|
||||
cmd="--smac ${mac_addr} ${cmd}";
|
||||
fi
|
||||
|
||||
if [ "${proto}" != "icmp" ]; then
|
||||
if [ "${ports}" != "none" ]; then
|
||||
IFS=","
|
||||
for port in ${ports};
|
||||
do
|
||||
cmd="--dport ${port}:${port} ${cmd}";
|
||||
done
|
||||
IFS=' '
|
||||
fi
|
||||
fi
|
||||
if [ "${proto}" != "none" ]; then
|
||||
cmd="-p ${proto} $cmd"
|
||||
fi
|
||||
cmd="-i ${BRIDGE_INTF} $cmd"
|
||||
cmd="-A ${rule_name} $cmd"
|
||||
|
||||
# Store the rule_names for cleanup on reload
|
||||
exec_class_log classcfg ${cmd}
|
||||
[ $? -eq 0 ] && \
|
||||
echo ${rule_name} >> ${RULE_LIST}
|
||||
}
|
||||
|
||||
manage_rule() {
|
||||
local cfg="$1"
|
||||
local priority macaddr proto port comment prio_num port_list ip ipmark
|
||||
|
||||
validate_rule_section "${1}" || {
|
||||
log "Validation of section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
prio_num=$(get_priority ${priority})
|
||||
port_list=$(echo ${port}|sed 's/ /,/g')
|
||||
ipmark=$(get_mark ${priority})
|
||||
ip=$(get_ipaddress ${macaddr})
|
||||
|
||||
if [ -n "${prio_num}" ]; then
|
||||
if [ "${proto}" == "none" -o "${proto}" == "tcpudp" ]; then
|
||||
create_rule tcp ${macaddr} ${prio_num} ${port_list}
|
||||
create_rule udp ${macaddr} ${prio_num} ${port_list}
|
||||
if [ -n "${ip}" ]; then
|
||||
create_ip_rule tcp ${ip} ${ipmark} ${port_list}
|
||||
create_ip_rule udp ${ip} ${ipmark} ${port_list}
|
||||
fi
|
||||
else
|
||||
create_rule ${proto} ${macaddr} ${prio_num} ${port_list}
|
||||
if [ -n "${ip}" ]; then
|
||||
create_ip_rule ${proto} ${ip} ${ipmark} ${port_list}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
get_bridge_interface
|
||||
map_client_entries
|
||||
clear_existing_rules
|
||||
config_load easy_qos
|
||||
config_foreach manage_rule rule
|
||||
clean_client_entries
|
||||
}
|
||||
|
||||
start_service() {
|
||||
[ -x /opt/intel/usr/sbin/classcfg ] || exit 0
|
||||
reload_service
|
||||
log "Easy QoS class installed"
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "easy_qos" "network"
|
||||
}
|
||||
|
||||
@@ -1,140 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t easy_qos.ebtable -p debug
|
||||
}
|
||||
|
||||
exec_log() {
|
||||
${@}
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
log "Failed to create ${@}";
|
||||
fi
|
||||
}
|
||||
|
||||
get_priority() {
|
||||
local prio=$(echo $1|tr [A-Z] [a-z]);
|
||||
case "${prio}" in
|
||||
"lowest")
|
||||
echo 0;;
|
||||
"low")
|
||||
echo 1;;
|
||||
"besteffort")
|
||||
echo 2;;
|
||||
"normal")
|
||||
echo 3;;
|
||||
"video")
|
||||
echo 4;;
|
||||
"medium")
|
||||
echo 5;;
|
||||
"high")
|
||||
echo 6;;
|
||||
"highest")
|
||||
echo 7;;
|
||||
esac
|
||||
}
|
||||
|
||||
validate_rule_section()
|
||||
{
|
||||
uci_validate_section easy_qos rule "${1}" \
|
||||
'priority:string' \
|
||||
'macaddr:string' \
|
||||
'proto:string:none' \
|
||||
'port:list(uinteger)' \
|
||||
'comment:string:none'
|
||||
}
|
||||
|
||||
# Clear existing rules before applying new rules
|
||||
clear_existing_rules() {
|
||||
local rule=$(ebtables -t broute -L BROUTING|grep -m 1 mark)
|
||||
while [ -n "${rule}" ]; do
|
||||
exec_log ebtables -t broute -D BROUTING ${rule}
|
||||
rule=$(ebtables -t broute -L BROUTING|grep -m 1 mark)
|
||||
done
|
||||
}
|
||||
|
||||
create_rule() {
|
||||
local protocol=$1; shift
|
||||
local mac=$1; shift
|
||||
local mark="0x$1"; shift
|
||||
local forward_port=$1;
|
||||
local cmd="";
|
||||
local protocol_number
|
||||
|
||||
cmd="-j mark --mark-or ${mark}";
|
||||
if [ -n "${forward_port}" ]; then
|
||||
cmd="--ip-destination-port ${forward_port} ${cmd}";
|
||||
fi
|
||||
|
||||
case "${protocol}" in
|
||||
"tcp")
|
||||
protocol_number=6;;
|
||||
"udp")
|
||||
protocol_number=17;;
|
||||
"dccp")
|
||||
protocol_number=33;;
|
||||
"sctp")
|
||||
protocol_number=132;;
|
||||
*)
|
||||
log "Protocol ${protocol} not supported in ebtables"
|
||||
return;;
|
||||
esac
|
||||
|
||||
cmd="--ip-proto ${protocol_number} $cmd"
|
||||
cmd="-p ip $cmd"
|
||||
|
||||
cmd="-s ${mac} $cmd"
|
||||
exec_log ebtables -t broute -A BROUTING ${cmd}
|
||||
}
|
||||
|
||||
manage_rule() {
|
||||
local cfg="$1"
|
||||
local priority macaddr proto port comment prio_num protocol
|
||||
|
||||
validate_rule_section "${1}" || {
|
||||
log "Validation of section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
protocol=$(echo ${proto}|tr [A-Z] [a-z])
|
||||
prio_num=$(get_priority ${priority})
|
||||
if [ -n "${macaddr}" -a -n "${prio_num}" ]; then
|
||||
for p in ${port}; do
|
||||
if [ "${protocol}" == "none" -o "${protocol}" == "tcpudp" ]; then
|
||||
create_rule tcp ${macaddr} ${prio_num} ${p}
|
||||
create_rule udp ${macaddr} ${prio_num} ${p}
|
||||
else
|
||||
create_rule ${protocol} ${macaddr} ${prio_num} ${p}
|
||||
fi
|
||||
done
|
||||
# Create rule for all ports if port is not mentioned in uci
|
||||
if [ -z "${port}" ]; then
|
||||
if [ "${protocol}" == "none" -o "${protocol}" == "tcpudp" ]; then
|
||||
create_rule tcp ${macaddr} ${prio_num}
|
||||
create_rule udp ${macaddr} ${prio_num}
|
||||
else
|
||||
create_rule ${protocol} ${macaddr} ${prio_num}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
# Do not apply rules if ebtables is not present in system
|
||||
[ -x /usr/sbin/ebtables ] || return;
|
||||
|
||||
clear_existing_rules
|
||||
config_load easy_qos
|
||||
config_foreach manage_rule rule
|
||||
}
|
||||
|
||||
start_service() {
|
||||
reload_service
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "easy_qos"
|
||||
}
|
||||
|
||||
@@ -1,186 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
CLIENT_LIST="/tmp/easy_qos_client.list"
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t easy_qos -p debug
|
||||
}
|
||||
|
||||
exec_log() {
|
||||
${@}
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
log "Failed to create ${@}";
|
||||
fi
|
||||
}
|
||||
|
||||
get_priority() {
|
||||
local prio=$(echo $1|tr [A-Z] [a-z]);
|
||||
case "${prio}" in
|
||||
"lowest")
|
||||
echo 0;;
|
||||
"low")
|
||||
echo 1;;
|
||||
"besteffort")
|
||||
echo 2;;
|
||||
"normal")
|
||||
echo 3;;
|
||||
"video")
|
||||
echo 4;;
|
||||
"medium")
|
||||
echo 5;;
|
||||
"high")
|
||||
echo 6;;
|
||||
"highest")
|
||||
echo 7;;
|
||||
esac
|
||||
}
|
||||
|
||||
clean_client_entries() {
|
||||
[ -f ${CLIENT_LIST} ] && rm ${CLIENT_LIST}
|
||||
}
|
||||
|
||||
map_client_entries() {
|
||||
local clients ip mac host
|
||||
|
||||
json_load "$(ubus call router.network 'clients')"
|
||||
json_get_keys keys
|
||||
|
||||
for key in ${keys};
|
||||
do
|
||||
json_select ${key}
|
||||
json_get_vars ipaddr macaddr hostname
|
||||
clients="${macaddr} ${ipaddr} ${hostname};${clients}"
|
||||
json_select ..
|
||||
done
|
||||
|
||||
json_init
|
||||
|
||||
# json_add_array "clients"
|
||||
IFS=";"
|
||||
for client in ${clients};
|
||||
do
|
||||
macaddr=$(echo ${client} | cut -d" " -f1)
|
||||
json_add_object "${macaddr//:/_}"
|
||||
json_add_string "ip" "$(echo ${client} | cut -d" " -f2)"
|
||||
json_add_string "macaddr" "$(echo ${client} | cut -d" " -f1)"
|
||||
json_add_string "host" "$(echo ${client} | cut -d" " -f3)"
|
||||
json_close_object
|
||||
done
|
||||
|
||||
IFS=' '
|
||||
echo `json_dump` > ${CLIENT_LIST}
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
# Find the IP of a corresponding mac from arp table
|
||||
get_ipaddress() {
|
||||
local clients ip mac host
|
||||
|
||||
json_load "$(cat ${CLIENT_LIST})"
|
||||
json_get_keys keys
|
||||
|
||||
# jshn seems a bit iffy on having : in key, replace by _
|
||||
json_select "${1//:/_}" 2 > /dev/null
|
||||
json_get_var ip ip
|
||||
|
||||
echo "$ip"
|
||||
}
|
||||
|
||||
validate_rule_section()
|
||||
{
|
||||
uci_validate_section easy_qos rule "${1}" \
|
||||
'priority:string' \
|
||||
'macaddr:string' \
|
||||
'proto:string:none' \
|
||||
'port:list(uinteger)' \
|
||||
'comment:string:none'
|
||||
}
|
||||
|
||||
# Clear existing rules before applying new rules
|
||||
clear_existing_rules() {
|
||||
local rule=$(iptables -t mangle -S PREROUTING | grep -m 1 MARK |sed 's/-A/-D/1')
|
||||
while [ -n "${rule}" ]; do
|
||||
exec_log iptables -t mangle ${rule}
|
||||
rule=$(iptables -t mangle -S PREROUTING | grep -m 1 MARK |sed 's/-A/-D/1')
|
||||
done
|
||||
}
|
||||
|
||||
check_and_create() {
|
||||
iptables -t mangle -C PREROUTING ${@} 2>/dev/null
|
||||
# Create rule if not exists
|
||||
if [ ${?} -ne 0 ]; then
|
||||
exec_log iptables -t mangle -A PREROUTING ${@}
|
||||
else
|
||||
log "Rule exists for ${@}"
|
||||
fi
|
||||
}
|
||||
|
||||
create_rule() {
|
||||
local proto=$1; shift
|
||||
local src_ip=$1; shift
|
||||
local mark="0x$1/0x$1"; shift
|
||||
local ports=$1;
|
||||
local cmd="";
|
||||
|
||||
cmd="-j MARK --set-xmark ${mark}";
|
||||
if [ -n "${ports}" ]; then
|
||||
cmd="--match multiport --dports ${ports} ${cmd}";
|
||||
fi
|
||||
|
||||
if [ "${proto}" == "icmp" ]; then
|
||||
cmd="-p icmp -m icmp --icmp-type 8 $cmd"
|
||||
elif [ "${proto}" == "all" ]; then
|
||||
cmd="-p all $cmd"
|
||||
else
|
||||
cmd="-p ${proto} -m ${proto} $cmd"
|
||||
fi
|
||||
cmd="-s ${src_ip} $cmd"
|
||||
|
||||
check_and_create ${cmd}
|
||||
}
|
||||
|
||||
manage_rule() {
|
||||
local cfg="$1"
|
||||
local priority macaddr proto port comment prio_num ip port_list
|
||||
|
||||
validate_rule_section "${1}" || {
|
||||
log "Validation of section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
prio_num=$(get_priority ${priority})
|
||||
ip=$(get_ipaddress ${macaddr})
|
||||
port_list=$(echo ${port}|sed 's/ /,/g')
|
||||
|
||||
if [ -n "${ip}" -a -n "${prio_num}" ]; then
|
||||
if [ "${proto}" == "none" -o "${proto}" == "tcpudp" ]; then
|
||||
create_rule tcp ${ip} ${prio_num} ${port_list}
|
||||
create_rule udp ${ip} ${prio_num} ${port_list}
|
||||
else
|
||||
create_rule ${proto} ${ip} ${prio_num} ${port_list}
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
clear_existing_rules
|
||||
map_client_entries
|
||||
config_load easy_qos
|
||||
config_foreach manage_rule rule
|
||||
clean_client_entries
|
||||
}
|
||||
|
||||
start_service() {
|
||||
reload_service
|
||||
echo "Easy QoS installed">/dev/console;
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "easy_qos"
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
# Add firewall include
|
||||
uci -q batch <<-EOT
|
||||
delete firewall.easyqos
|
||||
set firewall.easyqos=include
|
||||
set firewall.easyqos.path=/etc/firewall.easyqos
|
||||
set firewall.easyqos.reload=1
|
||||
commit firewall
|
||||
EOT
|
||||
@@ -1,110 +0,0 @@
|
||||
# All rights reserved.
|
||||
# See LICENSE for more information.
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=easy-soc-events
|
||||
PKG_VERSION:=1.1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/easy-soc-events.git
|
||||
PKG_SOURCE_VERSION:=5c582b0165b574dc94e4865f82e0bb91fa561754
|
||||
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)
|
||||
endif
|
||||
|
||||
|
||||
define KernelPackage/easy-soc-events/default
|
||||
SUBMENU:=Other modules
|
||||
endef
|
||||
|
||||
define KernelPackage/easy-soc-events
|
||||
$(KernelPackage/easy-soc-events/default)
|
||||
TITLE:=Helper module for netlink event notification
|
||||
FILES:=$(PKG_BUILD_DIR)/easyevent.ko
|
||||
AUTOLOAD:=$(call AutoLoad,11,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.
|
||||
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 \
|
||||
-Iarch/$(LINUX_KARCH)/include/generated \
|
||||
-Iarch/$(LINUX_KARCH)/include/generated/$(LINUX_UAPI_DIR) \
|
||||
-I$(LINUX_DIR)/include/generated/uapi \
|
||||
-Iarch/$(LINUX_KARCH)/include/$(LINUX_UAPI_DIR) \
|
||||
-include ./include/linux/kconfig.h
|
||||
|
||||
|
||||
define Build/Prepare
|
||||
$(call Build/Prepare/Default)
|
||||
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 +0,0 @@
|
||||
# libeasy configuration
|
||||
|
||||
config LIBWIFI_USE_CTRL_IFACE
|
||||
bool "Use UNIX sockets"
|
||||
default n
|
||||
@@ -1,130 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2020 iopsys Software Solutions AB
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=easy-soc-libs
|
||||
PKG_VERSION:=6.2.12
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=48b9abce9acace69a9b270ed4438b80434fc3446
|
||||
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)
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/easy-soc-libs
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=IOPSYS Easy SoC libraries
|
||||
SUBMENU:=IOPSYS Easy SoC libraries
|
||||
DEPENDS:=+libopenssl
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),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
|
||||
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
|
||||
$(info Unexpected CONFIG_TARGET, use default MAC80211)
|
||||
TARGET_PLATFORM=MAC80211
|
||||
TARGET_CFLAGS +=-DIOPSYS_MAC80211
|
||||
endif
|
||||
|
||||
export TARGET_PLATFORM
|
||||
|
||||
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
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/openssl \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3
|
||||
|
||||
MAKE_FLAGS += \
|
||||
CFLAGS="$(TARGET_CFLAGS) -Wall -I./" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
FPIC="$(FPIC)" \
|
||||
PLATFORM="$(TARGET_PLATFORM)" \
|
||||
subdirs="$(subdirs)"
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -r --exclude=.* ~/git/easy-soc-libs/ $(PKG_BUILD_DIR)/
|
||||
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_*)
|
||||
endef
|
||||
endif
|
||||
|
||||
STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell echo $(TARGET_CFLAGS) | mkhash md5)
|
||||
|
||||
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)))
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(foreach dir,$(subdirs),$(call Build/InstallDev/$(dir),$(1),$(2));)
|
||||
endef
|
||||
|
||||
define Package/easy-soc-libs/install
|
||||
:
|
||||
endef
|
||||
|
||||
$(eval $(foreach e,$(EASY_SOC_LIBS),$(call BuildPackage,$(e))))
|
||||
@@ -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,28 +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/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/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
|
||||
|
||||
46
endptcfg-open/Makefile
Normal file
46
endptcfg-open/Makefile
Normal file
@@ -0,0 +1,46 @@
|
||||
#
|
||||
# Copyright (C) 2006-2008 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:=endptcfg-open
|
||||
PKG_VERSION:=15-06-24
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://ihgsp.inteno.se/ihgsp/consumer/
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/image.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
|
||||
define Package/endptcfg-open
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Broadcom endpoint driver configuration application pre compiled for open SDK
|
||||
URL:=
|
||||
endef
|
||||
|
||||
define Package/endptcfg-open/description
|
||||
Broadcom endpoint driver configuration application pre compiled for open SDK
|
||||
endef
|
||||
|
||||
|
||||
|
||||
define Package/endptcfg-open/install
|
||||
mkdir -p $(1)/usr/bin/
|
||||
ifeq ($(CONFIG_BCM_CHIP_ID),"63138")
|
||||
$(CP) $(PKG_BUILD_DIR)/endptcfg_arm $(1)/usr/bin/endptcfg
|
||||
|
||||
else
|
||||
$(CP) $(PKG_BUILD_DIR)/endptcfg_mips $(1)/usr/bin/endptcfg
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,endptcfg-open))
|
||||
@@ -1,4 +0,0 @@
|
||||
|
||||
config ENDPT_OPEN
|
||||
bool "Use pre-compiled version for Open SDK"
|
||||
default n
|
||||
@@ -1,56 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2018 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:=endptmngr
|
||||
PKG_VERSION:=0.4
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/endptmngr.git
|
||||
PKG_SOURCE_VERSION:=b94de01a4ff24bb4d31bb16b3be9e1b1859359dd
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
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
|
||||
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/endptmngr/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Package/endptmngr
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Broadcom Voice Endpoint Manager
|
||||
URL:=
|
||||
DEPENDS:= +libubox +ubus +libpicoevent +uci +bcmkernel @TARGET_HAS_VOICE @BCM_VOICE
|
||||
endef
|
||||
|
||||
define Package/endptmngr/description
|
||||
endptmngr
|
||||
endef
|
||||
|
||||
define Package/endptmngr/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/endptmngr $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,endptmngr))
|
||||
@@ -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,19 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=95
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/ethmngr
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command ${PROG}
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2006-2010 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=fatrace
|
||||
PKG_VERSION:=0.12
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=98af6019a4a1b478a6fa35f74528cb3cd404ae40
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://git.launchpad.net/fatrace
|
||||
|
||||
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:=GPL-3.0
|
||||
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
|
||||
|
||||
PKG_CONFIG_DEPENDS := CONFIG_KERNEL_FANOTIFY
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/fatrace
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Report system wide file access events
|
||||
URL:=
|
||||
DEPENDS := +@KERNEL_FANOTIFY
|
||||
endef
|
||||
|
||||
define Package/fatrace/description
|
||||
Report system wide file access events.
|
||||
endef
|
||||
|
||||
MAKE_INSTALL_FLAGS += PREFIX="/"
|
||||
|
||||
define Package/fatrace/install
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/fatrace $(1)/sbin/
|
||||
# $(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,fatrace))
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
diff --git a/fatrace.c b/fatrace.c
|
||||
index 1c0899a..b7d1560 100644
|
||||
--- a/fatrace.c
|
||||
+++ b/fatrace.c
|
||||
@@ -44,7 +44,8 @@
|
||||
* http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=1e2ee49f7
|
||||
* O_LARGEFILE is usually 0, so hardcode it here
|
||||
*/
|
||||
-#define KERNEL_O_LARGEFILE 00100000
|
||||
+//#define KERNEL_O_LARGEFILE 00100000
|
||||
+#define KERNEL_O_LARGEFILE O_LARGEFILE
|
||||
|
||||
/* command line options */
|
||||
static char* option_output = NULL;
|
||||
@@ -1,12 +0,0 @@
|
||||
diff --git a/fatrace.c b/fatrace.c
|
||||
index b7d1560..6179272 100644
|
||||
--- a/fatrace.c
|
||||
+++ b/fatrace.c
|
||||
@@ -149,6 +149,7 @@ print_event(const struct fanotify_event_metadata *data,
|
||||
printf ("%li.%06li ", event_time->tv_sec, event_time->tv_usec);
|
||||
}
|
||||
printf ("%s(%i): %s %s\n", procname, data->pid, mask2str (data->mask), pathname);
|
||||
+ fflush(stdout);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -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:=485a38bc4eaf2a54d080b8529d5130b2955626d1
|
||||
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)))
|
||||
@@ -1,62 +0,0 @@
|
||||
# Copyright (c) 2017 Genexis B.V.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# version 2 as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=gryphon-led-kernel-module
|
||||
PKG_RELEASE:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define KernelPackage/$(PKG_NAME)
|
||||
SUBMENU:=LED modules
|
||||
TITLE:=LED driver for Gryphon
|
||||
FILES:=$(PKG_BUILD_DIR)/$(PKG_NAME).$(LINUX_KMOD_SUFFIX)
|
||||
KCONFIG:=CONFIG_PACKAGE_kmod-gryphon-led-kernel-module=y
|
||||
AUTOLOAD:=$(call AutoLoad,60,$(PKG_NAME))
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_URL:=
|
||||
endef
|
||||
|
||||
define KernelPackage/$(PKG_NAME)/description
|
||||
This package contains the LED driver for Gryphon devices.
|
||||
endef
|
||||
|
||||
EXTRA_KCONFIG:= CONFIG_RGB_LED=m
|
||||
|
||||
MODULE_INCLUDE=-I$(PKG_BUILD_DIR)
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)/kdevlinks/
|
||||
$(CP) -s `pwd`/src/* $(PKG_BUILD_DIR)/kdevlinks/
|
||||
$(CP) src/* $(PKG_BUILD_DIR)
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C "$(LINUX_DIR)" \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
ARCH="$(LINUX_KARCH)" \
|
||||
SUBDIRS="$(PKG_BUILD_DIR)" \
|
||||
EXTRA_CFLAGS="-DKERNEL_MODULE $(BUILDFLAGS) -I$(LINUX_DIR)/include -include generated/autoconf.h $(MODULE_INCLUDE)" \
|
||||
modules
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,$(PKG_NAME)))
|
||||
@@ -1,26 +0,0 @@
|
||||
# Copyright (c) 2017 Genexis B.V.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# version 2 as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
|
||||
MODULE_NAME = gryphon-led-kernel-module
|
||||
|
||||
obj-m := $(MODULE_NAME).o
|
||||
|
||||
GENEXIS_FILES= \
|
||||
main.o \
|
||||
sk9822.o \
|
||||
sk9822_bitbang.o
|
||||
|
||||
$(MODULE_NAME)-objs := $(GENEXIS_FILES)
|
||||
@@ -1,329 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017 Genexis B.V.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
#define DEBUG 1
|
||||
|
||||
#include <linux/delay.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/printk.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/gpio/consumer.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/version.h>
|
||||
|
||||
#include "sk9822.h"
|
||||
|
||||
#define DRIVER_NAME "canyon_led"
|
||||
#define DRIVER_AUTHOR "Genexis B.V."
|
||||
#define DRIVER_DESC "Canyon LED driver for SK9822"
|
||||
#define DRIVER_VERSION "1"
|
||||
|
||||
/**
|
||||
* sysfs interfaces
|
||||
*/
|
||||
|
||||
static ssize_t get_led_color(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
/* [ln] todo: dummy implementation */
|
||||
int len;
|
||||
|
||||
len = scnprintf(buf, PAGE_SIZE, "%d\n", 123);
|
||||
if (len <= 0) {
|
||||
dev_err(dev, "sk9822: Invalid sprintf len: %d\n", len);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set complete LED strip to a specific color
|
||||
* @retval count number of bytes written
|
||||
* @retval -EMSGSIZE if the message is too big
|
||||
* @retval -EIO for all other errors (e.g. leds cannot be configured)
|
||||
*/
|
||||
static ssize_t set_led_color(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t count)
|
||||
{
|
||||
int ret = 0;
|
||||
size_t buflen = count;
|
||||
struct sk9822_leds *sk9822 = dev_get_drvdata(dev);
|
||||
|
||||
if (IS_ERR(sk9822)) {
|
||||
printk(KERN_ERR "Platform get drvdata returned NULL\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* strip newline */
|
||||
if ((count > 0) && (buf[count-1] == '\n')) {
|
||||
buflen--;
|
||||
}
|
||||
|
||||
if (buflen != 6) { // RRGGBB\0
|
||||
return -EMSGSIZE;
|
||||
}
|
||||
|
||||
// Update the LED array here
|
||||
ret = sk9822_set_color_str(sk9822, buf);
|
||||
if (ret != 0) {
|
||||
printk(KERN_ERR "Failed to set led color\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
// 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_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
|
||||
};
|
||||
|
||||
static struct attribute_group sk9822_dev_attr_group = {
|
||||
.name = "sk9822",
|
||||
.attrs = sk9822_dev_attrs,
|
||||
};
|
||||
|
||||
/**
|
||||
* device prope and removal
|
||||
*/
|
||||
|
||||
static int canyon_led_probe(struct platform_device *pdev)
|
||||
{
|
||||
int ret;
|
||||
struct sk9822_leds *leds;
|
||||
|
||||
leds = devm_kzalloc(&pdev->dev, sizeof(*leds), GFP_KERNEL);
|
||||
if (!leds) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
leds->dev = &pdev->dev;
|
||||
leds->led_brightness = SK9822_DEFAULT_BRIGHTNESS;
|
||||
|
||||
ret = of_property_read_u16(pdev->dev.of_node, "led-count", &leds->led_count);
|
||||
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,
|
||||
(sizeof(cRGB) * leds->led_count), GFP_KERNEL);
|
||||
if (!leds->led_colors) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
||||
platform_set_drvdata(pdev, leds);
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 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);
|
||||
#else
|
||||
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)) {
|
||||
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);
|
||||
} else {
|
||||
printk(KERN_INFO "Got clock gpio\n");
|
||||
gpiod_set_value(leds->clock_gpio, 0);
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 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);
|
||||
#else
|
||||
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)) {
|
||||
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);
|
||||
} else {
|
||||
printk(KERN_INFO "Got data gpio\n");
|
||||
gpiod_set_value(leds->data_gpio, 0);
|
||||
}
|
||||
|
||||
printk(KERN_INFO "Attempt to set filefs stuff\n");
|
||||
ret = sysfs_create_group(&pdev->dev.kobj, &sk9822_dev_attr_group);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "sysfs creation failed\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if 0
|
||||
printk(KERN_INFO "Flash LEDs to verify they work\n");
|
||||
sk9822_set_color_str(leds, "00FF00");
|
||||
sk9822_update(leds);
|
||||
msleep(200);
|
||||
sk9822_set_color_str(leds, "000000");
|
||||
sk9822_update(leds);
|
||||
#endif
|
||||
|
||||
printk(KERN_INFO "canyon led successfully probed\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int canyon_led_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct sk9822_leds *leds;
|
||||
|
||||
sysfs_remove_group(&pdev->dev.kobj, &sk9822_dev_attr_group);
|
||||
|
||||
leds = platform_get_drvdata(pdev);
|
||||
if (IS_ERR(leds)) {
|
||||
printk(KERN_ERR "Platform get drvdata returned NULL\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (leds->clock_gpio) {
|
||||
gpiod_put(leds->clock_gpio);
|
||||
}
|
||||
|
||||
if (leds->data_gpio) {
|
||||
gpiod_put(leds->data_gpio);
|
||||
}
|
||||
|
||||
printk(KERN_NOTICE "Bye, bye\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* platform driver metadata
|
||||
*/
|
||||
|
||||
static const struct of_device_id canyon_led_of_ids[] = {
|
||||
{ .compatible = "canyon,led" },
|
||||
{ }
|
||||
};
|
||||
|
||||
static struct platform_driver canyon_led = {
|
||||
.probe = &canyon_led_probe,
|
||||
.remove = &canyon_led_remove,
|
||||
.driver = {
|
||||
.name = DRIVER_NAME,
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = canyon_led_of_ids,
|
||||
},
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(of, canyon_led_of_ids);
|
||||
module_platform_driver(canyon_led);
|
||||
MODULE_AUTHOR(DRIVER_AUTHOR);
|
||||
MODULE_DESCRIPTION(DRIVER_DESC);
|
||||
MODULE_VERSION(DRIVER_VERSION);
|
||||
MODULE_LICENSE("GPL");
|
||||
@@ -1,82 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017 Genexis B.V.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#include "sk9822.h"
|
||||
#include "sk9822_bitbang.h"
|
||||
|
||||
cRGB __hexs_to_rgb(const char *hex)
|
||||
{
|
||||
cRGB rgb;
|
||||
int r, g, b;
|
||||
|
||||
sscanf(hex, "%02x%02x%02x", &r, &g, &b);
|
||||
// This needs sanity checking
|
||||
rgb.r = r;
|
||||
rgb.g = g;
|
||||
rgb.b = b;
|
||||
return rgb;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief update the color over the given device struct to the provided HEX color
|
||||
*/
|
||||
int sk9822_set_color_str(struct sk9822_leds *sk9822, const char *hex)
|
||||
{
|
||||
int i;
|
||||
cRGB color = __hexs_to_rgb(hex);
|
||||
|
||||
for (i = 0; i < sk9822->led_count; i++) {
|
||||
sk9822->led_colors[i] = color;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief write device struct to the device
|
||||
*/
|
||||
int sk9822_update(struct sk9822_leds *sk9822)
|
||||
{
|
||||
uint16_t i;
|
||||
uint16_t led_count = sk9822->led_count;
|
||||
|
||||
// Start Frame
|
||||
sk9822_bb_write(sk9822, 0x00);
|
||||
sk9822_bb_write(sk9822, 0x00);
|
||||
sk9822_bb_write(sk9822, 0x00);
|
||||
sk9822_bb_write(sk9822, 0x00);
|
||||
|
||||
for (i = 0; i < led_count; i++) {
|
||||
cRGB *p = &sk9822->led_colors[i];
|
||||
sk9822_bb_write(sk9822, 0xe0+sk9822->led_brightness); // Maximum global brightness
|
||||
sk9822_bb_write(sk9822, p->b);
|
||||
sk9822_bb_write(sk9822, p->g);
|
||||
sk9822_bb_write(sk9822, p->r);
|
||||
}
|
||||
|
||||
// End frame
|
||||
sk9822_bb_write(sk9822, 0xff);
|
||||
sk9822_bb_write(sk9822, 0xff);
|
||||
sk9822_bb_write(sk9822, 0xff);
|
||||
sk9822_bb_write(sk9822, 0xff);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017 Genexis B.V.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef SK9822_H_
|
||||
#define SK9822_H_
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define SK9822_DEFAULT_NUM_LEDS 32 // U16, used if DT param fails
|
||||
#define SK9822_DEFAULT_BRIGHTNESS 15 // 5-bit brightness, 0-31
|
||||
|
||||
typedef struct {
|
||||
uint8_t b;
|
||||
uint8_t g;
|
||||
uint8_t r;
|
||||
} cRGB; // BGR (SK9822 Standard)
|
||||
|
||||
struct sk9822_leds {
|
||||
struct device *dev;
|
||||
struct gpio_desc *clock_gpio;
|
||||
struct gpio_desc *data_gpio;
|
||||
|
||||
cRGB *led_colors;
|
||||
uint8_t led_brightness;
|
||||
uint16_t led_count;
|
||||
};
|
||||
|
||||
int sk9822_set_color_str(struct sk9822_leds *sk9822, const char *hex);
|
||||
int sk9822_update(struct sk9822_leds *sk9822);
|
||||
|
||||
#endif /* SK9822_H_ */
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017 Genexis B.V.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <linux/gpio/consumer.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#include "sk9822.h"
|
||||
|
||||
/**
|
||||
* @brief Bitbang write operation CLOCK+DATA
|
||||
*
|
||||
* Assumed state before call: CLOCK- Low, DATA- High
|
||||
*/
|
||||
void sk9822_bb_write(struct sk9822_leds *sk9822, uint8_t c)
|
||||
{
|
||||
uint8_t i;
|
||||
|
||||
for (i = 0; i < 8 ; i++) {
|
||||
if (!(c&0x80)) {
|
||||
gpiod_set_value(sk9822->data_gpio, 0); // set data low
|
||||
} else {
|
||||
gpiod_set_value(sk9822->data_gpio, 1); // set data high
|
||||
}
|
||||
|
||||
gpiod_set_value(sk9822->clock_gpio, 1); // set clock high, data sampled here
|
||||
c <<= 1;
|
||||
udelay(1); // stretch clock
|
||||
gpiod_set_value(sk9822->clock_gpio, 0); // set clock low
|
||||
}
|
||||
|
||||
// State after call: SCK Low, Data high
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017 Genexis B.V.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _SK9822_BB_H_
|
||||
#define _SK9822_BB_H_
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#include "sk9822.h"
|
||||
|
||||
void sk9822_bb_write(struct sk9822_leds *sk9822, uint8_t c);
|
||||
|
||||
#endif /* _SK9822_BB_H_ */
|
||||
874
ice-client/Makefile
Normal file
874
ice-client/Makefile
Normal file
@@ -0,0 +1,874 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
# We use the foldername as main package name
|
||||
PKG_NAME:=ice-client
|
||||
|
||||
CFMODULES:=$(filter CONFIG_PACKAGE_$(PKG_NAME)-%,$(.VARIABLES))
|
||||
CFMODULES:=$(subst CONFIG_PACKAGE_$(PKG_NAME)-,,$(CFMODULES))
|
||||
$(info Building package: $(PKG_NAME))
|
||||
$(info Building with additional modules: $(CFMODULES))
|
||||
export CFMODULES
|
||||
|
||||
export HOME_DIR:=$(TOPDIR)
|
||||
|
||||
export PLATFORM_INCLUDE:=platforms/iopsys/build.mk
|
||||
|
||||
export DATE:=$(shell date +%Y-%m-%d-%H-%M-%S)
|
||||
export LOGIN:=$(shell whoami)
|
||||
BASE_PKG_VERSION:=3.4.0
|
||||
PKG_RELEASE:=RC6
|
||||
PKG_VERSION:=$(BASE_PKG_VERSION)-$(PKG_RELEASE)_$(DATE)_$(LOGIN)
|
||||
export PKG_VERSION
|
||||
|
||||
###########################--RELEASE--################################
|
||||
|
||||
PKG_SOURCE_URL:=ssh://git@iopsys.inteno.se/ice-client.git
|
||||
PKG_SOURCE_VERSION:=e860a7697ac8d6029cd1f75e1df9885e1d4131f5
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(BASE_PKG_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(BASE_PKG_VERSION)-$(PKG_RELEASE).tar.gz
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(BASE_PKG_VERSION)
|
||||
|
||||
|
||||
###########################--RELEASE--################################
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/ice-client/Default
|
||||
CATEGORY:=Utilities
|
||||
URL:=http://inteno.se/
|
||||
DEPENDS:= ice-client
|
||||
endef
|
||||
|
||||
define Package/ice-client
|
||||
$(call Package/ice-client/Default)
|
||||
TITLE:=ice-client
|
||||
MENU:=1
|
||||
DEPENDS:=+libopenssl +libstdcpp +libubus +ubus +ubusd +jshn +libubox +libpthread +libjson-c
|
||||
endef
|
||||
|
||||
###########################--DEVELOPMENT--################################
|
||||
# Development settings
|
||||
# Uncomment stuff Build/Prepare
|
||||
#
|
||||
# Plus make sure to comment and provide the following lines above
|
||||
# #PKG_SOURCE_URL:=ssh://git@iopsys.inteno.se/ice-client.git
|
||||
# #PKG_SOURCE_VERSION:=a11bf64e6b1054803b52750aabd71bf440ff6e16
|
||||
# #PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(BASE_PKG_VERSION)
|
||||
# #PKG_SOURCE:=$(PKG_NAME)-$(BASE_PKG_VERSION)-$(PKG_RELEASE).tar.gz
|
||||
#
|
||||
# PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(BASE_PKG_VERSION)
|
||||
#
|
||||
#
|
||||
# These settings allow you to specify a soruce folder where your source code is located
|
||||
# This avoids having to tar-zip or fetch from git each time
|
||||
# Changes can be done in your sources while the build is performed somewhere else
|
||||
# If you forget some settings, your source folder will be deleted!!! So be carefull and
|
||||
# check in or backup your sources first before doing this.
|
||||
#
|
||||
#define Build/Prepare
|
||||
# rm -rf $(PKG_BUILD_DIR)
|
||||
# ln -s /home/erik/Desktop/ice-client $(PKG_BUILD_DIR)
|
||||
## ln -s /home/erik/Desktop/checkCompilation/iopsys-client $(PKG_BUILD_DIR)
|
||||
#endef
|
||||
|
||||
###########################--DEVELOPMENT--################################
|
||||
|
||||
|
||||
#
|
||||
# Specify where and how to install the program. Since we only have one file,
|
||||
# the helloworld executable, install it by copying it to the /bin directory on
|
||||
# the router. The $(1) variable represents the root directory on the router running
|
||||
# OpenWrt. The $(INSTALL_DIR) variable contains a command to prepare the install
|
||||
# directory if it does not already exist. Likewise $(INSTALL_BIN) contains the
|
||||
# command to copy the binary file from its current location (in our case the build
|
||||
# directory) to the install directory.
|
||||
|
||||
define Build/Configure
|
||||
echo $(BASE_PKG_VERSION)-$(PKG_RELEASE) > $(PKG_BUILD_DIR)/core/version.txt
|
||||
echo $(DATE) > $(PKG_BUILD_DIR)/core/date.txt
|
||||
echo $(LOGIN) > $(PKG_BUILD_DIR)/core/login.txt
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) config
|
||||
endef
|
||||
|
||||
define Build/Clean
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) clean
|
||||
endef
|
||||
|
||||
define Package/ice-client/preinst
|
||||
#!/bin/sh
|
||||
echo "backup current config"
|
||||
cp /etc/iopsys/server.ini /tmp/iopsysserver.ini
|
||||
cp /etc/config/ice /tmp/ice.back
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client/install
|
||||
$(INSTALL_DIR) $(1)/bin
|
||||
$(CP) $(PKG_BUILD_DIR)/core/ice $(1)/bin
|
||||
$(CP) $(PKG_BUILD_DIR)/modules/system/ubusevent/obj/iopsys/ubusevent $(1)/bin
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/core/lib/{systemService.so.1.0.1,libconfStore.so.1,networkService.so.1.0.1,packageService.so.1.0.1,monitorService.so.1.0.1,iperfService.so.1.0.1,logService.so.1.0.1} $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/bin/ifs/iperf/execute
|
||||
$(INSTALL_DIR) $(1)/bin/ifs/iperf/progress
|
||||
$(INSTALL_DIR) $(1)/bin/ifs/iperf/result
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/scheduleiperf.sh $(1)/bin/ifs/iperf/execute
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/etc/config/ice $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/iopsys
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/server.ini $(1)/etc/iopsys
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/modify.ini $(1)/etc/iopsys
|
||||
$(INSTALL_DIR) $(1)/etc/iopsys/certificates
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/cert_server_ca.pem $(1)/etc/iopsys/certificates
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/inteno_root_ca.pem $(1)/etc/iopsys/certificates
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/ice-client $(1)/etc/init.d/ice-client
|
||||
endef
|
||||
|
||||
define Package/ice-client/postinst
|
||||
#!/bin/sh
|
||||
echo "Enabling rc.d symlink for iopsys"
|
||||
cp /tmp/iopsysserver.ini /etc/iopsys/server.ini
|
||||
rm -f /tmp/iopsysserver.ini
|
||||
cp /tmp/ice.back /etc/config/ice
|
||||
rm -f /tmp/ice.back
|
||||
if [ -f "/etc/rc.d/S99ice-client" ]; then
|
||||
/etc/init.d/ice-client start
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
# Additional modules
|
||||
|
||||
# Camerawatch
|
||||
define Package/ice-client-camerawatch
|
||||
$(call Package/ice-client/Default)
|
||||
TITLE:=Camerawatch
|
||||
DEPENDS+= +libjpeg
|
||||
endef
|
||||
|
||||
define Package/ice-client-camerawatch/description
|
||||
Camerawatch module for ice-client
|
||||
endef
|
||||
|
||||
define Package/ice-client-camerawatch/prerm
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
/bin/echo "system moduleRemove topic=cameramanager" > /tmp/cfin
|
||||
/bin/sleep 3
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-camerawatch/preinst
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
/bin/echo "system moduleRemove topic=cameramanager" > /tmp/cfin
|
||||
/bin/sleep 3
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-camerawatch/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/etc/iopsys
|
||||
$(CP) $(PKG_BUILD_DIR)/core/lib/camerawatch.so.1.0.1 $(1)/usr/lib
|
||||
endef
|
||||
|
||||
define Package/ice-client-camerawatch/postinst
|
||||
#!/bin/sh
|
||||
read -t 1 <>/tmp/cfout
|
||||
if [ -f /tmp/ice.pid ]; then
|
||||
/bin/echo "system moduleAdd file=camerawatch.so.1.0.1" package="ice-client-camerawatch" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
# Guest
|
||||
define Package/ice-client-guest
|
||||
$(call Package/ice-client/Default)
|
||||
TITLE:=Guest
|
||||
DEPENDS+=
|
||||
endef
|
||||
|
||||
define Package/ice-client-guest/description
|
||||
Guest module for ice-client
|
||||
endef
|
||||
|
||||
define Package/ice-client-guest/prerm
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
/bin/echo "system moduleRemove topic=guestMgr" > /tmp/cfin
|
||||
/bin/sleep 3
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-guest/preinst
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
/bin/echo "system moduleRemove topic=guestMgr" > /tmp/cfin
|
||||
/bin/sleep 3
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-guest/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/core/lib/guestService.so.1.0.1 $(1)/usr/lib
|
||||
endef
|
||||
|
||||
define Package/ice-client-guest/postinst
|
||||
#!/bin/sh
|
||||
read -t 1 <>/tmp/cfout
|
||||
if [ -f /tmp/ice.pid ]; then
|
||||
/bin/echo "system moduleAdd file=guestService.so.1.0.1" package="ice-client-guest" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
# OpenVPN
|
||||
define Package/ice-client-openvpn
|
||||
$(call Package/ice-client/Default)
|
||||
TITLE:=OpenVPN
|
||||
DEPENDS+= +openvpn
|
||||
endef
|
||||
|
||||
define Package/ice-client-openvpn/description
|
||||
OpenVPN module for ice-client
|
||||
endef
|
||||
|
||||
define Package/ice-client-openvpn/prerm
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
/bin/echo "system moduleRemove topic=ovpnMgr" > /tmp/cfin
|
||||
/bin/sleep 3
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-openvpn/preinst
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
/bin/echo "system moduleRemove topic=ovpnMgr" > /tmp/cfin
|
||||
/bin/sleep 3
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-openvpn/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/core/lib/ovpnService.so.1.0.1 $(1)/usr/lib
|
||||
endef
|
||||
|
||||
define Package/ice-client-openvpn/postinst
|
||||
#!/bin/sh
|
||||
read -t 1 <>/tmp/cfout
|
||||
if [ -f /tmp/ice.pid ]; then
|
||||
/bin/echo "system moduleAdd file=ovpnService.so.1.0.1" package="ice-client-openvpn" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
# Anyfi
|
||||
define Package/ice-client-anyfi
|
||||
$(call Package/ice-client/Default)
|
||||
TITLE:=AnyFi
|
||||
DEPENDS+=
|
||||
endef
|
||||
|
||||
define Package/ice-client-anyfi/description
|
||||
AnyFi module for ice-client
|
||||
endef
|
||||
|
||||
define Package/ice-client-anyfi/prerm
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
/bin/echo "system moduleRemove topic=anyfiMgr" > /tmp/cfin
|
||||
/bin/sleep 3
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-anyfi/preinst
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
/bin/echo "system moduleRemove topic=anyfiMgr" > /tmp/cfin
|
||||
/bin/sleep 3
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-anyfi/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/core/lib/anyfiService.so.1.0.1 $(1)/usr/lib
|
||||
endef
|
||||
|
||||
define Package/ice-client-anyfi/postinst
|
||||
#!/bin/sh
|
||||
read -t 1 <>/tmp/cfout
|
||||
if [ -f /tmp/ice.pid ]; then
|
||||
/bin/echo "system moduleAdd file=anyfiService.so.1.0.1" package="ice-client-anyfi" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
# Netrounds
|
||||
define Package/ice-client-netrounds
|
||||
$(call Package/ice-client/Default)
|
||||
TITLE:=Netrounds
|
||||
DEPENDS+=
|
||||
endef
|
||||
|
||||
define Package/ice-client-netrounds/description
|
||||
Netrounds module for ice-client
|
||||
endef
|
||||
|
||||
define Package/ice-client-netrounds/prerm
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
/bin/echo "system moduleRemove topic=netroundsMgr" > /tmp/cfin
|
||||
/bin/sleep 3
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-netrounds/preinst
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
/bin/echo "system moduleRemove topic=netroundsMgr" > /tmp/cfin
|
||||
/bin/sleep 3
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-netrounds/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/core/lib/netroundsService.so.1.0.1 $(1)/usr/lib
|
||||
endef
|
||||
|
||||
define Package/ice-client-netrounds/postinst
|
||||
#!/bin/sh
|
||||
read -t 1 <>/tmp/cfout
|
||||
if [ -f /tmp/ice.pid ]; then
|
||||
/bin/echo "system moduleAdd file=netroundsService.so.1.0.1" package="ice-client-netrounds" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
# Logreader
|
||||
define Package/ice-client-logreader
|
||||
$(call Package/ice-client/Default)
|
||||
TITLE:=LogReader
|
||||
DEPENDS+=
|
||||
endef
|
||||
|
||||
define Package/ice-client-logreader/description
|
||||
Logread module for ice-client
|
||||
endef
|
||||
|
||||
define Package/ice-client-logreader/prerm
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
/bin/echo "system moduleRemove topic=log" > /tmp/cfin
|
||||
/bin/sleep 3
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-logreader/preinst
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
/bin/echo "system moduleRemove topic=log" > /tmp/cfin
|
||||
/bin/sleep 3
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-logreader/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/core/lib/logService.so.1.0.1 $(1)/usr/lib
|
||||
endef
|
||||
|
||||
define Package/ice-client-logreader/postinst
|
||||
#!/bin/sh
|
||||
read -t 1 <>/tmp/cfout
|
||||
if [ -f /tmp/ice.pid ]; then
|
||||
echo "system moduleAdd file=logService.so.1.0.1" package="ice-client-logreader" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
|
||||
# fileme
|
||||
define Package/ice-client-fileme
|
||||
$(call Package/ice-client/Default)
|
||||
TITLE:=FileMe
|
||||
DEPENDS+= +lighttpd +samba2-client
|
||||
endef
|
||||
|
||||
define Package/ice-client-fileme/description
|
||||
FileMe module for ice-client
|
||||
endef
|
||||
|
||||
define Package/ice-client-fileme/prerm
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
echo "system moduleRemove topic=fileMeMgr" > /tmp/cfin
|
||||
/bin/sleep 2
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-fileme/preinst
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
echo "system moduleRemove topic=fileMeMgr" > /tmp/cfin
|
||||
/bin/sleep 2
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-fileme/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/core/lib/filemeService.so.1.0.1 $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/etc/iopsys/fileme/lighttpd/conf.d
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/fileme/mime.conf $(1)/etc/iopsys/fileme/lighttpd
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/fileme/conf.d/10-webdav.conf $(1)/etc/iopsys/fileme/lighttpd/conf.d
|
||||
$(INSTALL_DIR) $(1)/etc/iopsys/fileme/docroot/dav
|
||||
$(INSTALL_DIR) $(1)/etc/iopsys/fileme/docroot/shares
|
||||
endef
|
||||
|
||||
define Package/ice-client-fileme/postinst
|
||||
#!/bin/sh
|
||||
read -t 1 <>/tmp/cfout
|
||||
if [ -f /tmp/ice.pid ]; then
|
||||
echo "system moduleAdd file=filemeService.so.1.0.1" package="ice-client-fileme" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
# example
|
||||
define Package/ice-client-example
|
||||
$(call Package/ice-client/Default)
|
||||
TITLE:=example
|
||||
DEPENDS+=
|
||||
endef
|
||||
|
||||
define Package/ice-client-example/description
|
||||
example module for ice-client
|
||||
endef
|
||||
|
||||
define Package/ice-client-example/prerm
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
echo "system moduleRemove topic=example" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-example/preinst
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
echo "system moduleRemove topic=example" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-example/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/core/lib/exampleService.so.1.0.1 $(1)/usr/lib
|
||||
endef
|
||||
|
||||
define Package/ice-client-example/postinst
|
||||
#!/bin/sh
|
||||
read -t 1 <>/tmp/cfout
|
||||
if [ -f /tmp/ice.pid ]; then
|
||||
echo "system moduleAdd file=exampleService.so.1.0.1" package="ice-client-example" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
# iperf
|
||||
define Package/ice-client-iperf
|
||||
$(call Package/ice-client/Default)
|
||||
TITLE:=iperf
|
||||
DEPENDS+=
|
||||
endef
|
||||
|
||||
define Package/ice-client-iperf/description
|
||||
iperf module for ice-client
|
||||
endef
|
||||
|
||||
define Package/ice-client-iperf/prerm
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
echo "system moduleRemove topic=iperfMgr" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-iperf/preinst
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
echo "system moduleRemove topic=iperfMgr" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-iperf/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/core/lib/iperfService.so.1.0.1 $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/bin/ifs/iperf/execute
|
||||
$(INSTALL_DIR) $(1)/bin/ifs/iperf/progress
|
||||
$(INSTALL_DIR) $(1)/bin/ifs/iperf/result
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/scheduleiperf.sh $(1)/bin/ifs/iperf/execute
|
||||
endef
|
||||
|
||||
define Package/ice-client-iperf/postinst
|
||||
#!/bin/sh
|
||||
read -t 1 <>/tmp/cfout
|
||||
if [ -f /tmp/ice.pid ]; then
|
||||
echo "system moduleAdd file=iperfService.so.1.0.1" package="ice-client-iperf" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
# rshell
|
||||
define Package/ice-client-rshell
|
||||
$(call Package/ice-client/Default)
|
||||
TITLE:=rshell
|
||||
DEPENDS+=
|
||||
endef
|
||||
|
||||
define Package/ice-client-rshell/description
|
||||
rshell module for ice-client
|
||||
endef
|
||||
|
||||
define Package/ice-client-rshell/prerm
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
echo "system moduleRemove topic=rshellMgr" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-rshell/preinst
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
echo "system moduleRemove topic=rshellMgr" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-rshell/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/core/lib/rshellService.so.1.0.1 $(1)/usr/lib
|
||||
endef
|
||||
|
||||
define Package/ice-client-rshell/postinst
|
||||
#!/bin/sh
|
||||
read -t 1 <>/tmp/cfout
|
||||
if [ -f /tmp/ice.pid ]; then
|
||||
echo "system moduleAdd file=rshellService.so.1.0.1" package="ice-client-rshell" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
# rework
|
||||
define Package/ice-client-rework
|
||||
$(call Package/ice-client/Default)
|
||||
TITLE:=rework
|
||||
DEPENDS+=
|
||||
endef
|
||||
|
||||
define Package/ice-client-rework/description
|
||||
rework module for ice-client
|
||||
endef
|
||||
|
||||
define Package/ice-client-rework/prerm
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
echo "system moduleRemove topic=rework" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-rework/preinst
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
echo "system moduleRemove topic=rework" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-rework/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/core/lib/reworkService.so.1.0.1 $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/bin
|
||||
$(CP) $(PKG_BUILD_DIR)/modules/rework/sshpass-1.05/obj/iopsys/sshpass $(1)/bin
|
||||
endef
|
||||
|
||||
define Package/ice-client-rework/postinst
|
||||
#!/bin/sh
|
||||
read -t 1 <>/tmp/cfout
|
||||
if [ -f /tmp/ice.pid ]; then
|
||||
echo "system moduleAdd file=reworkService.so.1.0.1" package="ice-client-rework" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
# sip
|
||||
define Package/ice-client-sip
|
||||
$(call Package/ice-client/Default)
|
||||
TITLE:=sip
|
||||
DEPENDS+=
|
||||
endef
|
||||
|
||||
define Package/ice-client-sip/description
|
||||
sip module for ice-client
|
||||
endef
|
||||
|
||||
define Package/ice-client-sip/prerm
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
echo "system moduleRemove topic=sip" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-sip/preinst
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
echo "system moduleRemove topic=sip" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-sip/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/core/lib/sipService.so.1.0.1 $(1)/usr/lib
|
||||
endef
|
||||
|
||||
define Package/ice-client-sip/postinst
|
||||
#!/bin/sh
|
||||
read -t 1 <>/tmp/cfout
|
||||
if [ -f /tmp/ice.pid ]; then
|
||||
echo "system moduleAdd file=sipService.so.1.0.1" package="ice-client-sip" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
# monitor
|
||||
define Package/ice-client-monitor
|
||||
$(call Package/ice-client/Default)
|
||||
TITLE:=monitor
|
||||
DEPENDS+=
|
||||
endef
|
||||
|
||||
define Package/ice-client-monitor/description
|
||||
monitor module for ice-client
|
||||
endef
|
||||
|
||||
define Package/ice-client-monitor/prerm
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
echo "system moduleRemove topic=monitor" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-monitor/preinst
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
echo "system moduleRemove topic=monitor" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-monitor/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/core/lib/monitorService.so.1.0.1 $(1)/usr/lib
|
||||
endef
|
||||
|
||||
define Package/ice-client-monitor/postinst
|
||||
#!/bin/sh
|
||||
read -t 1 <>/tmp/cfout
|
||||
if [ -f /tmp/ice.pid ]; then
|
||||
echo "system moduleAdd file=monitorService.so.1.0.1" package="ice-client-monitor" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
# gigaset
|
||||
define Package/ice-client-gigaset
|
||||
$(call Package/ice-client/Default)
|
||||
TITLE:=gigaset
|
||||
DEPENDS+=
|
||||
endef
|
||||
|
||||
define Package/ice-client-gigaset/description
|
||||
gigaset module for ice-client
|
||||
endef
|
||||
|
||||
define Package/ice-client-gigaset/prerm
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
echo "system moduleRemove topic=gigaset" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-gigaset/preinst
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
echo "system moduleRemove topic=gigaset" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-gigaset/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/core/lib/gigasetService.so.1.0.1 $(1)/usr/lib
|
||||
endef
|
||||
|
||||
define Package/ice-client-gigaset/postinst
|
||||
#!/bin/sh
|
||||
read -t 1 <>/tmp/cfout
|
||||
if [ -f /tmp/ice.pid ]; then
|
||||
echo "system moduleAdd file=gigasetService.so.1.0.1" package="ice-client-gigaset" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
# This line executes the necessary commands to compile our program.
|
||||
# The above define directives specify all the information needed, but this
|
||||
# line calls BuildPackage which in turn actually uses this information to
|
||||
# build a package.
|
||||
$(eval $(call BuildPackage,ice-client))
|
||||
$(eval $(call BuildPackage,ice-client-guest))
|
||||
$(eval $(call BuildPackage,ice-client-camerawatch))
|
||||
$(eval $(call BuildPackage,ice-client-openvpn))
|
||||
$(eval $(call BuildPackage,ice-client-anyfi))
|
||||
$(eval $(call BuildPackage,ice-client-netrounds))
|
||||
$(eval $(call BuildPackage,ice-client-logreader))
|
||||
$(eval $(call BuildPackage,ice-client-fileme))
|
||||
$(eval $(call BuildPackage,ice-client-example))
|
||||
$(eval $(call BuildPackage,ice-client-iperf))
|
||||
$(eval $(call BuildPackage,ice-client-rshell))
|
||||
$(eval $(call BuildPackage,ice-client-rework))
|
||||
$(eval $(call BuildPackage,ice-client-sip))
|
||||
$(eval $(call BuildPackage,ice-client-monitor))
|
||||
$(eval $(call BuildPackage,ice-client-gigaset))
|
||||
@@ -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"
|
||||
@@ -20,4 +24,3 @@ config CWMP_DEVEL_DEBUG
|
||||
default n
|
||||
|
||||
endif
|
||||
|
||||
86
icwmp/Makefile
Executable file → Normal file
86
icwmp/Makefile
Executable file → Normal file
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2020 iopsys Software Solutions AB
|
||||
# Copyright (C) 2012 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
@@ -8,18 +8,19 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=7.0.1-2021-04-15
|
||||
PKG_VERSION:=3.0-2015-11-10
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
|
||||
ifeq ($(CONFIG_BCM_OPEN),y)
|
||||
PKG_SOURCE_URL:=http://ihgsp.inteno.se/git/freecwmp.git
|
||||
else
|
||||
PKG_SOURCE_URL:=ssh://git@iopsys.inteno.se/freecwmp.git
|
||||
endif
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=f70cc81e5688e32aa82084faae5bc6ff710bb81b
|
||||
PKG_SOURCE_VERSION:=8d34c241548a21b6462df5d16906824685fe916c
|
||||
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
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_CWMP_ACS_MULTI \
|
||||
@@ -27,26 +28,39 @@ 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/Default
|
||||
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
|
||||
DEPENDS:=+libuci +libmicroxml +libubox +jshn +libubus +libblobmsg-json +libpthread +ubusd +shflags +getopt
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
define Package/icwmp/description
|
||||
A free client implementation of CWMP (TR-069) protocol
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
source "$(SOURCE)/Config_cwmp.in"
|
||||
define Package/icwmp-curl
|
||||
$(call Package/icwmp/Default)
|
||||
TITLE+= (using libcurl)
|
||||
DEPENDS+= +libcurl
|
||||
VARIANT:=curl
|
||||
endef
|
||||
|
||||
define Package/icwmp-zstream
|
||||
$(call Package/icwmp/Default)
|
||||
TITLE+= (using libzstream)
|
||||
DEPENDS+= +libzstream
|
||||
VARIANT:=zstream
|
||||
endef
|
||||
|
||||
define Package/icwmp-zstream/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
|
||||
@@ -58,7 +72,7 @@ endif
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE -D_AADJ
|
||||
|
||||
|
||||
ifneq ($(CWMP_REVISION)_,_)
|
||||
ifneq ($(CWMP_REVISION),exported)
|
||||
ifneq ($(CWMP_REVISION),Unversioned directory)
|
||||
@@ -76,6 +90,17 @@ CONFIGURE_ARGS += \
|
||||
--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 += \
|
||||
--enable-acs=multi
|
||||
@@ -96,15 +121,32 @@ 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
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmpd $(1)/usr/sbin/
|
||||
$(CP) ./files/* $(1)/
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/icwmpd $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/cwmp $(1)/etc/config
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/dmmap $(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_BIN) $(PKG_BUILD_DIR)/init/icwmpd.init $(1)/etc/init.d/icwmpd
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uci-defaults/90-cwmpfirewall $(1)/etc/uci-defaults/90-cwmpfirewall
|
||||
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
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/iwepkeygen $(1)/usr/sbin/iwepkeygen
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/watchicwmpd.sh $(1)/usr/sbin/watchicwmpd
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/postinst
|
||||
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
|
||||
@@ -112,7 +154,7 @@ define Package/$(PKG_NAME)/postinst
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/prerm
|
||||
define Package/icwmp-$(BUILD_VARIANT)/prerm
|
||||
#!/bin/sh
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
echo "Disabling rc.d symlink for icwmpd"
|
||||
@@ -121,4 +163,6 @@ define Package/$(PKG_NAME)/prerm
|
||||
exit 0
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
||||
$(eval $(call BuildPackage,icwmp-curl))
|
||||
$(eval $(call BuildPackage,icwmp-zstream))
|
||||
|
||||
136
icwmp/README
Normal file
136
icwmp/README
Normal file
@@ -0,0 +1,136 @@
|
||||
1)Build
|
||||
Requirements<74>:
|
||||
librairies:
|
||||
- libuci.so
|
||||
- libexpat.so
|
||||
- libcurl.so
|
||||
- libpthread.so
|
||||
- libopenssl.so
|
||||
- libz.so
|
||||
- libcrypto.so
|
||||
the librairies should be present in the "staging_dir/target-i386_uClibc-0.9.30.1/usr/lib/" or "staging_dir/toolchain-mips_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/lib"
|
||||
|
||||
header files and folders:
|
||||
- expat.h
|
||||
- expat_external.h
|
||||
- uci.h
|
||||
- uci_config.h
|
||||
- zlib.h
|
||||
- curl folder
|
||||
- openssl folder
|
||||
the header files and folders should be present in the staging_dir/target-i386_uClibc-0.9.30.1/usr/include/ or staging_dir/toolchain-i386_gcc-4.1.2_uClibc-0.9.30.1/usr/include/
|
||||
|
||||
|
||||
if a librairie doesn't exist:
|
||||
a- run make menuconfig and select the librarie
|
||||
b- build the librarie package
|
||||
|
||||
2) Build
|
||||
|
||||
this software is composed of 3 packages:
|
||||
- icwmp package: contains icwmpd daemon
|
||||
- cwmp lib package: contains cwmplib and contains cwmp_value_change binary. They could be used by other user space applications in order to notify the icwmp daemon when paramter changes
|
||||
- cwmp kernel package: contains cwmp kernel module. This module could be used by other kernel modules to notify the icwmpd daemon when kernel parameter changes
|
||||
|
||||
The three packages should be selected in the make menu config in order to get the three packages compiled.
|
||||
To compile the three packages: $ make package/cwmpd/compile
|
||||
|
||||
3) OpenWRT settings
|
||||
in the OpenWRT, Add the following lines in the /usr/share/udhcpc/default.script file:
|
||||
uci_set_state provisioning iup tr069url "$url"
|
||||
uci_set_state provisioning iup provisioningcode "$provisioningcode"
|
||||
|
||||
4) Run
|
||||
Requirements:
|
||||
- libuci package should be installed
|
||||
- libexpat package should be installed
|
||||
- libcurl package should be installed
|
||||
- libpthread package should be installed
|
||||
- libopenssl package should be installed
|
||||
- libz package should be installed
|
||||
- libcrypto package should be installed
|
||||
|
||||
Configure the acs url in the /etc/config/icwmp
|
||||
and then start the cwmpd service: /etc/init.d/icwmpd start
|
||||
for the help: /etc/init.d/icwmpd
|
||||
|
||||
5) Value Change
|
||||
|
||||
5.1) value change for user space applications (using the libcwmp)
|
||||
|
||||
Before using the libcwmp, we should check that the libcwmp package is selected in "make menu config". and we should check that the package is compiled.
|
||||
The libcwmp should be installed uin the OpenWRT firmware
|
||||
|
||||
example of using libcwmp
|
||||
in myapplication.c
|
||||
|
||||
#...
|
||||
#include <cwmp_lib.h>
|
||||
#...
|
||||
|
||||
int anyfunction ()
|
||||
{
|
||||
.....
|
||||
/* parameter change here */
|
||||
/* so we inform the icwmp: */
|
||||
lib_api_cwmp_value_change_call (3, "InternetGatewayDevice.LANDevice.{i}.LANHostConfigManagement.IPInterface.{i}.IPInterfaceIPAddress","lan2","3");
|
||||
.....
|
||||
/*
|
||||
Description of lib_api_cwmp_value_change_call input parameters
|
||||
parameter 1 : is the number of input string in the function lib_api_cwmp_value_change_call
|
||||
parameter 2 : is the parameter path
|
||||
parameter 3 : is the first correspondence related to the first indice
|
||||
parameter 4 : is the second correspondence related to the second indice
|
||||
.
|
||||
.
|
||||
.
|
||||
parameter n : is the (n-2) correspondence related to the (n-2) indice
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
5.2) value change for user space applications (using the cwmp_value_change CLI)
|
||||
|
||||
Before using the libcwmp, we should check that the libcwmp package is selected in "make menu config". and we should check that the package is compiled.
|
||||
The libcwmp should be installed uin the OpenWRT firmware
|
||||
|
||||
in OpenWRT:
|
||||
|
||||
root@OpenWrt:~# cwmp_value_change InternetGatewayDevice.LANDevice.{i}.LANHostConfigManagement.IPInterface.{i}.IPInterfaceIPAddress "lan2" "3"
|
||||
|
||||
in this case the command will force cwmp client to send a notification to the ACS (if and only if the parameter path as configured as active or as passive parameter using the setAttributeParameter method)
|
||||
|
||||
5.3) value change for kernel space modules
|
||||
Before using the cwmp kernel module for value change, we should check that the kernel module package is selected in "make menu config". and we should check that the package is compiled.
|
||||
The kernel module should be installed uin the OpenWRT firmware and should be insert before all other kernel modules
|
||||
|
||||
example of using cwmp kernel module
|
||||
in mykernelmodule.c
|
||||
|
||||
#...
|
||||
#include <linux/cwmp_kernel.h>
|
||||
#...
|
||||
|
||||
int anykernelfunction ()
|
||||
{
|
||||
.....
|
||||
/* parameter change here */
|
||||
/* so we inform the cwmp: */
|
||||
kernel_api_cwmp_value_change_call (3, "InternetGatewayDevice.LANDevice.{i}.LANHostConfigManagement.IPInterface.{i}.IPInterfaceIPAddress","lan2","3");
|
||||
.....
|
||||
/*
|
||||
Description of lib_api_cwmp_value_change_call input parameters
|
||||
parameter 1 : is the number of input string in the function lib_api_cwmp_value_change_call
|
||||
parameter 2 : is the parameter path
|
||||
parameter 3 : is the first correspondence related to the first indice
|
||||
parameter 4 : is the second correspondence related to the second indice
|
||||
.
|
||||
.
|
||||
.
|
||||
parameter n : is the (n-2) correspondence related to the (n-2) indice
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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 ubus_socket '/var/run/ubus.sock'
|
||||
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'
|
||||
|
||||
config lwn 'lwn'
|
||||
option enable '1'
|
||||
option hostname ''
|
||||
option port '0'
|
||||
@@ -1,21 +0,0 @@
|
||||
#created by the icwmp package
|
||||
zone_name=""
|
||||
port=""
|
||||
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
|
||||
#iptables -I FW_ZONE -p tcp -s ACS_ADDRESS --dport PORT -j ACCEPT --comment "Open ACS port"
|
||||
@@ -1,87 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions/network.sh
|
||||
|
||||
[ "$ACTION" == "ifup" ] || exit 0
|
||||
|
||||
[ -f /etc/config/cwmp ] || exit 0
|
||||
|
||||
handle_icwmp_restart() {
|
||||
[ -f /tmp/switching_mode ] && exit 0
|
||||
[ -f /tmp/wificontrol.txt -a -f /tmp/netmode-conf.pid ] && exit 0
|
||||
|
||||
[ "$INTERFACE" == "loopback" ] && exit 0
|
||||
|
||||
local defwan=$(uci -q get cwmp.cpe.default_wan_interface)
|
||||
[ -n "$defwan" -a "$(uci -q get network.$defwan)" == "interface" -a "$defwan" != "$INTERFACE" ] && exit 0
|
||||
|
||||
local islan="$(uci -q get network.$INTERFACE.is_lan)"
|
||||
[ "$islan" == "1" ] && exit 0
|
||||
|
||||
local proto="$(uci -q get network.$INTERFACE.proto)"
|
||||
[ "$proto" == "none" ] && exit 0
|
||||
|
||||
local ifname="$(uci -q get network.$INTERFACE.ifname)"
|
||||
[ "${ifname:0:1}" == "@" ] && exit 0
|
||||
|
||||
mkdir -p /tmp/ipv4
|
||||
|
||||
network_flush_cache
|
||||
|
||||
local previpaddr=""
|
||||
local curipaddr=""
|
||||
local ipaddrfile=/tmp/ipv4/$INTERFACE-ipaddr
|
||||
previpaddr=$(cat $ipaddrfile 2>/dev/null)
|
||||
network_get_ipaddr curipaddr $INTERFACE
|
||||
[ -n "$curipaddr" ] && echo $curipaddr > $ipaddrfile || rm -f $ipaddrfile
|
||||
|
||||
local prevgateway=""
|
||||
local curgateway=""
|
||||
local gatewayfile=/tmp/ipv4/$INTERFACE-gateway
|
||||
prevgateway=$(cat $gatewayfile 2>/dev/null)
|
||||
network_get_gateway curgateway $INTERFACE
|
||||
[ -n "$curgateway" ] && echo $curgateway > $gatewayfile || rm -f $gatewayfile
|
||||
|
||||
local prevsubnets=""
|
||||
local cursubnets=""
|
||||
local subnetsfile=/tmp/ipv4/$INTERFACE-subnets
|
||||
prevsubnets=$(cat $subnetsfile 2>/dev/null)
|
||||
network_get_subnets cursubnets $INTERFACE
|
||||
[ -n "$cursubnets" ] && echo $cursubnets > $subnetsfile || rm -f $subnetsfile
|
||||
|
||||
local prevdnsservers=""
|
||||
local curdnsservers=""
|
||||
local dnsserverfile=/tmp/ipv4/$INTERFACE-dnsservers
|
||||
prevdnsservers=$(cat $dnsserverfile 2>/dev/null)
|
||||
network_get_dnsserver curdnsservers $INTERFACE
|
||||
[ -n "$curdnsservers" ] && echo $curdnsservers > $dnsserverfile || rm -f $dnsserverfile
|
||||
|
||||
local prevdev=""
|
||||
local curdev=""
|
||||
local devfile=/tmp/ipv4/$INTERFACE-dev
|
||||
prevdev=$(cat $devfile 2>/dev/null)
|
||||
network_get_device curdev $INTERFACE
|
||||
[ -n "$curdev" ] && echo $curdev > $devfile || rm -f $devfile
|
||||
|
||||
local prevopt43url=""
|
||||
local curopt43url=""
|
||||
local opt43urlfile=/tmp/ipv4/$INTERFACE-opt43url
|
||||
prevopt43url=$(cat $opt43urlfile 2>/dev/null)
|
||||
curopt43url="$(uci -P /var/state -q get cwmp.acs.dhcp_url)"
|
||||
[ -n "$curopt43url" ] && echo $curopt43url > $opt43urlfile || rm -f $opt43urlfile
|
||||
|
||||
[ \
|
||||
"$prevdev" == "$curdev" -a \
|
||||
"$previpaddr" = "$curipaddr" -a \
|
||||
"$prevgateway" = "$curgateway" -a \
|
||||
"$prevsubnets" = "$cursubnets" -a \
|
||||
"$prevdnsservers" = "$curdnsservers" \
|
||||
] && {
|
||||
[ "$prevopt43url" = "$curopt43url" ] && exit 0
|
||||
[ -z "$prevopt43url" ] && exit 0
|
||||
}
|
||||
|
||||
/etc/init.d/icwmpd reload &
|
||||
}
|
||||
|
||||
handle_icwmp_restart
|
||||
@@ -1,189 +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"
|
||||
|
||||
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 -P /var/state -q get cwmp.acs.dhcp_url)"
|
||||
|
||||
if [ "$acs_dhcp_discovery" == "enable" -a -n "$dhcp_url" -o -z "$url" ]; then
|
||||
url="$dhcp_url"
|
||||
echo "ACS URL from DHCP server: $url"
|
||||
[ -n "$url" ] && uci -P /var/state -q set cwmp.acs.url="$url" || url="$default_acs"
|
||||
elif [ -n "$url" ];then
|
||||
url="$(uci -q get cwmp.acs.url)"
|
||||
echo "ACS URL from configuration: $url"
|
||||
else
|
||||
url="$default_acs"
|
||||
echo "Using default ACS URL: $url"
|
||||
[ -n "$url" ] && uci -P /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
|
||||
echo "Waiting for discovery of ACS URL from dhcp server ..."
|
||||
while [ $tm -le $time ]
|
||||
do
|
||||
acs_url=`uci -P /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
|
||||
}
|
||||
|
||||
start_service() {
|
||||
if [ ! -f /tmp/.icwmpd_boot ]; then
|
||||
touch /etc/icwmpd/.icwmpd_boot
|
||||
touch /tmp/.icwmpd_boot
|
||||
else
|
||||
[ -f /sbin/netifd ] && echo "Waiting for Network to be started ..." && ubus -t 5 wait_for network.interface
|
||||
[ -f /etc/config/wireless ] && echo "Waiting for WiFi to be started ..." && ubus -t 5 wait_for network.wireless
|
||||
[ -f /usr/sbin/dnsmasq ] && echo "Waiting for DNS Proxy to be started ..." && ubus -t 5 wait_for dnsmasq
|
||||
[ -f /etc/config/dhcp ] && echo "Waiting for DNS Server(s) ..." && wait_for_resolvfile 20
|
||||
[ -f /usr/sbin/asterisk ] && echo "Waiting for Voice to be started ..." && ubus -t 5 wait_for asterisk
|
||||
|
||||
config_load cwmp
|
||||
set_wan_interface
|
||||
wait_for_option43 20
|
||||
get_acs_url
|
||||
|
||||
procd_open_instance
|
||||
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 "3" "7" "0"
|
||||
procd_close_instance
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_config_trigger "config.change" "cwmp" /etc/init.d/icwmpd reload
|
||||
}
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
# Copy defaults by the factory to the cwmp UCI user section.
|
||||
|
||||
|
||||
# Get factory base MAC.
|
||||
baseMac=$(db -q get hw.board.basemac)
|
||||
|
||||
# Erase colon and space characters.
|
||||
baseMac=${baseMac//:/}
|
||||
baseMac=${baseMac// /}
|
||||
|
||||
# Caseing and fixed length string.
|
||||
mac=$(printf "%12.12X" $((0x$baseMac)))
|
||||
|
||||
# Get system serial number.
|
||||
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)
|
||||
|
||||
# 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,54 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
set_cwmp_reqopts() {
|
||||
### Ask for DHCP Option 43 only if CWMP is enabled ###
|
||||
local wan=$(uci -q get cwmp.cpe.default_wan_interface)
|
||||
local dhcp_discovery=$(uci -q get cwmp.acs.dhcp_discovery)
|
||||
local discovery=0
|
||||
case $dhcp_discovery in
|
||||
enable|1) discovery=1 ;;
|
||||
esac
|
||||
|
||||
local newreqopts=
|
||||
local baseopts=
|
||||
local reqopts="$(uci -q get network.$wan.reqopts)"
|
||||
local proto="$(uci -q get network.$wan.proto)"
|
||||
local tropts="43"
|
||||
local oldreqopts="$reqopts"
|
||||
local ropt iopt
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
43) ;;
|
||||
*) baseopts="$baseopts $ropt" ;;
|
||||
esac
|
||||
done
|
||||
ropt=""
|
||||
reqopts="$baseopts $tropts"
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
43) [ $discovery -eq 1 ] && newreqopts="$newreqopts $ropt" ;;
|
||||
*) newreqopts="$newreqopts $ropt" ;;
|
||||
esac
|
||||
done
|
||||
if [ "$proto" == "dhcp" ]; then
|
||||
newreqopts="$(echo $newreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')"
|
||||
oldreqopts="$(echo $oldreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')"
|
||||
[ "$newreqopts" == "$oldreqopts" ] && return
|
||||
uci -q set network.$wan.reqopts="$newreqopts"
|
||||
uci commit network
|
||||
fi
|
||||
}
|
||||
|
||||
regenerate_ssl_link(){
|
||||
local cert_dir="/etc/ssl/certs"
|
||||
local all_file=$(ls $cert_dir/*.pem)
|
||||
for cfile in $all_file
|
||||
do
|
||||
ln -s $cfile $cert_dir/$(openssl x509 -hash -noout -in $cfile).0
|
||||
done
|
||||
}
|
||||
|
||||
set_cwmp_reqopts
|
||||
regenerate_ssl_link
|
||||
@@ -1 +0,0 @@
|
||||
/etc/icwmpd/.icwmpd_backup_session.xml
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# As part of sysupgrade we copy CWMP Backup Session XML file.
|
||||
|
||||
|
||||
# Abort on any error.
|
||||
set -e
|
||||
|
||||
|
||||
# Do nothing if user want to discard old settings.
|
||||
if [ -n "$SAVE_CONFIG" ] && [ $SAVE_CONFIG -eq 0 ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Source functions.
|
||||
for f in /lib/upgrade/iopsys*.sh; do
|
||||
[ -r "$f" -a -s "$f" ] || continue
|
||||
source $f
|
||||
done
|
||||
|
||||
|
||||
if [ -s "${2}/etc/icwmpd/.icwmpd_backup_session.xml" ]; then
|
||||
cat "${2}/etc/icwmpd/.icwmpd_backup_session.xml" > "/etc/icwmpd/.icwmpd_backup_session.xml"
|
||||
fi
|
||||
|
||||
# Report success.
|
||||
log "post-hooks" "CWMP Backup Session XML file migrated"
|
||||
|
||||
exit 0
|
||||
@@ -1,29 +0,0 @@
|
||||
if PACKAGE_ieee1905 || PACKAGE_lib1905al
|
||||
|
||||
menu "developer/debug options"
|
||||
|
||||
config IEEE1905_MAP_COMPLETE_NETWORK
|
||||
bool "Create network topology for complete network"
|
||||
default n
|
||||
|
||||
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
|
||||
endmenu
|
||||
endif
|
||||
@@ -1,142 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2019 Iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=2.1.44
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=33d05c2223023ce5b57001008555bd0f82e88541
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ieee1905.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/ieee1905
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=IEEE1905 daemon
|
||||
DEPENDS:= +libuci +libjson-c +libieee1905 +ubox +libpcap +libopenssl +libwifi +libeasy
|
||||
endef
|
||||
|
||||
define Package/ieee1905/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Package/ieee1905/description
|
||||
IEEE1905 stack with extended functionalities.
|
||||
endef
|
||||
|
||||
define Package/libieee1905
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=IEEE1905 cmdu tlv utility library
|
||||
endef
|
||||
|
||||
define Package/libwsc
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Wifi Simple Configuration building and processing library
|
||||
DEPENDS= +libopenssl +libuci +libubus
|
||||
endef
|
||||
|
||||
define Package/lib1905hle
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=IEEE1905 hle stack library
|
||||
endef
|
||||
|
||||
LIBS := \
|
||||
$(if $(CONFIG_PACKAGE_libwsc),libwsc.so)
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-D_GNU_SOURCE \
|
||||
-fstrict-aliasing \
|
||||
-Wall \
|
||||
-Wextra
|
||||
|
||||
MAKE_FLAGS += \
|
||||
LIBS="$(LIBS)"
|
||||
|
||||
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_MAP_COMPLETE_NETWORK),y)
|
||||
TARGET_CFLAGS += -DIEEE1905_MAP_COMPLETE_NETWORK
|
||||
endif
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/ieee1905/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/ieee1905/install
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/ieee1905
|
||||
$(INSTALL_DIR) $(1)/usr/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) ./files/etc/init.d/ieee1905 $(1)/etc/init.d/ieee1905
|
||||
$(INSTALL_DATA) ./files/etc/config/ieee1905 $(1)/etc/config/ieee1905
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ieee1905d $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
define Package/lib1905hle/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/lib1905hle.so $(1)/usr/lib/lib1905hle.so
|
||||
endef
|
||||
|
||||
define Package/libieee1905/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/libieee1905.so $(1)/usr/lib/libieee1905.so
|
||||
endef
|
||||
|
||||
define Package/libwsc/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/libwsc.so $(1)/usr/lib/libwsc.so
|
||||
endef
|
||||
|
||||
define Build/InstallDev/libwsc.so
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libwsc/include/wsc.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/libwsc.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/include/ieee1905
|
||||
$(INSTALL_DIR) $(1)/usr/include/ieee1905
|
||||
$(INSTALL_DIR) $(1)/usr/include/lib1905hle
|
||||
$(CP) $(PKG_BUILD_DIR)/include/*.h $(1)/usr/include/ieee1905/
|
||||
$(CP) $(PKG_BUILD_DIR)/libieee1905/include/*.h $(1)/usr/include/ieee1905/
|
||||
$(CP) $(PKG_BUILD_DIR)/lib1905hle/include/*.h $(1)/usr/include/lib1905hle/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/libieee1905.so $(1)/usr/lib
|
||||
$(foreach lib,$(LIBS),$(call Build/InstallDev/$(lib),$(1),$(2));)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libieee1905))
|
||||
$(eval $(call BuildPackage,lib1905hle))
|
||||
$(eval $(call BuildPackage,libwsc))
|
||||
$(eval $(call BuildPackage,ieee1905))
|
||||
@@ -1,17 +0,0 @@
|
||||
config ieee1905 'ieee1905'
|
||||
option enabled '1'
|
||||
option debug true
|
||||
option debug_level 2
|
||||
option macaddress 'auto'
|
||||
option registrar 0
|
||||
option cmdu_event 1
|
||||
option map_plugin 1
|
||||
|
||||
config security 'security'
|
||||
list method 'PBC'
|
||||
|
||||
config al-iface
|
||||
option enabled 1
|
||||
option ifname 'br-lan'
|
||||
option media 'bridge'
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=96
|
||||
STOP=22
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/ieee1905d
|
||||
|
||||
validate_ieee1905_section()
|
||||
{
|
||||
uci_validate_section ieee1905 ieee1905 "${1}" \
|
||||
'debug:bool:false' \
|
||||
'enabled:bool:false'
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
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
|
||||
}
|
||||
|
||||
service_running() {
|
||||
ubus -t 2 wait_for wifi
|
||||
}
|
||||
|
||||
start_service() {
|
||||
|
||||
[ -d /usr/lib/ieee1905 ] || mkdir -p /usr/lib/ieee1905
|
||||
|
||||
procd_open_instance ieee1905
|
||||
procd_set_param command ${PROG}
|
||||
configure_ieee1905 "ieee1905"
|
||||
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"
|
||||
procd_add_reload_trigger "ieee1905"
|
||||
}
|
||||
39
ifsi/Makefile
Normal file
39
ifsi/Makefile
Normal file
@@ -0,0 +1,39 @@
|
||||
#
|
||||
# Copyright (C) 2015 Inteno
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=ifsi
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
LDFLAGS+= \
|
||||
-Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
|
||||
-Wl,-rpath-link=$(STAGING_DIR)/lib
|
||||
|
||||
define Package/ifsi
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=+ubus +libubox
|
||||
TITLE:=Inteno Functional Script Interface
|
||||
endef
|
||||
|
||||
define Package/ifsi/description
|
||||
Inteno Functional Script Interface
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
define Package/ifsi/install
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ifsi $(1)/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ifsi))
|
||||
17
ifsi/src/Makefile
Normal file
17
ifsi/src/Makefile
Normal file
@@ -0,0 +1,17 @@
|
||||
CC = gcc
|
||||
CFLAGS = -g -Wall
|
||||
LOCLIBS =
|
||||
LIBS = -lubus -lubox -lblobmsg_json
|
||||
OBJS = ifsi.o
|
||||
SRCS = ifsi.c
|
||||
LIBSRCS =
|
||||
ISRCS =
|
||||
|
||||
all: ifsi
|
||||
|
||||
ifsi: ${OBJS}
|
||||
${CC} ${LDFLAGS} ${LIBSRCS} -o ifsi ${OBJS} ${LIBS}
|
||||
|
||||
clean:
|
||||
rm -f ifsi *.o
|
||||
|
||||
74
ifsi/src/ifsi.c
Normal file
74
ifsi/src/ifsi.c
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* ifsi -- Inteno functional script interface
|
||||
*
|
||||
* Copyright (C) 2012-2013 Inteno Broadband Technology AB. All rights reserved.
|
||||
*
|
||||
* Author: dev@inteno.se
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include <libubox/blobmsg.h>
|
||||
#include <libubox/blobmsg_json.h>
|
||||
#include <libubox/uloop.h>
|
||||
|
||||
#include <libubus.h>
|
||||
|
||||
static struct ubus_context *ctx;
|
||||
static struct ubus_event_handler event_listener;
|
||||
static struct blob_buf b;
|
||||
|
||||
|
||||
static void receive_event(struct ubus_context *ctx, struct ubus_event_handler *ev,
|
||||
const char *type, struct blob_attr *msg)
|
||||
{
|
||||
char *str;
|
||||
uint32_t id;
|
||||
|
||||
str = blobmsg_format_json(msg, true);
|
||||
fprintf(stdout, "I got %s event %s\n", type, str);
|
||||
free(str);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
const char *ubus_socket = NULL;
|
||||
int ret;
|
||||
|
||||
uloop_init();
|
||||
|
||||
ctx = ubus_connect(ubus_socket);
|
||||
if (!ctx) {
|
||||
fprintf(stderr, "Failed to connect to ubus\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
ubus_add_uloop(ctx);
|
||||
|
||||
event_listener.cb = receive_event;
|
||||
ret = ubus_register_event_handler(ctx, &event_listener, "*");
|
||||
if (ret)
|
||||
fprintf(stderr, "Couldn't register to router events\n");
|
||||
|
||||
uloop_run();
|
||||
|
||||
ubus_free(ctx);
|
||||
uloop_done();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2018 iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=imonitor
|
||||
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:=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
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/imonitor
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=iopsysWrt process supervisor
|
||||
DEPENDS:=+ubox +uci +ubus +rpcd +rpcd-mod-file
|
||||
endef
|
||||
|
||||
define Package/imonitor/description
|
||||
imonitor is a process supervisor or a process control system similar to the Supervisor (http://supervisord.org/)
|
||||
endef
|
||||
|
||||
define Package/imonitor/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/imonitor $(1)/usr/bin/
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,imonitor))
|
||||
@@ -1,9 +0,0 @@
|
||||
config monitor
|
||||
option app 'test'
|
||||
option test 'echo test'
|
||||
option stream 'stdout'
|
||||
option string_match 'TEST'
|
||||
option execute 'echo executing test'
|
||||
option interval '10'
|
||||
option nr_tests '2'
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
#
|
||||
# Start the imonitor
|
||||
#
|
||||
|
||||
START=99
|
||||
STOP=01
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=imonitor
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command "imonitor"
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop() {
|
||||
service_stop imonitor
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2016 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:=inbd
|
||||
PKG_VERSION:=1.2.2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=10f765f3d0fcc226b6ecf0c481598c9e7f76315e
|
||||
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)
|
||||
|
||||
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/inbd
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=iopsys Netlink Bridge Daemon
|
||||
URL:=
|
||||
DEPENDS:=+libuci +libubus +libblobmsg-json +libnl-genl
|
||||
endef
|
||||
|
||||
define Package/inbd/description
|
||||
Application handling netlink messages from kernel and sending them out on ubus.
|
||||
endef
|
||||
|
||||
define Package/inbd/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/inbd $(1)/usr/bin/
|
||||
cp $(PKG_BUILD_DIR)/files/etc/init.d/inbd $(1)/etc/init.d/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,inbd))
|
||||
52
inteno-configs/Makefile
Normal file
52
inteno-configs/Makefile
Normal file
@@ -0,0 +1,52 @@
|
||||
#
|
||||
# Copyright (C) 2012 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=inteno-configs
|
||||
|
||||
PKG_VERSION:=1.0
|
||||
PKG_SOURCE_URL:=git@iopsys.inteno.se:inteno-configs.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=e6836dbc3dde40eba661b3c37d5f5d0cc6f2e5d0
|
||||
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
######################################
|
||||
|
||||
define NewConfig
|
||||
define Package/$(1)/install
|
||||
$(INSTALL_DIR) $$(1)/etc/config
|
||||
$(INSTALL_DIR) $$(1)/etc/uci-defaults
|
||||
$(CP) $(PKG_BUILD_DIR)/$(1)/etc/config/* $$(1)/etc/config/ | true
|
||||
$(CP) $(PKG_BUILD_DIR)/$(1)/etc/uci-defaults/* $$(1)/etc/uci-defaults | true
|
||||
endef
|
||||
|
||||
define Package/$(1)
|
||||
SECTION:=configs
|
||||
CATEGORY:=Configurations
|
||||
TITLE:=$(1)
|
||||
endef
|
||||
|
||||
endef
|
||||
|
||||
|
||||
define AddConfig
|
||||
$(eval $(call NewConfig,$(1)))
|
||||
$(eval $(call BuildPackage,$(1)))
|
||||
endef
|
||||
|
||||
######################################
|
||||
|
||||
$(eval $(call AddConfig,conf-common-inteno))
|
||||
$(eval $(call AddConfig,conf-caiman-inteno))
|
||||
|
||||
|
||||
35
iop/Makefile
35
iop/Makefile
@@ -1,35 +0,0 @@
|
||||
#
|
||||
# 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
|
||||
|
||||
PKG_NAME:=iop
|
||||
PKG_VERSION:=1.0
|
||||
PKG_RELEASE:=0
|
||||
PKG_LICENSE:=GPLv2
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/iop
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=iop utilities
|
||||
endef
|
||||
|
||||
define Package/iop/description
|
||||
This package contains iopsysWrt SDK utilities
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
true
|
||||
endef
|
||||
|
||||
define Package/iop/install
|
||||
true
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,iop))
|
||||
227
iop/config
227
iop/config
@@ -1,227 +0,0 @@
|
||||
CONFIG_BUILD_NLS=y
|
||||
CONFIG_BUSYBOX_CUSTOM=y
|
||||
CONFIG_CCACHE=y
|
||||
CONFIG_DEBUG=y
|
||||
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_chat=y
|
||||
CONFIG_PACKAGE_comgt=y
|
||||
CONFIG_PACKAGE_comgt-directip=y
|
||||
CONFIG_PACKAGE_comgt-ncm=y
|
||||
CONFIG_PACKAGE_ddns-scripts=y
|
||||
CONFIG_PACKAGE_ds-lite=y
|
||||
CONFIG_PACKAGE_ethtool=y
|
||||
CONFIG_PACKAGE_getopt=y
|
||||
CONFIG_PACKAGE_glib2=y
|
||||
CONFIG_PACKAGE_gre=y
|
||||
CONFIG_PACKAGE_icwmp=y
|
||||
CONFIG_PACKAGE_ieee1905=y
|
||||
CONFIG_PACKAGE_map-1905=y
|
||||
CONFIG_PACKAGE_map-topology=y
|
||||
CONFIG_PACKAGE_mosquitto-client-ssl=y
|
||||
CONFIG_PACKAGE_mosquitto-ssl=y
|
||||
CONFIG_PACKAGE_wfadatad=y
|
||||
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
|
||||
CONFIG_PACKAGE_iptables=y
|
||||
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_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-dsl=y
|
||||
CONFIG_PACKAGE_juci-network-netifd=y
|
||||
CONFIG_PACKAGE_juci-sysupgrade=y
|
||||
CONFIG_PACKAGE_juci-wireless=y
|
||||
CONFIG_PACKAGE_juci-theme-iopsys=y
|
||||
CONFIG_PACKAGE_libreswan=m
|
||||
CONFIG_PACKAGE_libwifi=y
|
||||
CONFIG_PACKAGE_lscpu=y
|
||||
CONFIG_PACKAGE_map=y
|
||||
CONFIG_PACKAGE_miniupnpd=y
|
||||
CONFIG_PACKAGE_mwan3=y
|
||||
CONFIG_PACKAGE_nand-utils=y
|
||||
CONFIG_PACKAGE_ndisc6=y
|
||||
CONFIG_PACKAGE_netmode=y
|
||||
CONFIG_PACKAGE_ntfs-3g=y
|
||||
CONFIG_PACKAGE_ntpd=y
|
||||
CONFIG_PACKAGE_obuspa=y
|
||||
CONFIG_PACKAGE_odhcp6c=y
|
||||
CONFIG_PACKAGE_odhcpd=y
|
||||
CONFIG_PACKAGE_openssl-util=y
|
||||
CONFIG_OPENSSL_WITH_COMPRESSION=y
|
||||
CONFIG_PACKAGE_openvpn-easy-rsa=y
|
||||
CONFIG_PACKAGE_openvpn-openssl=y
|
||||
CONFIG_PACKAGE_owsd=y
|
||||
CONFIG_PACKAGE_peripheral_manager=y
|
||||
CONFIG_PACKAGE_port-management=y
|
||||
CONFIG_PACKAGE_ppp-mod-pppoa=y
|
||||
CONFIG_PACKAGE_ppp-mod-pppoe=y
|
||||
CONFIG_PACKAGE_ppp-mod-pppol2tp=y
|
||||
CONFIG_PACKAGE_ppp-mod-pptp=y
|
||||
CONFIG_PACKAGE_ppp-multilink=y
|
||||
# CONFIG_PACKAGE_ppp is not set
|
||||
# CONFIG_PACKAGE_qos-scripts is not set
|
||||
CONFIG_PACKAGE_questd=y
|
||||
CONFIG_PACKAGE_rdisc6=y
|
||||
CONFIG_PACKAGE_rdnssd=y
|
||||
CONFIG_PACKAGE_relayd=y
|
||||
CONFIG_PACKAGE_resolveip=y
|
||||
CONFIG_PACKAGE_rpcd=y
|
||||
CONFIG_PACKAGE_rpcd-mod-rpcsys=y
|
||||
CONFIG_PACKAGE_rulengd=y
|
||||
CONFIG_PACKAGE_strace=y
|
||||
CONFIG_PACKAGE_swmodd=m
|
||||
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_uspd=y
|
||||
CONFIG_PACKAGE_vsftpd-tls=m
|
||||
CONFIG_PACKAGE_wwan=y
|
||||
CONFIG_PACKAGE_wifimngr=y
|
||||
CONFIG_PACKAGE_uuidgen=y
|
||||
CONFIG_PACKAGE_xl2tpd=y
|
||||
CONFIG_PACKAGE_zoneinfo-core=y
|
||||
CONFIG_PACKAGE_zoneinfo-europe=y
|
||||
CONFIG_TARGET_CUSTOMER="IOPSYS"
|
||||
# CONFIG_USE_SSTRIP is not set
|
||||
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_INSMOD is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_MODINFO is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_MODPROBE is not set
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_MODPROBE_BLACKLIST=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_CHECK_TAINTED_MODULE=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_MODUTILS_ALIAS=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_MODUTILS_SYMBOLS=y
|
||||
CONFIG_BUSYBOX_CONFIG_DEFAULT_MODULES_DIR="/lib/modules"
|
||||
CONFIG_BUSYBOX_CONFIG_DEFAULT_DEPMOD_FILE="modules.dep"
|
||||
CONFIG_BUSYBOX_CONFIG_LAST_SYSTEM_ID=999
|
||||
CONFIG_BUSYBOX_CONFIG_LOGIN=y
|
||||
# CONFIG_BUSYBOX_CONFIG_LSMOD is not set
|
||||
CONFIG_BUSYBOX_CONFIG_LSPCI=y
|
||||
CONFIG_BUSYBOX_CONFIG_LSUSB=y
|
||||
CONFIG_BUSYBOX_CONFIG_MICROCOM=y
|
||||
# CONFIG_BUSYBOX_CONFIG_RMMOD is not set
|
||||
CONFIG_BUSYBOX_CONFIG_STTY=y
|
||||
CONFIG_BUSYBOX_CONFIG_TFTP=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_CHECK_TAINTED_MODULE=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_AUTH_MD5=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_BASIC_AUTH=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_CGI=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_ENCODE_URL_STR=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_ERROR_PAGES=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_GZIP=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_PROXY=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_RANGES=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_SETUID=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_USE_SENDFILE=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT=y
|
||||
# CONFIG_BUSYBOX_CONFIG_FEATURE_NOLOGIN is not set
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_SECURETTY=y
|
||||
# CONFIG_BUSYBOX_CONFIG_FEATURE_TFTP_BLOCKSIZE is not set
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_TFTP_GET=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_TFTP_PUT=y
|
||||
# CONFIG_BUSYBOX_CONFIG_WGET is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_LOGIN_SCRIPTS is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_LOGIN_SESSION_AS_CHILD is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_PAM is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_TFTP_DEBUG is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_NTPD is not set
|
||||
CONFIG_BUSYBOX_CONFIG_MOUNTPOINT=y
|
||||
CONFIG_BUSYBOX_CONFIG_RUN_PARTS=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_RUN_PARTS_FANCY=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_GZIP_LEVELS=y
|
||||
CONFIG_BUSYBOX_CONFIG_GZIP_FAST=2
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_FANCY_SLEEP=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_FLOAT_SLEEP=y
|
||||
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_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/"
|
||||
|
||||
# Generation of /etc/banner.
|
||||
CONFIG_IMAGEOPT=y
|
||||
CONFIG_VERSIONOPT=y
|
||||
CONFIG_VERSION_MANUFACTURER="iopsysWrt"
|
||||
CONFIG_VERSION_MANUFACTURER_URL="https://iopsys.eu/"
|
||||
|
||||
# Disable as much as possible of OpenWrt messy "pre-init" stuff.
|
||||
CONFIG_PREINITOPT=y
|
||||
# CONFIG_TARGET_PREINIT_SUPPRESS_STDERR is not set
|
||||
CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE=y
|
||||
CONFIG_TARGET_PREINIT_TIMEOUT=1
|
||||
# CONFIG_TARGET_PREINIT_SHOW_NETMSG is not set
|
||||
# CONFIG_TARGET_PREINIT_SUPPRESS_FAILSAFE_NETMSG is not set
|
||||
CONFIG_TARGET_PREINIT_IFNAME=""
|
||||
CONFIG_TARGET_PREINIT_IP=""
|
||||
CONFIG_TARGET_PREINIT_NETMASK=""
|
||||
CONFIG_TARGET_PREINIT_BROADCAST=""
|
||||
|
||||
# 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
|
||||
@@ -1,94 +0,0 @@
|
||||
# Bash completion for IOPSYS "./iop" utility
|
||||
# Source this file into the curent shell or copy it into
|
||||
# /usr/share/bash-completion/completions/ and start a new shell
|
||||
# for automatic availability.
|
||||
|
||||
_iop_get_profiles()
|
||||
{
|
||||
find feeds/targets/iopsys-*/ -name '*.diff' \
|
||||
|awk -F'/' '{print$NF}' \
|
||||
|awk -F. '{print$1}'
|
||||
}
|
||||
|
||||
_iop_get_models()
|
||||
{
|
||||
find feeds/targets/iopsys-*/ -mindepth 1 -maxdepth 1 -type d \
|
||||
|awk -F'/' '{print$NF}' \
|
||||
|egrep '^(cg|dg|eg|vg|vox)[0-9]'
|
||||
}
|
||||
|
||||
_iop_get_model_customers()
|
||||
{
|
||||
local model=$1
|
||||
find customerconfigs/$prev -mindepth 1 -maxdepth 1 -type d \
|
||||
|awk -F'/' '{print$NF}'
|
||||
}
|
||||
|
||||
_iop()
|
||||
{
|
||||
local cur prev iopcmds
|
||||
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
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"
|
||||
|
||||
if [ $COMP_CWORD -eq 1 ] ; then
|
||||
|
||||
# Complete the primary iop command
|
||||
COMPREPLY=($(compgen -W "${iopcmds}" -- ${cur}))
|
||||
return 0
|
||||
|
||||
else
|
||||
|
||||
# Complete the arguments to "iopcmds"
|
||||
local cmd="${COMP_WORDS[1]}"
|
||||
case "$cmd" in
|
||||
|
||||
extract_core)
|
||||
if [ "$prev" == "-e" ] ; then
|
||||
_filedir -d
|
||||
else
|
||||
COMPREPLY=( $(compgen -W "-e -h" -- ${cur}) )
|
||||
fi
|
||||
return 0
|
||||
;;
|
||||
|
||||
genconfig)
|
||||
if [ "$prev" == "-p" ] ; then
|
||||
local profiles=$(_iop_get_profiles)
|
||||
COMPREPLY=( $(compgen -W "juci $profiles" -- ${cur}) )
|
||||
elif [[ $cur == -* ]] ; then
|
||||
COMPREPLY=( $(compgen -W "-c -h -p -s -t -u -v" -- ${cur}) )
|
||||
else
|
||||
local models=$(_iop_get_models)
|
||||
if echo $models |grep -qw -- $prev ; then
|
||||
local customers=$(_iop_get_model_customers $prev)
|
||||
COMPREPLY=( $(compgen -W "$customers" -- ${cur}) )
|
||||
else
|
||||
COMPREPLY=( $(compgen -W "$models" -- ${cur}) )
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
;;
|
||||
ssh_upgrade)
|
||||
if [ "$prev" == "-f" ] ; then
|
||||
_filedir
|
||||
else
|
||||
COMPREPLY=( $(compgen -W "-f -t -i -n -x -b" -- ${cur}) )
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
# No arguments or arguments not supported yet
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
complete -F _iop ./iop
|
||||
complete -F _iop iop
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
function disable_add_config () {
|
||||
local COPTION="$1"
|
||||
|
||||
HAVE_OPTION=`grep $COPTION .config | wc -l`
|
||||
HAVE_OPTION_DISABLED=`grep "# $COPTION" .config | wc -l`
|
||||
if [ "$HAVE_OPTION" = "1" ]
|
||||
then
|
||||
if [ "$HAVE_OPTION_DISABLED" = "0" ]
|
||||
then
|
||||
sed -i -e "s,$COPTION=y,# $COPTION is not set,g" .config
|
||||
fi
|
||||
else
|
||||
echo "# $COPTION is not set" >> .config
|
||||
fi
|
||||
}
|
||||
|
||||
function enable_option () {
|
||||
local COPTION="$1"
|
||||
# cat .config| grep DSL
|
||||
sed -i -e "s,# $COPTION is not set,$COPTION=y,g" .config
|
||||
# cat .config| grep DSL
|
||||
}
|
||||
|
||||
function annexconfig {
|
||||
|
||||
v() {
|
||||
[ "$VERBOSE" -ge 1 ] && echo "$@"
|
||||
}
|
||||
|
||||
local ANNEX="$1"
|
||||
|
||||
disable_add_config CONFIG_TARGET_NO_DSL
|
||||
disable_add_config CONFIG_TARGET_DSL_ANNEX_A
|
||||
disable_add_config CONFIG_TARGET_DSL_ANNEX_B
|
||||
disable_add_config CONFIG_TARGET_DSL_ANNEX_C
|
||||
disable_add_config CONFIG_TARGET_DSL_SADSL
|
||||
disable_add_config CONFIG_TARGET_DSL_GFAST
|
||||
|
||||
|
||||
if [ "$ANNEX" = "no" ]
|
||||
then
|
||||
echo "No DSL"
|
||||
enable_option CONFIG_TARGET_NO_DSL
|
||||
elif [ "$ANNEX" = "a" ]
|
||||
then
|
||||
echo "Annex A"
|
||||
enable_option CONFIG_TARGET_DSL_ANNEX_A
|
||||
elif [ "$ANNEX" = "b" ]
|
||||
then
|
||||
echo "Annex B"
|
||||
enable_option CONFIG_TARGET_DSL_ANNEX_B
|
||||
elif [ "$ANNEX" = "c" ]
|
||||
then
|
||||
echo "Annex C"
|
||||
enable_option CONFIG_TARGET_DSL_ANNEX_C
|
||||
elif [ "$ANNEX" = "sadsl" ]
|
||||
then
|
||||
echo "sadsl"
|
||||
enable_option CONFIG_TARGET_DSL_SADSL
|
||||
elif [ "$ANNEX" = "gfast" ]
|
||||
then
|
||||
echo "G.fast"
|
||||
enable_option CONFIG_TARGET_DSL_GFAST
|
||||
else
|
||||
echo "Only option no,a,b,c,sadsl,gfast supported"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
register_command "annexconfig" "Select configuration annex"
|
||||
@@ -1,60 +0,0 @@
|
||||
#!/bin/sh
|
||||
# build_branch
|
||||
#./iop build_branch <branch> <board> [<customer>]
|
||||
|
||||
function build_branch_usage {
|
||||
echo "usage: $0 build_branch <branch> <board> [<customer>]"
|
||||
echo "example: $0 build_branch devel-new ex400 DEV"
|
||||
echo "example: $0 build_branch_sysupgrade devel-new ex400 DEV 192.168.1.1 -n"
|
||||
set +x
|
||||
exit 1
|
||||
}
|
||||
|
||||
function branch_exists {
|
||||
local branch=$1
|
||||
[ -z "$branch" ] && return 1
|
||||
git branch | grep -q $branch && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
function build_branch {
|
||||
set -x
|
||||
local branch=$1
|
||||
local board=$2
|
||||
local customer=$3
|
||||
[ "$customer" == "INT" ] && customer=""
|
||||
|
||||
if ! branch_exists $branch ; then
|
||||
echo "Branch $branch not found"
|
||||
build_branch_usage
|
||||
fi
|
||||
|
||||
time {
|
||||
git fetch origin || build_branch_usage
|
||||
git fetch --all -p || build_branch_usage
|
||||
git checkout $branch || build_branch_usage
|
||||
git pull || exit 1
|
||||
./iop feeds_update || build_branch_usage
|
||||
./iop genconfig -c $board $customer || build_branch_usage
|
||||
make -j 8 || build_branch_usage
|
||||
set +x
|
||||
}
|
||||
}
|
||||
|
||||
function build_branch_sysupgrade {
|
||||
set -x
|
||||
local branch=$1 ; shift
|
||||
local board=$1 ; shift
|
||||
local customer=$1 ; shift
|
||||
local ip=$1 ; shift
|
||||
local opts=$*
|
||||
|
||||
time {
|
||||
./iop build_branch $branch $board $customer
|
||||
[ "$?" == "0" ] && ./iop ssh_sysupgrade_latest $ip $opts
|
||||
}
|
||||
set +x
|
||||
}
|
||||
|
||||
register_command "build_branch" "<branch> <board> [<customer>] Build a <branch> for a <board> [with a <customer> profile]"
|
||||
register_command "build_branch_sysupgrade" "<branch> <board> <customer>|INT <ip> [<opts>] Build a <branch> for a <board> [with a <customer> profile] and sysupgrade [with <opts>] it on the router at <ip>"
|
||||
@@ -1,42 +0,0 @@
|
||||
# this is a developer helper script to install firmware on a remote host running in CFE mode
|
||||
|
||||
function usage {
|
||||
echo "usage: $0 cfe_upgrade <host> <file>"
|
||||
}
|
||||
|
||||
function cfe_upgrade {
|
||||
if [ -z "$1" ] ; then
|
||||
usage
|
||||
echo "Error: host required"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$2" ] ; then
|
||||
usage
|
||||
echo "Error: firmware filename required"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -e $2 ] ; then
|
||||
usage
|
||||
echo "Error: firmware file does not exist"
|
||||
exit 1
|
||||
fi
|
||||
IMAGE=`basename $2`
|
||||
echo "CFE upgrade host: $1 with file $IMAGE"
|
||||
[ "$2" ] && [ -e "$2" ] && curl -i -F filedata=@$2 http://$1/upload.cgi && echo "upgrade done!"
|
||||
}
|
||||
|
||||
register_command "cfe_upgrade" "<host> <file> Install firmware on remote host in CFE mode"
|
||||
|
||||
function cfe_upgrade_latest {
|
||||
if [ -z "$1" ] ; then
|
||||
echo "usage: $0 cfe_upgrade_latest <host>"
|
||||
echo "Error: host required"
|
||||
exit 1
|
||||
fi
|
||||
{ cd `dirname $0`
|
||||
IMAGE=`ls -Art bin/*/*.w | tail -n1`
|
||||
[ "$IMAGE" ] && [ -e "$IMAGE" ] && ./iop cfe_upgrade $1 $IMAGE
|
||||
}
|
||||
}
|
||||
|
||||
register_command "cfe_upgrade_latest" "<host> Install latest firmware on remote host in CFE mode"
|
||||
@@ -1,27 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
function compile {
|
||||
if [ -z "$1" ]; then
|
||||
echo "Please give a valid package as first argument."
|
||||
return 1
|
||||
fi
|
||||
|
||||
local cpath pck
|
||||
local lpath=$(find package/ -type l -name $1)
|
||||
local dpath=$(find package/ -type d -name $1)
|
||||
|
||||
for pck in $lpath $dpath; do
|
||||
if [ -n "$(ls $pck/Makefile 2>/dev/null)" ]; then
|
||||
cpath=$pck
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$cpath" ]; then
|
||||
make $cpath/compile V=$2
|
||||
else
|
||||
echo "Package $1 does not exist. Make sure you have installed the necessary feed."
|
||||
fi
|
||||
}
|
||||
|
||||
register_command "compile" "Compile a specific package: ./iop compile <PACKAGE_NAME> [0-99]; i.e ./iop compile netifd 99"
|
||||
@@ -1,136 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
function extract_core {
|
||||
initial_commit=1427738ac4b77f474999ae21af1a8b916468df36
|
||||
patch_dir=extract_core_patches
|
||||
topdir=$(pwd)
|
||||
|
||||
# Paths to packages that should be exported.
|
||||
paths+='package/network/config/firewall '
|
||||
paths+='package/network/config/netifd '
|
||||
paths+='package/utils/busybox '
|
||||
paths+='package/system/rpcd '
|
||||
paths+='package/network/services/openvpn '
|
||||
|
||||
function print_usage {
|
||||
echo "Usage: $0 extract_core"
|
||||
echo " -p <path-to-package> | default"
|
||||
echo " -r <import-repo>"
|
||||
echo " -b <import-branch>"
|
||||
echo ""
|
||||
echo "Example: $0 extract_core"
|
||||
echo " -p package/utils/busybox"
|
||||
echo " -r feeds/openwrt_core"
|
||||
echo " -b devel"
|
||||
echo ""
|
||||
echo "Extract all default packages:"
|
||||
echo "$0 extract_core"
|
||||
echo " -p default"
|
||||
echo " -r feeds/openwrt_core"
|
||||
echo " -b devel"
|
||||
}
|
||||
|
||||
function orphan_branch {
|
||||
local branch=$1
|
||||
|
||||
git checkout --orphan $branch
|
||||
git rm -rf --cached *
|
||||
git rm -rf --cached .empty
|
||||
rm -rf *
|
||||
rm -rf .empty
|
||||
}
|
||||
|
||||
function export_core {
|
||||
local path=$1
|
||||
|
||||
echo "Extracting ${path} from core to ${import_repo}:${import_branch}"
|
||||
|
||||
# Generate patches from start of openwrt repo.
|
||||
mkdir -p $patch_dir
|
||||
repo=$(basename $path)
|
||||
dir=$(dirname $path)
|
||||
git format-patch $initial_commit $path -o $patch_dir
|
||||
|
||||
# Remove dirname from patches to commit the packages to the
|
||||
# top directory in the destination repo.
|
||||
ls $patch_dir | while read line; do
|
||||
sdir=$(echo "$dir/" | sed 's/\//\\\//g')
|
||||
sed -i "s/$sdir//g" $patch_dir/$line
|
||||
done
|
||||
|
||||
cd $import_repo
|
||||
|
||||
if [ -n "$(git rev-parse -q --verify remotes/origin/$repo)" ]; then
|
||||
# Create temporary branch to apply patches on.
|
||||
# We need to do this as git am does not like it
|
||||
# when patches have already been applied.
|
||||
orphan_branch tmp
|
||||
git am $topdir/$patch_dir/*
|
||||
|
||||
# Rebase and merge.
|
||||
git rebase origin/$repo
|
||||
git checkout --track -b $repo origin/$repo
|
||||
git merge tmp
|
||||
git br -d tmp
|
||||
else
|
||||
# Remote branch does not exist for packet so create it.
|
||||
orphan_branch $repo
|
||||
git am $topdir/$patch_dir/*
|
||||
fi
|
||||
|
||||
git push origin $repo
|
||||
|
||||
# Merge the package branch into the main branch.
|
||||
git checkout $import_branch
|
||||
git merge $repo -m "Syncing $repo"
|
||||
git push origin $import_branch
|
||||
git br -d $repo
|
||||
|
||||
rm -rf $topdir/$patch_dir
|
||||
cd $topdir
|
||||
}
|
||||
|
||||
# Execute user command
|
||||
while getopts "p:r:b:h" opt; do
|
||||
case $opt in
|
||||
p)
|
||||
export_path=${OPTARG}
|
||||
;;
|
||||
r)
|
||||
import_repo=${OPTARG}
|
||||
;;
|
||||
b)
|
||||
import_branch=${OPTARG}
|
||||
;;
|
||||
h)
|
||||
print_usage
|
||||
exit 1
|
||||
;;
|
||||
\?)
|
||||
print_usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ ! -n "$export_path" ] || [ ! -n "$import_repo" ] || [ ! -n "$import_branch" ]; then
|
||||
print_usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$export_path" == "default" ]; then
|
||||
echo "Extracting default packages:"
|
||||
for p in $paths; do
|
||||
export_core $p
|
||||
|
||||
done
|
||||
else
|
||||
export_core $export_path
|
||||
fi
|
||||
|
||||
exit 0
|
||||
}
|
||||
|
||||
register_command "extract_core" "Extract core package to separate feed"
|
||||
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
function extract_top {
|
||||
tmp_dir=extract_top_tmp
|
||||
|
||||
# Paths to packages that should be ignored.
|
||||
paths+='package/network/services/dnsmasq '
|
||||
paths+='package/network/config/firewall '
|
||||
paths+='package/network/config/netifd '
|
||||
paths+='package/network/config/qos-scripts '
|
||||
paths+='package/utils/busybox '
|
||||
paths+='package/base-files '
|
||||
paths+='package/system/procd '
|
||||
paths+='package/system/rpcd '
|
||||
paths+='package/network/services/openvpn '
|
||||
|
||||
function extract {
|
||||
|
||||
current_branch=$(git rev-parse --abbrev-ref HEAD)
|
||||
git format-patch $start_commit -o $tmp_dir #> /dev/null
|
||||
|
||||
ls $tmp_dir |
|
||||
while read file; do
|
||||
# Remove feed patches.
|
||||
# echo $file | grep -i Update-feed > /dev/null && \
|
||||
# rm $tmp_dir/$file && continue
|
||||
cat $tmp_dir/$file | grep "+++ b/feeds.conf" > /dev/null && \
|
||||
rm $tmp_dir/$file && continue
|
||||
|
||||
# Remove core patches.
|
||||
for path in $paths; do
|
||||
cat $tmp_dir/$file | grep $path > /dev/null && \
|
||||
rm $tmp_dir/$file && break
|
||||
done
|
||||
done
|
||||
|
||||
git checkout -b ${current_branch}-new $start_commit
|
||||
git am $tmp_dir/*
|
||||
git checkout $current_branch
|
||||
rm -rf $tmp_dir
|
||||
}
|
||||
|
||||
function print_usage {
|
||||
|
||||
echo "Usage:"
|
||||
echo " $0 -s <start_commit>"
|
||||
}
|
||||
|
||||
# Execute user command
|
||||
while getopts "s:" opt; do
|
||||
case $opt in
|
||||
s)
|
||||
start_commit=${OPTARG}
|
||||
;;
|
||||
\?)
|
||||
print_usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ ! -n "$start_commit" ]; then
|
||||
print_usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
extract
|
||||
|
||||
}
|
||||
|
||||
register_command "extract_top" "Extract commits made to top repo"
|
||||
@@ -1,59 +0,0 @@
|
||||
#! /bin/bash
|
||||
|
||||
function feeds_update {
|
||||
|
||||
developer=0
|
||||
override=1
|
||||
start=$(date -u +'%s');
|
||||
while getopts "n" opt; do
|
||||
case $opt in
|
||||
n)
|
||||
override=0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
git remote -v | grep -q http || developer=1
|
||||
|
||||
cp .config .genconfig_config_bak
|
||||
|
||||
#if -d argument is passed, clone feeds with ssh instead of http
|
||||
if [ $developer == 1 ]; then
|
||||
./scripts/feeds update -g
|
||||
else
|
||||
./scripts/feeds update
|
||||
fi
|
||||
./scripts/feeds update -ai
|
||||
|
||||
# replace core packages with iopsys versions
|
||||
if [ $override == 1 ]; then
|
||||
./scripts/feeds install -f -p openwrt_core -a
|
||||
fi
|
||||
|
||||
# targets need to be installed explicitly
|
||||
targets="iopsys-brcm63xx-arm iopsys-ramips intel_mips iopsys-x86 iopsys-armvirt iopsys-bcm27xx iopsys-mediatek"
|
||||
for target in $targets
|
||||
do
|
||||
rm -f target/linux/$target
|
||||
./scripts/feeds install -p targets $target
|
||||
done
|
||||
|
||||
# install all packages
|
||||
./scripts/feeds install -a
|
||||
|
||||
# remove broken symlinks ( for packages that are no longer in the feed )
|
||||
find -L package/feeds -maxdepth 2 -type l -delete
|
||||
|
||||
cp .genconfig_config_bak .config
|
||||
make defconfig
|
||||
|
||||
# record when we last run this script
|
||||
touch tmp/.iop_bootstrap
|
||||
|
||||
# always return true
|
||||
exit 0
|
||||
}
|
||||
|
||||
register_command "feeds_update" "Update feeds to point to commit hashes from feeds.conf"
|
||||
|
||||
@@ -1,518 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
function genconfig {
|
||||
export CLEAN=0
|
||||
export IMPORT=1
|
||||
export SRCTREEOVERR=0
|
||||
export FILEDIR="files/"
|
||||
export THEMEDIR="tmp/juci-themes"
|
||||
CURRENT_CONFIG_FILE=".current_config_file"
|
||||
export CONFIGPATH="package/feeds/iopsys/iop"
|
||||
CUSTPATH="customerconfigs"
|
||||
export CUSTCONF="customerconfigs/customers"
|
||||
export VERBOSE=0
|
||||
export DEVELOPER=0
|
||||
target="bogus"
|
||||
target_config_path=""
|
||||
bcm27xx="target/linux/iopsys-bcm27xx"
|
||||
brcm63xx_arm="target/linux/iopsys-brcm63xx-arm"
|
||||
ramips="target/linux/iopsys-ramips"
|
||||
intel_mips="target/linux/intel_mips"
|
||||
mediatek="target/linux/iopsys-mediatek"
|
||||
x86="target/linux/iopsys-x86"
|
||||
armvirt="target/linux/iopsys-armvirt"
|
||||
|
||||
Red='\033[0;31m' # Red
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
Yellow='\033[0;33m' # Yellow
|
||||
|
||||
function find_last {
|
||||
egrep "^[ #]*${1}[ =]" $2 | tail -n1
|
||||
}
|
||||
|
||||
function is_new {
|
||||
for opt in $conf_warned
|
||||
do
|
||||
if [ "$opt" == "$1" ]
|
||||
then
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
# option not found return true
|
||||
return 0
|
||||
}
|
||||
|
||||
function verify_config {
|
||||
IFS=$'\n'
|
||||
org=$(<.genconfig.config)
|
||||
unset IFS
|
||||
local num
|
||||
local conf_opt
|
||||
local conf_org
|
||||
local conf_new
|
||||
|
||||
#echo "lines to check $tot_lines"
|
||||
num=0
|
||||
for line in $org
|
||||
do
|
||||
conf_opt=$(echo $line | grep CONFIG_ | sed 's|.*\(CONFIG_[^ =]*\)[ =].*|\1|')
|
||||
if [ -n "${conf_opt}" ]
|
||||
then
|
||||
conf_org=$(find_last ${conf_opt} .genconfig.config)
|
||||
conf_new=$(find_last ${conf_opt} .config)
|
||||
if [ "$conf_org" != "$conf_new" ]
|
||||
then
|
||||
if is_new $conf_opt
|
||||
then
|
||||
echo -e "config option [${Red}$conf_opt${Color_Off}] is not set correctly in .config"
|
||||
echo -e "got value [${Yellow}$conf_new${Color_Off}] but wanted [${Yellow}$conf_org${Color_Off}]"
|
||||
echo "This is a real problem somebody needs to investigate"
|
||||
echo ""
|
||||
conf_warned="$conf_warned $conf_opt"
|
||||
fi
|
||||
else
|
||||
true
|
||||
# for debug to see all options
|
||||
#echo -e "wanted [$conf_org] got [$conf_new]"
|
||||
fi
|
||||
fi
|
||||
num=$((num+1))
|
||||
done
|
||||
}
|
||||
|
||||
# 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
|
||||
|
||||
[ -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 $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_intel_mips iopsys_x86 iopsys_armvirt iopsys_bcm27xx; do
|
||||
echo "$list based boards:"
|
||||
for b in ${!list}; do
|
||||
echo -e "\t$b"
|
||||
done
|
||||
done
|
||||
return
|
||||
fi
|
||||
|
||||
for p in $iopsys_brcm63xx_arm; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_brcm63xx_arm"
|
||||
target_config_path="$brcm63xx_arm/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
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_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"
|
||||
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() {
|
||||
[ "$VERBOSE" -ge 1 ] && echo "$@"
|
||||
}
|
||||
|
||||
usage() {
|
||||
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"
|
||||
echo -e " -l|--list [customer]\tList all Customers or all boards for one customer"
|
||||
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
|
||||
exit 0
|
||||
}
|
||||
|
||||
list_customers()
|
||||
{
|
||||
local ALL="$1"
|
||||
local CUSTOMER="$2"
|
||||
if [ "$CUSTOMER" -a -d "$CUSTCONF/$CUSTOMER" ]; then
|
||||
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
|
||||
echo -e "\t$board"
|
||||
done
|
||||
else
|
||||
echo "No boards found for $CUSTOMER"
|
||||
fi
|
||||
elif [ "$CUSTOMER" ]; then
|
||||
echo "No customer called $CUSTOMER"
|
||||
exit 1
|
||||
elif [ -d $CUSTCONF ]; then
|
||||
local customers="$(ls -1 $CUSTCONF)"
|
||||
if [ "$customers" -a "$ALL" == 1 ]; then
|
||||
for customer in $customers; do
|
||||
echo $customer
|
||||
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"
|
||||
done
|
||||
else
|
||||
echo "has no boards"
|
||||
fi
|
||||
done
|
||||
elif [ "$customers" ]; then
|
||||
echo -e "$customers"
|
||||
else
|
||||
echo "no customers found"
|
||||
fi
|
||||
else
|
||||
echo "No $CUSTCONF folder found"
|
||||
fi
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
||||
generate_config()
|
||||
{
|
||||
DIFFFILE="$1"
|
||||
MASTERFILE="$2"
|
||||
while read p; do
|
||||
v "$p"
|
||||
sed -r -i "$p" $MASTERFILE
|
||||
done < $DIFFFILE
|
||||
}
|
||||
|
||||
setup_dirs()
|
||||
{
|
||||
git remote -v | grep -q http || {
|
||||
if git ls-remote $CUSTREPO -q 2>/dev/null; then
|
||||
if [ ! -d "$CUSTPATH" ]; then
|
||||
git clone "$CUSTREPO" "$CUSTPATH"
|
||||
elif [ $IMPORT -eq 1 ]; then
|
||||
cd $CUSTPATH
|
||||
v "git pull"
|
||||
git pull
|
||||
cd - >/dev/null #go back
|
||||
fi
|
||||
else
|
||||
echo "You do not have access to $CUSTREPO"
|
||||
fi
|
||||
}
|
||||
|
||||
if [ ! -d "$FILEDIR" ]; then
|
||||
mkdir -p $FILEDIR
|
||||
elif [ -d "$FILEDIR" -a $CLEAN -eq 1 ]; then
|
||||
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()
|
||||
{
|
||||
local BOARDTYPE=$1
|
||||
shift
|
||||
local CUSTOMERS=$@
|
||||
|
||||
# Validate seleced board and customers
|
||||
set_target $BOARDTYPE
|
||||
if [ $target == "bogus" ]; then
|
||||
echo "Hardware profile does not exist"
|
||||
exit 1
|
||||
elif [ -n "$CUSTOMERS" ]; then
|
||||
for CUSTOMER in $CUSTOMERS; do
|
||||
if [ ! -d "$CUSTCONF/$CUSTOMER/" ]; then
|
||||
echo "Customer profile for '$CUSTOMER' does not exist"
|
||||
exit 1
|
||||
elif [ ! -d "$CUSTCONF/$CUSTOMER/$BOARDTYPE/" ]; then
|
||||
echo "'$BOARDTYPE' board profile does not exist for customer '$CUSTOMER'"
|
||||
if [ -f "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
|
||||
echo "Common profile configuration will be used"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Generate base config
|
||||
rm -f .config
|
||||
v "Config $BOARDTYPE selected"
|
||||
v "cp $CONFIGPATH/config .config"
|
||||
cp $CONFIGPATH/config .config
|
||||
|
||||
if [ -f $target_config_path/config ]; then
|
||||
cat $target_config_path/config >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
if [ -f $target_config_path/$BOARDTYPE/config ]; then
|
||||
cat $target_config_path/$BOARDTYPE/config >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
|
||||
#special handling for intel_mips/iopsys_ramips 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_${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_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
|
||||
else
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
|
||||
fi
|
||||
|
||||
echo "$CUSTOMERS $BOARDTYPE" > $CURRENT_CONFIG_FILE
|
||||
|
||||
# Add customerconfig diff if a customer is selected
|
||||
if [ -n "$CUSTOMERS" ]; then
|
||||
for CUSTOMER in $CUSTOMERS; do
|
||||
if [ -d "$CUSTCONF/$CUSTOMER/common/fs" ]; then
|
||||
v "cp -ar $CUSTCONF/$CUSTOMER/common/fs/* $FILEDIR"
|
||||
cp -ar $CUSTCONF/$CUSTOMER/common/fs/* $FILEDIR
|
||||
fi
|
||||
if [ -d "$CUSTCONF/$CUSTOMER/$BOARDTYPE/fs" ]; then
|
||||
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)
|
||||
echo "CONFIG_TARGET_VERSION=\"${GIT_TAG}\"" >> .config
|
||||
echo "CONFIG_VERSION_CODE=\"${GIT_TAG}\"" >> .config
|
||||
echo "CONFIG_VERSION_PRODUCT=\"$BOARDTYPE"\" >> .config
|
||||
|
||||
# Enable Pckage source tree override if selected
|
||||
[ $SRCTREEOVERR -eq 1 ] && echo CONFIG_SRC_TREE_OVERRIDE=y >> .config
|
||||
|
||||
# developer mode selected ?
|
||||
echo "CONFIG_DEVEL=y" >>.config
|
||||
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
|
||||
else
|
||||
echo "# CONFIG_GITMIRROR_REWRITE is not set" >>.config
|
||||
echo "CONFIG_BCM_OPEN=y" >> .config
|
||||
echo "CONFIG_ENDPT_OPEN=y" >> .config
|
||||
fi
|
||||
|
||||
if [ -n "$BRCM_MAX_JOBS" ]
|
||||
then
|
||||
echo "CONFIG_BRCM_MAX_JOBS=\"1\"" >>.config
|
||||
fi
|
||||
|
||||
# Force regeneration of themes
|
||||
touch package/feeds/iopsys/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
|
||||
# so just touch that file.
|
||||
[ -d ./build_dir ] && find build_dir/ -name "boardparms*c" -print0 2>/dev/null | xargs -0 touch 2>/dev/null
|
||||
|
||||
# Store generated config
|
||||
cp .config .genconfig.config
|
||||
|
||||
# Set default values based on selected parameters
|
||||
v "$(make defconfig 2>&1)"
|
||||
|
||||
echo Set version to $(grep -w CONFIG_TARGET_VERSION .config | cut -d'=' -f2 | tr -d '"')
|
||||
|
||||
# Clean base-file package to force rebuild when changing profile
|
||||
v "$(make package/base-files/clean 2>&1)"
|
||||
|
||||
verify_config
|
||||
}
|
||||
|
||||
####### main #####
|
||||
if [ ! -e tmp/.iop_bootstrap ]; then
|
||||
echo "You have not installed feeds. Running genconfig in this state would create a non functional configuration."
|
||||
echo "Run: iop feeds_update"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo Current profile:
|
||||
cat $CURRENT_CONFIG_FILE
|
||||
echo "Try ./iop genconfig -h' to get instructions if you want to change current config"
|
||||
exit 0
|
||||
else
|
||||
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;;
|
||||
-S|--brcmsingel) export BRCM_MAX_JOBS=1;;
|
||||
-h|--help) usage;;
|
||||
-l|--list) list_customers 0 $2;;
|
||||
-a|--list-all)list_customers 1;;
|
||||
-b|--boards)set_target LIST;exit 0;;
|
||||
-*)
|
||||
echo "Invalid option: $1 "
|
||||
echo "Try -h or --help for more information."
|
||||
exit 1
|
||||
;;
|
||||
*) break;;
|
||||
esac
|
||||
shift;
|
||||
done
|
||||
|
||||
CUSTREPO="${CUSTREPO:-git@dev.iopsys.eu:consumer/iopsys.git}"
|
||||
|
||||
setup_dirs
|
||||
create_and_copy_files "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
register_command "genconfig" "Generate configuration for board and customer"
|
||||
@@ -1,457 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
function genconfig_min {
|
||||
export CLEAN=0
|
||||
export SRCTREEOVERR=0
|
||||
export FILEDIR="files/"
|
||||
CURRENT_CONFIG_FILE=".current_config_file"
|
||||
export CONFIGPATH="package/feeds/iopsys/iop"
|
||||
CUSTPATH="customerconfigs"
|
||||
export CUSTCONF="customerconfigs/customers"
|
||||
export VERBOSE=0
|
||||
#always use the mirror
|
||||
export DEVELOPER=0
|
||||
target="bogus"
|
||||
config_path=""
|
||||
bcm27xx="target/linux/iopsys-bcm27xx"
|
||||
brcm63xx_arm="target/linux/iopsys-brcm63xx-arm"
|
||||
ramips="target/linux/iopsys-ramips"
|
||||
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
|
||||
Yellow='\033[0;33m' # Yellow
|
||||
|
||||
function find_last {
|
||||
egrep "^[ #]*${1}[ =]" $2 | tail -n1
|
||||
}
|
||||
|
||||
function is_new {
|
||||
for opt in $conf_warned
|
||||
do
|
||||
if [ "$opt" == "$1" ]
|
||||
then
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
# option not found return true
|
||||
return 0
|
||||
}
|
||||
|
||||
function verify_config {
|
||||
IFS=$'\n'
|
||||
org=$(<.genconfig.config)
|
||||
unset IFS
|
||||
local num
|
||||
local conf_opt
|
||||
local conf_org
|
||||
local conf_new
|
||||
|
||||
#echo "lines to check $tot_lines"
|
||||
num=0
|
||||
for line in $org
|
||||
do
|
||||
conf_opt=$(echo $line | grep CONFIG_ | sed 's|.*\(CONFIG_[^ =]*\)[ =].*|\1|')
|
||||
if [ -n "${conf_opt}" ]
|
||||
then
|
||||
conf_org=$(find_last ${conf_opt} .genconfig.config)
|
||||
conf_new=$(find_last ${conf_opt} .config)
|
||||
if [ "$conf_org" != "$conf_new" ]
|
||||
then
|
||||
if is_new $conf_opt
|
||||
then
|
||||
echo -e "config option [${Red}$conf_opt${Color_Off}] is not set correctly in .config"
|
||||
echo -e "got value [${Yellow}$conf_new${Color_Off}] but wanted [${Yellow}$conf_org${Color_Off}]"
|
||||
echo "This is a real problem somebody needs to investigate"
|
||||
echo ""
|
||||
conf_warned="$conf_warned $conf_opt"
|
||||
fi
|
||||
else
|
||||
true
|
||||
# for debug to see all options
|
||||
#echo -e "wanted [$conf_org] got [$conf_new]"
|
||||
fi
|
||||
fi
|
||||
num=$((num+1))
|
||||
done
|
||||
}
|
||||
|
||||
# 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 '-' '_')"
|
||||
config_path="$targetpath/config"
|
||||
fi
|
||||
|
||||
return
|
||||
fi
|
||||
|
||||
[ -e $brcm63xx_arm/genconfig ] &&
|
||||
iopsys_brcm63xx_arm=$(cd $brcm63xx_arm; ./genconfig)
|
||||
[ -e $ramips/genconfig ] &&
|
||||
iopsys_ramips=$(cd $ramips; ./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_intel_mips iopsys_x86 iopsys_armvirt iopsys_bcm27xx; do
|
||||
echo "$list based boards:"
|
||||
for b in ${!list}; do
|
||||
echo -e "\t$b"
|
||||
done
|
||||
done
|
||||
return
|
||||
fi
|
||||
|
||||
for p in $iopsys_brcm63xx_arm; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_brcm63xx_arm"
|
||||
config_path="$brcm63xx_arm/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_ramips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_ramips"
|
||||
config_path="$ramips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_intel_mips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="intel_mips"
|
||||
config_path="$intel_mips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_x86; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_x86"
|
||||
config_path="$x86/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_armvirt; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_armvirt"
|
||||
config_path="$armvirt/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_bcm27xx; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_bcm27xx"
|
||||
config_path="$bcm27xx/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
git remote -v | grep -q http || {
|
||||
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() {
|
||||
[ "$VERBOSE" -ge 1 ] && echo "$@"
|
||||
}
|
||||
|
||||
usage() {
|
||||
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"
|
||||
echo -e " -l|--list [customer]\tList all Customers or all boards for one customer"
|
||||
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 dg400prime IOPSYS"
|
||||
echo
|
||||
exit 0
|
||||
}
|
||||
|
||||
list_customers()
|
||||
{
|
||||
local ALL="$1"
|
||||
local CUSTOMER="$2"
|
||||
if [ "$CUSTOMER" -a -d "$CUSTCONF/$CUSTOMER" ]; then
|
||||
local boards="$(ls -1 "$CUSTCONF/$CUSTOMER" | grep -v common )"
|
||||
if [ "$boards" ]; then
|
||||
echo "$CUSTOMER has following boards:"
|
||||
for board in $boards; do
|
||||
echo -e "\t$board"
|
||||
done
|
||||
else
|
||||
echo "No boards found for $CUSTOMER"
|
||||
fi
|
||||
elif [ "$CUSTOMER" ]; then
|
||||
echo "No customer called $CUSTOMER"
|
||||
exit 1
|
||||
elif [ -d $CUSTCONF ]; then
|
||||
local customers="$(ls -1 $CUSTCONF)"
|
||||
if [ "$customers" -a "$ALL" == 1 ]; then
|
||||
for customer in $customers; do
|
||||
echo $customer
|
||||
local boards="$(ls -1 $CUSTCONF/$customer | grep -v common )"
|
||||
if [ "$boards" ]; then
|
||||
for board in $boards; do
|
||||
echo -e "\t$board"
|
||||
done
|
||||
else
|
||||
echo "has no boards"
|
||||
fi
|
||||
done
|
||||
elif [ "$customers" ]; then
|
||||
echo -e "$customers"
|
||||
else
|
||||
echo "no customers found"
|
||||
fi
|
||||
else
|
||||
echo "No $CUSTCONF folder found"
|
||||
fi
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
||||
generate_config()
|
||||
{
|
||||
DIFFFILE="$1"
|
||||
MASTERFILE="$2"
|
||||
while read p; do
|
||||
v "$p"
|
||||
sed -r -i "$p" $MASTERFILE
|
||||
done < $DIFFFILE
|
||||
}
|
||||
|
||||
setup_dirs()
|
||||
{
|
||||
|
||||
if [ ! -d "$FILEDIR" ]; then
|
||||
mkdir -p $FILEDIR
|
||||
elif [ -d "$FILEDIR" -a $CLEAN -eq 1 ]; then
|
||||
v "rm -rf $FILEDIR*"
|
||||
rm -rf $FILEDIR*
|
||||
fi
|
||||
}
|
||||
|
||||
create_and_copy_files()
|
||||
{
|
||||
local BOARDTYPE=$1
|
||||
shift
|
||||
local CUSTOMERS=$@
|
||||
|
||||
# Validate seleced board and customers
|
||||
set_target $BOARDTYPE
|
||||
if [ $target == "bogus" ]; then
|
||||
echo "Hardware profile does not exist"
|
||||
exit 1
|
||||
elif [ -n "$CUSTOMERS" ]; then
|
||||
for CUSTOMER in $CUSTOMERS; do
|
||||
if [ ! -d "$CUSTCONF/$CUSTOMER/" ]; then
|
||||
echo "Customer profile for '$CUSTOMER' does not exist"
|
||||
exit 1
|
||||
elif [ ! -d "$CUSTCONF/$CUSTOMER/$BOARDTYPE/" ]; then
|
||||
echo "'$BOARDTYPE' board profile does not exist for customer '$CUSTOMER'"
|
||||
if [ -f "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
|
||||
echo "Common profile configuration will be used"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Generate base config
|
||||
rm -f .config
|
||||
v "Config $BOARDTYPE selected"
|
||||
v "cp $CONFIGPATH/config .config"
|
||||
cp $CONFIGPATH/config .config
|
||||
|
||||
if [ -f $config_path/config ]; then
|
||||
cat $config_path/config >> .config
|
||||
fi
|
||||
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
|
||||
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_${target}_${subtarget}_DEVICE_${BOARDTYPE}=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
|
||||
device=$(echo $BOARDTYPE | tr a-z A-Z)
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
else
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
|
||||
fi
|
||||
|
||||
echo "$CUSTOMERS $BOARDTYPE" > $CURRENT_CONFIG_FILE
|
||||
|
||||
# Add customerconfig diff if a customer is selected
|
||||
if [ -n "$CUSTOMERS" ]; then
|
||||
for CUSTOMER in $CUSTOMERS; do
|
||||
if [ -d "$CUSTCONF/$CUSTOMER/common/fs" ]; then
|
||||
v "cp -ar $CUSTCONF/$CUSTOMER/common/fs/* $FILEDIR"
|
||||
cp -ar $CUSTCONF/$CUSTOMER/common/fs/* $FILEDIR
|
||||
fi
|
||||
if [ -d "$CUSTCONF/$CUSTOMER/$BOARDTYPE/fs" ]; then
|
||||
v "cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR"
|
||||
cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR
|
||||
fi
|
||||
if [ -e "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
|
||||
v "Apply $CUSTCONF/$CUSTOMER/common/common.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/common/common.diff >> .config
|
||||
fi
|
||||
if [ -e "$CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff" ]; then
|
||||
v "Apply $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff >> .config
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Set target version
|
||||
local GIT_TAG=$(git describe --abbrev=0 --tags)
|
||||
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
|
||||
|
||||
# developer mode selected ?
|
||||
echo "CONFIG_DEVEL=y" >>.config
|
||||
|
||||
if [ -n "$BRCM_MAX_JOBS" ]
|
||||
then
|
||||
echo "CONFIG_BRCM_MAX_JOBS=\"1\"" >>.config
|
||||
fi
|
||||
|
||||
# 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
|
||||
# so just touch that file.
|
||||
[ -d ./build_dir ] && find build_dir/ -name "boardparms*c" -print0 2>/dev/null | xargs -0 touch 2>/dev/null
|
||||
|
||||
# Store generated config
|
||||
cp .config .genconfig.config
|
||||
|
||||
# Set default values based on selected parameters
|
||||
v "$(make defconfig 2>&1)"
|
||||
|
||||
echo Set version to $(grep -w CONFIG_TARGET_VERSION .config | cut -d'=' -f2 | tr -d '"')
|
||||
|
||||
# Clean base-file package to force rebuild when changing profile
|
||||
v "$(make package/base-files/clean 2>&1)"
|
||||
|
||||
verify_config
|
||||
}
|
||||
|
||||
####### main #####
|
||||
if [ ! -e tmp/.iop_bootstrap ]; then
|
||||
echo "You have not installed feeds. Running genconfig in this state would create a non functional configuration."
|
||||
echo "Run: iop feeds_update"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo Current profile:
|
||||
cat $CURRENT_CONFIG_FILE
|
||||
echo "Try ./iop genconfig -h' to get instructions if you want to change current config"
|
||||
exit 0
|
||||
else
|
||||
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;;
|
||||
-S|--brcmsingel) export BRCM_MAX_JOBS=1;;
|
||||
-h|--help) usage;;
|
||||
-l|--list) list_customers 0 $2;;
|
||||
-a|--list-all)list_customers 1;;
|
||||
-b|--boards)set_target LIST;exit 0;;
|
||||
-*)
|
||||
echo "Invalid option: $1 "
|
||||
echo "Try -h or --help for more information."
|
||||
exit 1
|
||||
;;
|
||||
*) break;;
|
||||
esac
|
||||
shift;
|
||||
done
|
||||
|
||||
setup_dirs
|
||||
create_and_copy_files "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
register_command "genconfig_min" "Generate configuration for customer with manual board configuration"
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user