On 23 May 2023, at 18:23, Jonatan Schlag jonatan.schlag@ipfire.org wrote:
This allows us to start the local and uplink network independent of each other. The function of /etc/init.d/network remains unchangend to maintain backwards compatibility.
Signed-off-by: Jonatan Schlag jonatan.schlag@ipfire.org
config/rootfiles/common/aarch64/initscripts | 2 ++ config/rootfiles/common/riscv64/initscripts | 2 ++ config/rootfiles/common/x86_64/initscripts | 2 ++ lfs/initscripts | 3 +++ src/initscripts/system/network | 22 ++++++++++++--------- 5 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/config/rootfiles/common/aarch64/initscripts b/config/rootfiles/common/aarch64/initscripts index 506f616e6..739503ae6 100644 --- a/config/rootfiles/common/aarch64/initscripts +++ b/config/rootfiles/common/aarch64/initscripts @@ -36,6 +36,8 @@ etc/rc.d/init.d/mountfs etc/rc.d/init.d/mountkernfs etc/rc.d/init.d/mounttmpfs etc/rc.d/init.d/network +etc/rc.d/init.d/network-local +etc/rc.d/init.d/network-uplink #etc/rc.d/init.d/networking etc/rc.d/init.d/networking/any etc/rc.d/init.d/networking/blue diff --git a/config/rootfiles/common/riscv64/initscripts b/config/rootfiles/common/riscv64/initscripts index e834cbfc3..ed1eae904 100644 --- a/config/rootfiles/common/riscv64/initscripts +++ b/config/rootfiles/common/riscv64/initscripts @@ -36,6 +36,8 @@ etc/rc.d/init.d/mountfs etc/rc.d/init.d/mountkernfs etc/rc.d/init.d/mounttmpfs etc/rc.d/init.d/network +etc/rc.d/init.d/network-local +etc/rc.d/init.d/network-uplink #etc/rc.d/init.d/networking etc/rc.d/init.d/networking/any etc/rc.d/init.d/networking/blue diff --git a/config/rootfiles/common/x86_64/initscripts b/config/rootfiles/common/x86_64/initscripts index e834cbfc3..ed1eae904 100644 --- a/config/rootfiles/common/x86_64/initscripts +++ b/config/rootfiles/common/x86_64/initscripts @@ -36,6 +36,8 @@ etc/rc.d/init.d/mountfs etc/rc.d/init.d/mountkernfs etc/rc.d/init.d/mounttmpfs etc/rc.d/init.d/network +etc/rc.d/init.d/network-local +etc/rc.d/init.d/network-uplink #etc/rc.d/init.d/networking etc/rc.d/init.d/networking/any etc/rc.d/init.d/networking/blue diff --git a/lfs/initscripts b/lfs/initscripts index 263292da9..e8a2e4c6e 100644 --- a/lfs/initscripts +++ b/lfs/initscripts @@ -193,6 +193,9 @@ $(TARGET) : ln -sf any /etc/rc.d/init.d/networking/$$i; \ done
- ln -sf /etc/rc.d/init.d/network /etc/rc.d/init.d/network-local
- ln -sf /etc/rc.d/init.d/networking/red /etc/rc.d/init.d/network-uplink
This is really unexpected.
# intel intel no swconfig ifeq "$(BUILD_PLATFORM)" "arm" ln -sf ../init.d/swconfig /etc/rc.d/rcsysinit.d/S73swconfig diff --git a/src/initscripts/system/network b/src/initscripts/system/network index e3fe47597..ff305e472 100644 --- a/src/initscripts/system/network +++ b/src/initscripts/system/network @@ -36,20 +36,24 @@ declare -a VALID_ZONES VALID_ZONES+=("blue") VALID_ZONES+=("green") VALID_ZONES+=("orange") -VALID_ZONES+=("red")
+# If we are called as /etc/init.d/network also red is a valid zone. +# Otherwise we are called as /etc/init.d/network-local where red +# is invalid. +if [[ "$(basename $0)" == "network" ]]; then
- VALID_ZONES+=("red")
+fi
declare -A ZONE_ACTION
-ZONE_ACTION[blue]=false -ZONE_ACTION[green]=false -ZONE_ACTION[orange]=false -ZONE_ACTION[red]=false +for i in "${VALID_ZONES[@]}"; do
- ZONE_ACTION[${i}]=false
+done
if [ $# -eq 0 ]; then
- ZONE_ACTION[blue]=true
- ZONE_ACTION[green]=true
- ZONE_ACTION[orange]=true
- ZONE_ACTION[red]=true
- for i in "${VALID_ZONES[@]}"; do
- ZONE_ACTION[${i}]=true
- done
fi
while [ $# -ne 0 ]; do
2.30.2