static bool using_rootfs;
static bool custom_rootfs;
static bool no_net;
+static bool no_dhcp;
extern bool ioport_debug;
extern int active_console;
extern int debug_iodelay;
OPT_CALLBACK_DEFAULT('n', "network", NULL, "network params",
"Create a new guest NIC",
netdev_parser, NULL),
+ OPT_BOOLEAN('\0', "no-dhcp", &no_dhcp, "Disable kernel DHCP in rootfs mode"),
OPT_GROUP("BIOS options:"),
OPT_INTEGER('\0', "vidmode", &vidmode,
if (using_rootfs) {
strcat(real_cmdline, " root=/dev/root rw rootflags=rw,trans=virtio,version=9p2000.L rootfstype=9p");
- if (custom_rootfs)
- strcat(real_cmdline, " init=/virt/init ip=dhcp");
+ if (custom_rootfs) {
+ strcat(real_cmdline, " init=/virt/init");
+ if (!no_dhcp)
+ strcat(real_cmdline, " ip=dhcp");
+ }
} else if (!strstr(real_cmdline, "root=")) {
strlcat(real_cmdline, " root=/dev/vda rw ", sizeof(real_cmdline));
}