mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
dslmngr, easy-qos, uboot: remove reference to intel_mips
misleading target support
This commit is contained in:
parent
5eb40eb826
commit
f4daa579da
4 changed files with 3 additions and 354 deletions
|
|
@ -28,12 +28,6 @@ include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
||||||
TARGET_PLATFORM=BROADCOM
|
TARGET_PLATFORM=BROADCOM
|
||||||
else ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
|
|
||||||
TARGET_PLATFORM=MEDIATEK
|
|
||||||
else ifeq ($(CONFIG_TARGET_iopsys_linksys),y)
|
|
||||||
TARGET_PLATFORM=MARVELL
|
|
||||||
else ifeq ($(CONFIG_TARGET_intel_mips),y)
|
|
||||||
TARGET_PLATFORM=INTEL
|
|
||||||
else
|
else
|
||||||
$(info Unexpected CONFIG_TARGET)
|
$(info Unexpected CONFIG_TARGET)
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ define Package/easy-qos
|
||||||
SECTION:=net
|
SECTION:=net
|
||||||
CATEGORY:=Network
|
CATEGORY:=Network
|
||||||
TITLE:=Easy QoS
|
TITLE:=Easy QoS
|
||||||
DEPENDS:=@(TARGET_intel_mips||TARGET_iopsys_brcm63xx_arm)
|
DEPENDS:=@TARGET_iopsys_brcm63xx_arm
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/easy-qos/description
|
define Package/easy-qos/description
|
||||||
|
|
@ -39,11 +39,7 @@ define Package/easy-qos/install
|
||||||
$(INSTALL_DIR) $(1)/etc/init.d
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||||
$(CP) ./files/etc/config/easy_qos $(1)/etc/config/
|
$(CP) ./files/etc/config/easy_qos $(1)/etc/config/
|
||||||
ifeq ($(CONFIG_TARGET_intel_mips),y)
|
|
||||||
$(CP) ./files/etc/init.d/easy_qos.classcfg $(1)/etc/init.d/easy_qos
|
|
||||||
else
|
|
||||||
$(CP) ./files/etc/init.d/easy_qos.iptables $(1)/etc/init.d/easy_qos
|
$(CP) ./files/etc/init.d/easy_qos.iptables $(1)/etc/init.d/easy_qos
|
||||||
endif
|
|
||||||
$(CP) ./files/etc/uci-defaults/* $(1)/etc/uci-defaults/
|
$(CP) ./files/etc/uci-defaults/* $(1)/etc/uci-defaults/
|
||||||
$(CP) ./files/etc/firewall.easyqos $(1)/etc/firewall.easyqos
|
$(CP) ./files/etc/firewall.easyqos $(1)/etc/firewall.easyqos
|
||||||
endef
|
endef
|
||||||
|
|
|
||||||
|
|
@ -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"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -4,9 +4,6 @@
|
||||||
# This is free software, licensed under the GNU General Public License v2.
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
#
|
#
|
||||||
# intel_mips branch:
|
|
||||||
# iopsys 4.x: iop_grx-ugw-8.1.1-ga
|
|
||||||
# iopsys 5.x: iop_grx-ugw-8.4.1.30
|
|
||||||
|
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
|
@ -15,10 +12,7 @@ PKG_VERSION:=2016.08
|
||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
|
|
||||||
ifdef CONFIG_TARGET_intel_mips
|
ifdef CONFIG_TARGET_iopsys_econet
|
||||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/intel/uboot.git
|
|
||||||
PKG_SOURCE_VERSION:=feed838bd1bfeeb57a9afb93b4d704971f423d92
|
|
||||||
else ifdef CONFIG_TARGET_iopsys_econet
|
|
||||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/ensemble/u-boot.git
|
PKG_SOURCE_URL:=https://dev.iopsys.eu/ensemble/u-boot.git
|
||||||
PKG_SOURCE_VERSION:=1b320f0656bfc8504fa4f771dd77d8e403ed00e0
|
PKG_SOURCE_VERSION:=1b320f0656bfc8504fa4f771dd77d8e403ed00e0
|
||||||
else
|
else
|
||||||
|
|
@ -65,41 +59,9 @@ define uboot/en7562
|
||||||
UBOOT_IMG:=u-boot-nand.bin
|
UBOOT_IMG:=u-boot-nand.bin
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define uboot/sdx810_ap
|
|
||||||
TITLE:=U-Boot for the sdx810_ap
|
|
||||||
DEPENDS:=@TARGET_iopsys_ramips
|
|
||||||
PKG_RELEASE:=6
|
|
||||||
endef
|
|
||||||
|
|
||||||
define uboot/grx500
|
|
||||||
TITLE:=U-Boot for the grx
|
|
||||||
UBOOT_IMG:=u-boot-nand.bin
|
|
||||||
DEPENDS:=@TARGET_intel_mips
|
|
||||||
PKG_RELEASE:=12
|
|
||||||
endef
|
|
||||||
|
|
||||||
# obsolete: no longer supported
|
|
||||||
define uboot/grx500_speedport_smart3
|
|
||||||
TITLE:=U-Boot for the Speedport Smart3
|
|
||||||
UBOOT_IMG:=u-boot-nand.bin
|
|
||||||
DEPENDS:=@TARGET_intel_mips
|
|
||||||
PKG_RELEASE:=7
|
|
||||||
endef
|
|
||||||
|
|
||||||
define uboot/grx500_norrland
|
|
||||||
TITLE:=U-Boot for Norrland Board
|
|
||||||
UBOOT_IMG:=u-boot-nand.bin
|
|
||||||
DEPENDS:=@TARGET_intel_mips
|
|
||||||
PKG_RELEASE:=17
|
|
||||||
endef
|
|
||||||
|
|
||||||
UBOOTS := \
|
UBOOTS := \
|
||||||
ex400 \
|
ex400 \
|
||||||
en7562 \
|
en7562
|
||||||
sdx810_ap \
|
|
||||||
grx500 \
|
|
||||||
grx500_speedport_smart3 \
|
|
||||||
grx500_norrland
|
|
||||||
|
|
||||||
define Package/uboot/template
|
define Package/uboot/template
|
||||||
define Package/uboot-$(1)
|
define Package/uboot-$(1)
|
||||||
|
|
@ -145,8 +107,6 @@ endef
|
||||||
define Package/uboot/install/default
|
define Package/uboot/install/default
|
||||||
$(INSTALL_DIR) $$(1)/lib/upgrade
|
$(INSTALL_DIR) $$(1)/lib/upgrade
|
||||||
$(CP) ./files/uboot-upgrade $$(1)/lib/upgrade/
|
$(CP) ./files/uboot-upgrade $$(1)/lib/upgrade/
|
||||||
$(if $(CONFIG_TARGET_intel_mips), ,$(INSTALL_DIR) $$(1)/etc/init.d)
|
|
||||||
$(if $(CONFIG_TARGET_intel_mips), ,$(CP) ./files/uboot $$(1)/etc/init.d/)
|
|
||||||
|
|
||||||
$(INSTALL_DIR) $(BIN_DIR)/$(TARGET)
|
$(INSTALL_DIR) $(BIN_DIR)/$(TARGET)
|
||||||
$(CP) \
|
$(CP) \
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue