From e3b84b6ac09ff834bd1ecca89900e1225e55f05b Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 27 Oct 2020 15:22:11 -0300 Subject: Ubuntu fixes at kvmx-create --- kvmx-create | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'kvmx-create') diff --git a/kvmx-create b/kvmx-create index ba25147..7137060 100755 --- a/kvmx-create +++ b/kvmx-create @@ -180,7 +180,7 @@ function kvmx_create_custom { host_distro="`head -n 1 /etc/issue | cut -d ' ' -f 1 | tr '[:upper:]' '[:lower:]'`" # Determine distro and kernel package name - if echo $mirror | grep 'ubuntu'; then + if echo $mirror | grep -q 'ubuntu'; then distro="ubuntu" kernel_package="linux-image-generic" @@ -246,6 +246,18 @@ function kvmx_create_custom { tac $WORK/etc/hosts | $SUDO tee $WORK/etc/hosts.new > /dev/null kvmx_sudo_run mv $WORK/etc/hosts.new $WORK/etc/hosts + # Ubuntu needs this fix so we can continue + if [ "$distro" == "ubuntu" ]; then + # Points to ../run/systemd/resolve/stub-resolv.conf + kvmx_sudo_run rm $WORK/etc/resolv.conf + + # Temporary resolver: OpenNIC + cat <<-EOF | $SUDO tee $WORK/etc/resolv.conf > /dev/null +nameserver 45.71.185.100 +nameserver 172.98.193.42 +EOF + fi + # Fstab echo "/dev/vda2 / ext4 errors=remount-ro 0 1" | $SUDO tee $WORK/etc/fstab > /dev/null @@ -326,6 +338,11 @@ EOF kvmx_sudo_run umount $WORK/dev/pts kvmx_sudo_run umount $WORK/dev + # Give some time to Ubuntu + if [ "$distro" == "ubuntu" ]; then + sleep 10 + fi + # Run basic provision __kvmx_create_custom_second_stage -- cgit v1.2.3