freebsd-dev/stand
Kyle Evans 97875f4aa9 stand/zfs: Add all bootenvs to environment
For the benefit of lualoader, add all bootenvs to environment when
init_zfs_bootenv is invoked. All of the boot environment logic can then be
implemented in pure lua, rather than going back and forth with C to
implement paging.

This stores all boot environments in bootenvs[idx] and the final count of
bootenvs in bootenvs_count.

While here, make a copy of currdev for init_zfs_bootenv since it will be
modifying it and the caller may not necessarily want that. Some of the logic
was shifted around so that the 'currdev' pointer remains at the beginning of
the string and 'beroot' is moved around as needed to modify it or ultimately
store it in zfs_be_root.

The original zfs_bootenv that this was copied from will be able to go away
only if/when forth eventually goes away.

Tested with:	lualoader (and local changes to add boot env. support)
Tested with:	forth
Reviewed by:	cem (earlier version), imp
Differential Revision:	https://reviews.freebsd.org/D14435
2018-02-21 16:26:16 +00:00
..
arm Invent new LDR_INTERP for the loader interpreter to use. Use this in 2018-02-02 15:40:49 +00:00
arm64
common Consolidate three copies of ZFS commands into a central location. 2018-02-21 15:57:36 +00:00
efi Consolidate three copies of ZFS commands into a central location. 2018-02-21 15:57:36 +00:00
fdt Eliminate bsd.stand.mk and -fPIC 32-bit intel builds 2018-02-16 00:17:32 +00:00
ficl Eliminate bsd.stand.mk and -fPIC 32-bit intel builds 2018-02-16 00:17:32 +00:00
ficl32
forth Remove pcibios forth support. 2018-02-02 15:01:49 +00:00
geli Eliminate bsd.stand.mk and -fPIC 32-bit intel builds 2018-02-16 00:17:32 +00:00
i386 Honor settings for including / excluding cd9660, ufs, ext2fs and msdos. 2018-02-21 15:58:00 +00:00
kshim A more definitions to kernel emulation shim in order to build stand/usb. 2018-02-07 18:50:36 +00:00
liblua loader.lua: Expose errno table to lua 2018-02-20 19:39:48 +00:00
liblua32 Add Lua as a scripting langauge to /boot/loader 2018-02-12 15:31:53 +00:00
libsa Fix a memory leak introduced in r328426. 2018-02-16 15:41:03 +00:00
libsa32
lua lualoader: Use the key that interrupts autoboot as a menu choice 2018-02-21 14:37:49 +00:00
man
mips Eliminate bsd.stand.mk and -fPIC 32-bit intel builds 2018-02-16 00:17:32 +00:00
ofw Fix regression introduced in r328806, preventing boot at least on all 2018-02-03 23:49:21 +00:00
powerpc Unify metadata load files for arm, mips, powerpc, sparc64 2018-02-13 03:44:50 +00:00
sparc64 Consolidate three copies of ZFS commands into a central location. 2018-02-21 15:57:36 +00:00
uboot Eliminate bsd.stand.mk and -fPIC 32-bit intel builds 2018-02-16 00:17:32 +00:00
usb Move the stand/usb test loader into its own directory. 2018-02-07 19:20:59 +00:00
userboot Consolidate three copies of ZFS commands into a central location. 2018-02-21 15:57:36 +00:00
zfs stand/zfs: Add all bootenvs to environment 2018-02-21 16:26:16 +00:00
zfs32
defs.mk Eliminate bsd.stand.mk and -fPIC 32-bit intel builds 2018-02-16 00:17:32 +00:00
fdt.mk
ficl.mk Now that we no longer conditionally compile some files outside of ficl 2018-02-02 15:01:54 +00:00
loader.mk Consolidate three copies of ZFS commands into a central location. 2018-02-21 15:57:36 +00:00
lua.mk Add Lua as a scripting langauge to /boot/loader 2018-02-12 15:31:53 +00:00
Makefile Add the lua scripts from the lua-bootloader SoC 2018-02-12 15:32:00 +00:00
Makefile.amd64 Add Lua as a scripting langauge to /boot/loader 2018-02-12 15:31:53 +00:00
Makefile.arm
Makefile.arm64
Makefile.i386 Switch to proper MK_LOADER_GELI tests. 2017-12-04 01:14:12 +00:00
Makefile.inc Minor flags cleanup 2017-12-02 00:06:58 +00:00
Makefile.mips
Makefile.powerpc
Makefile.sparc64
uboot.mk Unify metadata load files for arm, mips, powerpc, sparc64 2018-02-13 03:44:50 +00:00