While netbooting with loader.efi on at least one arm64 platform
which uses u-boot emulating UEFI, the kernel gets corrupted, we
suspected the u-boot ethernet driver is still running.
The change to efinet_dev_init() allows net_cleanup() to be called via
dev_cleanup(), to ensure the u-boot ethernet driver is shut donw.
This however resulted in a loader crash.
Calling dev_cleanup() before bi_load() avoids that crash, and boot
completes successfully.
The rest is changes that should have been upstreamed ages ago.
When doing file verification, tftp needs to be able to handle multiple
open files concurrently.
We also need tftp_stat() to provide useful values for st_dev and st_ino.
Allow an architecture to define NETPROTO_DEFAULT.
The default is NET_NFS for backwards compatability.
In net_parse_rootpath() fix parsing of
<scheme>://<ip>[:<port]/<path>
and ensure we return INADDR_NONE unless we successfully
parsed an addr, so we don't end up clobbering rootip obtained
from bootp().
In install() if proto has not been determined, but
netproto is NET_TFTP set proto to tftp_fsops.
Extra debug tracing to help work out all the above.
libsa/bootp.c could not use BOOTP_DEBUG without common/dev_net.c
having NETIF_DEBUG.
Put a common DEBUG_PRINTF impl in stand.h so we can over time have
more consistent approach to debugging bits of the loader.
Sponsored by: Juniper Networks, Inc.