Skip to content

Commit

Permalink
Add support for Ubuntu 20.04 (Focal Fossa)
Browse files Browse the repository at this point in the history
Signed-off-by: Krzysztof Wilczyński <kw@linux.com>
  • Loading branch information
kwilczynski committed May 13, 2020
1 parent d4c31fd commit 42905ff
Show file tree
Hide file tree
Showing 7 changed files with 1,300 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Currently supported images:
- Ubuntu 14.04 "Trusty Tahr" (version: 14.04.6)
- Ubuntu 16.04 "Xenial Xerus" (version: 16.04.6)
- Ubuntu 18.04 "Bionic Beaver" (version: 18.04.4)
- Ubuntu 20.04 "Focal Fossa" (version: 20.04)

Up to date Vagrant boxes can be found at https://app.vagrantup.com/kwilczynski.

Expand All @@ -22,6 +23,7 @@ Some of the features that the images include:
- Backported version of Apt for 12.04
- More recent version of OpenSSL
- Native ZFS support (only 14.04 and 16.04)
- Snapcraft support has been removed from 20.04

Every Vagrant box includes an up-to-date version of VirtualBox Guest Additions, and a very basic system tuning (e.g.
network stack, virtual memory, etc.), plus sensible hardening (e.g. Kernel, OpenSSH, etc.).
Expand Down
8 changes: 8 additions & 0 deletions http/proxmox/ubuntu-20.04/preseed.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
d-i preseed/include string ../../common/preseed.cfg ../preseed.cfg

d-i pkgsel/include string openssh-server build-essential libssl-dev libreadline-dev zlib1g-dev linux-source dkms qemu-guest-agent

d-i preseed/late_command string \
in-target sed -i -e 's/GRUB_CMDLINE_LINUX_DEFAULT="\(.*\)"/GRUB_CMDLINE_LINUX_DEFAULT="\1 net.ifnames=0 biosdevname=0"/g' /etc/default/grub; \
in-target sed -i -e 's/\(enp0\|ens[0-9]\)[a-z0-9]\+/eth0/g' /etc/netplan/01-netcfg.yaml; \
in-target update-grub;
8 changes: 8 additions & 0 deletions http/vagrant/ubuntu-20.04/preseed.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
d-i preseed/include string ../../common/preseed.cfg ../preseed.cfg

d-i pkgsel/include string openssh-server build-essential libssl-dev libreadline-dev zlib1g-dev linux-source dkms nfs-common

d-i preseed/late_command string \
in-target sed -i -e 's/GRUB_CMDLINE_LINUX_DEFAULT="\(.*\)"/GRUB_CMDLINE_LINUX_DEFAULT="\1 net.ifnames=0 biosdevname=0"/g' /etc/default/grub; \
in-target sed -i -e 's/\(enp0\|ens[0-9]\)[a-z0-9]\+/eth0/g' /etc/netplan/01-netcfg.yaml; \
in-target update-grub;
3 changes: 3 additions & 0 deletions scripts/common/clean-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,9 @@ if [[ ! $UBUNTU_VERSION =~ ^(12|14).04$ ]]; then
ln -sf /dev/null /etc/systemd/network/99-default.link
fi

# Ubuntu 18.04 and newer.
rm -f /etc/netplan/50-cloud-init.yaml

rm -Rf /dev/.udev \
/var/lib/{dhcp,dhcp3}/* \
/var/lib/dhclient/*
Expand Down
21 changes: 18 additions & 3 deletions scripts/common/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ readonly AMAZON_EC2=$(detect_amazon_ec2 && echo 'true')
# https://www.docker.com/blog/changes-dockerproject-org-apt-yum-repositories/
cat <<EOF > /etc/apt/sources.list.d/docker.list
$(if [[ $UBUNTU_VERSION == '12.04' ]]; then
echo "deb [arch=amd64] https://ftp.yandex.ru/mirrors/docker ubuntu-${UBUNTU_RELEASE} main"
echo "deb [arch=amd64] https://ftp.yandex.ru/mirrors/docker ubuntu-${UBUNTU_RELEASE} main"
else
echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu ${UBUNTU_RELEASE} stable"
if [[ $UBUNTU_VERSION =~ ^(14|16|18).04$ ]]; then
echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu ${UBUNTU_RELEASE} stable"
else
# Starting from 20.04, Docker no long provides packages from their repository.
echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
fi
fi)
EOF

Expand Down Expand Up @@ -58,11 +63,21 @@ apt-get --assume-yes update \
PACKAGES=(
'pciutils'
'procps'
'btrfs-tools'
'xfsprogs'
'git'
)

if [[ $UBUNTU_VERSION =~ ^(12|14|16|18).04$ ]]; then
PACKAGES+=(
'btrfs-tools'
)
else
# Starting from 20.04, btrfs-progs is no longer a virtual package.
PACKAGES+=(
'btrfs-progs'
)
fi

DOCKER_PACKAGE='docker-ce'
if [[ $UBUNTU_VERSION == '12.04' ]]; then
DOCKER_PACKAGE='docker-engine'
Expand Down
Loading

0 comments on commit 42905ff

Please sign in to comment.