From dd13f1c61969d4eaabd96dcff92c5e9261e24680 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Fri, 20 Nov 2026 12:50:01 +0100 Subject: [PATCH 1/2] 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 From b1e33a9307eadd2a342847520333d56a6205f939 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Fri, 20 Nov 2026 12:50:27 +0100 Subject: [PATCH 2/2] Pass multiple nameservers and ntp servers correctly to d-i The nameserver and ntp loops quoted their list, so they ran once with all servers in one word. Unquoted in setdebopt, that split into extra arguments: debconf got only the first server and the preseed line got the second server where the type belongs. Set the nameservers as one space separated string, use the first ntp server (clock-setup takes one) and quote the setdebopt arguments. --- .../S25confluentinit | 21 ++++++++++--------- .../S25confluentinit | 21 ++++++++++--------- 2 files changed, 22 insertions(+), 20 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 6a2cc055..ed02abd1 100644 --- a/confluent_osdeploy/debian/initramfs/lib/debian-installer-startup.d/S25confluentinit +++ b/confluent_osdeploy/debian/initramfs/lib/debian-installer-startup.d/S25confluentinit @@ -10,8 +10,8 @@ reverse_uuid() { echo $1 | tail -c 18 | sed -e s/-// } setdebopt() { - debconf-set $1 $2 - echo d-i $1 $3 $2 >> /preseed.cfg + debconf-set "$1" "$2" + echo "d-i $1 $3 $2" >> /preseed.cfg } mkdir -p /etc/confluent @@ -152,9 +152,9 @@ cd $predir cp /etc/confluent/deploycfg /etc/confluent/confluent.deploycfg profile=$(grep ^profile: /etc/confluent/deploycfg|cut -d ' ' -f 2) namesrvs=$(sed -n '/^nameservers:/,/^[^-]/p' /etc/confluent/deploycfg|grep ^- | cut -d ' ' -f 2|sed -e 's/ //') -for namesrv in "$namesrvs"; do - setdebopt netcfg/get_nameservers $namesrv string -done +if [ -n "$namesrvs" ]; then + setdebopt netcfg/get_nameservers "$(echo $namesrvs)" string +fi rootpass=$(grep ^rootpassword: /etc/confluent/deploycfg|cut -d ' ' -f 2|sed -e 's/ //') if [ "$rootpass" = null ] || [ -z "$rootpass" ]; then setdebopt passwd/root-login false boolean @@ -164,10 +164,11 @@ else fi setdebopt time/zone $(grep ^timezone: /etc/confluent/deploycfg|cut -d ' ' -f 2|sed -e 's/ //') string ntpsrvs=$(sed -n '/^ntpservers:/,/^[^-]/p' /etc/confluent/deploycfg|grep ^- | cut -d ' ' -f 2|sed -e 's/ //') -for ntpsrv in "$ntpsrvs"; do +ntpsrv=$(echo $ntpsrvs | cut -d ' ' -f 1) +if [ -n "$ntpsrv" ]; then setdebopt clock-setup/ntp true boolean setdebopt clock-setup/ntp-server $ntpsrv string -done +fi setdebopt debian-installer/locale $(grep ^locale: /etc/confluent/deploycfg|cut -d ' ' -f 2) select domainname=$(grep ^dnsdomain: /etc/confluent/deploycfg|cut -d ' ' -f 2) if [ ! -z "$domainname" ] && [ "$domainname" != "null" ]; then @@ -219,9 +220,9 @@ if [ ! -e /dev/disk/by-label/CNFLNT_IDNT ]; then setdebopt netcfg/get_gateway $v4gw string fi namesrvs=$(sed -n '/^nameservers:/,/^[^-]/p' /etc/confluent/deploycfg|grep ^- | cut -d ' ' -f 2|sed -e 's/ //') - for namesrv in "$namesrvs"; do - setdebopt netcfg/get_nameservers $namesrv string - done + if [ -n "$namesrvs" ]; then + setdebopt netcfg/get_nameservers "$(echo $namesrvs)" string + fi elif [ "$v4cfgmeth" = "dhcp" ]; then setdebopt netcfg/disable_dhcp false boolean setdebopt netcfg/confirm_static false boolean 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 01496856..69d1f64f 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 @@ -10,8 +10,8 @@ reverse_uuid() { echo $1 | tail -c 18 | sed -e s/-// } setdebopt() { - debconf-set $1 $2 - echo d-i $1 $3 $2 >> /preseed.cfg + debconf-set "$1" "$2" + echo "d-i $1 $3 $2" >> /preseed.cfg } mkdir -p /etc/confluent @@ -144,9 +144,9 @@ cd $predir cp /etc/confluent/deploycfg /etc/confluent/confluent.deploycfg profile=$(grep ^profile: /etc/confluent/deploycfg|cut -d ' ' -f 2) namesrvs=$(sed -n '/^nameservers:/,/^[^-]/p' /etc/confluent/deploycfg|grep ^- | cut -d ' ' -f 2|sed -e 's/ //') -for namesrv in "$namesrvs"; do - setdebopt netcfg/get_nameservers $namesrv string -done +if [ -n "$namesrvs" ]; then + setdebopt netcfg/get_nameservers "$(echo $namesrvs)" string +fi rootpass=$(grep ^rootpassword: /etc/confluent/deploycfg|cut -d ' ' -f 2|sed -e 's/ //') if [ "$rootpass" = null ] || [ -z "$rootpass" ]; then setdebopt passwd/root-login false boolean @@ -156,10 +156,11 @@ else fi setdebopt time/zone $(grep ^timezone: /etc/confluent/deploycfg|cut -d ' ' -f 2|sed -e 's/ //') string ntpsrvs=$(sed -n '/^ntpservers:/,/^[^-]/p' /etc/confluent/deploycfg|grep ^- | cut -d ' ' -f 2|sed -e 's/ //') -for ntpsrv in "$ntpsrvs"; do +ntpsrv=$(echo $ntpsrvs | cut -d ' ' -f 1) +if [ -n "$ntpsrv" ]; then setdebopt clock-setup/ntp true boolean setdebopt clock-setup/ntp-server $ntpsrv string -done +fi setdebopt debian-installer/locale $(grep ^locale: /etc/confluent/deploycfg|cut -d ' ' -f 2) select domainname=$(grep ^dnsdomain: /etc/confluent/deploycfg|cut -d ' ' -f 2) if [ ! -z "$domainname" ] && [ "$domainname" != "null" ]; then @@ -210,9 +211,9 @@ if [ ! -e /dev/disk/by-label/CNFLNT_IDNT ]; then setdebopt netcfg/get_gateway $v4gw string fi namesrvs=$(sed -n '/^nameservers:/,/^[^-]/p' /etc/confluent/deploycfg|grep ^- | cut -d ' ' -f 2|sed -e 's/ //') - for namesrv in "$namesrvs"; do - setdebopt netcfg/get_nameservers $namesrv string - done + if [ -n "$namesrvs" ]; then + setdebopt netcfg/get_nameservers "$(echo $namesrvs)" string + fi elif [ "$v4cfgmeth" = "dhcp" ]; then setdebopt netcfg/disable_dhcp false boolean setdebopt netcfg/confirm_static false boolean