eclipse-kura / kura

Eclipse Kura™ is a versatile framework to supercharge your edge devices, streamlining the process of configuring your gateway, connecting sensors, and IoT devices to seamlessly collect, process, and send data to the cloud.
https://eclipse.dev/kura/
Eclipse Public License 2.0
498 stars 305 forks source link

fix(distrib): customize-installation.sh to always patch interface names on snapshot_0.xml and iptables #5275

Closed marcellorinaldo closed 3 months ago

marcellorinaldo commented 3 months ago

This PR modifies thecustomize-installation.sh script that is called only on generic profiles to apply the network interface names patch even on devices that have templates for snapshot_0.xml and iptables. This is to avoid applying a configuration with the wrong interface name when the standard interface enumeration changes.

Related Issue: N/A.

Description of the solution adopted: N/A.

Screenshots: N/A.

Manual Tests: To test the behavior, setup a Raspberry PI and:

  1. Enable the consistent interface naming using raspi-config -> Advanced Options menu and reboot. eth0 will change to something else.
  2. Install Kura.
  3. Inspect the installation logs, without this PR files snapshot_0.xml and iptables are not patched. Those files still have eth0 as interface name since the template for the raspberry has been picked up.
  4. Reboot, without this PR the device will be unreachable due to the interface naming mismatch.

By testing this PR, logs in /opt/eclipse/kura/log/kura_install* on a fresh installation should show that the patch has been applied to:

Any side note on the changes made: N/A.

pierantoniomerlino commented 3 months ago

Tested on RPI3 with 32-bit OS. Kura generic-arm32.