Add tftpfs support for the EFI loader

Allow netbooting on efi without having to setup any NFS server by rebuilding the
loader with LOADER_TFTP_SUPPORT like for the i386 pxeloader

Sponsored by:	Gandi.net
This commit is contained in:
Baptiste Daroussin
2016-08-23 13:35:48 +00:00
parent 5ddd0f16c5
commit fb22f749b3
4 changed files with 17 additions and 0 deletions
+5
View File
@@ -167,8 +167,13 @@ net_open(struct open_file *f, ...)
setenv("boot.netif.ip", inet_ntoa(myip), 1);
setenv("boot.netif.netmask", intoa(netmask), 1);
setenv("boot.netif.gateway", inet_ntoa(gateip), 1);
#ifdef LOADER_TFTP_SUPPORT
setenv("boot.tftproot.server", inet_ntoa(rootip), 1);
setenv("boot.tftproot.path", rootpath, 1);
#else
setenv("boot.nfsroot.server", inet_ntoa(rootip), 1);
setenv("boot.nfsroot.path", rootpath, 1);
#endif
if (intf_mtu != 0) {
char mtu[16];
sprintf(mtu, "%u", intf_mtu);
+4
View File
@@ -13,6 +13,10 @@ SRCS+= time.c
SRCS+= time_event.c
.endif
.if defined(LOADER_TFTP_SUPPORT)
CFLAGS+= -DLOADER_TFTP_SUPPORT
.endif
# We implement a slightly non-standard %S in that it always takes a
# CHAR16 that's common in UEFI-land instead of a wchar_t. This only
# seems to matter on arm64 where wchar_t defaults to an int instead
+4
View File
@@ -21,6 +21,10 @@ SRCS= autoload.c \
smbios.c \
vers.c
.if defined(LOADER_TFTP_SUPPORT)
CFLAGS+= -DLOADER_TFTP_SUPPORT
.endif
.if ${MK_ZFS} != "no"
SRCS+= zfs.c
.PATH: ${.CURDIR}/../../zfs
+4
View File
@@ -51,7 +51,11 @@ struct fs_ops *file_system[] = {
&dosfs_fsops,
&ufs_fsops,
&cd9660_fsops,
#ifdef LOADER_TFTP_SUPPORT
&tftp_fsops,
#else
&nfs_fsops,
#endif
&gzipfs_fsops,
&bzipfs_fsops,
NULL