-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/5g' into develop
- Loading branch information
Showing
12 changed files
with
210 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
# | ||
# Copyright (C) 2024 CZ.NIC z.s.p.o. (http://www.nic.cz/) | ||
# | ||
# This is free software, licensed under the GNU General Public License v2. | ||
# See /LICENSE for more information. | ||
# | ||
|
||
include $(TOPDIR)/rules.mk | ||
|
||
PKG_NAME:=omnia-5g-kit | ||
PKG_VERSION:=v0.1 | ||
PKG_RELEASE:=$(AUTORELEASE) | ||
|
||
PKG_MAINTAINER:=CZ.NIC <[email protected]> | ||
PKG_LICENSE:=GPL-2.0 | ||
|
||
include $(INCLUDE_DIR)/package.mk | ||
|
||
define Package/omnia-5g-kit | ||
TITLE:=Support for Turris Omnia 5G kit | ||
DEPENDS:=@TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia \ | ||
+turris-nor-update \ | ||
+mwan3 +watchcat \ | ||
+luci-app-mwan3 +luci-app-watchcat \ | ||
+kmod-usb-net-cdc-ncm +kmod-usb-serial-option | ||
CONFLICTS:=modem-manager-autosetup modem-manager | ||
endef | ||
|
||
define Package/omnia-5g-kit/description | ||
This package switches internal mPCIe slot into USB3 mode, reconfigures GSM | ||
network to work with our Quectell RM500U-EA 5G modem and also connects to the | ||
internet on every boot. | ||
endef | ||
|
||
define Build/Compile | ||
true | ||
endef | ||
|
||
define Package/omnia-5g-kit/install | ||
$(INSTALL_DIR) $(1)/etc/init.d | ||
$(INSTALL_BIN) ./files/5g-kit.init $(1)/etc/init.d/5g-kit | ||
endef | ||
|
||
define Package/omnia-5g-kit/postinst | ||
#!/bin/sh | ||
[ -n "$$IPKG_INSTROOT" ] || { | ||
/etc/init.d/5g-kit start | ||
uci -q delete network.gsm || : | ||
uci batch << EOF | ||
set network.gsm=interface | ||
set network.gsm.proto='dhcp' | ||
set network.gsm.device='usb0' | ||
set network.gsm.metric=2048 | ||
set network.gsm6=interface | ||
set network.gsm6.device='@gsm' | ||
set network.gsm6.proto='dhcpv6' | ||
set network.gsm6.ip6ifaceid='eui64' | ||
set network.gsm6.ip6assign='64' | ||
set watchcat.5gkit='watchcat' | ||
set watchcat.5gkit.period='30s' | ||
set watchcat.5gkit.mode='restart_iface' | ||
set watchcat.5gkit.pinghosts='1.1.1.1 8.8.8.8 9.9.9.9' | ||
set watchcat.5gkit.interface='usb0' | ||
EOF | ||
uci commit network | ||
uci commit watchcat | ||
zone="$$(uci show firewall | sed -n 's|^\(firewall\.@zone.*\)\.name=.wan.$$|\1|p')" | ||
if [ -n "$$zone" ]; then | ||
if uci show "$$zone.network" | grep "='[^[:blank:]']\\+[[:blank:]][^[:blank:]']\\+.*'"; then | ||
uci set "$$zone.network='$$(uci get "$$zone.network") gsm gsm6'" | ||
else | ||
uci add_list "$$zone.network=gsm" | ||
uci add_list "$$zone.network=gsm6" | ||
fi | ||
uci commit firewall | ||
fi | ||
} | ||
endef | ||
|
||
|
||
define Package/omnia-5g-kit/prerm | ||
#!/bin/sh | ||
[ -n "$$IPKG_INSTROOT" ] || { | ||
fw_setenv omnia_wwan_slot pcie | ||
uci -q delete network.gsm || : | ||
uci -q delete network.gsm6 || : | ||
uci -q delete watchcat.5gkit || : | ||
uci commit network | ||
uci commit watchcat | ||
zone="$$(uci show firewall | sed -n 's|^\(firewall\.@zone.*\)\.name=.wan.$$|\1|p')" | ||
if [ -n "$$zone" ]; then | ||
if uci show "$$zone.network" | grep "='[^[:blank:]']\\+[[:blank:]][^[:blank:]']\\+.*'"; then | ||
uci set "$$zone.network='$$(uci get "$$zone.network" | sed 's| gsm gsm6||')'" | ||
else | ||
uci del_list "$$zone.network=gsm" | ||
uci del_list "$$zone.network=gsm6" | ||
fi | ||
uci commit firewall | ||
fi | ||
} | ||
endef | ||
|
||
$(eval $(call BuildPackage,omnia-5g-kit)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/sh /etc/rc.common | ||
|
||
START=95 | ||
STOP=05 | ||
|
||
start() { | ||
local limit=0 | ||
if [ "$(fw_printenv omnia_wwan_slot)" != "omnia_wwan_slot=usb3" ]; then | ||
nor-update | ||
fw_setenv omnia_wwan_slot usb3 | ||
create_notification -s restart "Please reboot your router to complete 5G kit installation" | ||
return 0 | ||
fi | ||
while [ ! -e /dev/ttyUSB2 ] && [ "$limit" -lt 20 ]; do | ||
sleep 1 | ||
limit="$((limit + 1))" | ||
done | ||
if [ -e /dev/ttyUSB2 ]; then | ||
echo -ne 'ATZ\r\n' > /dev/ttyUSB2 | ||
echo -ne 'AT+CGDATA="M-ETHER",1\r\n' > /dev/ttyUSB2 | ||
fi | ||
} | ||
|
||
stop() { | ||
if [ -e /dev/ttyUSB2 ]; then | ||
echo -ne 'ATZ\r\n' > /dev/ttyUSB2 | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# | ||
# Copyright (C) 2024 CZ.NIC z.s.p.o. (http://www.nic.cz/) | ||
# | ||
# This is free software, licensed under the GNU General Public License v2. | ||
# See /LICENSE for more information. | ||
# | ||
|
||
include $(TOPDIR)/rules.mk | ||
|
||
PKG_NAME:=omnia-eeprom | ||
PKG_VERSION:=v0.1 | ||
PKG_RELEASE:=$(AUTORELEASE) | ||
|
||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 | ||
PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/$(PKG_NAME)/-/archive/$(PKG_VERSION)/ | ||
PKG_HASH:=6f949d0b8080adca8bae088774ce615b563ba6ec2807cce97ee6769b4eee7bbf | ||
|
||
PKG_MAINTAINER:=CZ.NIC <[email protected]> | ||
PKG_LICENSE:=GPL-2.0 | ||
|
||
include $(INCLUDE_DIR)/package.mk | ||
|
||
define Package/omnia-eeprom | ||
TITLE:=Utility to print / set EEPROM fields on Turris Omnia | ||
DEPENDS:=@TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia | ||
endef | ||
|
||
define Package/omnia-eeprom/description | ||
This package contains the omnia-eeprom utility, which allows you to display | ||
and update EEPROM fields on the Turris Omnia router. | ||
The EEPROM is normally not meant to be updated by users, but there are some | ||
exceptions where it might be useful. | ||
One such example is to change the DDR3 speed from the default 1600K mode to | ||
1333H mode, in order to solve random crashes that occur on some boards with | ||
newer versions of the U-Boot bootloader (because of bugs in newer versions of | ||
the DDR training algorithm). | ||
endef | ||
|
||
define Build/Compile | ||
$(MAKE) -C $(PKG_BUILD_DIR) \ | ||
CC="$(TARGET_CC)" \ | ||
CFLAGS="$(TARGET_CFLAGS) -Wall" \ | ||
LDFLAGS="$(TARGET_LDFLAGS)" \ | ||
OMNIA_EEPROM_VERSION="$(PKG_VERSION)" | ||
endef | ||
|
||
define Package/omnia-eeprom/install | ||
$(INSTALL_DIR) $(1)/usr/bin | ||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/omnia-eeprom $(1)/usr/bin/ | ||
endef | ||
|
||
$(eval $(call BuildPackage,omnia-eeprom)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
include $(TOPDIR)/rules.mk | ||
|
||
PKG_NAME:=turris-omnia-firmware | ||
PKG_VERSION:=1.2.1 | ||
PKG_VERSION:=1.4 | ||
PKG_RELEASE:=$(AUTORELEASE) | ||
|
||
PKG_MAINTAINER:=CZ.NIC <[email protected]> | ||
|
@@ -17,7 +17,7 @@ include $(INCLUDE_DIR)/package.mk | |
|
||
define Package/turris-omnia-firmware | ||
TITLE:=Firmware for Turris Omnia | ||
DEPENDS:=@TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia | ||
DEPENDS:=@TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia +omnia-eeprom | ||
PROVIDES:=turris-nor-update-firmware | ||
endef | ||
|
||
|
@@ -27,10 +27,10 @@ endef | |
|
||
define Package/turris-omnia-devel-firmware | ||
TITLE:=Data files for nor-update (development version) | ||
DEPENDS:=+turris-nor-update +rescue-image +u-boot-omnia @TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia | ||
DEPENDS:=+turris-nor-update +rescue-image +u-boot-omnia @TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia +turris-omnia-firmware | ||
PROVIDES:=turris-nor-update-devel-firmware | ||
VERSION:=0.0 | ||
RELEASE:=1 | ||
RELEASE:=2 | ||
endef | ||
|
||
define Package/turris-omnia-devel-firmware/description | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
include $(TOPDIR)/rules.mk | ||
|
||
PKG_NAME:=pkglists | ||
PKG_VERSION:=1.12 | ||
PKG_VERSION:=1.13 | ||
PKG_RELEASE:=$(AUTORELEASE) | ||
|
||
PKG_MAINTAINER:=CZ.NIC <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
include $(TOPDIR)/rules.mk | ||
|
||
PKG_NAME:=firmware-updater | ||
PKG_VERSION:=1.1 | ||
PKG_VERSION:=1.2 | ||
PKG_RELEASE:=$(AUTORELEASE) | ||
|
||
PKG_MAINTAINER:=CZ.NIC <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters