From 3d000339bb391ce402596c0aea981915327c98b6 Mon Sep 17 00:00:00 2001 From: Dan Voiculeasa Date: Wed, 20 Jul 2022 14:22:47 +0300 Subject: [PATCH] Debian: Wait for devices to be configured after boot This work is part of AIO-DX integration effort. This will allow controller-1 to be installed. When pxebooting controller-1 from controller-0 it is observed that a dhcp request is initiated before the NIC is renamed. This will lead to bad network configuration generated during kickstarts. Wait for NICs to be renamed before doing the dhcp request. Tests: PASS: AIO-DX controller-1 gets installed Story: 2009968 Task: 45826 Signed-off-by: Dan Voiculeasa Change-Id: Ib375d846961e6a04f430293c5e218e31e7afb250 --- ...-devices-to-be-configured-after-boot.patch | 36 +++++++++++++++++++ ostree/initramfs-ostree/debian/patches/series | 1 + 2 files changed, 37 insertions(+) create mode 100644 ostree/initramfs-ostree/debian/patches/0007-Wait-for-devices-to-be-configured-after-boot.patch diff --git a/ostree/initramfs-ostree/debian/patches/0007-Wait-for-devices-to-be-configured-after-boot.patch b/ostree/initramfs-ostree/debian/patches/0007-Wait-for-devices-to-be-configured-after-boot.patch new file mode 100644 index 000000000..c4cd2dc50 --- /dev/null +++ b/ostree/initramfs-ostree/debian/patches/0007-Wait-for-devices-to-be-configured-after-boot.patch @@ -0,0 +1,36 @@ +From 97ae81f83a1e98b84aeaf6cfc64f79ac9ea99315 Mon Sep 17 00:00:00 2001 +From: Dan Voiculeasa +Date: Tue, 19 Jul 2022 10:32:46 +0300 +Subject: [PATCH] Wait for devices to be configured after boot + +It was observed that dhcp requests happen too soon after boot. +It may happen that the NIC driver won't rename the interface +because it is in use. +Time is needed for drivers to rename NICs before using them. + +Use 'udevadm settle' to let the devices be configured before +continuing the configuration process. + +Signed-off-by: Dan Voiculeasa +--- + init-ostree-install.sh | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/init-ostree-install.sh b/init-ostree-install.sh +index 9bfcd2a..5442391 100644 +--- a/init-ostree-install.sh ++++ b/init-ostree-install.sh +@@ -965,7 +965,9 @@ if [ "$INSTSH" = 1 -o "$INSTSH" = 3 -o "$INSTSH" = 4 ] ; then + lreboot + fi + +-udevadm settle --timeout=3 ++echo "Waiting up to 5 minutes for devices to be properly configured." ++udevadm settle --timeout=300 || fatal "udevadm settle timed out after 300 seconds" ++echo "Devices should be properly configured." + + if [ "$INSTNAME" = "" ] ; then + fatal "Error no remote archive name, need kernel argument: instname=..." +-- +2.34.1 + diff --git a/ostree/initramfs-ostree/debian/patches/series b/ostree/initramfs-ostree/debian/patches/series index 460c2e578..28d4fdb6d 100644 --- a/ostree/initramfs-ostree/debian/patches/series +++ b/ostree/initramfs-ostree/debian/patches/series @@ -4,3 +4,4 @@ 0004-Wipe-signatures-and-zero-first-4KiB.patch 0005-Make-boot-efi-mount-as-rw.patch 0006-debian-set-default-size-variables-in-install-script.patch +0007-Wait-for-devices-to-be-configured-after-boot.patch