[RFC PATCH] fff-network: Tidy up network files on startup

Tim Niemeyer tim at tn-x.org
Mi Jul 5 12:27:40 CEST 2017


Hi

Dagegen, weil das löschen verbraucht Speicher und bringt sonst keinen Vorteil.

Wenn überhaupt, dann sollten die Files gar nicht erst im Image landen.

Tim

Am 4. Juli 2017 20:42:57 MESZ schrieb Adrian Schmutzler <freifunk at adrianschmutzler.de>:
>To prevent lots of network configurations crowding the /etc
>directory, this renames the correct file to network.config
>and deletes all the others. The network.config is never
>overwritten, so changes may be made here.
>
>Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
>
>Tested-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
>---
>src/packages/fff/fff-network/files/usr/sbin/configurenetwork | 12
>+++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
>diff --git
>a/src/packages/fff/fff-network/files/usr/sbin/configurenetwork
>b/src/packages/fff/fff-network/files/usr/sbin/configurenetwork
>index 7ecfa3b..d3c9b49 100755
>--- a/src/packages/fff/fff-network/files/usr/sbin/configurenetwork
>+++ b/src/packages/fff/fff-network/files/usr/sbin/configurenetwork
>@@ -10,7 +10,17 @@
> # GNU General Public License for more details.
> 
> BOARD="$(uci get board.model.name)"
>-. /etc/network.$BOARD
>+
>+if [ ! -s /etc/network.config ] ; then
>+    cp /etc/network.$BOARD /etc/network.config && find /etc/network.*
>-type f -maxdepth 0 ! -name 'network.mode' ! -name 'network.config'
>-exec rm {} \+
>+fi
>+
>+if [ -s /etc/network.config ] ; then
>+    . /etc/network.config
>+else
>+    . /etc/network.$BOARD # Fallback option if copying did not work
>+fi
>+
> 
> if ! uci get network.$SWITCHDEV.ifname; then
> 


Mehr Informationen über die Mailingliste franken-dev