aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2020-10-27 15:22:11 -0300
committerSilvio Rhatto <rhatto@riseup.net>2020-10-27 15:22:11 -0300
commite3b84b6ac09ff834bd1ecca89900e1225e55f05b (patch)
tree5fb3d48a71ac832c3cef56f48e71e8c79d259655
parentd750751918bfeb48bf09d2d06b9c94b2c0288b28 (diff)
downloadkvmx-e3b84b6ac09ff834bd1ecca89900e1225e55f05b.tar.gz
kvmx-e3b84b6ac09ff834bd1ecca89900e1225e55f05b.tar.bz2
Ubuntu fixes at kvmx-create
-rwxr-xr-xkvmx-create19
1 files changed, 18 insertions, 1 deletions
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