feat(rpi): default firmware ok
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit Details

This commit is contained in:
wpetit 2023-04-21 18:17:33 +02:00
parent 83f97abcbd
commit 23452a06ff
4 changed files with 55 additions and 2 deletions

7
install/raspberrypi.mk Normal file
View File

@ -0,0 +1,7 @@
install-rpi-network-config:
mkdir -p files/etc/config
cp misc/rpi/uci/network files/etc/config/network
install-rpi-uci-defaults:
mkdir -p files/etc/uci-defaults
cp misc/rpi/uci-defaults/* files/etc/uci-defaults/

View File

@ -0,0 +1,37 @@
#/bin/sh
set -e
main() {
# Update default firewall ruleset
uci add firewall rule
uci set firewall.@rule[-1].name='Allow SSH on WAN'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='22'
uci set firewall.@rule[-1].target='ACCEPT'
uci add firewall rule
uci set firewall.@rule[-1].name='Allow HTTP on WAN'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='80'
uci set firewall.@rule[-1].target='ACCEPT'
uci add firewall rule
uci set firewall.@rule[-1].name='Allow HTTPS on WAN'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='443'
uci set firewall.@rule[-1].target='ACCEPT'
uci commit firewall
# Disable DNS-rebind protection
uci set dhcp.@dnsmasq[0].rebind_protection='0'
uci commit dhcp
reload_config
}
main

9
misc/rpi/uci/network Normal file
View File

@ -0,0 +1,9 @@
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config interface 'wan'
option ifname 'eth0'
option proto 'dhcp'

View File

@ -2,7 +2,7 @@ all: rpi-4 rpi-3
rpi-4:
$(MAKE) \
ADDITIONAL_INSTALL="" \
ADDITIONAL_INSTALL="install-rpi-network-config install-rpi-uci-defaults" \
OPENWRT_TARGET="bcm27xx/bcm2711" \
EMISSARY_ARCH="arm64" \
OPENWRT_PROFILE="rpi-4" \
@ -10,7 +10,7 @@ rpi-4:
rpi-3:
$(MAKE) \
ADDITIONAL_INSTALL="" \
ADDITIONAL_INSTALL="install-rpi-network-config install-rpi-uci-defaults" \
OPENWRT_TARGET="bcm27xx/bcm2710" \
EMISSARY_ARCH="arm64" \
OPENWRT_PROFILE="rpi-3" \