pmb.qemu: drop telnet port forwarding (!1886)
Now that we try to use the IP assigned by QEMU via DHCP, the debug-shell is no longer working via telnet. This is because the VM does not have any IP assigned when it is running. We would need to start a DHCP client from the initfs to make it work. busybox provides both udhcpc (client) and udhcpd (server) so this is not a big problem. But the question is: Is it worth it? The debug-shell will be only used for debugging, and NetworkManager handles starting a proper DHCP client once the rootfs is mounted. Meanwhile the debug-shell can be also accessed via serial output/input, (available in the pmbootstrap stdout/stdin). So overall it does not seem worth the effort. Let's just recommend using serial instead.
This commit is contained in:
parent
79a8d04835
commit
81b3aade07
|
@ -76,7 +76,6 @@ def command_qemu(args, arch, img_path):
|
||||||
logging.debug("Kernel cmdline: " + cmdline)
|
logging.debug("Kernel cmdline: " + cmdline)
|
||||||
|
|
||||||
port_ssh = str(args.port)
|
port_ssh = str(args.port)
|
||||||
port_telnet = str(args.port + 1)
|
|
||||||
|
|
||||||
suffix = "rootfs_" + args.device
|
suffix = "rootfs_" + args.device
|
||||||
rootfs = args.work + "/chroot_" + suffix
|
rootfs = args.work + "/chroot_" + suffix
|
||||||
|
@ -119,7 +118,6 @@ def command_qemu(args, arch, img_path):
|
||||||
command += ["-netdev",
|
command += ["-netdev",
|
||||||
"user,id=net0,"
|
"user,id=net0,"
|
||||||
"hostfwd=tcp::" + port_ssh + "-:22,"
|
"hostfwd=tcp::" + port_ssh + "-:22,"
|
||||||
"hostfwd=tcp::" + port_telnet + "-:23"
|
|
||||||
]
|
]
|
||||||
command += ["-show-cursor"]
|
command += ["-show-cursor"]
|
||||||
|
|
||||||
|
@ -246,11 +244,10 @@ def run(args):
|
||||||
logging.info("NOTE: Run 'pmbootstrap qemu --image-size 2G' to set"
|
logging.info("NOTE: Run 'pmbootstrap qemu --image-size 2G' to set"
|
||||||
" the rootfs size when you run out of space!")
|
" the rootfs size when you run out of space!")
|
||||||
|
|
||||||
# SSH/telnet hints
|
# SSH/serial hints
|
||||||
logging.info("Connect to the VM (telnet requires 'pmbootstrap initfs"
|
logging.info("Connect to the VM:")
|
||||||
" hook_add debug-shell'):")
|
|
||||||
logging.info("* (ssh) ssh -p {port} {user}@localhost".format(**vars(args)))
|
logging.info("* (ssh) ssh -p {port} {user}@localhost".format(**vars(args)))
|
||||||
logging.info("* (telnet) telnet localhost " + str(args.port + 1))
|
logging.info("* (serial) in this console (stdout/stdin)")
|
||||||
|
|
||||||
# Run QEMU and kill it together with pmbootstrap
|
# Run QEMU and kill it together with pmbootstrap
|
||||||
process = None
|
process = None
|
||||||
|
|
Loading…
Reference in New Issue