As we boot to '/bin/sh' by default, enable kernel DHCP autoconfiguration too.
The guest kernel needs to be configured with the following configuration
options:
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
Cc: Asias He <asias.hejun@gmail.com>
Cc: Avi Kivity <avi@redhat.com>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Prasad Joshi <prasadjoshi124@gmail.com>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
- For virtio-rng device (--rng):
CONFIG_HW_RANDOM_VIRTIO=y
+ - For kernel DHCP autoconf (when booting to /bin/sh):
+ CONFIG_IP_PNP=y
+ CONFIG_IP_PNP_DHCP=y
5. And finally, launch the hypervisor:
using_rootfs = 1;
if (!strstr(real_cmdline, "init="))
- strlcat(real_cmdline, " init=/bin/sh ", sizeof(real_cmdline));
+ strlcat(real_cmdline, " init=/bin/sh ip=dhcp ", sizeof(real_cmdline));
}
if (!strstr(real_cmdline, "root="))