diff -Nru initramfs-tools-0.142ubuntu25/debian/changelog initramfs-tools-0.142ubuntu25.1/debian/changelog --- initramfs-tools-0.142ubuntu25/debian/changelog 2024-04-17 17:55:09.000000000 +0200 +++ initramfs-tools-0.142ubuntu25.1/debian/changelog 2024-05-10 15:03:48.000000000 +0200 @@ -1,3 +1,10 @@ +initramfs-tools (0.142ubuntu25.1) noble; urgency=medium + + * configure_network: Call dhcpcd with --nolink --noipv4ll to succeed getting + a DHCP lease on the first try and avoid a 30 seconds delay (LP: #2065037) + + -- Benjamin Drung Fri, 10 May 2024 15:03:48 +0200 + initramfs-tools (0.142ubuntu25) noble; urgency=medium * Copy only dhcpcd user into initramfs /etc/passwd (LP: #2059739) diff -Nru initramfs-tools-0.142ubuntu25/scripts/functions initramfs-tools-0.142ubuntu25.1/scripts/functions --- initramfs-tools-0.142ubuntu25/scripts/functions 2024-04-17 17:49:11.000000000 +0200 +++ initramfs-tools-0.142ubuntu25.1/scripts/functions 2024-05-10 15:03:42.000000000 +0200 @@ -273,33 +273,6 @@ return 1 } -_set_available_devices_to_up() -{ - # Look for devices with (IFF_UP and IFF_LOOPBACK) clear and - # (IFF_BROADCAST or IFF_POINTTOPOINT) set. Bring those devices up. - # Skip any enslaved device (has "master" link attribute on it) - # if NETWORK_SKIP_ENSLAVED is set to a value different than "0". - local device - local flags - for device in /sys/class/net/*; do - if [ ! -f "${device}/flags" ]; then - continue - fi - flags="$(cat "${device}/flags")" - if [ "$((flags & 9))" -ne 0 ] || - [ "$((flags & 0x12))" -eq 0 ]; then - continue - fi - - if [ "${NETWORK_SKIP_ENSLAVED:-0}" != 0 ]; then - ip -o link show "${device##*/}" | grep -q -w master && continue - fi - - echo "Setting ip link ${device##*/} up" - echo "$(( flags | 1 ))" > "${device}/flags" - done -} - _update_ip_param() { # If the ip= parameter is present, and is a colon-separated list, @@ -426,17 +399,13 @@ iter_entry_time=$(time_elapsed) - if [ -z "${DEVICE}" ]; then - _set_available_devices_to_up - fi - case ${IP} in none|done|off) # Do nothing IP="done" ;; ""|on|any|dhcp|bootp|both) - dhcpcd -1 -t $ROUNDTTT -4 ${DEVICE:+"${DEVICE}"} + dhcpcd -1KL -t $ROUNDTTT -4 ${DEVICE:+"${DEVICE}"} ;; *) ipconfig -t ${ROUNDTTT} -d "$IP" @@ -459,7 +428,7 @@ DEVICE6="$IP6" ;; esac - dhcpcd -1 -t $ROUNDTTT -6 ${DEVICE6:+"${DEVICE6}"} + dhcpcd -1KL -t $ROUNDTTT -6 ${DEVICE6:+"${DEVICE6}"} ;; esac