mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-27 12:33:49 +08:00
Compare commits
91 Commits
elements-s
...
3.10.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed107abe0e | ||
|
|
7968558847 | ||
|
|
692fced9f9 | ||
|
|
7f467c553a | ||
|
|
c6383f1d0d | ||
|
|
db87f6c673 | ||
|
|
32a6438946 | ||
|
|
ebbe738a6b | ||
|
|
dddf21c8ea | ||
|
|
351cbf5689 | ||
|
|
1a520f8012 | ||
|
|
6d946f825d | ||
|
|
b99bfac5d7 | ||
|
|
c22ff6da15 | ||
|
|
ecaae37784 | ||
|
|
2b52dbf70c | ||
|
|
5c83411d48 | ||
|
|
3fa43ebf40 | ||
|
|
b7a2269497 | ||
|
|
d4a22863e0 | ||
|
|
db54b7165f | ||
|
|
3d02f139b4 | ||
|
|
9fe6844f61 | ||
|
|
3bc7e1f27f | ||
|
|
436089b432 | ||
|
|
7356870093 | ||
|
|
bbe890c36b | ||
|
|
94725e8e68 | ||
|
|
7cc38e0625 | ||
|
|
56f334af49 | ||
|
|
0c490c89a5 | ||
|
|
84c6f751aa | ||
|
|
e4784566d0 | ||
|
|
625624ac76 | ||
|
|
703aac1b4c | ||
|
|
a40e0c6f52 | ||
|
|
1da89a58b6 | ||
|
|
cb81c8fad6 | ||
|
|
22faec3230 | ||
|
|
805f16b1de | ||
|
|
ea72126e80 | ||
|
|
cffb90c2df | ||
|
|
01d2fe6833 | ||
|
|
55ccad945a | ||
|
|
7e20efba97 | ||
|
|
365daeb278 | ||
|
|
92727456cb | ||
|
|
bb5318f201 | ||
|
|
a66af826a1 | ||
|
|
b03c76dfb9 | ||
|
|
661c1b2a5a | ||
|
|
95d45b3381 | ||
|
|
e0cd51c35f | ||
|
|
267fa988d6 | ||
|
|
f9392373cc | ||
|
|
08ef748614 | ||
|
|
37d39e0c2e | ||
|
|
dd385b48d1 | ||
|
|
9d138db4b2 | ||
|
|
cb7b42c053 | ||
|
|
029ea2e421 | ||
|
|
d716d0acf9 | ||
|
|
b1b0d943d5 | ||
|
|
8795d9e33a | ||
|
|
44b177be66 | ||
|
|
850ee347fd | ||
|
|
0138e62150 | ||
|
|
2b39fd9b62 | ||
|
|
a8fd92202f | ||
|
|
bf7c00a79f | ||
|
|
db132ac5fa | ||
|
|
1617952d52 | ||
|
|
db50e5cd71 | ||
|
|
c061cc8408 | ||
|
|
fa0506d8ce | ||
|
|
ccf5ebd1f4 | ||
|
|
6f6ccb924a | ||
|
|
f08ab2223c | ||
|
|
df1978f7c4 | ||
|
|
800d8d5075 | ||
|
|
d5413838e1 | ||
|
|
ee8ae8c13f | ||
|
|
52652dd042 | ||
|
|
2afc1d59c9 | ||
|
|
c40b31720f | ||
|
|
930ff414cb | ||
|
|
87afc76177 | ||
|
|
94267e3d7a | ||
|
|
387fb9ebf8 | ||
|
|
e8dc59ac6b | ||
|
|
eeb5d0a0af |
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=asterisk18-mod
|
||||
PKG_VERSION:=1.8.10.1
|
||||
|
||||
PKG_SOURCE_VERSION:=015d279241d0ac5d8c1321aa6f78b9ae551575d1
|
||||
PKG_SOURCE_VERSION:=62c3764e6765fa9b1d22cb5dda26476e4742bdcf
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=http://public.inteno.se:/asterisk-1.8.x
|
||||
|
||||
@@ -455,6 +455,8 @@ define Package/asterisk18-mod/install
|
||||
$(INSTALL_DATA) ./files/asterisk.default $(1)/etc/default/asterisk
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/asterisk.init $(1)/etc/init.d/asterisk
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
|
||||
$(INSTALL_BIN) ./files/asterisk.hotplug $(1)/etc/hotplug.d/iface/80-asterisk
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-sounds/install
|
||||
|
||||
18
asterisk-1.8.x-mod/files/asterisk.hotplug
Normal file
18
asterisk-1.8.x-mod/files/asterisk.hotplug
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$ACTION" = ifup ] || exit 0
|
||||
|
||||
config_load voice_client
|
||||
config_get bindintf SIP bindintf
|
||||
|
||||
[ "$INTERFACE" == "$bindintf" ] || exit 0
|
||||
|
||||
. /lib/functions/network.sh
|
||||
|
||||
if [ -n "$bindintf" ]; then
|
||||
network_get_ipaddr bindaddr "$bindintf"
|
||||
bindaddr="${bindaddr:-0.0.0.0}"
|
||||
sed -i "s/bindaddr=.*/bindaddr=$bindaddr/g" /etc/asterisk/sip.conf
|
||||
[ -e /var/run/asterisk/asterisk.ctl ] && /etc/init.d/asterisk reload
|
||||
fi
|
||||
|
||||
@@ -9,25 +9,9 @@ USE_PROCD=1
|
||||
NAME=asterisk
|
||||
PROG=/usr/sbin/asterisk
|
||||
DEFAULT=/etc/default/asterisk
|
||||
CONFDIR=/etc/asterisk
|
||||
|
||||
init_asterisk() {
|
||||
# do not start asterisk until the
|
||||
# router receives a default route
|
||||
config_load voice_client
|
||||
local bindintf
|
||||
config_get bindintf SIP bindintf ""
|
||||
if [ "$bindintf" == "" ]; then
|
||||
while ! ip r | grep -q default; do
|
||||
sleep 1
|
||||
done
|
||||
else
|
||||
network_get_ipaddr ip "$bindintf"
|
||||
while [ "$ip" == "" ]; do
|
||||
sleep 1
|
||||
network_get_ipaddr ip "$bindintf"
|
||||
done
|
||||
fi
|
||||
|
||||
[ -f $DEFAULT ] && . $DEFAULT
|
||||
[ -d /var/run/asterisk ] || mkdir -p /var/run/asterisk
|
||||
[ -d /var/log/asterisk ] || mkdir -p /var/log/asterisk
|
||||
@@ -55,6 +39,7 @@ start_service() {
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
asterisk -rx "config reload $CONFDIR/sip.conf"
|
||||
asterisk -rx "core reload"
|
||||
asterisk -rx "dialplan reload"
|
||||
asterisk -rx "brcm reload"
|
||||
|
||||
@@ -11,7 +11,7 @@ PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.1.0
|
||||
PKG_SOURCE_URL:=http://public.inteno.se:/dectmngr2
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=3191d38385c8e46c3888859f196e41c7db4447bc
|
||||
PKG_SOURCE_VERSION:=17aa3b1d8d372ebcf4d37379f7cc4fb59c461d4b
|
||||
PKG_NAME:=dectmngr2
|
||||
|
||||
|
||||
|
||||
@@ -19,14 +19,14 @@ export PLATFORM_INCLUDE:=platforms/iopsys/build.mk
|
||||
|
||||
export DATE:=$(shell date +%Y-%m-%d-%H-%M-%S)
|
||||
export LOGIN:=$(shell whoami)
|
||||
BASE_PKG_VERSION:=4.0.1
|
||||
PKG_RELEASE:=RC17
|
||||
BASE_PKG_VERSION:=4.1.0
|
||||
PKG_RELEASE:=RC8
|
||||
PKG_VERSION:=$(BASE_PKG_VERSION)-$(PKG_RELEASE)_$(DATE)_$(LOGIN)
|
||||
export PKG_VERSION
|
||||
|
||||
###########################--RELEASE--################################
|
||||
|
||||
PKG_SOURCE_VERSION:=97a3da5fae8b5374a598c78346cb11477c85e293
|
||||
PKG_SOURCE_VERSION:=5d13d0034c0174cdb6d66f09a458851fe54d810e
|
||||
ifeq ($(CONFIG_ICE_OPEN),y)
|
||||
BRCM_KERNEL_PROFILE=$(shell echo $(CONFIG_BCM_KERNEL_PROFILE) | sed s/\"//g)
|
||||
PKG_SOURCE_URL:=http://iopsys.inteno.se/iopsys/consumer/
|
||||
@@ -45,7 +45,7 @@ endif
|
||||
|
||||
###########################--RELEASE--################################
|
||||
|
||||
#include $(INCLUDE_DIR)/uclibc++.mk
|
||||
include $(INCLUDE_DIR)/uclibc++.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/ice-client/Default
|
||||
@@ -58,8 +58,7 @@ define Package/ice-client
|
||||
$(call Package/ice-client/Default)
|
||||
TITLE:=ice-client
|
||||
MENU:=1
|
||||
DEPENDS:=+libopenssl +libstdcpp +libubus +ubus +ubusd +jshn +libubox +libpthread
|
||||
# DEPENDS:=+libopenssl +uclibcxx +libubus +ubus +ubusd +jshn +libubox +libpthread
|
||||
DEPENDS:=+libopenssl +uclibcxx +libubus +ubus +ubusd +jshn +libubox +libpthread
|
||||
endef
|
||||
|
||||
define Package/ice-client/config
|
||||
@@ -79,7 +78,7 @@ endef
|
||||
# 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
|
||||
# These settings allow you to specify a source 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
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=3.0-2016-10-20
|
||||
PKG_VERSION:=3.0-2017-01-20
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=http://public.inteno.se:/icwmp.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=fdaa1daa184205fe256bb155b7fb0f29a034baaa
|
||||
PKG_SOURCE_VERSION:=5c39d8d99127010c8d553495cd318ced80531a04
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
@@ -34,7 +34,7 @@ define Package/icwmp/Default
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=CWMP client
|
||||
DEPENDS:=+libuci +libmicroxml +libubox +jshn +libubus +libblobmsg-json +libpthread +ubusd +shflags +getopt +zlib +libjson-c +libopenssl +libexpat +libstrophe +curl
|
||||
DEPENDS:=+libuci +libmicroxml +libubox +jshn +libubus +libblobmsg-json +libpthread +ubusd +shflags +getopt +zlib +libjson-c +libopenssl +libexpat +libstrophe +curl +libtrace
|
||||
endef
|
||||
|
||||
define Package/icwmp/description
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
include /lib/network
|
||||
|
||||
[ "$INTERFACE" != "$(uci get layer2_interface_ethernet.Wan.ifname)" ] && exit
|
||||
[ "$(uci get netmode.setup.curmode)" != "repeater" ] && exit
|
||||
|
||||
case "$(uci get netmode.setup.curmode)" in
|
||||
repeater|repeater_dualdown) echo "Preparing to switch mode" ;;
|
||||
|
||||
@@ -69,6 +69,13 @@ populate_netmodes() {
|
||||
local hardware=$(db get hw.board.hardware)
|
||||
local keys lang desc exp exclude
|
||||
for mode in $(ls $modedir); do
|
||||
|
||||
case "$mode" in
|
||||
repeater*)
|
||||
wlctl -i wl1 ap >/dev/null 2>&1 || continue
|
||||
;;
|
||||
esac
|
||||
|
||||
lang=""
|
||||
desc=""
|
||||
exp=""
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
config settings 'settings'
|
||||
option disabled '0'
|
||||
|
||||
config defaults
|
||||
option syn_flood 1
|
||||
option input ACCEPT
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
config settings 'settings'
|
||||
option disabled '0'
|
||||
|
||||
config defaults
|
||||
option syn_flood 1
|
||||
option input ACCEPT
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
{
|
||||
"description": [
|
||||
{ "en" : "Repeater 2.4▴▾2.4&5" },
|
||||
{ "sv" : "Repeater 2.4▴▾2.4&5" }
|
||||
{ "en" : "Repeater 2.4▴▾5" },
|
||||
{ "sv" : "Repeater 2.4▴▾5" }
|
||||
],
|
||||
"explanation": [
|
||||
{ "en" : "Your router is going to act as a wired extender or wireless repeater to the selected Wireless Access Point. Uplink 2.4G & Downlink 2.4G + 5G" },
|
||||
{ "sv" : "Routern kommer att fungera som en trådbunden extender eller trådlös repeater till den valda trådlösa åtkomstpunkten. Uplink 2.4G & Downlink 2.4G + 5G" }
|
||||
{ "en" : "Your router is going to act as a wired extender or wireless repeater to the selected Wireless Access Point. Uplink 2.4G & Downlink 5G" },
|
||||
{ "sv" : "Routern kommer att fungera som en trådbunden extender eller trådlös repeater till den valda trådlösa åtkomstpunkten. Uplink 2.4G & Downlink 5G" }
|
||||
],
|
||||
"excluded_boards" : [
|
||||
"DG*",
|
||||
"EG*",
|
||||
"VG*"
|
||||
"DG15*",
|
||||
"DG40*",
|
||||
"EG40*"
|
||||
],
|
||||
"acl" : [
|
||||
"admin"
|
||||
],
|
||||
"credentials" : 1,
|
||||
"reboot" : 0
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
config settings 'settings'
|
||||
option disabled '0'
|
||||
|
||||
config defaults
|
||||
option syn_flood 1
|
||||
option input ACCEPT
|
||||
@@ -8,7 +11,6 @@ config defaults
|
||||
|
||||
config zone
|
||||
option name lan
|
||||
list network 'lan'
|
||||
option input ACCEPT
|
||||
option output ACCEPT
|
||||
option forward ACCEPT
|
||||
|
||||
@@ -11,14 +11,6 @@ config interface 'wan'
|
||||
option proto 'dhcp'
|
||||
option vendorid 'Inteno_Repeater_$MAC4'
|
||||
option hostname 'Inteno_Repeater_$MAC4'
|
||||
option ifname '$WAN.1'
|
||||
option ifname '$WAN.1 $LAN1 $LAN2 $LAN3 $LAN4'
|
||||
option reqopts '43'
|
||||
|
||||
config interface 'lan'
|
||||
option is_lan '1'
|
||||
option type 'bridge'
|
||||
option proto 'static'
|
||||
option ifname '$LAN1 $LAN2 $LAN3 $LAN4'
|
||||
option ipaddr '192.168.11.1'
|
||||
option netmask '255.255.255.0'
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ config wifi-device 'wl0'
|
||||
option type 'broadcom'
|
||||
option country 'EU/13'
|
||||
option band 'a'
|
||||
option bandwidth '20'
|
||||
option bandwidth '80'
|
||||
option hwmode '11ac'
|
||||
option channel 'auto'
|
||||
option scantimer '15'
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
{
|
||||
"description": [
|
||||
{ "en" : "Repeater 2.4▴▾5" },
|
||||
{ "sv" : "Repeater 2.4▴▾5" }
|
||||
{ "en" : "Repeater 2.4▴▾2.4&5" },
|
||||
{ "sv" : "Repeater 2.4▴▾2.4&5" }
|
||||
],
|
||||
"explanation": [
|
||||
{ "en" : "Your router is going to act as a wired extender or wireless repeater to the selected Wireless Access Point. Uplink 2.4G & Downlink 5G" },
|
||||
{ "sv" : "Routern kommer att fungera som en trådbunden extender eller trådlös repeater till den valda trådlösa åtkomstpunkten. Uplink 2.4G & Downlink 5G" }
|
||||
{ "en" : "Your router is going to act as a wired extender or wireless repeater to the selected Wireless Access Point. Uplink 2.4G & Downlink 2.4G + 5G" },
|
||||
{ "sv" : "Routern kommer att fungera som en trådbunden extender eller trådlös repeater till den valda trådlösa åtkomstpunkten. Uplink 2.4G & Downlink 2.4G + 5G" }
|
||||
],
|
||||
"excluded_boards" : [
|
||||
"DG*",
|
||||
"EG*",
|
||||
"VG*"
|
||||
"DG15*",
|
||||
"DG40*",
|
||||
"EG40*"
|
||||
],
|
||||
"acl" : [
|
||||
"admin"
|
||||
],
|
||||
"credentials" : 1,
|
||||
"reboot" : 0
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
config settings 'settings'
|
||||
option disabled '0'
|
||||
|
||||
config defaults
|
||||
option syn_flood 1
|
||||
option input ACCEPT
|
||||
@@ -8,7 +11,6 @@ config defaults
|
||||
|
||||
config zone
|
||||
option name lan
|
||||
list network 'lan'
|
||||
option input ACCEPT
|
||||
option output ACCEPT
|
||||
option forward ACCEPT
|
||||
|
||||
@@ -11,14 +11,6 @@ config interface 'wan'
|
||||
option proto 'dhcp'
|
||||
option vendorid 'Inteno_Repeater_$MAC4'
|
||||
option hostname 'Inteno_Repeater_$MAC4'
|
||||
option ifname '$WAN.1'
|
||||
option ifname '$WAN.1 $LAN1 $LAN2 $LAN3 $LAN4'
|
||||
option reqopts '43'
|
||||
|
||||
config interface 'lan'
|
||||
option is_lan '1'
|
||||
option type 'bridge'
|
||||
option proto 'static'
|
||||
option ifname '$LAN1 $LAN2 $LAN3 $LAN4'
|
||||
option ipaddr '192.168.11.1'
|
||||
option netmask '255.255.255.0'
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ config wifi-device 'wl0'
|
||||
option type 'broadcom'
|
||||
option country 'EU/13'
|
||||
option band 'a'
|
||||
option bandwidth '20'
|
||||
option bandwidth '80'
|
||||
option hwmode '11ac'
|
||||
option channel 'auto'
|
||||
option scantimer '15'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
config settings settings
|
||||
option disabled 0
|
||||
config settings 'settings'
|
||||
option disabled '0'
|
||||
|
||||
config defaults
|
||||
option syn_flood 1
|
||||
|
||||
@@ -136,6 +136,7 @@ CONFIG_PACKAGE_umbim=y
|
||||
CONFIG_PACKAGE_uqmi=y
|
||||
CONFIG_PACKAGE_usb-modeswitch=y
|
||||
CONFIG_PACKAGE_usbreset=y
|
||||
CONFIG_PACKAGE_wget=y
|
||||
CONFIG_PACKAGE_wwan=y
|
||||
CONFIG_PACKAGE_xl2tpd=y
|
||||
CONFIG_PACKAGE_zoneinfo-core=y
|
||||
@@ -185,6 +186,7 @@ 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
|
||||
|
||||
@@ -1,297 +1,352 @@
|
||||
#!/bin/bash
|
||||
|
||||
function genconfig {
|
||||
export CLEAN=0
|
||||
export IMPORT=0
|
||||
export SRCTREEOVERR=0
|
||||
export FILEDIR="files/"
|
||||
export CONFIGPATH="package/feeds/feed_inteno_packages/iop/configs"
|
||||
export CUSTCONF="customerconfigs"
|
||||
export VERBOSE=0
|
||||
export DEVELOPER=0
|
||||
LOCAL_MIRROR="http://mirror.inteno.se/mirror"
|
||||
export CLEAN=0
|
||||
export IMPORT=1
|
||||
export SRCTREEOVERR=0
|
||||
export FILEDIR="files/"
|
||||
export THEMEDIR="themes"
|
||||
CURRENT_CONFIG_FILE=".current_config_file"
|
||||
export CONFIGPATH="package/feeds/feed_inteno_packages/iop/configs"
|
||||
CUSTPATH="customerconfigs"
|
||||
CUSTREPO="git@private.inteno.se:customerconfigs"
|
||||
export CUSTCONF="customerconfigs/customers"
|
||||
export VERBOSE=0
|
||||
export DEVELOPER=0
|
||||
LOCAL_MIRROR="http://mirror.inteno.se/mirror"
|
||||
|
||||
iopsys_brcm63xx_mips="cg300 cg301 dg150 dg150v2 dg150alv2 dg200 dg200al dg301 dg301al eg300 vg50 vox25"
|
||||
iopsys_brcm63xx_arm="dg400 eg400"
|
||||
iopsys_ramips="ex400"
|
||||
ramips="mt7621"
|
||||
target="bogus"
|
||||
masterconfig=1
|
||||
|
||||
set_target() {
|
||||
iopsys_brcm63xx_mips="cg300 cg301 dg150 dg150v2 dg150alv2 dg200 dg200al dg301 dg301al eg300 vg50 vox25"
|
||||
iopsys_brcm63xx_arm="dg400 eg400"
|
||||
iopsys_ramips="ex400"
|
||||
ramips="mt7621"
|
||||
target="bogus"
|
||||
masterconfig=1
|
||||
|
||||
set_target()
|
||||
{
|
||||
local profile=$1
|
||||
|
||||
for p in $iopsys_brcm63xx_mips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_brcm63xx_mips"
|
||||
return
|
||||
fi
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_brcm63xx_mips"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_brcm63xx_arm; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_brcm63xx_arm"
|
||||
return
|
||||
fi
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_brcm63xx_arm"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_ramips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_ramips"
|
||||
return
|
||||
fi
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_ramips"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $ramips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="ramips"
|
||||
masterconfig=0
|
||||
return
|
||||
fi
|
||||
if [ $p == $profile ]; then
|
||||
target="ramips"
|
||||
masterconfig=0
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
git remote -v | grep -q http || {
|
||||
DEVELOPER=1
|
||||
|
||||
bcmAllowed=0
|
||||
iceAllowed=0
|
||||
endptAllowed=0
|
||||
natalieAllowed=0
|
||||
|
||||
allowedRepos="$(ssh -o ConnectTimeout=5 git@private.inteno.se 2>/dev/null | grep -w 'R\|W' | awk '{print$NF}')"
|
||||
for repo in $allowedRepos; do
|
||||
case $repo in
|
||||
bcmkernel) bcmAllowed=1 ;;
|
||||
ice-client) iceAllowed=1 ;;
|
||||
endptcfg) endptAllowed=1 ;;
|
||||
natalie-dect*) natalieAllowed=1 ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
v() {
|
||||
[ "$VERBOSE" -ge 1 ] && echo "$@"
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo
|
||||
echo 1>&2 "Usage: $0 [ OPTIONS ] < Board_Type > [ Customer ]"
|
||||
echo
|
||||
echo -e " -c|--clean\tRemove all files under ./files and import from config "
|
||||
echo -e " -v|--verbose\tVerbose"
|
||||
echo -e " -n|--no-update\tDo NOT! Update customer config before applying"
|
||||
echo -e " -p|--profile\tSet profile (if exists) default juci"
|
||||
echo -e " -s|--override\tEnable 'Package source tree override'"
|
||||
echo -e " -h|--help\tShow this message"
|
||||
echo -e " -l|--list [customer]\tList all Customers or all boards for one customer"
|
||||
echo -e " -a|--list-all\tList all Customers and their board types"
|
||||
echo
|
||||
echo "Example ./iop genconfig vg50 TELIA"
|
||||
echo "(if no customerconfig is chosen the Inteno 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)"
|
||||
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 "$1" == 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
|
||||
}
|
||||
|
||||
|
||||
git remote -v | grep -q http || {
|
||||
DEVELOPER=1
|
||||
use_local_mirror()
|
||||
{
|
||||
if wget -T 3 -t 2 -O /dev/null $LOCAL_MIRROR >/dev/null 2>/dev/null; then
|
||||
echo "mirror [$LOCAL_MIRROR] exists. Using local mirror"
|
||||
sed -i "s;CONFIG_LOCALMIRROR=.*;CONFIG_LOCALMIRROR=\"$LOCAL_MIRROR\";" .config
|
||||
else
|
||||
echo "mirror [$LOCAL_MIRROR] does not exist. Not using local mirror"
|
||||
fi
|
||||
}
|
||||
|
||||
bcmAllowed=0
|
||||
iceAllowed=0
|
||||
endptAllowed=0
|
||||
natalieAllowed=0
|
||||
|
||||
allowedRepos="$(ssh -o ConnectTimeout=5 git@private.inteno.se 2>/dev/null | grep -w 'R\|W' | awk '{print$NF}')"
|
||||
for repo in $allowedRepos; do
|
||||
case $repo in
|
||||
bcmkernel) bcmAllowed=1 ;;
|
||||
ice-client) iceAllowed=1 ;;
|
||||
endptcfg) endptAllowed=1 ;;
|
||||
natalie-dect*) natalieAllowed=1 ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
v() {
|
||||
[ "$VERBOSE" -ge 1 ] && echo "$@"
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo
|
||||
echo 1>&2 "Usage: $0 [OPTIONS] BoardConfig Customerconfig"
|
||||
echo
|
||||
echo " -c, remove all files under ./files and import from config "
|
||||
echo " -v, verbose"
|
||||
echo " -u, Update customer config before applying"
|
||||
echo " -p, set profile (if exists)"
|
||||
echo " -t, use latest git tag and number of commits since as version for the build"
|
||||
echo " -s, enable 'Package source tree override'"
|
||||
echo
|
||||
echo "BoardConfig ex "
|
||||
ls -1 configs
|
||||
if [ -d "$CUSTCONF/$1" ]; then
|
||||
echo "Customerconfig ex"
|
||||
ls $CUSTCONF/*
|
||||
fi
|
||||
echo
|
||||
echo "Example ./genconfig vg50 TELIA"
|
||||
echo "(if no customerconfig is chosen the Inteno Config will be used)"
|
||||
echo
|
||||
exit 127
|
||||
}
|
||||
|
||||
use_local_mirror()
|
||||
{
|
||||
if wget -T 3 -t 2 -O /dev/null $LOCAL_MIRROR >/dev/null 2>/dev/null
|
||||
then
|
||||
echo "mirror [$LOCAL_MIRROR] exists. Using local mirror"
|
||||
sed -i "s;CONFIG_LOCALMIRROR=.*;CONFIG_LOCALMIRROR=\"$LOCAL_MIRROR\";" .config
|
||||
else
|
||||
echo "mirror [$LOCAL_MIRROR] does not exist. Not using local mirror"
|
||||
fi
|
||||
}
|
||||
|
||||
generate_config()
|
||||
{
|
||||
generate_config()
|
||||
{
|
||||
DIFFFILE="$1"
|
||||
MASTERFILE="$2"
|
||||
while read p; do
|
||||
v "$p"
|
||||
sed -r -i "$p" $MASTERFILE
|
||||
v "$p"
|
||||
sed -r -i "$p" $MASTERFILE
|
||||
done < $DIFFFILE
|
||||
}
|
||||
}
|
||||
|
||||
setup_dirs()
|
||||
{
|
||||
if [ $DEVELOPER -eq 1 ]; then
|
||||
if [ ! -d "$CUSTCONF" ]; then
|
||||
git clone git@private.inteno.se:customerconfigs
|
||||
elif [ $IMPORT -eq 1 ]; then
|
||||
cd customerconfigs
|
||||
v "git pull"
|
||||
git pull
|
||||
cd ..
|
||||
fi
|
||||
setup_dirs()
|
||||
{
|
||||
if [ $DEVELOPER -eq 1 ]; 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
|
||||
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
|
||||
local CUSTOMER=$2
|
||||
|
||||
# Validate seleced board and customer
|
||||
set_target $BOARDTYPE
|
||||
if [ $target == "bogus" ]; then
|
||||
echo "Hardware profile does not exist"
|
||||
exit 1
|
||||
elif [ -n "$CUSTOMER" -a ! -d "$CUSTCONF/$CUSTOMER/$BOARDTYPE/" ]; then
|
||||
echo "Customer profile does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Generate base config
|
||||
# Used only for iopsys targets, not openwrt targets
|
||||
rm -f .config
|
||||
if [ $masterconfig -eq 1 ]; then
|
||||
v "Config $BOARDTYPE selected"
|
||||
v "cp $CONFIGPATH/config .config"
|
||||
cp $CONFIGPATH/config .config
|
||||
fi
|
||||
|
||||
# Apply profile diff to master config if selected
|
||||
if [ -n "$PROFILE" ]; then
|
||||
if [ -e "$CONFIGPATH/$PROFILE.diff" ]; then
|
||||
cat $CONFIGPATH/$PROFILE.diff >> .config
|
||||
elif [ "$PROFILE" == "juci" ]; then
|
||||
v "Default profile (juci) is selected."
|
||||
else
|
||||
echo "ERROR: profile $PROFILE does not exist!"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
v "No profile selected! Using default."
|
||||
fi
|
||||
|
||||
# Set target and profile
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
|
||||
|
||||
echo "$CUSTOMER $BOARDTYPE" > $CURRENT_CONFIG_FILE
|
||||
|
||||
# Add customerconfig diff if a customer is selected
|
||||
if [ -n "$CUSTOMER" ]; then
|
||||
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
|
||||
fi
|
||||
if [ -e "$CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff" ]; then
|
||||
v "Apply $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff >> .config
|
||||
fi
|
||||
fi
|
||||
|
||||
# Set target version
|
||||
local GIT_TAG=$(git describe --abbrev=0 --tags)
|
||||
echo "CONFIG_TARGET_VERSION=\"${GIT_TAG}\"" >> .config
|
||||
|
||||
# Enable Pckage source tree override if selected
|
||||
[ $SRCTREEOVERR -eq 1 ] && echo CONFIG_SRC_TREE_OVERRIDE=y >> .config
|
||||
|
||||
# developer mode selected ?
|
||||
if [ $DEVELOPER -eq 1 ]; then
|
||||
# rewrite url to clone with ssh instead of http
|
||||
echo "CONFIG_DEVEL=y" >>.config
|
||||
echo "CONFIG_GITMIRROR_REWRITE=y" >>.config
|
||||
[ $bcmAllowed -eq 0 ] && echo "CONFIG_BCM_OPEN=y" >> .config
|
||||
[ $iceAllowed -eq 0 ] && echo "CONFIG_ICE_OPEN=y" >> .config
|
||||
[ $endptAllowed -eq 0 ] && echo "CONFIG_ENDPT_OPEN=y" >> .config
|
||||
[ $natalieAllowed -eq 0 ] && echo "CONFIG_NATALIE_OPEN=y" >> .config
|
||||
else
|
||||
echo "CONFIG_BCM_OPEN=y" >> .config
|
||||
echo "CONFIG_ICE_OPEN=y" >> .config
|
||||
echo "CONFIG_ENDPT_OPEN=y" >> .config
|
||||
echo "CONFIG_NATALIE_OPEN=y" >> .config
|
||||
fi
|
||||
|
||||
# Force regeneration of themes
|
||||
touch package/feeds/feed_inteno_juci/juci/Makefile
|
||||
|
||||
# Force regeneration of kernel Makefile
|
||||
# Needed to disable kmods for iopsys-brcm targets
|
||||
touch package/kernel/linux/Makefile
|
||||
|
||||
# Set default values based on selected parameters
|
||||
v "$(make defconfig 2>&1)"
|
||||
|
||||
# Temporary fixup for juci/luci profile
|
||||
if [ "$PROFILE" == "luci" ]; then
|
||||
sed -i '/CONFIG_DEFAULT_juci/d' .config
|
||||
sed -i '/CONFIG_PACKAGE_juci/d' .config
|
||||
sed -i '/CONFIG_PACKAGE_uhttpd/d' .config
|
||||
fi
|
||||
|
||||
if [ $masterconfig -eq 1 ]; then
|
||||
echo Set version to $(grep -w CONFIG_TARGET_VERSION .config | cut -d'=' -f2 | tr -d '"')
|
||||
fi
|
||||
|
||||
# Clean base-file package to force rebuild when changing profile
|
||||
v "$(make package/base-files/clean 2>&1)"
|
||||
}
|
||||
|
||||
####### 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 [ ! -d "$FILEDIR" ]; then
|
||||
mkdir $FILEDIR
|
||||
elif [ -d "$FILEDIR" -a $CLEAN -eq 1 ]; then
|
||||
v "rm -rf $FILEDIR*"
|
||||
rm -rf $FILEDIR*
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
create_and_copy_files()
|
||||
{
|
||||
local BOARDTYPE=$1
|
||||
local CUSTOMER=$2
|
||||
|
||||
# Validate seleced board and customer
|
||||
set_target $BOARDTYPE
|
||||
if [ $target == "bogus" ]; then
|
||||
echo "Hardware profile does not exist"
|
||||
exit 1
|
||||
elif [ -n "$CUSTOMER" -a ! -d "$CUSTCONF/$BOARDTYPE/$CUSTOMER/" ]; then
|
||||
echo "Customer profile does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Generate base config
|
||||
# Used only for iopsys targets, not openwrt targets
|
||||
rm -f .config
|
||||
if [ $masterconfig -eq 1 ]; then
|
||||
v "Config $BOARDTYPE selected"
|
||||
v "cp $CONFIGPATH/config .config"
|
||||
cp $CONFIGPATH/config .config
|
||||
fi
|
||||
|
||||
# Apply profile diff to master config if selected
|
||||
if [ -n "$PROFILE" ]; then
|
||||
if [ -e "$CONFIGPATH/$PROFILE.diff" ]; then
|
||||
cat $CONFIGPATH/$PROFILE.diff >> .config
|
||||
elif [ "$PROFILE" == "juci" ]; then
|
||||
v "Default profile (juci) is selected."
|
||||
else
|
||||
echo "ERROR: profile $PROFILE does not exist!"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
v "No profile selected! Using default."
|
||||
fi
|
||||
|
||||
# Set target and profile
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
|
||||
|
||||
echo "$BOARDTYPE $CUSTOMER" > .current_config_file
|
||||
|
||||
# Add customerconfig diff if a customer is selected
|
||||
if [ -n "$CUSTOMER" ]; then
|
||||
if [ -d "$CUSTCONF/$BOARDTYPE/$CUSTOMER/fs" ]; then
|
||||
v "cp -rLp $CUSTCONF/$BOARDTYPE/$CUSTOMER/fs/* $FILEDIR"
|
||||
cp -rLp $CUSTCONF/$BOARDTYPE/$CUSTOMER/fs/* $FILEDIR
|
||||
fi
|
||||
if [ -e "$CUSTCONF/$BOARDTYPE/$CUSTOMER/$BOARDTYPE.diff" ]; then
|
||||
v "Apply $CUSTCONF/$BOARDTYPE/$CUSTOMER/$BOARDTYPE.diff"
|
||||
cat $CUSTCONF/$BOARDTYPE/$CUSTOMER/$BOARDTYPE.diff >> .config
|
||||
fi
|
||||
fi
|
||||
|
||||
# Set target version
|
||||
local GIT_TAG=$(git describe --abbrev=0 --tags)
|
||||
echo "CONFIG_TARGET_VERSION=\"${GIT_TAG}\"" >> .config
|
||||
|
||||
|
||||
# Enable Pckage source tree override if selected
|
||||
[ $SRCTREEOVERR -eq 1 ] && \
|
||||
echo CONFIG_SRC_TREE_OVERRIDE=y >> .config
|
||||
|
||||
|
||||
# developer mode selected ?
|
||||
if [ $DEVELOPER -eq 1 ]; then
|
||||
# rewrite url to clone with ssh instead of http
|
||||
echo "CONFIG_DEVEL=y" >>.config
|
||||
echo "CONFIG_GITMIRROR_REWRITE=y" >>.config
|
||||
[ $bcmAllowed -eq 0 ] && echo "CONFIG_BCM_OPEN=y" >> .config
|
||||
[ $iceAllowed -eq 0 ] && echo "CONFIG_ICE_OPEN=y" >> .config
|
||||
[ $endptAllowed -eq 0 ] && echo "CONFIG_ENDPT_OPEN=y" >> .config
|
||||
[ $natalieAllowed -eq 0 ] && echo "CONFIG_NATALIE_OPEN=y" >> .config
|
||||
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
|
||||
echo "CONFIG_BCM_OPEN=y" >> .config
|
||||
echo "CONFIG_ICE_OPEN=y" >> .config
|
||||
echo "CONFIG_ENDPT_OPEN=y" >> .config
|
||||
echo "CONFIG_NATALIE_OPEN=y" >> .config
|
||||
while [ -n "$1" ]; do
|
||||
case "$1" in
|
||||
|
||||
-c|--clean) export CLEAN=1;;
|
||||
-n|--no-update) export IMPORT=0;;
|
||||
-v|--verbose) export VERBOSE="$(($VERBOSE + 1))";;
|
||||
-p|--profile) export PROFILE="$2"; shift;;
|
||||
-s|--override) export SRCTREEOVERR=1;;
|
||||
-h|--help) usage;;
|
||||
-l|--list) list_customers 0 $2;;
|
||||
-a|--list-all)list_customers 1;;
|
||||
-*)
|
||||
echo "Invalid option: $1 "
|
||||
echo "Try -h or --help for more information."
|
||||
exit 1
|
||||
;;
|
||||
*) break;;
|
||||
esac
|
||||
shift;
|
||||
done
|
||||
setup_dirs
|
||||
create_and_copy_files "$1" "$2"
|
||||
|
||||
if [ $masterconfig -eq 1 ]; then
|
||||
use_local_mirror
|
||||
fi
|
||||
fi
|
||||
|
||||
# Force regeneration of kernel Makefile
|
||||
# Needed to disable kmods for iopsys-brcm targets
|
||||
touch package/kernel/linux/Makefile
|
||||
|
||||
# Set default values based on selected parameters
|
||||
make defconfig
|
||||
|
||||
# Temporary fixup for juci/luci profile
|
||||
if [ "$PROFILE" == "luci" ]; then
|
||||
sed -i '/CONFIG_DEFAULT_juci/d' .config
|
||||
sed -i '/CONFIG_PACKAGE_juci/d' .config
|
||||
sed -i '/CONFIG_PACKAGE_uhttpd/d' .config
|
||||
fi
|
||||
|
||||
if [ $masterconfig -eq 1 ]; then
|
||||
echo Set version to $(grep -w CONFIG_TARGET_VERSION .config | cut -d'=' -f2 | tr -d '"')
|
||||
fi
|
||||
|
||||
# Clean base-file package to force rebuild when changing profile
|
||||
make package/base-files/clean
|
||||
|
||||
|
||||
}
|
||||
|
||||
####### 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_get_config.sh -h' to get instructions if you want to change current config"
|
||||
exit 0
|
||||
else
|
||||
|
||||
while [ -n "$1" ]; do
|
||||
case "$1" in
|
||||
|
||||
-c) export CLEAN=1;;
|
||||
-u) export IMPORT=1;;
|
||||
-v) export VERBOSE="$(($VERBOSE + 1))";;
|
||||
-p) export PROFILE="$2"; shift;;
|
||||
-t) export USE_TAG=1;;
|
||||
-s) export SRCTREEOVERR=1;;
|
||||
-h) usage;;
|
||||
-*)
|
||||
echo "Invalid option: $1 "
|
||||
echo "Try -h' for more information."
|
||||
exit 1
|
||||
;;
|
||||
*) break;;
|
||||
esac
|
||||
shift;
|
||||
done
|
||||
setup_dirs
|
||||
create_and_copy_files "$1" "$2"
|
||||
|
||||
if [ $masterconfig -eq 1 ]; then
|
||||
use_local_mirror
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
register_command "genconfig" "Generate configuration for board and customer"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
UPDATE=0
|
||||
|
||||
print_git_update()
|
||||
{
|
||||
@@ -99,6 +100,28 @@ insert_hash_in_feed_makefile()
|
||||
(cd ${PKG_DIR}; git add ${name})
|
||||
}
|
||||
|
||||
insert_version_in_feed_makefile()
|
||||
{
|
||||
if [ -n "$PKG_SOURCE_VERSION_FILE" ]
|
||||
then
|
||||
name="$PKG_SOURCE_VERSION_FILE"
|
||||
else
|
||||
name=Makefile
|
||||
fi
|
||||
|
||||
last_version=$(awk -F '=' '/PKG_VERSION:=/ {print $2}' ${PKG_DIR}/${name})
|
||||
|
||||
echo -n "please enter version: "
|
||||
read -ei "$last_version" answer
|
||||
|
||||
if [ -z ${answer} ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
sed -i -e "s/\(^PKG_VERSION:=\).*/\1${answer}/" ${PKG_DIR}/${name}
|
||||
(cd ${PKG_DIR}; git add ${name})
|
||||
}
|
||||
|
||||
|
||||
# BUG: fix if only local branche name!
|
||||
branch_uptodate()
|
||||
@@ -400,6 +423,7 @@ check_packages()
|
||||
# print_git_update
|
||||
git_repos_uptodate
|
||||
insert_hash_in_feed_makefile
|
||||
[ "${UPDATE}" ] && insert_version_in_feed_makefile
|
||||
create_message >tmp/msg
|
||||
commit_feed tmp/msg
|
||||
insert_hash_in_feeds_config
|
||||
@@ -547,6 +571,13 @@ feeds_at_top()
|
||||
exit 0
|
||||
}
|
||||
|
||||
usage(){
|
||||
echo -e "$0 [flags]"
|
||||
echo -e "flags:"
|
||||
echo -e " -v\tVerbose mode"
|
||||
echo -e " -h\tShow this help"
|
||||
echo -e " -u\tUpdate package version\n"
|
||||
}
|
||||
|
||||
# Exported interface
|
||||
function update_package {
|
||||
@@ -563,15 +594,18 @@ function update_package {
|
||||
Cyan='\033[0;36m' # Cyan
|
||||
White='\033[0;37m' # White
|
||||
|
||||
while getopts "v:h" opt; do
|
||||
while getopts "v:hu" opt; do
|
||||
case $opt in
|
||||
v)
|
||||
verbose=$OPTARG
|
||||
;;
|
||||
h)
|
||||
echo "some help! No options yet"
|
||||
exit 1
|
||||
;;
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
u)
|
||||
UPDATE=1
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
exit 1
|
||||
|
||||
@@ -381,12 +381,14 @@ done
|
||||
|
||||
# Process IUP related DHCP options #
|
||||
if [ -n "$1" ]; then
|
||||
local privopt224 vendorspecinf httpurl128
|
||||
local privopt224 privopt225 privopt226 vendorspecinf httpurl128
|
||||
local tftp bootfile vlanid vlanpriority interface
|
||||
|
||||
json_load "$1"
|
||||
json_get_var interface interface
|
||||
json_get_var privopt224 privopt224
|
||||
json_get_var privopt225 privopt225
|
||||
json_get_var privopt226 privopt226
|
||||
json_get_var vendorspecinf vendorspecinf
|
||||
json_get_var httpurl128 httpurl128
|
||||
json_get_var tftp tftp
|
||||
@@ -422,6 +424,24 @@ if [ -n "$1" ]; then
|
||||
elif [ -n "$vlanid" ]; then
|
||||
logger -t dhcp_opt132 "vlanid: ${vlanid}"
|
||||
change_to_vlan ${vlanid} 0 ${interface}
|
||||
elif [ -n "$privopt225" ] || [ -n "$privopt226" ]; then
|
||||
# opt225 and opt226 can be used together or separatly
|
||||
if [ -n "$privopt225" ]; then
|
||||
echo "dhcp option 225: $privopt225" >/dev/console
|
||||
# option225 is allowd to change only once per CPE
|
||||
if [ "$(uci get -q ice.cloud.frozen)" != "1" ] ; then
|
||||
uci set ice.cloud.frozen="1"
|
||||
uci set ice.cloud.enabled="1"
|
||||
uci set ice.cloud.server="$privopt225"
|
||||
fi
|
||||
fi
|
||||
if [ -n "$privopt226" ]; then
|
||||
echo "dhcp option 226: $privopt226" >/dev/console
|
||||
[ -z "$(uci get -q ice.dhcp)" ] && uci set ice.dhcp="dhcp"
|
||||
uci set ice.dhcp.opt226connectionid="$privopt226"
|
||||
ubus send dhcp.opt226connectionid '{"opt226connectionid":"","value":"'$privopt226'"}'
|
||||
fi
|
||||
uci commit
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -85,6 +85,7 @@ wlmngr_doWlConf() {
|
||||
|
||||
#wlctl -i wl$idx nreqd $nreqd
|
||||
wlconf wl$idx up
|
||||
wlctl -i wl$idx obss_coex 1
|
||||
}
|
||||
|
||||
wlmngr_setupMbssMacAddr() {
|
||||
@@ -98,22 +99,6 @@ wlmngr_setupMbssMacAddr() {
|
||||
done
|
||||
}
|
||||
|
||||
#enableBSD() {
|
||||
# nvram_set bsd_role=0
|
||||
# [ act_wl_cnt == 0 ] && return FALSE
|
||||
# for i in wl0 wl1; do
|
||||
# if [ m_instance_wl[i].m_wlVar.wlEnbl == TRUE && m_instance_wl[i].m_wlVar.bsdRole > 0 ]; then
|
||||
# nvram set bsd_role=m_instance_wl[i].m_wlVar.bsdRole
|
||||
# nvram set bsd_pport=m_instance_wl[i].m_wlVar.bsdPport
|
||||
# nvram set bsd_hpport=m_instance_wl[i].m_wlVar.bsdHport
|
||||
# nvram set bsd_helper=m_instance_wl[i].m_wlVar.bsdHelper
|
||||
# nvram set bsd_primary=m_instance_wl[i].m_wlVar.bsdPrimary
|
||||
# return TRUE
|
||||
# fi
|
||||
# done
|
||||
# return FALSE
|
||||
#}
|
||||
|
||||
#enableSSD() {
|
||||
# nvram set ssd_enable=0
|
||||
# [ act_wl_cnt == 0 ] && return FALSE
|
||||
@@ -169,6 +154,89 @@ wlmngr_startServices() {
|
||||
# }
|
||||
}
|
||||
|
||||
enableBSD() {
|
||||
local wdev wdev_to_steer
|
||||
local enabled policy
|
||||
local rssi_threshold bw_util
|
||||
|
||||
nvram set bsd_role=0
|
||||
nvram unset bsd_ifnames
|
||||
|
||||
enabled="$(uci -q get wireless.bandsteering.enabled)"
|
||||
|
||||
[ "$enabled" == "1" ] || return 1
|
||||
|
||||
policy="$(uci -q get wireless.bandsteering.policy)"
|
||||
policy=${policy:-0}
|
||||
rssi_threshold="$(uci -q get wireless.bandsteering.rssi_threshold)"
|
||||
rssi_threshold=${rssi_threshold:--75}
|
||||
bw_util="$(uci -q get wireless.bandsteering.bw_util)"
|
||||
bw_util=${bw_util:--60}
|
||||
|
||||
nvram set bsd_role=3
|
||||
nvram set bsd_pport=9878
|
||||
nvram set bsd_hpport=9877
|
||||
nvram set bsd_helper=192.168.1.2
|
||||
nvram set bsd_primary=192.168.1.1
|
||||
nvram set bsd_scheme=2
|
||||
nvram set bsd_poll_interval=1
|
||||
nvram set bsd_bounce_detect="180 8 3600"
|
||||
nvram set bsd_msglevel=0
|
||||
nvram set bsd_status_poll=5
|
||||
nvram set bsd_status=3
|
||||
|
||||
for wdev in wl0 wl1; do
|
||||
#if [ "$(uci -q get wireless.$wdev.band_steering)" == "1" ]; then
|
||||
nvram set bsd_ifnames="$(nvram get bsd_ifnames) $wdev"
|
||||
[ "$wdev" == "wl0" ] && wdev_to_steer="wl1" || wdev_to_steer="wl0"
|
||||
|
||||
if [ "$policy" == "0" ]; then
|
||||
# RSSI Threshold based policy #
|
||||
if [ "$(nvram get ${wdev}_nband)" == "2" ]; then
|
||||
# 2.4G
|
||||
nvram set ${wdev}_bsd_if_quality_policy="0 0x0 -100"
|
||||
nvram set ${wdev}_bsd_if_select_policy=$wdev_to_steer
|
||||
nvram set ${wdev}_bsd_sta_select_policy="10 0 0 0 1 1 0 0 0 0x400"
|
||||
nvram set ${wdev}_bsd_steer_prefix=$wdev
|
||||
nvram set ${wdev}_bsd_steering_policy="0 5 3 0 0 0x1"
|
||||
else
|
||||
# 5G
|
||||
nvram set ${wdev}_bsd_if_quality_policy="20 0x0 $rssi_threshold"
|
||||
nvram set ${wdev}_bsd_if_select_policy=$wdev_to_steer
|
||||
nvram set ${wdev}_bsd_sta_select_policy="100 0 0 0 0 1 0 0 0 0x40"
|
||||
nvram set ${wdev}_bsd_steer_prefix=$wdev
|
||||
nvram set ${wdev}_bsd_steering_policy="80 5 3 $rssi_threshold 0 0x40"
|
||||
fi
|
||||
else
|
||||
# Bandwidth Usage based policy #
|
||||
if [ "$(nvram get ${wdev}_nband)" == "2" ]; then
|
||||
# 2.4G
|
||||
nvram set ${wdev}_bsd_if_quality_policy="0 0x0 -75"
|
||||
nvram set ${wdev}_bsd_if_select_policy=$wdev_to_steer
|
||||
nvram set ${wdev}_bsd_sta_select_policy="0 0 0 0 0 1 0 0 0 0x600"
|
||||
nvram set ${wdev}_bsd_steer_prefix=$wdev
|
||||
nvram set ${wdev}_bsd_steering_policy="0 5 3 0 0 0x10"
|
||||
else
|
||||
# 5G
|
||||
nvram set ${wdev}_bsd_if_quality_policy="40 0x0 -75"
|
||||
nvram set ${wdev}_bsd_if_select_policy=$wdev_to_steer
|
||||
nvram set ${wdev}_bsd_sta_select_policy="0 0 0 0 0 1 0 0 0 0x240"
|
||||
nvram set ${wdev}_bsd_steer_prefix=$wdev
|
||||
nvram set ${wdev}_bsd_steering_policy="$bw_util 5 3 0 0 0x40"
|
||||
fi
|
||||
fi
|
||||
#fi
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
wlmngr_BSDCtrl() {
|
||||
killall -q -15 bsd 2>/dev/null
|
||||
if $(enableBSD); then
|
||||
bsd&
|
||||
fi
|
||||
}
|
||||
|
||||
wlmngr_startWsc()
|
||||
{
|
||||
local idx=$1
|
||||
@@ -240,6 +308,20 @@ wlmngr_wlIfcUp() {
|
||||
ifconfig $vif down
|
||||
fi
|
||||
done
|
||||
|
||||
case "$(uci -q get wireless.wl$idx.monitor)" in
|
||||
1)
|
||||
wlctl -i wl$idx monitor 1
|
||||
ifconfig prism$idx up
|
||||
;;
|
||||
2)
|
||||
wlctl -i wl$idx monitor 2
|
||||
ifconfig radiotap$idx up
|
||||
;;
|
||||
*)
|
||||
wlctl -i wl$idx monitor 0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
wlmngr_doWds() {
|
||||
@@ -272,6 +354,7 @@ wlmngr_finalize() {
|
||||
# local isac="$(db get hw.$pcid.is_ac)"
|
||||
# if [ "$isac" == "1" ]; then
|
||||
# wlctl -i $device msglevel +radar +dfs
|
||||
# #dhdctl -i $device dconpoll 200
|
||||
# fi
|
||||
local rdrthrs="$(db get hw.$pcid.radarthrs)"
|
||||
if [ -n "$rdrthrs" ]; then
|
||||
|
||||
84
libtrace/Makefile
Normal file
84
libtrace/Makefile
Normal file
@@ -0,0 +1,84 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libtrace
|
||||
PKG_VERSION:=3.0.22
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/apietila/libtrace.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_VERSION:=HEAD
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_INSTALL:=1
|
||||
PKG_FIXUP:=autoreconf
|
||||
|
||||
include $(INCLUDE_DIR)/uclibc++.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/libtrace/Default
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Libtrace library for packet trace processing
|
||||
URL:=http://research.wand.net.nz/software/libtrace.php
|
||||
endef
|
||||
|
||||
define Package/libtrace
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=Libtrace library for packet trace processing
|
||||
URL:=http://research.wand.net.nz/software/libtrace.php
|
||||
DEPENDS:=+libpcap +libpthread +zlib +libbz2 +liblzo +librt $(CXX_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/libtrace/description
|
||||
Network trace processing library for trace processing. Supports multiple
|
||||
input methods, including device capture, raw and gz-compressed
|
||||
trace, and sockets.
|
||||
endef
|
||||
|
||||
define Package/libtrace-tools
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Libtrace tools for packet trace processing
|
||||
URL:=http://research.wand.net.nz/software/libtrace.php
|
||||
DEPENDS:=+libncurses +libtrace
|
||||
endef
|
||||
|
||||
define Package/libtrace-tools/description
|
||||
Network trace processing tools for trace processing.
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--with-bzip2 \
|
||||
--with-zlib \
|
||||
--with-lzo \
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libtrace.{a,so*} $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libwandio.{a,so*} $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpacketdump.{a,so*} $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libtrace/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libtrace.so.* $(1)/usr/lib/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libwandio.so.* $(1)/usr/lib/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libpacketdump.so.* $(1)/usr/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/libpacketdump
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libpacketdump/*.so* $(1)/usr/lib/libpacketdump/
|
||||
endef
|
||||
|
||||
define Package/libtrace-tools/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{traceanon,tracediff,traceends,tracepktdump,tracereplay,tracereport,tracertstats,tracesplit,tracestats} $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libtrace))
|
||||
$(eval $(call BuildPackage,libtrace-tools))
|
||||
|
||||
47
logrotate/Makefile
Normal file
47
logrotate/Makefile
Normal file
@@ -0,0 +1,47 @@
|
||||
#
|
||||
# Copyright (C) 2006 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
# $Id$
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=logrotate
|
||||
PKG_VERSION:=3.7.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
|
||||
PKG_SOURCE_URL:=http://ftp.de.debian.org/debian/pool/main/l/logrotate
|
||||
PKG_MD5SUM:=552639142e163745f6bcd4f1f3816d8a
|
||||
PKG_CAT:=zcat
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/logrotate
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=+libpopt
|
||||
TITLE:=rotates, compresses, and mails system logs
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(call Build/Compile/Default, \
|
||||
RPM_OPT_FLAGS="$(TARGET_CFLAGS) $(EXTRA_CPPFLAGS)" \
|
||||
LDFLAGS="$(EXTRA_LDFLAGS)" \
|
||||
logrotate \
|
||||
)
|
||||
endef
|
||||
|
||||
define Package/logrotate/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) ${PKG_BUILD_DIR}/logrotate $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(CP) ./files/logrotate.conf $(1)/etc/
|
||||
$(INSTALL_DIR) $(1)/etc/logrotate.d
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,logrotate))
|
||||
30
logrotate/files/logrotate.conf
Normal file
30
logrotate/files/logrotate.conf
Normal file
@@ -0,0 +1,30 @@
|
||||
# rotate log files weekly
|
||||
weekly
|
||||
#daily
|
||||
|
||||
# keep 4 weeks worth of backlogs
|
||||
rotate 4
|
||||
|
||||
# create new (empty) log files after rotating old ones
|
||||
create
|
||||
|
||||
notifempty
|
||||
nomail
|
||||
#olddir /var/log/backup/
|
||||
missingok
|
||||
#dateext
|
||||
|
||||
# uncomment this if you want your log files compressed
|
||||
#compress
|
||||
|
||||
# packages can drop log rotation information into this directory
|
||||
include /etc/logrotate.d
|
||||
|
||||
# no packages own lastlog or wtmp -- we'll rotate them here
|
||||
#/var/log/wtmp {
|
||||
# monthly
|
||||
# create 0664 root utmp
|
||||
# rotate 1
|
||||
#}
|
||||
|
||||
# system-specific logs may be also be configured here.
|
||||
433
logrotate/patches/01-dateext_maxage.patch
Normal file
433
logrotate/patches/01-dateext_maxage.patch
Normal file
@@ -0,0 +1,433 @@
|
||||
diff -u -ruN logrotate-3.7.1.orig/config.c logrotate-3.7.1/config.c
|
||||
--- logrotate-3.7.1.orig/config.c 2003-08-07 07:13:14.000000000 -0400
|
||||
+++ logrotate-3.7.1/config.c 2005-05-24 12:21:09.000000000 -0400
|
||||
@@ -511,6 +511,14 @@
|
||||
newlog->flags &= ~LOG_FLAG_IFEMPTY;
|
||||
|
||||
*endtag = oldchar, start = endtag;
|
||||
+ } else if (!strcmp(start, "dateext")) {
|
||||
+ newlog->flags |= LOG_FLAG_DATEEXT;
|
||||
+
|
||||
+ *endtag = oldchar, start = endtag;
|
||||
+ } else if (!strcmp(start, "nodateext")) {
|
||||
+ newlog->flags &= ~LOG_FLAG_DATEEXT;
|
||||
+
|
||||
+ *endtag = oldchar, start = endtag;
|
||||
} else if (!strcmp(start, "noolddir")) {
|
||||
newlog->oldDir = NULL;
|
||||
|
||||
@@ -670,6 +678,21 @@
|
||||
}
|
||||
*endtag = oldchar, start = endtag;
|
||||
}
|
||||
+ } else if (!strcmp(start, "maxage")) {
|
||||
+ *endtag = oldchar, start = endtag;
|
||||
+
|
||||
+ if (!isolateValue(configFile, lineNum, "maxage count", &start,
|
||||
+ &endtag)) {
|
||||
+ oldchar = *endtag, *endtag = '\0';
|
||||
+
|
||||
+ newlog->rotateAge = strtoul(start, &chptr, 0);
|
||||
+ if (*chptr || newlog->rotateAge < 0) {
|
||||
+ message(MESS_ERROR, "%s:%d bad maximum age '%s'\n",
|
||||
+ configFile, lineNum, start);
|
||||
+ return 1;
|
||||
+ }
|
||||
+ *endtag = oldchar, start = endtag;
|
||||
+ }
|
||||
} else if (!strcmp(start, "errors")) {
|
||||
message(MESS_DEBUG, "%s: %d: the errors directive is deprecated and no longer used.\n",
|
||||
configFile, lineNum);
|
||||
diff -u -ruN logrotate-3.7.1.orig/logrotate.8 logrotate-3.7.1/logrotate.8
|
||||
--- logrotate-3.7.1.orig/logrotate.8 2003-08-07 07:13:14.000000000 -0400
|
||||
+++ logrotate-3.7.1/logrotate.8 2005-05-24 12:21:09.000000000 -0400
|
||||
@@ -200,6 +200,11 @@
|
||||
Log files are rotated every day.
|
||||
|
||||
.TP
|
||||
+\fBdateext\fR
|
||||
+Archive old versions of log files adding a daily extension like YYYYMMDD
|
||||
+instead of simply adding a number.
|
||||
+
|
||||
+.TP
|
||||
\fBdelaycompress\fR
|
||||
Postpone compression of the previous log file to the next rotation cycle.
|
||||
This has only effect when used in combination with \fBcompress\fR.
|
||||
@@ -246,6 +251,12 @@
|
||||
instead of the just-rotated file (this is the default).
|
||||
|
||||
.TP
|
||||
+\fBmaxage\fR \fIcount\fR
|
||||
+Remove rotated logs older than <count> days. The age is only checked
|
||||
+if the logfile is to be rotated. The files are mailed to the
|
||||
+configured address if \fBmaillast\fR and \fBmail\fR are configured.
|
||||
+
|
||||
+.TP
|
||||
\fBmissingok\fR
|
||||
If the log file is missing, go on to the next one without issuing an error
|
||||
message. See also \fBnomissingok\fR.
|
||||
diff -u -ruN logrotate-3.7.1.orig/logrotate.c logrotate-3.7.1/logrotate.c
|
||||
--- logrotate-3.7.1.orig/logrotate.c 2004-10-19 17:41:24.000000000 -0400
|
||||
+++ logrotate-3.7.1/logrotate.c 2005-05-24 12:21:09.000000000 -0400
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <sys/wait.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
+#include <glob.h>
|
||||
|
||||
#ifdef WITH_SELINUX
|
||||
#include <selinux/selinux.h>
|
||||
@@ -22,6 +23,10 @@
|
||||
#include "log.h"
|
||||
#include "logrotate.h"
|
||||
|
||||
+#if !defined(GLOB_ABORTED) && defined(GLOB_ABEND)
|
||||
+#define GLOB_ABORTED GLOB_ABEND
|
||||
+#endif
|
||||
+
|
||||
typedef struct {
|
||||
char * fn;
|
||||
struct tm lastRotated; /* only tm.mon, tm_mday, tm_year are good! */
|
||||
@@ -42,6 +47,14 @@
|
||||
char * mailCommand = DEFAULT_MAIL_COMMAND;
|
||||
time_t nowSecs = 0;
|
||||
|
||||
+static int globerr(const char * pathname, int theerr) {
|
||||
+ message(MESS_ERROR, "error accessing %s: %s\n", pathname,
|
||||
+ strerror(theerr));
|
||||
+
|
||||
+ /* We want the glob operation to continue, so return 0 */
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
static logState * findState(const char * fn, struct stateSet * sip) {
|
||||
int i;
|
||||
logState * states = sip->states;
|
||||
@@ -49,9 +62,11 @@
|
||||
struct tm now = *localtime(&nowSecs);
|
||||
time_t lr_time;
|
||||
|
||||
+ /* find the filename fn in the statesPtr list */
|
||||
for (i = 0; i < numStates; i++)
|
||||
if (!strcmp(fn, states[i].fn)) break;
|
||||
|
||||
+ /* not in statesPtr list, so add new entry */
|
||||
if (i == numStates) {
|
||||
i = numStates++;
|
||||
states = realloc(states, sizeof(*states) * numStates);
|
||||
@@ -121,6 +136,17 @@
|
||||
return rc;
|
||||
}
|
||||
|
||||
+static int removeLogFile(char * name) {
|
||||
+ message(MESS_DEBUG, "removing old log %s\n", name);
|
||||
+
|
||||
+ if (!debug && unlink(name)) {
|
||||
+ message(MESS_ERROR, "Failed to remove old log %s: %s\n",
|
||||
+ name, strerror(errno));
|
||||
+ return 1;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int compressLogFile(char * name, logInfo * log, struct stat *sb) {
|
||||
char * compressedName;
|
||||
const char ** fullCommand;
|
||||
@@ -265,6 +291,25 @@
|
||||
return rc;
|
||||
}
|
||||
|
||||
+static int mailLogWrapper (char * mailFilename, char * mailCommand, int logNum, logInfo * log) {
|
||||
+ /* if the log is compressed (and we're not mailing a
|
||||
+ * file whose compression has been delayed), we need
|
||||
+ * to uncompress it */
|
||||
+ if ((log->flags & LOG_FLAG_COMPRESS) &&
|
||||
+ !((log->flags & LOG_FLAG_DELAYCOMPRESS) &&
|
||||
+ (log->flags & LOG_FLAG_MAILFIRST))) {
|
||||
+ if (mailLog(mailFilename, mailCommand,
|
||||
+ log->uncompress_prog, log->logAddress,
|
||||
+ log->files[logNum]))
|
||||
+ return 1;
|
||||
+ } else {
|
||||
+ if (mailLog(mailFilename, mailCommand, NULL,
|
||||
+ log->logAddress, mailFilename))
|
||||
+ return 1;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int copyTruncate(char * currLog, char * saveLog, struct stat * sb, int flags) {
|
||||
char buf[BUFSIZ];
|
||||
int fdcurr = -1, fdsave = -1;
|
||||
@@ -479,6 +524,9 @@
|
||||
char * baseName;
|
||||
char * dirName;
|
||||
char * firstRotated;
|
||||
+ char * glob_pattern;
|
||||
+ glob_t globResult;
|
||||
+ int rc;
|
||||
size_t alloc_size;
|
||||
int rotateCount = log->rotateCount ? log->rotateCount : 1;
|
||||
int logStart = (log->logStart == -1) ? 1 : log->logStart;
|
||||
@@ -509,7 +557,7 @@
|
||||
|
||||
alloc_size = strlen(dirName) + strlen(baseName) +
|
||||
strlen(log->files[logNum]) + strlen(fileext) +
|
||||
- strlen(compext) + 10;
|
||||
+ strlen(compext) + 18;
|
||||
|
||||
oldName = alloca(alloc_size);
|
||||
newName = alloca(alloc_size);
|
||||
@@ -531,16 +579,116 @@
|
||||
/* First compress the previous log when necessary */
|
||||
if (log->flags & LOG_FLAG_COMPRESS &&
|
||||
log->flags & LOG_FLAG_DELAYCOMPRESS) {
|
||||
- struct stat sbprev;
|
||||
-
|
||||
- sprintf(oldName, "%s/%s.%d%s", dirName, baseName, logStart, fileext);
|
||||
- if (stat(oldName, &sbprev)) {
|
||||
- message(MESS_DEBUG, "previous log %s does not exist\n",
|
||||
- oldName);
|
||||
- } else {
|
||||
- hasErrors = compressLogFile(oldName, log, &sbprev);
|
||||
+ if (log->flags & LOG_FLAG_DATEEXT) {
|
||||
+ /* glob for uncompressed files with our pattern */
|
||||
+ glob_pattern = malloc(strlen(dirName) + strlen(baseName)
|
||||
+ + strlen(fileext) + 44 );
|
||||
+ sprintf(glob_pattern,
|
||||
+ "%s/%s-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]%s",
|
||||
+ dirName, baseName, fileext);
|
||||
+ rc = glob(glob_pattern, 0, globerr, &globResult);
|
||||
+ if (!rc && globResult.gl_pathc > 0) {
|
||||
+ for (i = 0; i < globResult.gl_pathc && !hasErrors; i++) {
|
||||
+ struct stat sbprev;
|
||||
+ sprintf(oldName,"%s",(globResult.gl_pathv)[i]);
|
||||
+ if (stat(oldName, &sbprev)) {
|
||||
+ message(MESS_DEBUG, "previous log %s does not exist\n", oldName);
|
||||
+ } else {
|
||||
+ hasErrors = compressLogFile(oldName, log, &sbprev);
|
||||
+ }
|
||||
+ }
|
||||
+ } else {
|
||||
+ message (MESS_DEBUG, "glob finding logs to compress failed\n");
|
||||
+ /* fallback to old behaviour */
|
||||
+ sprintf(oldName, "%s/%s.%d%s", dirName, baseName, logStart, fileext);
|
||||
+ }
|
||||
+ globfree(&globResult);
|
||||
+ free(glob_pattern);
|
||||
+ } else {
|
||||
+ struct stat sbprev;
|
||||
+
|
||||
+ sprintf(oldName, "%s/%s.%d%s", dirName, baseName, logStart, fileext);
|
||||
+ if (stat(oldName, &sbprev)) {
|
||||
+ message(MESS_DEBUG, "previous log %s does not exist\n",
|
||||
+ oldName);
|
||||
+ } else {
|
||||
+ hasErrors = compressLogFile(oldName, log, &sbprev);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
+
|
||||
+ firstRotated = alloca(strlen(dirName) + strlen(baseName) +
|
||||
+ strlen(fileext) + strlen(compext) + 30);
|
||||
+
|
||||
+ if(log->flags & LOG_FLAG_DATEEXT) {
|
||||
+ /* glob for compressed files with our pattern
|
||||
+ * and compress ext */
|
||||
+ glob_pattern = malloc(strlen(dirName)+strlen(baseName)
|
||||
+ +strlen(fileext)+strlen(compext)+44);
|
||||
+ sprintf(glob_pattern,
|
||||
+ "%s/%s-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]%s%s",
|
||||
+ dirName, baseName, fileext, compext);
|
||||
+ rc = glob(glob_pattern, 0, globerr, &globResult);
|
||||
+ if (!rc) {
|
||||
+ /* search for files to drop, if we find one remember it,
|
||||
+ * if we find another one mail and remove the first and
|
||||
+ * remember the second and so on */
|
||||
+ struct stat fst_buf;
|
||||
+ int mail_out = -1;
|
||||
+ /* remove the first (n - rotateCount) matches
|
||||
+ * no real rotation needed, since the files have
|
||||
+ * the date in their name */
|
||||
+ for (i = 0; i < globResult.gl_pathc; i++) {
|
||||
+ if( !stat((globResult.gl_pathv)[i],&fst_buf) ) {
|
||||
+ if ((i <= ((int)globResult.gl_pathc - rotateCount))
|
||||
+ || ((log->rotateAge > 0)
|
||||
+ && (((nowSecs - fst_buf.st_mtime)/60/60/24)
|
||||
+ > log->rotateAge))) {
|
||||
+ if ( mail_out != -1 ) {
|
||||
+ if (!hasErrors && log->logAddress) {
|
||||
+ char * mailFilename = (globResult.gl_pathv)[mail_out];
|
||||
+ hasErrors = mailLogWrapper(mailFilename, mailCommand, logNum, log);
|
||||
+ if (!hasErrors)
|
||||
+ hasErrors = removeLogFile(mailFilename);
|
||||
+ }
|
||||
+ }
|
||||
+ mail_out = i;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ if ( mail_out != -1 ) {
|
||||
+ /* oldName is oldest Backup found (for unlink later) */
|
||||
+ sprintf(oldName, "%s", (globResult.gl_pathv)[mail_out]);
|
||||
+ strcpy(disposeName, oldName);
|
||||
+ } else
|
||||
+ disposeName = NULL;
|
||||
+ } else {
|
||||
+ message (MESS_DEBUG, "glob finding old rotated logs failed\n");
|
||||
+ disposeName = NULL;
|
||||
+ }
|
||||
+ /* firstRotated is most recently created/compressed rotated log */
|
||||
+ sprintf(firstRotated, "%s/%s-%04d%02d%02d%s%s",
|
||||
+ dirName, baseName, now.tm_year+1900,
|
||||
+ now.tm_mon+1, now.tm_mday, fileext, compext);
|
||||
+ globfree(&globResult);
|
||||
+ free(glob_pattern);
|
||||
+ } else {
|
||||
+ if ( log->rotateAge ) {
|
||||
+ struct stat fst_buf;
|
||||
+ for (i=1; i <= rotateCount; i++) {
|
||||
+ sprintf(oldName, "%s/%s.%d%s%s", dirName, baseName,
|
||||
+ rotateCount + 1, fileext, compext);
|
||||
+ if(!stat(oldName,&fst_buf)
|
||||
+ && (((nowSecs - fst_buf.st_mtime)/60/60/24)
|
||||
+ > log->rotateAge)) {
|
||||
+ char * mailFilename = (globResult.gl_pathv)[i];
|
||||
+ if (!hasErrors && log->logAddress)
|
||||
+ hasErrors = mailLogWrapper(mailFilename, mailCommand, logNum, log);
|
||||
+ if (!hasErrors)
|
||||
+ hasErrors = removeLogFile(mailFilename);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
|
||||
sprintf(oldName, "%s/%s.%d%s%s", dirName, baseName,
|
||||
logStart + rotateCount, fileext, compext);
|
||||
@@ -548,8 +696,6 @@
|
||||
|
||||
strcpy(disposeName, oldName);
|
||||
|
||||
- firstRotated = alloca(strlen(dirName) + strlen(baseName) +
|
||||
- strlen(fileext) + strlen(compext) + 30);
|
||||
sprintf(firstRotated, "%s/%s.%d%s%s", dirName, baseName,
|
||||
logStart, fileext,
|
||||
(log->flags & LOG_FLAG_DELAYCOMPRESS) ? "" : compext);
|
||||
@@ -600,12 +746,27 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
-
|
||||
+ } /* !LOG_FLAG_DATEEXT */
|
||||
+
|
||||
finalName = oldName;
|
||||
-
|
||||
- /* note: the gzip extension is *not* used here! */
|
||||
- sprintf(finalName, "%s/%s.%d%s", dirName, baseName, logStart, fileext);
|
||||
-
|
||||
+
|
||||
+ if(log->flags & LOG_FLAG_DATEEXT) {
|
||||
+ char * destFile = alloca(strlen(dirName) + strlen(baseName) +
|
||||
+ strlen(fileext) + strlen(compext) + 30);
|
||||
+ struct stat fst_buf;
|
||||
+ sprintf(finalName, "%s/%s-%04d%02d%02d%s",
|
||||
+ dirName, baseName, now.tm_year+1900,
|
||||
+ now.tm_mon+1, now.tm_mday, fileext);
|
||||
+ sprintf(destFile, "%s%s", finalName, compext);
|
||||
+ if(!stat(destFile,&fst_buf)) {
|
||||
+ message (MESS_DEBUG, "destination %s already exists, skipping rotation\n", firstRotated);
|
||||
+ hasErrors = 1;
|
||||
+ }
|
||||
+ } else {
|
||||
+ /* note: the gzip extension is *not* used here! */
|
||||
+ sprintf(finalName, "%s/%s.%d%s", dirName, baseName, logStart, fileext);
|
||||
+ }
|
||||
+
|
||||
/* if the last rotation doesn't exist, that's okay */
|
||||
if (!debug && access(disposeName, F_OK)) {
|
||||
message(MESS_DEBUG, "log %s doesn't exist -- won't try to "
|
||||
@@ -613,9 +774,6 @@
|
||||
disposeName = NULL;
|
||||
}
|
||||
|
||||
- free(dirName);
|
||||
- free(baseName);
|
||||
-
|
||||
if (!hasErrors) {
|
||||
if (log->pre && !(log->flags & LOG_FLAG_SHAREDSCRIPTS)) {
|
||||
message(MESS_DEBUG, "running prerotate script\n");
|
||||
@@ -722,33 +880,12 @@
|
||||
else
|
||||
mailFilename = disposeName;
|
||||
|
||||
- if (mailFilename) {
|
||||
- /* if the log is compressed (and we're not mailing a
|
||||
- file whose compression has been delayed), we need
|
||||
- to uncompress it */
|
||||
- if ((log->flags & LOG_FLAG_COMPRESS) &&
|
||||
- !((log->flags & LOG_FLAG_DELAYCOMPRESS) &&
|
||||
- (log->flags & LOG_FLAG_MAILFIRST))) {
|
||||
- if (mailLog(mailFilename, mailCommand,
|
||||
- log->uncompress_prog, log->logAddress,
|
||||
- log->files[logNum]))
|
||||
- hasErrors = 1;
|
||||
- } else {
|
||||
- if (mailLog(mailFilename, mailCommand, NULL,
|
||||
- log->logAddress, mailFilename))
|
||||
- hasErrors = 1;
|
||||
- }
|
||||
- }
|
||||
+ if (mailFilename)
|
||||
+ hasErrors = mailLogWrapper(mailFilename, mailCommand, logNum, log);
|
||||
}
|
||||
|
||||
if (!hasErrors && disposeName) {
|
||||
- message(MESS_DEBUG, "removing old log %s\n", disposeName);
|
||||
-
|
||||
- if (!debug && unlink(disposeName)) {
|
||||
- message(MESS_ERROR, "Failed to remove old log %s: %s\n",
|
||||
- disposeName, strerror(errno));
|
||||
- hasErrors = 1;
|
||||
- }
|
||||
+ hasErrors = removeLogFile(disposeName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -761,6 +898,8 @@
|
||||
}
|
||||
}
|
||||
#endif
|
||||
+ free(dirName);
|
||||
+ free(baseName);
|
||||
return hasErrors;
|
||||
}
|
||||
|
||||
@@ -1047,7 +1186,9 @@
|
||||
|
||||
int main(int argc, const char ** argv) {
|
||||
logInfo defConfig = { NULL, NULL, 0, NULL, ROT_SIZE,
|
||||
- /* threshHold */ 1024 * 1024, 0,
|
||||
+ /* threshHold */ 1024 * 1024,
|
||||
+ /* rotateCount */ 0,
|
||||
+ /* rotateAge */ 0,
|
||||
/* log start */ -1,
|
||||
/* pre, post */ NULL, NULL,
|
||||
/* first, last */ NULL, NULL,
|
||||
diff -u -ruN logrotate-3.7.1.orig/logrotate.h logrotate-3.7.1/logrotate.h
|
||||
--- logrotate-3.7.1.orig/logrotate.h 2003-08-07 07:13:14.000000000 -0400
|
||||
+++ logrotate-3.7.1/logrotate.h 2005-05-24 12:21:09.000000000 -0400
|
||||
@@ -15,6 +15,7 @@
|
||||
#define LOG_FLAG_MAILFIRST (1 << 6)
|
||||
#define LOG_FLAG_SHAREDSCRIPTS (1 << 7)
|
||||
#define LOG_FLAG_COPY (1 << 8)
|
||||
+#define LOG_FLAG_DATEEXT (1 << 9)
|
||||
|
||||
#define NO_FORCE_ROTATE 0
|
||||
#define FORCE_ROTATE 1
|
||||
@@ -34,6 +35,7 @@
|
||||
enum { ROT_DAYS, ROT_WEEKLY, ROT_MONTHLY, ROT_SIZE, ROT_FORCE } criterium;
|
||||
unsigned int threshhold;
|
||||
int rotateCount;
|
||||
+ int rotateAge;
|
||||
int logStart;
|
||||
char * pre, * post, * first, * last;
|
||||
char * logAddress;
|
||||
12
logrotate/patches/02-datehack.patch
Normal file
12
logrotate/patches/02-datehack.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff -u -ruN logrotate-3.7.1.orig/logrotate.c logrotate-3.7.1/logrotate.c
|
||||
--- logrotate-3.7.1.orig/logrotate.c 2004-10-19 17:41:24.000000000 -0400
|
||||
+++ logrotate-3.7.1/logrotate.c 2005-05-24 12:12:26.000000000 -0400
|
||||
@@ -1002,7 +1002,7 @@
|
||||
}
|
||||
|
||||
/* Hack to hide earlier bug */
|
||||
- if ((year != 1900) && (year < 1996 || year > 2100)) {
|
||||
+ if ((year != 1900) && (year < 1970 || year > 2100)) {
|
||||
message(MESS_ERROR, "bad year %d for file %s in state file %s\n",
|
||||
year, argv[0], stateFilename);
|
||||
fclose(f);
|
||||
14
logrotate/patches/03-ignore_hidden.patch
Normal file
14
logrotate/patches/03-ignore_hidden.patch
Normal file
@@ -0,0 +1,14 @@
|
||||
--- logrotate-3.7/config.c.orig 2005-04-26 22:57:53.000000000 -0400
|
||||
+++ logrotate-3.7/config.c 2005-04-26 22:59:36.000000000 -0400
|
||||
@@ -142,6 +142,11 @@
|
||||
(!fname[1] || (fname[1] == '.' && !fname[2])))
|
||||
return 0;
|
||||
|
||||
+ /* Don't include 'hidden' files either; this breaks Gentoo
|
||||
+ portage config file management http://bugs.gentoo.org/87683 */
|
||||
+ if (fname[0] == '.')
|
||||
+ return 0;
|
||||
+
|
||||
/* Check if fname is ending in a taboo-extension; if so, return
|
||||
false */
|
||||
for (i = 0; i < tabooCount; i++) {
|
||||
54
logrotate/patches/04-no_tmpdir.patch
Normal file
54
logrotate/patches/04-no_tmpdir.patch
Normal file
@@ -0,0 +1,54 @@
|
||||
diff -u -ruN logrotate-3.7.1-cur/logrotate.c logrotate-3.7.1/logrotate.c
|
||||
--- logrotate-3.7.1-cur/logrotate.c 2005-05-25 18:20:41.000000000 -0400
|
||||
+++ logrotate-3.7.1/logrotate.c 2005-05-25 18:21:10.000000000 -0400
|
||||
@@ -90,10 +90,7 @@
|
||||
}
|
||||
|
||||
static int runScript(char * logfn, char * script) {
|
||||
- int fd;
|
||||
- char *filespec;
|
||||
int rc;
|
||||
- char buf[256];
|
||||
|
||||
if (debug) {
|
||||
message(MESS_DEBUG, "running script with arg %s: \"%s\"\n",
|
||||
@@ -101,38 +98,12 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
- filespec = buf;
|
||||
- snprintf(buf, sizeof(buf), "%s/logrotate.XXXXXX", getenv("TMPDIR") ?: "/tmp");
|
||||
- fd = -1;
|
||||
- if (!filespec || (fd = mkstemp(filespec)) < 0 || fchmod(fd, 0700)) {
|
||||
- message(MESS_DEBUG, "error creating %s: %s\n", filespec,
|
||||
- strerror(errno));
|
||||
- if (fd >= 0) {
|
||||
- close(fd);
|
||||
- unlink(filespec);
|
||||
- }
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
- if (write(fd, "#!/bin/sh\n\n", 11) != 11 ||
|
||||
- write(fd, script, strlen(script)) != strlen(script)) {
|
||||
- message(MESS_DEBUG, "error writing %s\n", filespec);
|
||||
- close(fd);
|
||||
- unlink(filespec);
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
- close(fd);
|
||||
-
|
||||
if (!fork()) {
|
||||
- execlp(filespec, filespec, logfn, NULL);
|
||||
+ execl("/bin/sh", "sh", "-c", script, NULL);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
wait(&rc);
|
||||
-
|
||||
- unlink(filespec);
|
||||
-
|
||||
return rc;
|
||||
}
|
||||
|
||||
12
logrotate/patches/05-taboo_to_debug.patch
Normal file
12
logrotate/patches/05-taboo_to_debug.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff -u -ruN logrotate-3.7.1.orig/config.c logrotate-3.7.1/config.c
|
||||
--- logrotate-3.7.1.orig/config.c 2003-08-07 07:13:14.000000000 -0400
|
||||
+++ logrotate-3.7.1/config.c 2005-05-24 12:13:41.000000000 -0400
|
||||
@@ -147,7 +147,7 @@
|
||||
for (i = 0; i < tabooCount; i++) {
|
||||
if (!strcmp(fname + strlen(fname) - strlen(tabooExts[i]),
|
||||
tabooExts[i])) {
|
||||
- message(MESS_ERROR, "Ignoring %s, because of %s "
|
||||
+ message(MESS_DEBUG, "Ignoring %s, because of %s "
|
||||
"ending\n", fname, tabooExts[i]);
|
||||
|
||||
return 0;
|
||||
22
logrotate/patches/06-weekly.patch
Normal file
22
logrotate/patches/06-weekly.patch
Normal file
@@ -0,0 +1,22 @@
|
||||
--- logrotate-3.7.1-old/logrotate.c 2004-10-19 23:41:24.000000000 +0200
|
||||
+++ logrotate-3.7.1-new/logrotate.c 2005-10-02 17:29:22.380767321 +0200
|
||||
@@ -424,12 +424,15 @@ int findNeedRotating(logInfo * log, int
|
||||
switch (log->criterium) {
|
||||
case ROT_WEEKLY:
|
||||
/* rotate if:
|
||||
- 1) the current weekday is before the weekday of the
|
||||
- last rotation
|
||||
+ 1) the day of the week is the same as the day of the week of
|
||||
+ the previous rotation but not the same day of the year
|
||||
+ this will rotate it on the same day every week, but not
|
||||
+ twice a day.
|
||||
2) more then a week has passed since the last
|
||||
rotation */
|
||||
- state->doRotate = ((now.tm_wday < state->lastRotated.tm_wday) ||
|
||||
- ((mktime(&now) - mktime(&state->lastRotated)) >
|
||||
+ state->doRotate = ((now.tm_wday == state->lastRotated.tm_wday &&
|
||||
+ now.tm_yday != state->lastRotated.tm_yday) ||
|
||||
+ ((mktime(&now) - mktime(&state->lastRotated)) >
|
||||
(7 * 24 * 3600)));
|
||||
break;
|
||||
case ROT_MONTHLY:
|
||||
@@ -27,9 +27,9 @@ failover() {
|
||||
|
||||
add() {
|
||||
|
||||
wan_fail_map=$(echo $wan_fail_map | sed -e "s/${1}\[${failchk}\]//g")
|
||||
wan_fail_map=$(echo $wan_fail_map | sed -e "s/\(^\|.*\]\)${1}\[${failchk}\]/\1/g")
|
||||
wan_fail_map="$wan_fail_map${1}[x]"
|
||||
wan_recovery_map=$(echo $wan_recovery_map | sed -e "s/${1}\[${recvrychk}\]//g")
|
||||
wan_recovery_map=$(echo $wan_recovery_map | sed -e "s/\(^\|.*\]\)${1}\[${recvrychk}\]/\1/g")
|
||||
update_cache
|
||||
|
||||
if [ "$existing_failover" == "2" ]; then
|
||||
@@ -46,8 +46,8 @@ failover() {
|
||||
|
||||
del() {
|
||||
|
||||
wan_recovery_map=$(echo $wan_recovery_map | sed -e "s/${1}\[${recvrychk}\]//g")
|
||||
wan_fail_map=$(echo $wan_fail_map | sed -e "s/${1}\[${failchk}\]//g")
|
||||
wan_recovery_map=$(echo $wan_recovery_map | sed -e "s/\(^\|.*\]\)${1}\[${recvrychk}\]/\1/g")
|
||||
wan_fail_map=$(echo $wan_fail_map | sed -e "s/\(^\|.*\]\)${1}\[${failchk}\]/\1/g")
|
||||
update_cache
|
||||
|
||||
if [ "$existing_failover" == "3" ]; then
|
||||
@@ -70,7 +70,7 @@ fail_wan() {
|
||||
|
||||
local failchk=$(query_config failchk $1)
|
||||
local recvrychk=$(query_config recvrychk $1)
|
||||
wan_recovery_map=$(echo $wan_recovery_map | sed -e "s/${1}\[${recvrychk}\]//g")
|
||||
wan_recovery_map=$(echo $wan_recovery_map | sed -e "s/\(^\|.*\]\)${1}\[${recvrychk}\]/\1/g")
|
||||
|
||||
if [ -z "$failchk" ]; then
|
||||
failchk=1
|
||||
@@ -80,7 +80,7 @@ fail_wan() {
|
||||
if [ "$failchk" != "x" ]; then
|
||||
new_fail_count=$(($failchk + 1))
|
||||
if [ "$new_fail_count" -lt "$health_fail_retries" ]; then
|
||||
wan_fail_map=$(echo $wan_fail_map | sed -e "s/${1}\[${failchk}\]/$1\[${new_fail_count}\]/g")
|
||||
wan_fail_map=$(echo $wan_fail_map | sed -e "s/\(^\|.*\]\)${1}\[${failchk}\]/\1${1}\[${new_fail_count}\]/g")
|
||||
else
|
||||
failover add $1
|
||||
refresh_dns
|
||||
@@ -103,7 +103,7 @@ recover_wan() {
|
||||
local wanid=$(query_config wanid $1)
|
||||
|
||||
if [ ! -z "$failchk" -a "$failchk" != "x" ]; then
|
||||
wan_fail_map=$(echo $wan_fail_map | sed -e "s/${1}\[${failchk}\]//g")
|
||||
wan_fail_map=$(echo $wan_fail_map | sed -e "s/\(^\|.*\]\)${1}\[${failchk}\]/\1/g")
|
||||
update_cache
|
||||
fi
|
||||
|
||||
@@ -117,7 +117,7 @@ recover_wan() {
|
||||
else
|
||||
new_recovery_count=$(($recvrychk + 1))
|
||||
if [ "$new_recovery_count" -lt "$health_recovery_retries" ]; then
|
||||
wan_recovery_map=$(echo $wan_recovery_map | sed -e "s/${1}\[${recvrychk}\]/$1\[${new_recovery_count}\]/g")
|
||||
wan_recovery_map=$(echo $wan_recovery_map | sed -e "s/\(^\|.*\]\)${1}\[${recvrychk}\]/\1${1}\[${new_recovery_count}\]/g")
|
||||
update_cache
|
||||
else
|
||||
failover del $1
|
||||
@@ -138,11 +138,12 @@ acquire_wan_data() {
|
||||
local old_gateway
|
||||
|
||||
local ifname ipaddr gateway
|
||||
network_flush_cache
|
||||
network_get_device ifname ${1} || ifname=x
|
||||
network_get_ipaddr ipaddr ${1} || ipaddr=x
|
||||
network_get_gateway gateway ${1} || gateway=x
|
||||
|
||||
check_old_map=$(echo $wan_id_map 2>&1 | grep -o "$1\[")
|
||||
check_old_map=$(echo $wan_id_map 2>&1 | grep -o -e "^$1\[" -e "\]$1\[")
|
||||
|
||||
if [ -z $check_old_map ]; then
|
||||
wancount=$(($wancount + 1))
|
||||
@@ -160,9 +161,9 @@ acquire_wan_data() {
|
||||
old_ifname=$(query_config ifname $1)
|
||||
get_wanid=$(query_config wanid $1)
|
||||
|
||||
wan_if_map=$(echo $wan_if_map | sed -e "s/${1}\[${old_ifname}\]/$1\[${ifname}\]/g")
|
||||
wan_ip_map=$(echo $wan_ip_map | sed -e "s/${1}\[${old_ipaddr}\]/$1\[${ipaddr}\]/g")
|
||||
wan_gw_map=$(echo $wan_gw_map | sed -e "s/${1}\[${old_gateway}\]/$1\[${gateway}\]/g")
|
||||
wan_if_map=$(echo $wan_if_map | sed -e "s/\(^\|.*\]\)${1}\[${old_ifname}\]/\1${1}\[${ifname}\]/g")
|
||||
wan_ip_map=$(echo $wan_ip_map | sed -e "s/\(^\|.*\]\)${1}\[${old_ipaddr}\]/\1${1}\[${ipaddr}\]/g")
|
||||
wan_gw_map=$(echo $wan_gw_map | sed -e "s/\(^\|.*\]\)${1}\[${old_gateway}\]/\1${1}\[${gateway}\]/g")
|
||||
|
||||
if [ "$old_ifname" != "$ifname" ]; then
|
||||
iptables -D MultiWanPreHandler -t mangle -i $old_$ifname -m state --state NEW -j FW${get_wanid}MARK
|
||||
@@ -205,14 +206,14 @@ update_cache() {
|
||||
|
||||
query_config() {
|
||||
case $1 in
|
||||
ifname) echo $wan_if_map | grep -o "$2\[\w*.*\]" | awk -F "[" '{print $2}' | awk -F "]" '{print $1}';;
|
||||
ipaddr) echo $wan_ip_map | grep -o "$2\[\w*.*\]" | awk -F "[" '{print $2}' | awk -F "]" '{print $1}';;
|
||||
gateway) echo $wan_gw_map | grep -o "$2\[\w*.*\]" | awk -F "[" '{print $2}' | awk -F "]" '{print $1}';;
|
||||
wanid) echo $wan_id_map | grep -o "$2\[\w*.*\]" | awk -F "[" '{print $2}' | awk -F "]" '{print $1}';;
|
||||
failchk) echo $wan_fail_map | grep -o "$2\[\w*.*\]" | awk -F "[" '{print $2}' | awk -F "]" '{print $1}';;
|
||||
recvrychk) echo $wan_recovery_map | grep -o "$2\[\w*.*\]" | awk -F "[" '{print $2}' | awk -F "]" '{print $1}';;
|
||||
monitor) echo $wan_monitor_map | grep -o "$2\[\w*.*\]" | awk -F "[" '{print $2}' | awk -F "]" '{print $1}';;
|
||||
group) echo $wan_id_map | grep -o "\w*\[$2\]" | awk -F "[" '{print $1}';;
|
||||
ifname) echo $wan_if_map | grep -o -e "^$2\[\w*.*\]" -e "\]$2\[\w*.*\]" | awk -F "[" '{print $2}' | awk -F "]" '{print $1}';;
|
||||
ipaddr) echo $wan_ip_map | grep -o -e "^$2\[\w*.*\]" -e "\]$2\[\w*.*\]" | awk -F "[" '{print $2}' | awk -F "]" '{print $1}';;
|
||||
gateway) echo $wan_gw_map | grep -o -e "^$2\[\w*.*\]" -e "\]$2\[\w*.*\]" | awk -F "[" '{print $2}' | awk -F "]" '{print $1}';;
|
||||
wanid) echo $wan_id_map | grep -o -e "^$2\[\w*.*\]" -e "\]$2\[\w*.*\]" | awk -F "[" '{print $2}' | awk -F "]" '{print $1}';;
|
||||
failchk) echo $wan_fail_map | grep -o -e "^$2\[\w*.*\]" -e "\]$2\[\w*.*\]" | awk -F "[" '{print $2}' | awk -F "]" '{print $1}';;
|
||||
recvrychk) echo $wan_recovery_map | grep -o -e "^$2\[\w*.*\]" -e "\]$2\[\w*.*\]" | awk -F "[" '{print $2}' | awk -F "]" '{print $1}';;
|
||||
monitor) echo $wan_monitor_map | grep -o -e "^$2\[\w*.*\]" -e "\]$2\[\w*.*\]" | awk -F "[" '{print $2}' | awk -F "]" '{print $1}';;
|
||||
group) echo $wan_id_map | grep -o "\w*\[$2\]" | awk -F "[" '{print $1}';;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -435,6 +436,34 @@ mwanrule() {
|
||||
add_rule
|
||||
}
|
||||
|
||||
|
||||
get_dns_servers() {
|
||||
local group=$1
|
||||
local groups=$1
|
||||
local dns=""
|
||||
local dnss=""
|
||||
local aliases=""
|
||||
local g
|
||||
|
||||
aliases="$(uci show network| grep =\'@$group\')"
|
||||
|
||||
for g in $aliases ; do
|
||||
g=${g#*.}; g=${g%%.*}
|
||||
[ "$(uci -q get network.$g)" == "interface" ] || continue
|
||||
groups="$groups $g"
|
||||
done
|
||||
|
||||
groups="$(echo $groups | tr ' ' '\n' | sort -u | tr '\n' ' ')"
|
||||
|
||||
for group in $groups ; do
|
||||
network_get_dnsserver dns ${group}
|
||||
dnss="$dnss $dns"
|
||||
done
|
||||
|
||||
echo $dnss
|
||||
}
|
||||
|
||||
|
||||
refresh_dns() {
|
||||
local dns
|
||||
local group
|
||||
@@ -445,6 +474,8 @@ refresh_dns() {
|
||||
local compile_dns
|
||||
local dns_server
|
||||
|
||||
network_flush_cache
|
||||
|
||||
iptables -F MultiWanDNS -t mangle
|
||||
|
||||
rm /tmp/resolv.conf.auto
|
||||
@@ -461,8 +492,8 @@ refresh_dns() {
|
||||
failchk=$(query_config failchk $group)
|
||||
|
||||
dns=$(uci_get_state multiwan ${group} dns 'auto')
|
||||
[ "$dns" == "auto" ] && network_get_dnsserver dns ${group}
|
||||
dns=$(echo $dns | sed -e "s/ /\n/g")
|
||||
[ "$dns" == "auto" ] && dns=$(get_dns_servers $group)
|
||||
dns=$(echo $dns | sed -e "s/\,/ /g" | sed -e "s/ /\n/g")
|
||||
|
||||
if [ ! -z "$dns" -a "$failchk" != "x" -a "$ipaddr" != "x" -a "$gateway" != "x" -a "$ifname" != "x" ]; then
|
||||
echo "$dns" | while read dns_server; do
|
||||
@@ -822,6 +853,7 @@ monitor_wan() {
|
||||
while :; do
|
||||
[ "${health_monitor%.*}" = 'parallel' ] && sleep $health_interval
|
||||
|
||||
network_flush_cache
|
||||
network_get_device ifname ${1} || ifname=x
|
||||
network_get_ipaddr ipaddr ${1} || ipaddr=x
|
||||
network_get_gateway gateway ${1} || gateway=x
|
||||
@@ -892,7 +924,7 @@ monitor_wan() {
|
||||
fi
|
||||
|
||||
[ "$health_monitor" = 'serial' ] && {
|
||||
wan_monitor_map=$(echo $wan_monitor_map | sed -e "s/$1\[\w*\]/$1\[$(date +%s)\]/g")
|
||||
wan_monitor_map=$(echo $wan_monitor_map | sed -e "s/\(^\|.*\]\)${1}\[\w*\]/\1${1}\[$(date +%s)\]/g")
|
||||
update_cache
|
||||
break
|
||||
}
|
||||
|
||||
@@ -42,6 +42,10 @@ define Package/natalie-dect
|
||||
DEPENDS:=bcmkernel
|
||||
endef
|
||||
|
||||
define Package/natalie-dect/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Package/natalie-dect/description
|
||||
Kernel dect driver
|
||||
endef
|
||||
@@ -51,13 +55,16 @@ define Build/Compile
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/natalie-dect/install
|
||||
mkdir -p $(1)/lib/modules/$(BCM_KERNEL_VERSION)/extra/
|
||||
ifeq ($(CONFIG_NATALIE_OPEN),y)
|
||||
define Package/natalie-dect/install
|
||||
$(INSTALL_DIR) $(1)/lib/modules/$(BCM_KERNEL_VERSION)/extra
|
||||
$(CP) $(PKG_BUILD_DIR)/dect.ko $(1)/lib/modules/$(BCM_KERNEL_VERSION)/extra/dect.ko
|
||||
else
|
||||
$(CP) $(PKG_BUILD_DIR)/NatalieFpCvm6362/Src/Projects/NatalieV3/FpCvm/Linux6362/dects.ko $(1)/lib/modules/$(BCM_KERNEL_VERSION)/extra/dect.ko
|
||||
endif
|
||||
endef
|
||||
else
|
||||
define Package/natalie-dect/install
|
||||
$(INSTALL_DIR) $(1)/lib/modules/$(BCM_KERNEL_VERSION)/extra
|
||||
$(CP) $(PKG_BUILD_DIR)/NatalieFpCvm6362/Src/Projects/NatalieV3/FpCvm/Linux6362/dects.ko $(1)/lib/modules/$(BCM_KERNEL_VERSION)/extra/dect.ko
|
||||
endef
|
||||
endif
|
||||
|
||||
$(eval $(call BuildPackage,natalie-dect))
|
||||
|
||||
@@ -6,9 +6,9 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=questd
|
||||
PKG_VERSION:=3.1.22
|
||||
PKG_VERSION:=3.1.28
|
||||
|
||||
PKG_SOURCE_VERSION:=70ad526e6f44a98f03944f535add1712295dd3ec
|
||||
PKG_SOURCE_VERSION:=74cd9925cf99f48e2241b4430b6bf3134790122a
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=http://public.inteno.se:/questd
|
||||
|
||||
@@ -19,20 +19,20 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_mips),y)
|
||||
QUESTD_CLFAGS:=-DIOPSYS_BROADCOM
|
||||
QUESTD_CFLAGS:=-DIOPSYS_BROADCOM
|
||||
KERNEL_DIR:=$(BUILD_DIR)/bcmkernel/bcm963xx
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
||||
QUESTD_CLFAGS:=-DIOPSYS_BROADCOM
|
||||
QUESTD_CFLAGS:=-DIOPSYS_BROADCOM
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_linksys),y)
|
||||
QUESTD_CLFAGS:=-DIOPSYS_MARVELL
|
||||
QUESTD_CFLAGS:=-DIOPSYS_MARVELL
|
||||
else ifeq ($(CONFIG_TARGET_lantiq_xrx500),y)
|
||||
QUESTD_CLFAGS:=-DIOPSYS_LANTIQ
|
||||
QUESTD_CFLAGS:=-DIOPSYS_LANTIQ
|
||||
else
|
||||
$(info (UNEXPECTED CONFIG TARGET))
|
||||
endif
|
||||
|
||||
export KERNEL_DIR
|
||||
export QUESTD_CLFAGS
|
||||
export QUESTD_CFLAGS
|
||||
|
||||
define Package/questd
|
||||
CATEGORY:=Utilities
|
||||
|
||||
@@ -11,6 +11,8 @@ start_service() {
|
||||
procd_set_param command "/sbin/questd"
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
|
||||
pidof questd-monitor > /dev/null 2>&1 || /sbin/questd-monitor &
|
||||
}
|
||||
|
||||
stop() {
|
||||
|
||||
159
questd/files/sbin/questd-monitor
Executable file
159
questd/files/sbin/questd-monitor
Executable file
@@ -0,0 +1,159 @@
|
||||
#!/bin/sh
|
||||
|
||||
# 1. sleep for $SLEEP_LONG seconds
|
||||
# 2. run the check_* functions
|
||||
# 3. sleep for $SLEEP_SHORT seconds
|
||||
# 4. go to step 2. $SAMPLES-1 times (step 2. will run $SAMPLES times)
|
||||
# 5. go to step 1.
|
||||
SAMPLES=4
|
||||
SLEEP_SHORT=2
|
||||
SLEEP_LONG=10
|
||||
|
||||
# worst-case scenario:
|
||||
# quest will be restarted in:
|
||||
# SLEEP_LONG + (SAMPLES-1)*SLEEP_SHORT + UBUS_TIMEOUT + epsilon =
|
||||
# = 21 seconds
|
||||
|
||||
# number of process
|
||||
NPROC_LIMIT=2 # the value that is considered to be wrong (and above)
|
||||
NPROC_COUNT=4 # number of time that the NPROC_LIMIT has to be hit to trigger a process restart
|
||||
NPROC_NFAIL=0 # current consecutive Number of FAILures. process restarts when NPROC_NFAIL == NPROC_COUNT
|
||||
|
||||
# memmory limit
|
||||
MEM_LIMIT=50000
|
||||
MEM_COUNT=4
|
||||
MEM_NFAIL=0
|
||||
|
||||
# procentage of CPU usage
|
||||
PCPU_LIMIT=38
|
||||
PCPU_COUNT=4
|
||||
PCPU_NFAIL=0
|
||||
|
||||
UBUS_TIMEOUT=5
|
||||
|
||||
|
||||
restart_questd()
|
||||
{
|
||||
logger -s -t $0[$$] "Restarting questd. $NPROC_NFAIL $MEM_NFAIL $PCPU_NFAIL"
|
||||
|
||||
/etc/init.d/quest stop
|
||||
killall -q -KILL questd
|
||||
/etc/init.d/quest start
|
||||
|
||||
NPROC_NFAIL=0
|
||||
MEM_NFAIL=0
|
||||
PCPU_NFAIL=0
|
||||
}
|
||||
|
||||
|
||||
check_nproc()
|
||||
{
|
||||
local nproc="$@"
|
||||
|
||||
if [ "$nproc" -ge "$NPROC_LIMIT" ]; then
|
||||
NPROC_NFAIL=$((NPROC_NFAIL + 1))
|
||||
else
|
||||
NPROC_NFAIL=0
|
||||
fi
|
||||
|
||||
[ "$NPROC_NFAIL" -ge "$NPROC_COUNT" ] && return 1
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
check_mem()
|
||||
{
|
||||
local mem="$@"
|
||||
local ok=true
|
||||
|
||||
for m in $mem; do
|
||||
if [ "$m" -ge "$MEM_LIMIT" ]; then
|
||||
ok=false
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
[ "$ok" = "true" ] && MEM_NFAIL=0
|
||||
[ "$ok" = "false" ] && MEM_NFAIL=$((MEM_NFAIL + 1))
|
||||
|
||||
[ "$MEM_NFAIL" -ge "$MEM_COUNT" ] && return 1
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
check_pcpu()
|
||||
{
|
||||
local pcpu="$@"
|
||||
local ok=true
|
||||
|
||||
for p in $pcpu; do
|
||||
p=${p%%%*}
|
||||
if [ "$p" -ge "$PCPU_LIMIT" ]; then
|
||||
ok=false
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
[ "$ok" = "true" ] && PCPU_NFAIL=0
|
||||
[ "$ok" = "false" ] && PCPU_NFAIL=$((PCPU_NFAIL + 1))
|
||||
|
||||
[ "$PCPU_NFAIL" -ge "$PCPU_COUNT" ] && return 1
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
check_ubuscall()
|
||||
{
|
||||
local rv
|
||||
|
||||
ubus -t $UBUS_TIMEOUT call router.system info >/dev/null 2>&1
|
||||
rv=$?
|
||||
|
||||
[ "$rv" = "0" ] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
|
||||
main()
|
||||
{
|
||||
local topline nproc mem pcpu
|
||||
local restart_nproc restart_mem restart_pcpu
|
||||
local sample=1
|
||||
|
||||
while true ; do
|
||||
|
||||
# collect info
|
||||
topline=$(top -bn1 | grep "/sbin/[q]uestd" | grep -v monitor)
|
||||
|
||||
nproc=$(echo "$topline" | wc -l)
|
||||
check_nproc $nproc
|
||||
restart_nproc=$?
|
||||
|
||||
mem=$(echo -en "$topline" | awk '{print $5}')
|
||||
check_mem $mem
|
||||
restart_mem=$?
|
||||
|
||||
pcpu=$(echo -en "$topline" | awk '{print $7}')
|
||||
check_pcpu $pcpu
|
||||
restart_pcpu=$?
|
||||
|
||||
# do the restart
|
||||
if [ "$restart_nproc" = "1" -o \
|
||||
"$restart_mem" = "1" -o \
|
||||
"$restart_pcpu" = "1" ]
|
||||
then
|
||||
check_ubuscall || restart_questd
|
||||
fi
|
||||
|
||||
# sleep
|
||||
if [ "$sample" -lt "$SAMPLES" ]; then
|
||||
sample=$((sample + 1))
|
||||
sleep $SLEEP_SHORT
|
||||
else
|
||||
sample=1
|
||||
sleep $SLEEP_LONG
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
main $@
|
||||
@@ -1,25 +1,25 @@
|
||||
AUS;19x
|
||||
BEL;09xx
|
||||
BRA;05xx
|
||||
AUS;19x+
|
||||
BEL;09xx+
|
||||
BRA;05xx+
|
||||
CHL;
|
||||
CHN;
|
||||
CZE;9xx
|
||||
DNK;90xx
|
||||
CZE;9xx+
|
||||
DNK;90xx+
|
||||
ETS;
|
||||
FIN;0(7[0,5]|[1-3,6]0)
|
||||
FRA;0[8,9]xx
|
||||
DEU;0(9xx|137)
|
||||
HUN;06-[8,9]x
|
||||
FIN;0(7[0,5]|[1-3,6]0)x+
|
||||
FRA;0[8,9]xx+
|
||||
DEU;0(9xx|137)x+
|
||||
HUN;06-[8,9]x+
|
||||
IND;
|
||||
ITA;8
|
||||
JPN;0990
|
||||
NLD;09xx
|
||||
NZL;0900
|
||||
USA;1-900
|
||||
ESP;([8,9]0x|118)
|
||||
SWE;09xx
|
||||
CHE;09xx
|
||||
NOR;82x
|
||||
TWN;020[3,4,9]
|
||||
GBR;0[8,9]xx
|
||||
ARE;[2,6]00
|
||||
JPN;0990x+
|
||||
NLD;09xx+
|
||||
NZL;0900x+
|
||||
USA;1-900x+
|
||||
ESP;([8,9]0x|118)x+
|
||||
SWE;90510,09(00|39|44)x+,099x+
|
||||
CHE;09xx+
|
||||
NOR;82x+
|
||||
TWN;020[3,4,9]x+
|
||||
GBR;0[8,9]xx+
|
||||
ARE;[2,6]00x+
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
[syslog]
|
||||
|
||||
facility = local0
|
||||
priority = cdr
|
||||
template = "callId:${CDR(clid)}, src:${CDR(src)}, dst:${CDR(dst)}, dstContext:${CDR(dcontext)}, chan:${CDR(channel)}, dstChan:${CDR(dstchannel)},$ app:${CDR(lastapp)}, arg:${CDR(lastdata)}, start:${CDR(start)}, answ:${CDR(answer)}, end:${CDR(end)}, duration:${CDR(duration)}, billsec:${CDR(billsec)}, dispos:${CDR(disposition)}, amaflag:${CDR(amaflags)}, accCode:${CDR(accountcode)}, uniqId:${CDR(uniqueid)}, userfield:${CDR(userfield)}"
|
||||
@@ -167,3 +167,6 @@ config 'sip_service_provider' 'sip0'
|
||||
option 'is_fax' '0'
|
||||
option 'transport' 'udp'
|
||||
|
||||
config cdr_log 'CDR_LOG'
|
||||
option cdr_syslog '0'
|
||||
|
||||
|
||||
@@ -66,6 +66,7 @@ TMPL_QUEUE=$TEMPLATEDIR/queue.TEMPLATE
|
||||
|
||||
TMPL_ASTERISK=$TEMPLATEDIR/asterisk.conf.TEMPLATE
|
||||
TMPL_CDR=$TEMPLATEDIR/cdr.conf.TEMPLATE
|
||||
TMPL_CDR_SYSLOG=$TEMPLATEDIR/cdr_syslog.conf.TEMPLATE
|
||||
TMPL_INDICATIONS=$TEMPLATEDIR/indications.conf.TEMPLATE
|
||||
TMPL_LOGGER=$TEMPLATEDIR/logger.conf.TEMPLATE
|
||||
TMPL_MANAGER=$TEMPLATEDIR/manager.conf.TEMPLATE
|
||||
@@ -142,6 +143,7 @@ assemble_and_copy_config()
|
||||
# Copy the template files which we don't edit.
|
||||
cp $TMPL_ASTERISK $WORKDIR/asterisk.conf
|
||||
cp $TMPL_CDR $WORKDIR/cdr.conf
|
||||
cp $TMPL_CEL $WORKDIR/cel.conf
|
||||
cp $TMPL_INDICATIONS $WORKDIR/indications.conf
|
||||
cp $TMPL_MANAGER $WORKDIR/manager.conf
|
||||
cp $TMPL_MODULES $WORKDIR/modules.conf
|
||||
@@ -843,6 +845,7 @@ encrypt_password()
|
||||
if [ -e /usr/bin/voicesec ] ; then
|
||||
echo "Encrypting password for $1"
|
||||
/usr/bin/voicesec -e $secret > /usr/lib/asterisk/voicesec_$1
|
||||
fsync /usr/lib/asterisk/voicesec_$1
|
||||
fi
|
||||
uci_remove voice_client $1 secret
|
||||
uci_commit voice_client
|
||||
@@ -1116,6 +1119,21 @@ configure_cdr()
|
||||
{
|
||||
mkdir -p /var/log/asterisk/cdr-csv
|
||||
touch /var/log/asterisk/cdr-csv/Master.csv
|
||||
|
||||
|
||||
local cdr_syslog
|
||||
config_get cdr_syslog CDR_LOG cdr_syslog
|
||||
|
||||
echo "cdr_syslog: $cdr_syslog"
|
||||
|
||||
if [ -z "$cdr_syslog" ] ; then
|
||||
cdr_syslog='0'
|
||||
fi
|
||||
|
||||
# Enable/disable CDR logging in syslog
|
||||
if [ "$cdr_syslog" == "1" ] ; then
|
||||
cp $TMPL_CDR_SYSLOG $WORKDIR/cdr_syslog.conf
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
@@ -1200,7 +1218,7 @@ configure_call_filters()
|
||||
# All x characters are replaced with [0-9] to match a single digit
|
||||
srn="($(echo $srn | tr -s "" | tr "," "|" | sed 's/x/[0-9]/g'))"
|
||||
|
||||
echo "exten => s,n,GotoIf($[\"\${ARG1}\":\"(^$srn[0-9]+)\">0]?special-rate:normal-rate)" >> $WORKDIR/macros.tmp
|
||||
echo "exten => s,n,GotoIf($[\"\${ARG1}\":\"(^$srn$)\">0]?special-rate:normal-rate)" >> $WORKDIR/macros.tmp
|
||||
echo "exten => s,n(special-rate),Set(SPECRATE=1)" >> $WORKDIR/macros.tmp
|
||||
echo "exten => s,n,MacroExit()" >> $WORKDIR/macros.tmp
|
||||
echo "exten => s,n(normal-rate),Set(SPECRATE=0)" >> $WORKDIR/macros.tmp
|
||||
|
||||
Reference in New Issue
Block a user