From dd13f1c61969d4eaabd96dcff92c5e9261e24680 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Fri, 20 Nov 2026 12:50:01 +0100 Subject: [PATCH] Fix DHCP identity image and dhcp netcfg checks in d-i startup The identity image DHCP branch tested an unset variable, so it never ran, and its udhcpc call would not have worked (no -i, no -q/-n) nor recorded the interface. Probe each link like the static branch does. The deploycfg dhcp check also misspelled v4cfgmeth. --- .../S25confluentinit | 30 +++++++++++++------ .../S25confluentinit | 30 +++++++++++++------ 2 files changed, 42 insertions(+), 18 deletions(-) diff --git a/confluent_osdeploy/debian/initramfs/lib/debian-installer-startup.d/S25confluentinit b/confluent_osdeploy/debian/initramfs/lib/debian-installer-startup.d/S25confluentinit index 5be507cc..6a2cc055 100644 --- a/confluent_osdeploy/debian/initramfs/lib/debian-installer-startup.d/S25confluentinit +++ b/confluent_osdeploy/debian/initramfs/lib/debian-installer-startup.d/S25confluentinit @@ -78,16 +78,28 @@ if [ -e /dev/disk/by-label/CNFLNT_IDNT ]; then done done #TODO: nameservers - elif [ "$v4cfgmeth" = "dhcp" ]; then + elif [ "$autoconfigmethod" = "dhcp" ]; then setdebopt netcfg/disable_dhcp false boolean setdebopt netcfg/confirm_static false boolean - for NICGUESS in $(ip link|grep LOWER_UP|grep -v LOOPBACK|cut -d ' ' -f 2 | sed -e 's/:$//'); do - udhcpc $NICGUESS - done - for dsrv in $deploysrvs; do - if wget https://$dsrv/confluent-public/ --tries=1 --timeout=1 -O /dev/null > /dev/null 2>&1; then - deploysrvs=$dsrv - fi + NIC="" + while [ -z "$NIC" ]; do + for NICGUESS in $(ip link|grep LOWER_UP|grep -v LOOPBACK|cut -d ' ' -f 2 | sed -e 's/:$//'); do + if udhcpc -i $NICGUESS -t 2 -T 2 -n -q; then + for dsrv in $deploysrvs; do + if wget https://$dsrv/confluent-public/ --tries=1 --timeout=1 -O /dev/null > /dev/null 2>&1; then + deploysrvs=$dsrv + NIC=$NICGUESS + setdebopt netcfg/choose_interface $NIC select + break + fi + done + fi + if [ -z "$NIC" ]; then + ip -4 a flush dev $NICGUESS + else + break + fi + done done fi mgr=$deploysrvs @@ -210,7 +222,7 @@ if [ ! -e /dev/disk/by-label/CNFLNT_IDNT ]; then for namesrv in "$namesrvs"; do setdebopt netcfg/get_nameservers $namesrv string done - elif [ "$vpcfgmeth" = "dhcp" ]; then + elif [ "$v4cfgmeth" = "dhcp" ]; then setdebopt netcfg/disable_dhcp false boolean setdebopt netcfg/confirm_static false boolean fi diff --git a/confluent_osdeploy/ubuntu18.04/initramfs/lib/debian-installer-startup.d/S25confluentinit b/confluent_osdeploy/ubuntu18.04/initramfs/lib/debian-installer-startup.d/S25confluentinit index 4d0c79df..01496856 100644 --- a/confluent_osdeploy/ubuntu18.04/initramfs/lib/debian-installer-startup.d/S25confluentinit +++ b/confluent_osdeploy/ubuntu18.04/initramfs/lib/debian-installer-startup.d/S25confluentinit @@ -78,16 +78,28 @@ if [ -e /dev/disk/by-label/CNFLNT_IDNT ]; then done done #TODO: nameservers - elif [ "$v4cfgmeth" = "dhcp" ]; then + elif [ "$autoconfigmethod" = "dhcp" ]; then setdebopt netcfg/disable_dhcp false boolean setdebopt netcfg/confirm_static false boolean - for NICGUESS in $(ip link|grep LOWER_UP|grep -v LOOPBACK|cut -d ' ' -f 2 | sed -e 's/:$//'); do - udhcpc $NICGUESS - done - for dsrv in $deploysrvs; do - if wget https://$dsrv/confluent-public/ --tries=1 --timeout=1 -O /dev/null > /dev/null 2>&1; then - deploysrvs=$dsrv - fi + NIC="" + while [ -z "$NIC" ]; do + for NICGUESS in $(ip link|grep LOWER_UP|grep -v LOOPBACK|cut -d ' ' -f 2 | sed -e 's/:$//'); do + if udhcpc -i $NICGUESS -t 2 -T 2 -n -q; then + for dsrv in $deploysrvs; do + if wget https://$dsrv/confluent-public/ --tries=1 --timeout=1 -O /dev/null > /dev/null 2>&1; then + deploysrvs=$dsrv + NIC=$NICGUESS + setdebopt netcfg/choose_interface $NIC select + break + fi + done + fi + if [ -z "$NIC" ]; then + ip -4 a flush dev $NICGUESS + else + break + fi + done done fi mgr=$deploysrvs @@ -201,7 +213,7 @@ if [ ! -e /dev/disk/by-label/CNFLNT_IDNT ]; then for namesrv in "$namesrvs"; do setdebopt netcfg/get_nameservers $namesrv string done - elif [ "$vpcfgmeth" = "dhcp" ]; then + elif [ "$v4cfgmeth" = "dhcp" ]; then setdebopt netcfg/disable_dhcp false boolean setdebopt netcfg/confirm_static false boolean fi