mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
loader: Move some support things around, maybe lame?
Sponsored by: Netflix
This commit is contained in:
1 parent
197df29edb
commit
6413a870fa
6 files changed
+25
-5
No files matched your search
@@ -127,6 +127,12 @@ CFLAGS+= -I${SASRC}/geli
|
|||||||
.if ${LOADER_DISK_SUPPORT:Uyes} == "yes"
|
.if ${LOADER_DISK_SUPPORT:Uyes} == "yes"
|
||||||
CFLAGS+= -DLOADER_DISK_SUPPORT
|
CFLAGS+= -DLOADER_DISK_SUPPORT
|
||||||
.endif
|
.endif
|
||||||
|
.if ${LOADER_NET_SUPPORT:Uno} == "yes"
|
||||||
|
CFLAGS+= -DLOADER_NET_SUPPORT
|
||||||
|
.endif
|
||||||
|
.if ${LOADER_MD_SUPPORT:Uno} == "yes"
|
||||||
|
CFLAGS+= -DLOADER_MD_SUPPORT
|
||||||
|
.endif
|
||||||
|
|
||||||
# Machine specific flags for all builds here
|
# Machine specific flags for all builds here
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
LOADER_NET_SUPPORT?= yes
|
||||||
|
LOADER_MD_SUPPORT?= yes
|
||||||
|
|
||||||
.include <bsd.init.mk>
|
.include <bsd.init.mk>
|
||||||
|
|
||||||
LIB= efi
|
LIB= efi
|
||||||
|
|||||||
@@ -452,9 +452,13 @@ efi_env_net_params(struct iodesc *desc)
|
|||||||
* There must be a rootpath. It may be ip:/path or it may be just the
|
* There must be a rootpath. It may be ip:/path or it may be just the
|
||||||
* path in which case the ip needs to be serverip.
|
* path in which case the ip needs to be serverip.
|
||||||
*/
|
*/
|
||||||
|
#ifdef LOADER_NET_SUPPORT
|
||||||
rootaddr = net_parse_rootpath();
|
rootaddr = net_parse_rootpath();
|
||||||
if (rootaddr == INADDR_NONE)
|
if (rootaddr == INADDR_NONE)
|
||||||
rootaddr = serveraddr;
|
rootaddr = serveraddr;
|
||||||
|
#else
|
||||||
|
rootaddr = serveraddr;
|
||||||
|
#endif
|
||||||
rootip.s_addr = rootaddr;
|
rootip.s_addr = rootaddr;
|
||||||
|
|
||||||
#ifdef EFINET_DEBUG
|
#ifdef EFINET_DEBUG
|
||||||
@@ -662,10 +666,12 @@ efinet_dev_init(void)
|
|||||||
*/
|
*/
|
||||||
efi_pxe_snapshot_all(nifs);
|
efi_pxe_snapshot_all(nifs);
|
||||||
|
|
||||||
|
#ifdef LOADER_NET_SUPPORT
|
||||||
efinet_dev.dv_cleanup = netdev.dv_cleanup;
|
efinet_dev.dv_cleanup = netdev.dv_cleanup;
|
||||||
efinet_dev.dv_open = netdev.dv_open;
|
efinet_dev.dv_open = netdev.dv_open;
|
||||||
efinet_dev.dv_close = netdev.dv_close;
|
efinet_dev.dv_close = netdev.dv_close;
|
||||||
efinet_dev.dv_strategy = netdev.dv_strategy;
|
efinet_dev.dv_strategy = netdev.dv_strategy;
|
||||||
|
#endif
|
||||||
|
|
||||||
done:
|
done:
|
||||||
free(handles2);
|
free(handles2);
|
||||||
|
|||||||
@@ -1275,6 +1275,7 @@ testmd(pdinfo_t *md)
|
|||||||
void
|
void
|
||||||
efiblk_memdisk_preload(void)
|
efiblk_memdisk_preload(void)
|
||||||
{
|
{
|
||||||
|
#ifdef LOADER_MD_SUPPORT
|
||||||
MEDIA_RAM_DISK_DEVICE_PATH *ram;
|
MEDIA_RAM_DISK_DEVICE_PATH *ram;
|
||||||
uint64_t start, end;
|
uint64_t start, end;
|
||||||
pdinfo_t *md;
|
pdinfo_t *md;
|
||||||
@@ -1289,4 +1290,5 @@ efiblk_memdisk_preload(void)
|
|||||||
end = ((uint64_t)ram->EndingAddr[1] << 32) | ram->EndingAddr[0];
|
end = ((uint64_t)ram->EndingAddr[1] << 32) | ram->EndingAddr[0];
|
||||||
md_export_to_kernel(start, end - start + 1);
|
md_export_to_kernel(start, end - start + 1);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
@@ -136,6 +136,7 @@ download_finish(IN VOID *Context, IN EFI_STATUS Status)
|
|||||||
static int
|
static int
|
||||||
fallback_to_md(EFI_PHYSICAL_ADDRESS pa, size_t len)
|
fallback_to_md(EFI_PHYSICAL_ADDRESS pa, size_t len)
|
||||||
{
|
{
|
||||||
|
#ifdef LOADER_MD_SUPPORT
|
||||||
int unit;
|
int unit;
|
||||||
|
|
||||||
unit = md_register((void *)(uintptr_t)pa, len, MD_FLAG_KERNEL);
|
unit = md_register((void *)(uintptr_t)pa, len, MD_FLAG_KERNEL);
|
||||||
@@ -146,6 +147,10 @@ fallback_to_md(EFI_PHYSICAL_ADDRESS pa, size_t len)
|
|||||||
}
|
}
|
||||||
setenv("uefi_ignore_boot_mgr", "true", 1);
|
setenv("uefi_ignore_boot_mgr", "true", 1);
|
||||||
return (0);
|
return (0);
|
||||||
|
#else
|
||||||
|
printf("No memory disk support in this loader\n");
|
||||||
|
return (EOPNOTSUPP);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@@ -218,6 +223,7 @@ out_close:
|
|||||||
void
|
void
|
||||||
maybe_download_initmd(void)
|
maybe_download_initmd(void)
|
||||||
{
|
{
|
||||||
|
#ifdef LOADER_NET_SUPPORT
|
||||||
struct devdesc dev;
|
struct devdesc dev;
|
||||||
const char *url;
|
const char *url;
|
||||||
int error;
|
int error;
|
||||||
@@ -243,6 +249,7 @@ maybe_download_initmd(void)
|
|||||||
error = download_md_image(url);
|
error = download_md_image(url);
|
||||||
if (error != 0 && error != ECANCELED)
|
if (error != 0 && error != ECANCELED)
|
||||||
printf("Could not download initmd: %s\n", strerror(error));
|
printf("Could not download initmd: %s\n", strerror(error));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
+1
-5
@@ -75,7 +75,6 @@ SRCS+= bcache.c
|
|||||||
.if defined(MD_IMAGE_SIZE)
|
.if defined(MD_IMAGE_SIZE)
|
||||||
CFLAGS+= -DMD_IMAGE_SIZE=${MD_IMAGE_SIZE}
|
CFLAGS+= -DMD_IMAGE_SIZE=${MD_IMAGE_SIZE}
|
||||||
.endif
|
.endif
|
||||||
CFLAGS+= -DLOADER_MD_SUPPORT
|
|
||||||
SRCS+= md.c
|
SRCS+= md.c
|
||||||
CLEANFILES+= md.o
|
CLEANFILES+= md.o
|
||||||
.endif
|
.endif
|
||||||
@@ -138,10 +137,7 @@ CFLAGS+= -DLOADER_BZIP2_SUPPORT
|
|||||||
CFLAGS+= -DLOADER_XZ_SUPPORT
|
CFLAGS+= -DLOADER_XZ_SUPPORT
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
# Network related things
|
# Network related things (LOADER_NET_SUPPORT itself: see defs.mk)
|
||||||
.if ${LOADER_NET_SUPPORT:Uno} == "yes"
|
|
||||||
CFLAGS+= -DLOADER_NET_SUPPORT
|
|
||||||
.endif
|
|
||||||
.if ${LOADER_NFS_SUPPORT:Uno} == "yes"
|
.if ${LOADER_NFS_SUPPORT:Uno} == "yes"
|
||||||
CFLAGS+= -DLOADER_NFS_SUPPORT
|
CFLAGS+= -DLOADER_NFS_SUPPORT
|
||||||
.endif
|
.endif
|
||||||
|
|||||||
Reference in new issue
Block a user