mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
add
This commit is contained in:
parent
7f7ccd1afb
commit
e3e4f84d8c
7 changed files with 364 additions and 0 deletions
36
ipcalc/Makefile
Normal file
36
ipcalc/Makefile
Normal file
|
@ -0,0 +1,36 @@
|
|||
#
|
||||
# Copyright (C) 2018-2019 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ipcalc
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/nmav/ipcalc.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=e9f88461f2585575d12fc95f5eeb9996b863f5af
|
||||
PKG_MAINTAINER:=Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
MAKE_FLAGS += USE_GEOIP=no USE_MAXMIND=no
|
||||
|
||||
define Package/ipcalc
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
MAINTAINER:=Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
TITLE:=Modern tool to assist in network address calculations for IPv4 and IPv6.
|
||||
endef
|
||||
|
||||
define Package/ipcalc/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ipcalc $(1)/usr/sbin/ipcalc
|
||||
endef
|
||||
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
44
libell/Makefile
Normal file
44
libell/Makefile
Normal file
|
@ -0,0 +1,44 @@
|
|||
#
|
||||
# Copyright (C) 2020-2021 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ell
|
||||
PKG_VERSION:=0.41
|
||||
PKG_RELEASE:=1
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_HASH:=4e8dba6c53cf152dbd0fd1dc3d4c7b04abf79e20a948895f85943e586870505c
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/libs/ell
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_LICENSE_FILES:=GPL
|
||||
PKG_INSTALL:=1
|
||||
PKG_MAINTAINER:=Ycarus <ycarus@zugaina.org>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/libell
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=Embedded Linux library
|
||||
URL:=https://git.kernel.org/pub/scm/libs/ell/ell.git
|
||||
endef
|
||||
|
||||
define Package/libell/description
|
||||
Embeded Linux library
|
||||
endef
|
||||
|
||||
define Package/libell/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libell*.so* $(1)/usr/lib
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)
|
||||
$(CP) $(PKG_INSTALL_DIR)/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libell))
|
45
macvlan/Makefile
Normal file
45
macvlan/Makefile
Normal file
|
@ -0,0 +1,45 @@
|
|||
#
|
||||
# Copyright (C) 2018-2019 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3 or later.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=macvlan
|
||||
PKG_VERSION:=1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_MAINTAINER:=Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/macvlan
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=MacVLAN configuration scripts
|
||||
DEPENDS:=+kmod-macvlan
|
||||
PKGARCH:=all
|
||||
endef
|
||||
|
||||
define Package/macvlan/description
|
||||
MacVLAN configuration for OpenMPTCProuter.
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/macvlan/install
|
||||
$(INSTALL_DIR) $(1)
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,macvlan))
|
0
macvlan/files/etc/config/macvlan
Normal file
0
macvlan/files/etc/config/macvlan
Normal file
111
macvlan/files/etc/init.d/macvlan
Executable file
111
macvlan/files/etc/init.d/macvlan
Executable file
|
@ -0,0 +1,111 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=4
|
||||
USE_PROCD=1
|
||||
|
||||
_setup_macaddr() {
|
||||
uci -q get "network.$1_dev.macaddr" >/dev/null && return
|
||||
uci -q set "network.$1_dev.macaddr=$2"
|
||||
}
|
||||
|
||||
_save_macaddr() {
|
||||
local _ifname
|
||||
local _macaddr
|
||||
uci -q get "network.$1_dev.ifname" >/dev/null && {
|
||||
_ifname=$(uci -q get "network.$1.ifname")
|
||||
[ -z "$_ifname" ] && _ifname=$(uci -q get "network.$1.device")
|
||||
if [ -n "$(uci -q get network.$1.macaddr)" ] && [ "$(uci -q get network.$1.macaddr)" != "$(uci -q get network.$1_dev.macaddr)" ]; then
|
||||
uci -q set network.$1_dev.macaddr="$(uci -q get network.$1.macaddr)"
|
||||
else
|
||||
_macaddr=$(ip link show dev $_ifname 2>/dev/null | grep link | awk '{print $2}')
|
||||
[ -n "$_macaddr" ] && {
|
||||
uci -q set network.$1_dev.macaddr=$_macaddr
|
||||
uci -q set network.$1.macaddr=$_macaddr
|
||||
}
|
||||
fi
|
||||
}
|
||||
[ -z "$(uci -q get network.$1.macaddr)" ] && {
|
||||
_ifname=$(uci -q get "network.$1.ifname")
|
||||
[ -z "$_ifname" ] && _ifname=$(uci -q get "network.$1.device")
|
||||
[ -n "$_ifname" ] && [ -z "$(echo $_ifname | grep '\.')" ] && {
|
||||
_macaddr=$(ip link show dev $_ifname 2>/dev/null | grep link | awk '{print $2}')
|
||||
[ -n "$_macaddr" ] && {
|
||||
uci -q set network.$1.macaddr=$_macaddr
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_delete_device() {
|
||||
[ "$(echo $1 | grep _dev)" != "" ] && {
|
||||
local _intfdev=$(echo $1 | sed 's/_dev//')
|
||||
[ "$(uci -q get network.$_intfdev.type)" != "macvlan" ] && {
|
||||
logger -t "macvlan" "$_intfdev type is not MacVLAN, remove device network.$1"
|
||||
uci -q batch <<-EOF
|
||||
delete network.$1
|
||||
commit network
|
||||
EOF
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Configuration by interface
|
||||
_setup_interface() {
|
||||
local _ifname
|
||||
config_get _ifname "$1" masterintf
|
||||
[ -z "$_ifname" ] && return
|
||||
local _type
|
||||
config_get _type "$1" type
|
||||
config_get _proto "$1" proto
|
||||
[ "$_proto" = "macvlan" ] && _type="macvlan"
|
||||
[ "$_type" = "macvlan" ] || return 0
|
||||
|
||||
uci -q get "network.$1_dev.ifname" >/dev/null && {
|
||||
uci -q set network.$1_dev.mtu=$(uci -q get network.$1.mtu)
|
||||
[ -z "$(uci -q get network.$1.masterintf)" ] && uci -q set network.$1.masterintf=$(uci -q get network.$1_dev.ifname)
|
||||
[ -n "$(uci -q get network.$1.masterintf)" ] && uci -q set network.$1_dev.ifname=$(uci -q get network.$1.masterintf)
|
||||
[ -n "$(uci -q get network.$1.macaddr)" ] && uci -q set network.$1_dev.macaddr=$(uci -q get network.$1.macaddr)
|
||||
uci set network.$1.device=$1
|
||||
uci -q commit network
|
||||
return 0
|
||||
}
|
||||
|
||||
uci -q batch <<-EOF
|
||||
set network.$1_dev=device
|
||||
set network.$1_dev.name=$1
|
||||
set network.$1_dev.type='macvlan'
|
||||
set network.$1_dev.ifname=$_ifname
|
||||
set network.$1_dev.mode='private'
|
||||
set network.$1_dev.multicast=0
|
||||
set network.$1.device=$1
|
||||
set network.$1.masterintf=$_ifname
|
||||
set network.$1.type=macvlan
|
||||
set network.$1.defaultroute=0
|
||||
delete network.$1.macaddr
|
||||
EOF
|
||||
|
||||
#_macaddr=$(uci -q get "network.$1.macaddr")
|
||||
#_setup_macaddr "$1" "${_macaddr:-auto$(date +%s)}"
|
||||
_setup_macaddr "$1" "$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')"
|
||||
uci -q set network.$1_dev.mtu=$(uci -q get network.$1.mtu)
|
||||
uci -q commit network
|
||||
}
|
||||
|
||||
start_service() {
|
||||
. /lib/functions.sh
|
||||
config_load network
|
||||
config_foreach _delete_device device
|
||||
config_foreach _setup_interface interface
|
||||
config_foreach _save_macaddr interface
|
||||
uci -q commit network
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger network
|
||||
}
|
11
macvlan/files/etc/uci-defaults/40_luci-app-macvlan
Normal file
11
macvlan/files/etc/uci-defaults/40_luci-app-macvlan
Normal file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@macvlan[-1]
|
||||
add ucitrack macvlan
|
||||
set ucitrack.@macvlan[-1].init=macvlan
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
117
protobuf/Makefile
Normal file
117
protobuf/Makefile
Normal file
|
@ -0,0 +1,117 @@
|
|||
#
|
||||
# Copyright (C) 2007-2015 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=protobuf
|
||||
PKG_VERSION:=3.14.0
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-cpp-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/google/protobuf/releases/download/v$(PKG_VERSION)
|
||||
PKG_HASH:=50ec5a07c0c55d4ec536dd49021f2e194a26bfdbc531d03d1e9d4d3e27175659
|
||||
|
||||
PKG_MAINTAINER:=Ken Keys <kkeys@caida.org>
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_CPE_ID:=cpe:/a:google:protobuf
|
||||
|
||||
HOST_BUILD_PARALLEL:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
CMAKE_SOURCE_SUBDIR:=cmake
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/protobuf/Default
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=A structured data encoding library
|
||||
URL:=https://github.com/google/protobuf
|
||||
DEPENDS:=+zlib +libpthread +libatomic +libstdcpp
|
||||
endef
|
||||
|
||||
define Package/protobuf
|
||||
$(call Package/protobuf/Default)
|
||||
DEPENDS+=+protobuf-lite
|
||||
endef
|
||||
|
||||
define Package/protobuf-lite
|
||||
$(call Package/protobuf/Default)
|
||||
endef
|
||||
|
||||
define Package/protobuf/description/Default
|
||||
Protocol Buffers are a way of encoding structured data in an efficient
|
||||
yet extensible format. Google uses Protocol Buffers for almost all
|
||||
of its internal RPC protocols and file formats.
|
||||
endef
|
||||
|
||||
define Package/protobuf/description
|
||||
$(call Package/protobuf/description/Default)
|
||||
|
||||
This package provides the libprotoc, libprotobuf, and libprotobuf-lite
|
||||
libraries. For a much smaller protobuf package, see "protobuf-lite".
|
||||
|
||||
endef
|
||||
|
||||
define Package/protobuf-lite/description
|
||||
$(call Package/protobuf/description/Default)
|
||||
|
||||
This package provides the libprotobuf-lite library.
|
||||
|
||||
endef
|
||||
|
||||
CMAKE_HOST_OPTIONS += \
|
||||
-Dprotobuf_BUILD_PROTOC_BINARIES=ON \
|
||||
-Dprotobuf_BUILD_TESTS=OFF \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DCMAKE_SKIP_RPATH=OFF \
|
||||
-DCMAKE_INSTALL_LIBDIR=lib \
|
||||
-DCMAKE_INSTALL_RPATH="${STAGING_DIR_HOSTPKG}/lib"
|
||||
|
||||
CMAKE_OPTIONS += \
|
||||
-Dprotobuf_BUILD_PROTOC_BINARIES=ON \
|
||||
-Dprotobuf_BUILD_TESTS=OFF \
|
||||
-Dprotobuf_WITH_ZLIB=ON \
|
||||
-DBUILD_SHARED_LIBS=ON
|
||||
|
||||
TARGET_LDFLAGS += -latomic $(if $(CONFIG_USE_GLIBC),-lm)
|
||||
|
||||
define Build/InstallDev
|
||||
$(call Build/InstallDev/cmake,$(1))
|
||||
$(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/protobuf.pc
|
||||
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/protobuf.pc
|
||||
$(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/protobuf-lite.pc
|
||||
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/protobuf-lite.pc
|
||||
endef
|
||||
|
||||
define Package/protobuf-lite/install
|
||||
$(INSTALL_DIR) \
|
||||
$(1)/usr/lib
|
||||
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/libprotobuf-lite.so* \
|
||||
$(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/protobuf/install
|
||||
$(INSTALL_DIR) \
|
||||
$(1)/usr/lib
|
||||
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/libprotoc.so* \
|
||||
$(1)/usr/lib/
|
||||
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/libprotobuf.so* \
|
||||
$(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,protobuf))
|
||||
$(eval $(call BuildPackage,protobuf-lite))
|
||||
$(eval $(call HostBuild))
|
Loading…
Add table
Add a link
Reference in a new issue