diff -Nru initramfs-tools-0.122ubuntu8.1/debian/changelog initramfs-tools-0.122ubuntu8.3/debian/changelog --- initramfs-tools-0.122ubuntu8.1/debian/changelog 2016-06-06 18:32:03.000000000 +0000 +++ initramfs-tools-0.122ubuntu8.3/debian/changelog 2016-09-27 20:27:38.000000000 +0000 @@ -1,3 +1,25 @@ +initramfs-tools (0.122ubuntu8.3) xenial; urgency=medium + + * scripts/functions: make sure we can try to start all available and suitable + interfaces if ip= isn't set when setting up the network, and exit as soon + as we get an IP address. This retains the old behavior from ipconfig when + ip= is unset, for really simple remote-root scenarios. (LP: #1628306) + * scripts/functions: retain bootp/rarp behavior using ipconfig. + + -- Mathieu Trudel-Lapierre Tue, 27 Sep 2016 16:27:38 -0400 + +initramfs-tools (0.122ubuntu8.2) xenial; urgency=medium + + [ Mathieu Trudel-Lapierre ] + * scripts/functions: update configure_networking to use dhclient. + (LP: #1621507) + + [ LaMont Jones ] + * Depend/Breaks isc-dhcp-client as needed to make sure that it has + initramfs support + + -- LaMont Jones Fri, 23 Sep 2016 16:01:48 -0600 + initramfs-tools (0.122ubuntu8.1) xenial; urgency=medium * hook-functions: include ehci-msm in auto_add_modules_list diff -Nru initramfs-tools-0.122ubuntu8.1/debian/control initramfs-tools-0.122ubuntu8.3/debian/control --- initramfs-tools-0.122ubuntu8.1/debian/control 2016-02-21 21:22:01.000000000 +0000 +++ initramfs-tools-0.122ubuntu8.3/debian/control 2016-09-27 20:27:38.000000000 +0000 @@ -14,11 +14,11 @@ Package: initramfs-tools Architecture: all Multi-Arch: foreign -Depends: initramfs-tools-core (= ${binary:Version}), linux-base, ${misc:Depends} +Depends: initramfs-tools-core (= ${binary:Version}), linux-base, ${misc:Depends}, isc-dhcp-client (>= 4.3.3-5ubuntu12.3) Suggests: bash-completion Provides: linux-initramfs-tool Conflicts: linux-initramfs-tool, usplash (<< 0.5.50) -Breaks: cryptsetup (<< 2:1.6.6-4~), elilo (<< 3.12-3.1~), lilo (<< 22.8-8.2~), s390-tools (<< 1.8.3-2~), console-setup (<< 1.72), systemd-sysv (<< 186), lvm2 (<< 2.02.111-2.1~), initscripts (<< 2.88dsf-59.3~), mountall (<< 2.0~) +Breaks: cryptsetup (<< 2:1.6.6-4~), elilo (<< 3.12-3.1~), lilo (<< 22.8-8.2~), s390-tools (<< 1.8.3-2~), console-setup (<< 1.72), systemd-sysv (<< 186), lvm2 (<< 2.02.111-2.1~), initscripts (<< 2.88dsf-59.3~), mountall (<< 2.0~), isc-dhcp-client (= 4.3.3-5ubuntu13) Description: generic modular initramfs generator (automation) This package builds a bootable initramfs for Linux kernel packages. The initramfs is loaded along with the kernel and is responsible for diff -Nru initramfs-tools-0.122ubuntu8.1/scripts/functions initramfs-tools-0.122ubuntu8.3/scripts/functions --- initramfs-tools-0.122ubuntu8.1/scripts/functions 2016-03-05 09:47:31.000000000 +0000 +++ initramfs-tools-0.122ubuntu8.3/scripts/functions 2016-09-27 20:25:48.000000000 +0000 @@ -194,6 +194,34 @@ return ${RET} } +all_netbootable_devices() +{ + for device in /sys/class/net/* ; do + if [ ! -e $device/flags ]; then + continue + fi + + loop=$(($(cat $device/flags) & 0x8 && 1 || 0)) + bc=$(($(cat $device/flags) & 0x2 && 1 || 0)) + ptp=$(($(cat $device/flags) & 0x10 && 1 || 0)) + + # Skip any device that is a loopback + if [ $loop = 1 ]; then + continue + fi + + # Skip any device that isn't a broadcast + # or point-to-point. + if [ $bc = 0 ] && [ $ptp = 0 ]; then + continue + fi + + DEVICE="$DEVICE $(basename $device)" + done + + echo $DEVICE +} + configure_networking() { if [ -n "${BOOTIF}" ]; then @@ -254,11 +282,37 @@ none|off) # Do nothing ;; - ""|on|any) + ""|::::*|on|any|dhcp) + # if IP contains something other than BOOTIF; use that + # interface to bring up the network. + if ! echo "${IP}" | grep -qc 'BOOTIF'; then + DEVICE="${IP#*:*:*:*:*:*}"; + fi + + # if we don't have a device specified, try to bring up + # any eligible device. + if [ -z "${DEVICE}" ]; then + DEVICE=$(all_netbootable_devices) + fi + # Bring up device - ipconfig -t ${ROUNDTTT} "${DEVICE}" + for dev in "${DEVICE}"; do + dhclient -4 -1 -v "${dev}" + dhclient -6 -1 -v "${dev}" + + # If we reach BOUND or BOUND6, break out -- we + # got an interface configured. + if grep -qc BOUND /run/net-${dev}.conf; then + break + fi + done + + # At this point we should have configured an interface + # properly, or none were suitable. Keep track of the + # last device we reached to source the results later. + DEVICE=$dev ;; - dhcp|bootp|rarp|both) + bootp|rarp|both) ipconfig -t ${ROUNDTTT} -c ${IP} -d "${DEVICE}" ;; *)