From 2b42dd91c2058cd2419310635c0f15fb1381c851 Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Wed, 6 Mar 2024 13:28:22 +0100 Subject: [PATCH] Fix configuring BOOTIF when using iSCSI When the iSCSI has a static address, the script `local-top/iscsi` from open-iscsi creates a `/run/net-$DEVICE.conf` file for the iSCSI interface. The existence of this file makes `configure_networking()` skip configuring the BOOTIF later. In case a network device is specific (e. g. by setting BOOTIF), wait for exactly this device to be configured. LP: #2056187 Signed-off-by: Benjamin Drung --- scripts/functions | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/scripts/functions b/scripts/functions index e27a799b..5b2c30dc 100644 --- a/scripts/functions +++ b/scripts/functions @@ -466,19 +466,12 @@ configure_networking() # The NIC is to be configured if this file does not exist. # Ip-Config tries to create this file and when it succeds # creating the file, ipconfig is not run again. - for x in /run/net-"${DEVICE}".conf /run/net-*.conf ; do - if [ -e "$x" ]; then - IP="done" - break - fi - done - - for x in /run/net6-"${DEVICE}".conf /run/net6-*.conf ; do - if [ -e "$x" ]; then - IP6="done" - break - fi - done + if [ -z "${DEVICE}" ] && ls /run/net-*.conf >/dev/null 2>&1 || [ -e /run/net-"${DEVICE}".conf ]; then + IP="done" + fi + if [ -z "${DEVICE6}" ] && ls /run/net6-*.conf >/dev/null 2>&1 || [ -e /run/net6-"${DEVICE6}".conf ]; then + IP6="done" + fi # if we've reached a point where both IP and IP6 are "done", # then we're finished with network configuration. -- 2.40.1