From mboxrd@z Thu Jan 1 00:00:00 1970 From: git@ipfire.org To: ipfire-scm@lists.ipfire.org Subject: [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 4e341f19b076e906c493347c8a11af5c45efc976 Date: Mon, 09 Mar 2015 16:36:34 +0100 Message-ID: <20150309153635.0098B21EC3@argus.ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0770405818730504270==" List-Id: --===============0770405818730504270== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 2.x development tree". The branch, next has been updated via 4e341f19b076e906c493347c8a11af5c45efc976 (commit) via 600b99fb315f02cd778b7725cdf54ca95caf095d (commit) from 5604dc748d0c38a05d2f909aedbe50d8d05684e7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 4e341f19b076e906c493347c8a11af5c45efc976 Author: Michael Tremer Date: Mon Mar 9 16:36:04 2015 +0100 setup: Remove writing udev rules for network interfaces commit 600b99fb315f02cd778b7725cdf54ca95caf095d Author: Michael Tremer Date: Mon Mar 9 15:35:57 2015 +0100 network: Configure device names from /var/ipfire/ethernet/settings =20 Instead of creating a copy of the configuration values and for better extensibility, we will have udev execute a script that parses /var/ipfire/ethernet/settings and will return the correct name of the corresponding device (green0, blue0, ...). ----------------------------------------------------------------------- Summary of changes: config/rootfiles/common/armv5tel/initscripts | 2 + config/rootfiles/common/i586/initscripts | 2 + config/rootfiles/common/udev | 3 +- config/udev/60-net.rules | 3 ++ .../udev/network-hotplug-rename | 60 +++++++++++++++++---= -- lfs/initscripts | 1 + lfs/udev | 9 ++-- src/initscripts/init.d/network-trigger | 22 ++++++++ src/setup/netstuff.c | 21 -------- src/setup/networking.c | 1 - src/setup/setup.h | 1 - 11 files changed, 84 insertions(+), 41 deletions(-) create mode 100644 config/udev/60-net.rules copy tools/check_langs.sh =3D> config/udev/network-hotplug-rename (54%) mode change 100755 =3D> 100644 create mode 100644 src/initscripts/init.d/network-trigger Difference in files: diff --git a/config/rootfiles/common/armv5tel/initscripts b/config/rootfiles/= common/armv5tel/initscripts index 53bc64f..05b8cee 100755 --- a/config/rootfiles/common/armv5tel/initscripts +++ b/config/rootfiles/common/armv5tel/initscripts @@ -60,6 +60,7 @@ etc/rc.d/init.d/mounttmpfs #etc/rc.d/init.d/mysql #etc/rc.d/init.d/netsnmpd etc/rc.d/init.d/network +etc/rc.d/init.d/network-trigger etc/rc.d/init.d/network-vlans #etc/rc.d/init.d/networking etc/rc.d/init.d/networking/any @@ -228,6 +229,7 @@ etc/rc.d/rcsysinit.d/S73swconfig etc/rc.d/rcsysinit.d/S75firstsetup etc/rc.d/rcsysinit.d/S80localnet etc/rc.d/rcsysinit.d/S85firewall +etc/rc.d/rcsysinit.d/S90network-trigger etc/rc.d/rcsysinit.d/S91network-vlans etc/rc.d/rcsysinit.d/S92rngd etc/rc.d/rc3.d/S15fireinfo diff --git a/config/rootfiles/common/i586/initscripts b/config/rootfiles/comm= on/i586/initscripts index 7bab7c4..d4779ab 100755 --- a/config/rootfiles/common/i586/initscripts +++ b/config/rootfiles/common/i586/initscripts @@ -62,6 +62,7 @@ etc/rc.d/init.d/mounttmpfs #etc/rc.d/init.d/mysql #etc/rc.d/init.d/netsnmpd etc/rc.d/init.d/network +etc/rc.d/init.d/network-trigger etc/rc.d/init.d/network-vlans #etc/rc.d/init.d/networking etc/rc.d/init.d/networking/any @@ -233,6 +234,7 @@ etc/rc.d/rcsysinit.d/S70console etc/rc.d/rcsysinit.d/S75firstsetup etc/rc.d/rcsysinit.d/S80localnet etc/rc.d/rcsysinit.d/S85firewall +etc/rc.d/rcsysinit.d/S90network-trigger etc/rc.d/rcsysinit.d/S91network-vlans etc/rc.d/rcsysinit.d/S92rngd etc/rc.d/rc3.d/S15fireinfo diff --git a/config/rootfiles/common/udev b/config/rootfiles/common/udev index bc1cdaa..d01c461 100644 --- a/config/rootfiles/common/udev +++ b/config/rootfiles/common/udev @@ -2,7 +2,6 @@ bin/udevadm etc/modprobe.d/blacklist.conf etc/udev #etc/udev/rules.d -#etc/udev/rules.d/30-persistent-network.rules #etc/udev/rules.d/55-lfs.rules #etc/udev/rules.d/81-cdrom.rules #etc/udev/rules.d/83-cdrom-symlinks.rules @@ -29,6 +28,7 @@ lib/udev #lib/udev/hwdb.d/60-keyboard.hwdb #lib/udev/init-net-rules.sh #lib/udev/mtd_probe +#lib/udev/network-hotplug-rename #lib/udev/rule_generator.functions #lib/udev/rules.d #lib/udev/rules.d/25-alsa.rules @@ -37,6 +37,7 @@ lib/udev #lib/udev/rules.d/50-udev-default.rules #lib/udev/rules.d/60-cdrom_id.rules #lib/udev/rules.d/60-keyboard.rules +#lib/udev/rules.d/60-net.rules #lib/udev/rules.d/60-persistent-alsa.rules #lib/udev/rules.d/60-persistent-input.rules #lib/udev/rules.d/60-persistent-serial.rules diff --git a/config/udev/60-net.rules b/config/udev/60-net.rules new file mode 100644 index 0000000..4f22a1e --- /dev/null +++ b/config/udev/60-net.rules @@ -0,0 +1,3 @@ +# Call a script that checks for the right name of the new device. +# If it matches the configuration it will be renamed accordingly. +ACTION=3D=3D"add", SUBSYSTEM=3D=3D"net", PROGRAM=3D"/lib/udev/network-hotplu= g-rename", RESULT=3D=3D"?*", NAME=3D"$result" diff --git a/config/udev/network-hotplug-rename b/config/udev/network-hotplug= -rename new file mode 100644 index 0000000..331b788 --- /dev/null +++ b/config/udev/network-hotplug-rename @@ -0,0 +1,75 @@ +#!/bin/bash +############################################################################= ### +# = # +# IPFire.org - A linux based firewall = # +# Copyright (C) 2015 IPFire Team = # +# = # +# This program is free software: you can redistribute it and/or modify = # +# it under the terms of the GNU General Public License as published by = # +# the Free Software Foundation, either version 3 of the License, or = # +# (at your option) any later version. = # +# = # +# This program is distributed in the hope that it will be useful, = # +# but WITHOUT ANY WARRANTY; without even the implied warranty of = # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the = # +# GNU General Public License for more details. = # +# = # +# You should have received a copy of the GNU General Public License = # +# along with this program. If not, see . = # +# = # +############################################################################= ### + +# Check if all appropriate variables are set +[ -n "${INTERFACE}" ] || exit 2 + +# Ignore virtual interfaces, etc. +case "${INTERFACE}" in + lo) + exit 0 + ;; + tun*) + exit 0 + ;; + ppp*) + exit 0 + ;; +esac + +# Check if INTERFACE actually exists +[ -d "/sys/class/net/${INTERFACE}" ] || exit 1 + +# If the network configuration is not readable, +# we cannot go on. +if [ ! -r "/var/ipfire/ethernet/settings" ]; then + exit 1 +fi + +# Read network settings +eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings) + +# Standard zones +ZONES=3D"RED GREEN ORANGE BLUE" + +# Determine the address of INTERFACE +ADDRESS=3D"$(