diff options
author | xengineering <me@xengineering.eu> | 2025-07-30 19:08:19 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2025-07-30 19:50:18 +0200 |
commit | 663205ee522cddababe21b9437523ac32adb13c8 (patch) | |
tree | e380a5a45f8a454e4b8ede5aa0005275d25d7d4c /fw | |
parent | d07fc8cb10b7c04f3a22137678fe1150f4a1e379 (diff) | |
download | iot-contact-663205ee522cddababe21b9437523ac32adb13c8.tar iot-contact-663205ee522cddababe21b9437523ac32adb13c8.tar.zst iot-contact-663205ee522cddababe21b9437523ac32adb13c8.zip |
fw: Remove simulate-network.sh
This script requires root privileges. It is annoying to always type a
password for it and in general to start this script to test the native
sim firmware.
Thus the new approach is to provide the network infrastructure with a
system-wide NetworkManager connection and the required servers (IPv6
router advertisement, MQTT, IPv4 DHCP in the future) with systemd
services constantly.
That way the full network environment for the simulation is always just
there for the `zeth` interface and the firmware executable can just be
started with user privileges.
Diffstat (limited to 'fw')
-rwxr-xr-x | fw/simulate-network.sh | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/fw/simulate-network.sh b/fw/simulate-network.sh deleted file mode 100755 index 880a5f9..0000000 --- a/fw/simulate-network.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh - - -# This Source Code Form is subject to the terms of the Mozilla Public License, -# v. 2.0. If a copy of the MPL was not distributed with this file, You can -# obtain one at https://mozilla.org/MPL/2.0/. - -# This script provides a simulated network environment for a simulated Zephyr -# firmware. -# -# It is based on providing a simulated layer 2 network interface (TAP) and -# providing required services as Linux processes there. One example is the -# radvd service which send router advertisements which are required for IPv6 -# stateless address auto configuration (SLAAC). -# -# Root rights are required to run this script. Use your preferred privilege -# escalation program to call this script like this: -# -# sudo ./simulate-network.sh -# -# The creation of a TAP interface can be done persistently with NetworkManager -# too: -# -# nmcli connection add type tun con-name zeth ifname zeth mode tap - - -set -euf - - -FW="$(dirname "$0")" -RADVD_CONF="${FW}/radvd.conf" - -INTERFACE='zeth' -LINUX_IP='fdb3:c9f2:efda:1::2' -NETMASK='64' - -radvd_pid='' - - -cleanup() { - if test "$radvd_pid" != "" - then - kill "$radvd_pid" - fi - - ip link delete "$INTERFACE" -} - - -trap cleanup EXIT - -set -x - -ip tuntap add "$INTERFACE" mode tap -ip link set dev "$INTERFACE" up -ip addr add "${LINUX_IP}/${NETMASK}" dev "$INTERFACE" - -radvd --nodaemon --config "$RADVD_CONF" > /dev/null 2>&1 & -radvd_pid="$!" - -wait |