[Midnightbsd-cvs] src [10193] trunk/sys/boot/i386/loader: sync up
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Fri Jun 1 19:38:09 EDT 2018
Revision: 10193
http://svnweb.midnightbsd.org/src/?rev=10193
Author: laffer1
Date: 2018-06-01 19:38:08 -0400 (Fri, 01 Jun 2018)
Log Message:
-----------
sync up
Modified Paths:
--------------
trunk/sys/boot/i386/loader/Makefile
trunk/sys/boot/i386/loader/conf.c
trunk/sys/boot/i386/loader/main.c
Modified: trunk/sys/boot/i386/loader/Makefile
===================================================================
--- trunk/sys/boot/i386/loader/Makefile 2018-06-01 23:37:47 UTC (rev 10192)
+++ trunk/sys/boot/i386/loader/Makefile 2018-06-01 23:38:08 UTC (rev 10193)
@@ -1,4 +1,5 @@
# $MidnightBSD$
+# $FreeBSD: stable/10/sys/boot/i386/loader/Makefile 293294 2016-01-07 01:50:50Z dteske $
.include <bsd.own.mk>
MK_SSP= no
@@ -41,8 +42,12 @@
# Enable BootForth
BOOT_FORTH= yes
CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386
+.if ${MACHINE_CPUARCH} == "amd64"
+LIBFICL= ${.OBJDIR}/../../ficl32/libficl.a
+.else
LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
.endif
+.endif
.if defined(LOADER_BZIP2_SUPPORT)
CFLAGS+= -DLOADER_BZIP2_SUPPORT
@@ -50,8 +55,11 @@
.if !defined(LOADER_NO_GZIP_SUPPORT)
CFLAGS+= -DLOADER_GZIP_SUPPORT
.endif
+.if defined(LOADER_NANDFS_SUPPORT)
+CFLAGS+= -DLOADER_NANDFS_SUPPORT
+.endif
-# Always add MI sources
+# Always add MI sources
.PATH: ${.CURDIR}/../../common
.include "${.CURDIR}/../../common/Makefile.inc"
CFLAGS+= -I${.CURDIR}/../../common
@@ -66,6 +74,8 @@
LIBI386= ${.OBJDIR}/../libi386/libi386.a
CFLAGS+= -I${.CURDIR}/..
+LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a
+
# BTX components
CFLAGS+= -I${.CURDIR}/../btx/lib
@@ -96,23 +106,14 @@
FILESMODE_${LOADER}= ${BINMODE} -b
.if !defined(LOADER_ONLY)
-.PATH: ${.CURDIR}/../../forth
-FILES+= loader.help loader.4th support.4th loader.conf
-FILES+= screen.4th frames.4th beastie.4th
-FILES+= brand.4th check-password.4th color.4th delay.4th
-FILES+= menu.4th menu-commands.4th menusets.4th shortcuts.4th version.4th
-FILESDIR_loader.conf= /boot/defaults
+.PATH: ${.CURDIR}/../../forth
+.include "${.CURDIR}/../../forth/Makefile.inc"
-.if !exists(${DESTDIR}/boot/loader.rc)
-FILES+= loader.rc
+FILES+= loader.rc menu.rc
.endif
-.if !exists(${DESTDIR}/boot/menu.rc)
-FILES+= menu.rc
-.endif
-.endif
# XXX crt0.o needs to be first for pxeboot(8) to work
-OBJS= ${BTXCRT}
+OBJS= ${BTXCRT}
DPADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBSTAND}
LDADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBSTAND}
Modified: trunk/sys/boot/i386/loader/conf.c
===================================================================
--- trunk/sys/boot/i386/loader/conf.c 2018-06-01 23:37:47 UTC (rev 10192)
+++ trunk/sys/boot/i386/loader/conf.c 2018-06-01 23:38:08 UTC (rev 10193)
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: stable/9/sys/boot/i386/loader/conf.c 277947 2015-01-30 18:55:16Z jhb $");
+__FBSDID("$FreeBSD: stable/10/sys/boot/i386/loader/conf.c 294417 2016-01-20 13:23:02Z royger $");
#include <stand.h>
#include <bootstrap.h>
@@ -78,6 +78,9 @@
&ext2fs_fsops,
&dosfs_fsops,
&cd9660_fsops,
+#if defined(LOADER_NANDFS_SUPPORT)
+ &nandfs_fsops,
+#endif
#ifdef LOADER_NFS_SUPPORT
&nfs_fsops,
#endif
@@ -105,8 +108,12 @@
extern struct file_format i386_elf_obj;
extern struct file_format amd64_elf;
extern struct file_format amd64_elf_obj;
+extern struct file_format multiboot;
+extern struct file_format multiboot_obj;
struct file_format *file_formats[] = {
+ &multiboot,
+ &multiboot_obj,
#ifdef LOADER_PREFER_AMD64
&amd64_elf,
&amd64_elf_obj,
Modified: trunk/sys/boot/i386/loader/main.c
===================================================================
--- trunk/sys/boot/i386/loader/main.c 2018-06-01 23:37:47 UTC (rev 10192)
+++ trunk/sys/boot/i386/loader/main.c 2018-06-01 23:38:08 UTC (rev 10193)
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/boot/i386/loader/main.c 295475 2016-02-10 17:49:22Z allanjude $");
/*
* MD bootstrap main() and assorted miscellaneous
@@ -44,6 +44,7 @@
#include "bootstrap.h"
#include "common/bootargs.h"
#include "libi386/libi386.h"
+#include "libi386/smbios.h"
#include "btxv86.h"
#ifdef LOADER_ZFS_SUPPORT
@@ -116,7 +117,7 @@
}
setheap(heap_bottom, heap_top);
- /*
+ /*
* XXX Chicken-and-egg problem; we want to have console output early, but some
* console attributes may depend on reading from eg. the boot device, which we
* can't do yet.
@@ -182,7 +183,7 @@
biosacpi_detect();
/* detect SMBIOS for future reference */
- smbios_detect();
+ smbios_detect(NULL);
printf("\n");
printf("%s, Revision %s\n", bootprog_name, bootprog_rev);
@@ -291,6 +292,11 @@
new_currdev.d_unit = 0;
}
+#ifdef LOADER_ZFS_SUPPORT
+ if (new_currdev.d_type == DEVT_ZFS)
+ init_zfs_bootenv(zfs_fmtdev(&new_currdev));
+#endif
+
env_setenv("currdev", EV_VOLATILE, i386_fmtdev(&new_currdev),
i386_setcurrdev, env_nounset);
env_setenv("loaddev", EV_VOLATILE, i386_fmtdev(&new_currdev), env_noset,
@@ -350,8 +356,42 @@
command_errmsg = strerror(err);
return (CMD_ERROR);
}
+
return (CMD_OK);
}
+
+COMMAND_SET(reloadbe, "reloadbe", "refresh the list of ZFS Boot Environments",
+ command_reloadbe);
+
+static int
+command_reloadbe(int argc, char *argv[])
+{
+ int err;
+ char *root;
+
+ if (argc > 2) {
+ command_errmsg = "wrong number of arguments";
+ return (CMD_ERROR);
+ }
+
+ if (argc == 2) {
+ err = zfs_bootenv(argv[1]);
+ } else {
+ root = getenv("zfs_be_root");
+ if (root == NULL) {
+ /* There does not appear to be a ZFS pool here, exit without error */
+ return (CMD_OK);
+ }
+ err = zfs_bootenv(getenv("zfs_be_root"));
+ }
+
+ if (err != 0) {
+ command_errmsg = strerror(err);
+ return (CMD_ERROR);
+ }
+
+ return (CMD_OK);
+}
#endif
/* ISA bus access functions for PnP. */
More information about the Midnightbsd-cvs
mailing list