From 1e56aff95fed57909a16f46866a03bd3c3d5cf7d Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Mon, 28 Nov 2016 13:59:09 +0300 Subject: tools: fix getty configuration in create-image.sh create-image.sh adds the string "V0:23:respawn:/sbin/getty 115200 hvc0" to inittab of a virtual machine, but a fresh debian-wheezy doesn't have a hvc0 device. So getty fails to start and respawns over and over again: INIT: Id "V0" respawning too fast: disabled for 5 minutes Let's fix create-image.sh to have a working VM terminal. Signed-off-by: Alexander Popov --- tools/create-image.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/create-image.sh b/tools/create-image.sh index 7aa4a20de..78120e67d 100755 --- a/tools/create-image.sh +++ b/tools/create-image.sh @@ -13,7 +13,7 @@ sudo debootstrap --include=openssh-server wheezy wheezy # Set some defaults and enable promtless ssh to the machine for root. sudo sed -i '/^root/ { s/:x:/::/ }' wheezy/etc/passwd -echo 'V0:23:respawn:/sbin/getty 115200 hvc0' | sudo tee -a wheezy/etc/inittab +echo 'T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100' | sudo tee -a wheezy/etc/inittab printf '\nauto eth0\niface eth0 inet dhcp\n' | sudo tee -a wheezy/etc/network/interfaces echo 'debugfs /sys/kernel/debug debugfs defaults 0 0' | sudo tee -a wheezy/etc/fstab echo 'debug.exception-trace = 0' | sudo tee -a wheezy/etc/sysctl.conf -- cgit mrf-deployment From 3a5ae29218c1bc75952a1cc1da984c77bee3ba50 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Mon, 28 Nov 2016 14:32:47 +0300 Subject: vm/qemu: prevent eth0 renaming create-image.sh tries to enable eth0 network interface of the virtual machine, but there is no eth0 in a fresh debian-wheezy, since biosdevname renames interfaces. VM log quotation: e1000 0000:00:03.0 eth0: (PCI:33MHz:32-bit) 52:54:00:12:34:56 e1000 0000:00:03.0 eth0: Intel(R) PRO/1000 Network Connection e1000 0000:00:03.0 ens3: renamed from eth0 ... Cannot find device "eth0" Bind socket to interface: No such device Failed to bring up eth0. The simplest fix is disabling biosdevname by adding "net.ifnames=0 biosdevname=0" to the kernel command line. Signed-off-by: Alexander Popov --- vm/qemu/qemu.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vm/qemu/qemu.go b/vm/qemu/qemu.go index 87a075c00..cef95b645 100644 --- a/vm/qemu/qemu.go +++ b/vm/qemu/qemu.go @@ -190,7 +190,7 @@ func (inst *instance) Boot() error { } if inst.cfg.Kernel != "" { cmdline := "console=ttyS0 vsyscall=native rodata=n oops=panic panic_on_warn=1 panic=-1" + - " ftrace_dump_on_oops=orig_cpu earlyprintk=serial slub_debug=UZ " + " ftrace_dump_on_oops=orig_cpu earlyprintk=serial slub_debug=UZ net.ifnames=0 biosdevname=0 " if inst.cfg.Image == "9p" { cmdline += "root=/dev/root rootfstype=9p rootflags=trans=virtio,version=9p2000.L,cache=loose " cmdline += "init=" + filepath.Join(inst.cfg.Workdir, "init.sh") + " " -- cgit mrf-deployment