From 0cc588f8e9dd6d0eba76980352c2bebeab874878 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 14 Mar 2023 15:24:37 -0400 Subject: [PATCH] Carry nic detection through to bottom of Ubuntu --- .../initramfs/scripts/casper-bottom/99confluent | 8 +++++--- .../ubuntu22.04/initramfs/scripts/init-premount/confluent | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/confluent_osdeploy/ubuntu22.04/initramfs/scripts/casper-bottom/99confluent b/confluent_osdeploy/ubuntu22.04/initramfs/scripts/casper-bottom/99confluent index ef385a30..94a0c4b2 100755 --- a/confluent_osdeploy/ubuntu22.04/initramfs/scripts/casper-bottom/99confluent +++ b/confluent_osdeploy/ubuntu22.04/initramfs/scripts/casper-bottom/99confluent @@ -25,9 +25,13 @@ if [ -e /tmp/cnflnthmackeytmp ]; then chroot . custom-installation/confluent/bin/genpasshmac $passfile $passcrypt $hmacfile $hmackeyfile chroot . curl -f -H "CONFLUENT_NODENAME: $NODENAME" -H "CONFLUENT_CRYPTHMAC: $(cat /root/$hmacfile)" -d @/tmp/cnflntcryptfile https://$MGR/confluent-api/self/registerapikey cp /root/$passfile /root/custom-installation/confluent/confluent.apikey + DEVICE=$(cat /tmp/autodetectnic) else chroot . custom-installation/confluent/bin/clortho $NODENAME $MGR > /root/custom-installation/confluent/confluent.apikey MGR=[$MGR] + nic=$(grep ^MANAGER /custom-installation/confluent/confluent.info|grep fe80::|sed -e s/.*%//|head -n 1) + nic=$(ip link |grep ^$nic:|awk '{print $2}') + DEVICE=${nic%:} fi if [ -z "$MGTIFACE" ]; then chroot . usr/bin/curl -f -H "CONFLUENT_NODENAME: $NODENAME" -H "CONFLUENT_APIKEY: $(cat /root//custom-installation/confluent/confluent.apikey)" https://${MGR}/confluent-api/self/deploycfg > $deploycfg @@ -35,11 +39,9 @@ else chroot . usr/bin/curl -f -H "CONFLUENT_MGTIFACE: $MGTIFACE" -H "CONFLUENT_NODENAME: $NODENAME" -H "CONFLUENT_APIKEY: $(cat /root//custom-installation/confluent/confluent.apikey)" https://${MGR}/confluent-api/self/deploycfg > $deploycfg fi umask $oum -nic=$(grep ^MANAGER /custom-installation/confluent/confluent.info|grep fe80::|sed -e s/.*%//|head -n 1) -nic=$(ip link |grep ^$nic:|awk '{print $2}') -DEVICE=${nic%:} ipv4m=$(grep ^ipv4_method $netcfgfile|awk '{print$2}') . /scripts/functions +set -x if [ "$ipv4m" = "dhcp" ]; then IP=dhcp configure_networking diff --git a/confluent_osdeploy/ubuntu22.04/initramfs/scripts/init-premount/confluent b/confluent_osdeploy/ubuntu22.04/initramfs/scripts/init-premount/confluent index 1e632017..219919e6 100755 --- a/confluent_osdeploy/ubuntu22.04/initramfs/scripts/init-premount/confluent +++ b/confluent_osdeploy/ubuntu22.04/initramfs/scripts/init-premount/confluent @@ -29,6 +29,7 @@ if [ -e /dev/disk/by-label/CNFLNT_IDNT ]; then MYGW=$(grep ^ipv4_gateway: $tcfg | awk '{print $2}') MYNM=$(grep ^ipv4_netmask: $tcfg | awk '{print $2}') ipconfig -d $MYIP::$MYGW:$MYNM::$TRYNIC + echo $TRYNIC > /tmp/autodetectnic else configure_networking fi