From b02a32343646f377ae07ae8a8f4de5045ce09ef4 Mon Sep 17 00:00:00 2001 From: "Meadows, Alan (am240k)" Date: Fri, 20 Mar 2020 13:10:29 -0700 Subject: [PATCH] Update debian-isogen to use ubuntu style interface names This change allows the resulting debian live cd to use ubuntu compatible interface names so that network configuration for ubuntu hosts can be compatible with this debian live cd This change also adds utilities to support bonding and vlans as well as a few critical network debugging tools. Change-Id: Idf07797ca7c2998aaede85e290a330ce3202bf0e --- debian-isogen/files/build.sh | 2 ++ debian-isogen/files/functions.sh | 10 ++++++++++ debian-isogen/files/packages_install.sh | 15 ++++++++++++++- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/debian-isogen/files/build.sh b/debian-isogen/files/build.sh index 2ea325a..ffda0d7 100644 --- a/debian-isogen/files/build.sh +++ b/debian-isogen/files/build.sh @@ -25,6 +25,8 @@ _debootstrap chroot "${CHROOT}" < "${BASEDIR}/packages_install.sh" +_use_ubuntu_net_device_names + mkdir -p "${CLOUD_DATA_LATEST}" cp "${BASEDIR}/meta_data.json" "${CLOUD_DATA_LATEST}" cp "${USER_DATA}" "${CLOUD_DATA_LATEST}/user_data" diff --git a/debian-isogen/files/functions.sh b/debian-isogen/files/functions.sh index bc5270f..c5a0b47 100644 --- a/debian-isogen/files/functions.sh +++ b/debian-isogen/files/functions.sh @@ -23,6 +23,16 @@ function _debootstrap (){ http://ftp.debian.org/debian/ } +function _use_ubuntu_net_device_names (){ +# this prioritizes the path policy over slot +# giving ubuntu compatible interface names + cat <"${HOME}"/LIVE_BOOT/chroot/usr/lib/systemd/network/99-default.link +[Link] +NamePolicy=kernel database onboard path slot +MACAddressPolicy=persistent +EOF +} + function _make_kernel(){ mkdir -p "${HOME}"/LIVE_BOOT/{scratch,image/live} mksquashfs \ diff --git a/debian-isogen/files/packages_install.sh b/debian-isogen/files/packages_install.sh index 5d1e77d..20a0d02 100644 --- a/debian-isogen/files/packages_install.sh +++ b/debian-isogen/files/packages_install.sh @@ -24,9 +24,22 @@ apt-get update && apt-get install -y --no-install-recommends \ openssh-server \ curl \ gnupg \ - iptables + iptables \ + ifenslave \ + bridge-utils \ + tcpdump \ + iputils-ping \ + vlan UNSTABLE_REPO="deb http://ftp.debian.org/debian unstable main" echo "${UNSTABLE_REPO}" >> /etc/apt/sources.list.d/unstable.list + +# ensure we support bonding and 802.1q + +echo 'bonding' >> /etc/modules +echo '8021q' >> /etc/modules + apt-get update && apt-get install -y --no-install-recommends \ cloud-init rm -rf /etc/apt/sources.list.d/unstable.list /var/lib/apt/lists/* + +