From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: [Patch RFC 13/15] network startup: Add scripts for local and uplink Date: Wed, 24 May 2023 10:00:46 +0100 Message-ID: In-Reply-To: <20230523172314.7826-14-jonatan.schlag@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2686236291804179270==" List-Id: --===============2686236291804179270== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable > On 23 May 2023, at 18:23, Jonatan Schlag wrot= e: >=20 > 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. >=20 > Signed-off-by: Jonatan Schlag > --- > 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(-) >=20 > 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 >=20 > + 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+=3D("blue") > VALID_ZONES+=3D("green") > VALID_ZONES+=3D("orange") > -VALID_ZONES+=3D("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)" =3D=3D "network" ]]; then > + VALID_ZONES+=3D("red") > +fi >=20 > declare -A ZONE_ACTION >=20 > -ZONE_ACTION[blue]=3Dfalse > -ZONE_ACTION[green]=3Dfalse > -ZONE_ACTION[orange]=3Dfalse > -ZONE_ACTION[red]=3Dfalse > +for i in "${VALID_ZONES[@]}"; do > + ZONE_ACTION[${i}]=3Dfalse > +done >=20 > if [ $# -eq 0 ]; then > - ZONE_ACTION[blue]=3Dtrue > - ZONE_ACTION[green]=3Dtrue > - ZONE_ACTION[orange]=3Dtrue > - ZONE_ACTION[red]=3Dtrue > + for i in "${VALID_ZONES[@]}"; do > + ZONE_ACTION[${i}]=3Dtrue > + done > fi >=20 > while [ $# -ne 0 ]; do > --=20 > 2.30.2 >=20 --===============2686236291804179270==--