aboutsummaryrefslogtreecommitdiff
path: root/stand
Commit message (Collapse)AuthorAgeFilesLines
* No need to use relative paths like this here.Warner Losh2017-12-191-2/+2
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=326963
* Hoist btx include stuff to i386/Makefile.incWarner Losh2017-12-197-8/+2
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=326962
* Interact is always called with NULL. Simplify code a little byWarner Losh2017-12-1912-27/+19
| | | | | | | | | | | | removing this argument, and expanding when rc is NULL. This effectively completes the back out of custom scripts for tftp booted loaders from r269153 that was started in r292344 with the new path tricks that obsoleted it. Submitted by: Netflix Notes: svn path=/head/; revision=326961
* Simplify things a little. The RETURN macro isn't required. It's onlyWarner Losh2017-12-191-8/+2
| | | | | | | | | used once, inside an #ifdef where it would be defined to be return. Sponsored by: Netflix Notes: svn path=/head/; revision=326960
* libficl is only ever used in a loader (never a boot) program. Move itWarner Losh2017-12-182-9/+10
| | | | | | | | | to loader.mk. Sponsored by: Netflix Notes: svn path=/head/; revision=326927
* Move loader help file definitions to being 100% inside of loader.mk.Warner Losh2017-12-1813-21/+8
| | | | | | | | | | | | HELP_FILES is a loader only thing, so move it to loader.mk. Only generate the help file if HELP_FILES is defined. Adjust Makefiles to new convention. Fix a few cases where ${.CURDIR}/ was missing resulting in missing bits from the help files. Sponsored by: Netflix Notes: svn path=/head/; revision=326926
* Move loader-only defines to loader.mk from defs.mkWarner Losh2017-12-162-49/+49
| | | | | | | | | Produces the same .o's, verified with md5. Sponsored by: Netflix Notes: svn path=/head/; revision=326914
* Remove the 'mini libstand in libstand' that util.[ch] provided. TheseWarner Losh2017-12-1510-315/+14
| | | | | | | | | | | | | | | | | | | | | | | | weren't needed, and their existance interfered with things in subtle ways. One of these subtle ways was that malloc could be different based on what files were included when (even within the same .c file, it turns out). Move to a single malloc implementation as well by adding the calls to setheap() to gptboot.c and zfsboot.c. Once upon a time, these boot loaders strove to not use libstand. However, with the proliferation of features, that striving is too hard for too little gain and lead to stupid mistakes. This fixes the GELI-enabled (but not even using) boot environment. The geli routines were calling libstand malloc but zfsboot.c and gptboot.c were using the mini libstand malloc, so this failed when we tried to probe for GELI partitions. Subtle changes in build order when moving to self-contained stand build in r326593 toggled what it used from one type to another due to odd nesting of the zfs implementation code that differed subtly between zfsloader and zfsboot. Sponsored by: Netflix Notes: svn path=/head/; revision=326887
* Panic in sbrk if setheap hasn't been called yet. This is preferable toWarner Losh2017-12-151-0/+3
| | | | | | | | | a mysterious crash. Sponsored by: Netflix Notes: svn path=/head/; revision=326886
* Revert r326855: Cargo cut a fix for the regressions r326585 caused.Warner Losh2017-12-141-3/+3
| | | | | | | | | | | | This was an experiment that landed in the wrong branch and was pushed accidentally. It's best if it is ignored because the difference was due to vers.o being different, not float.o... And it was confirmed to not fix anything... Pointy Hat to: imp Notes: svn path=/head/; revision=326858
* Turn loader GELI support in the boot loaders off by default as aWarner Losh2017-12-141-1/+1
| | | | | | | | | temporary workaround. This fixes zfs booting generally, but breaks all GELI booting by default. Add note to UPDATING to this effect. When the GELI issues are resolved, this will be reverted. Notes: svn path=/head/; revision=326857
* Fix comments after bump in size.Warner Losh2017-12-141-2/+2
| | | | Notes: svn path=/head/; revision=326856
* Cargo cut a fix for the regressions r326585 caused.Warner Losh2017-12-141-3/+3
| | | | | | | | | | | | | | | | We need to include ficl.h after the standard includes, rather than before them. It changes the generated code in ways that haven't been completely analyized. This restores the old code generation (as verified by md5 changing back for zfsloader). This should restore GPT + ZFS and GPT + ZFS + GELI booting that was broken in r326585 (or would have been if r326584 hadn't broken the build). Sponsored by: Netflix Notes: svn path=/head/; revision=326855
* libefi: make efichar.h more usable in stand codeToomas Soome2017-12-145-7/+10
| | | | | | | | | | | Use _STANDALONE for guard expression in efichar.[ch] and add efi_char typedef. clean up boot1.c, and replace for loop in efipart.c with ucs2len(). Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D13488 Notes: svn path=/head/; revision=326854
* Revert r326792, r326784, r326772, r326712Warner Losh2017-12-1215-524/+397
| | | | | | | | | | Something subtle is creating problems for disk access on ubldr. Back it out unti that can be sorted out. Sponsored by: Netflix Notes: svn path=/head/; revision=326812
* Attempt to unbreak buildworldAntoine Brodin2017-12-121-1/+1
| | | | Notes: svn path=/head/; revision=326792
* Revert part of 362772. It was causing problems for includes and makingWarner Losh2017-12-111-1/+1
| | | | | | | | | the menus disappear. Sponsored by: Netflix Notes: svn path=/head/; revision=326784
* Fix regression with lua importWarner Losh2017-12-1111-31/+17
| | | | | | | | | | | | | | Don't print when we can't find a file. Copy it instead to the error buffer. Higher level routines determine if it's appropriate to print the error message. Also, remove dead code (labeled bogusly lost functionality) since we never used that functionality. Remove unused arg from interact() too. Sponsored by: Netflix Notes: svn path=/head/; revision=326772
* Fix a comment to be more accurateWarner Losh2017-12-111-1/+1
| | | | Notes: svn path=/head/; revision=326768
* When building for arm arches, set PKGALIGN to the max cache line sizeIan Lepore2017-12-101-1/+8
| | | | | | | | | | supported by the arch, to meet u-boot's requirement that I/O be done in cache-aligned chunks. PR: 223977 Notes: svn path=/head/; revision=326754
* Save and restore r9 register in arm ubldr. In old gcc 4.2, r9 was a callee-Ian Lepore2017-12-101-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | saved register, but in arm EABI it may be either callee-saved or dedicated to some special purpose (such as a TLS pointer). It appears clang does not treat it as a callee-saved register (instead using it as another work register, similar to r12). Another important side effect of these changes is that saving an extra register in the push/pop statements keeps the stack aligned to an 8-byte boundary during the self_reloc() call, as it always should have been. As stated in the PR... Essentially the important caller-saved registers are pushed (r0, r1, r9, lr) before the relocation call, and popped after. Then r8/r9 are saved as usual for the syscall trampoline, and lr is stored in r8 (now free) as a callee-saved value before calling into `main`. The call to `main` can no longer be a tail call because we must restore r9 especially after main returns (although since we have used r8 to hold lr we must also restore this). PR: 224008 Notes: svn path=/head/; revision=326752
* This path belongs in ficl/Makefile, not the common defines for usersWarner Losh2017-12-082-2/+2
| | | | | | | | | of ficl. Sponsored by: Netflix Notes: svn path=/head/; revision=326720
* boot1.c needs EFI_ZFS_BOOT too, so add it globally. Otherwise we'llWarner Losh2017-12-081-1/+1
| | | | | | | | | not be able to actually read ZFS partitions. Submitted by: kevans@ Notes: svn path=/head/; revision=326714
* Create interp class.Warner Losh2017-12-085-376/+517
| | | | | | | | | | | | | Create an interp class. Use it to separate out the different types of interpreters: forth and simple with function pointers rather than via #ifdefs. Obtained from: lua boot loader project (via https://bsdimp@github.com/bsdimp/freebsd.git lua-bootloader) Sponsored by: Netflix Notes: svn path=/head/; revision=326712
* Const poison a couple of interfaces.Warner Losh2017-12-083-5/+5
| | | | | | | | Obtained from: lua boot project Sponsored by: Netflix Notes: svn path=/head/; revision=326711
* Put the files we're copying over into a few variables and add them toWarner Losh2017-12-081-3/+10
| | | | | | | | | CLEANDIRS and CLEANFILES so make clean removes any divots. Sponsored by: Netflix Notes: svn path=/head/; revision=326710
* Provide implementations for iscntrl, ispunct and isgraph.Warner Losh2017-12-081-0/+16
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=326709
* Remove _KERNEL hack now that errno.h does the right thing whenWarner Losh2017-12-081-3/+0
| | | | | | | | | _STANDALONE is defined. Sponsored By: Netflix Notes: svn path=/head/; revision=326708
* Add partial support signal.h functioanlity. Pull in machine/signal.hWarner Losh2017-12-082-1/+4
| | | | | | | | | to define sig_atomic_t. Sponsored by: Netflix Notes: svn path=/head/; revision=326707
* Avoid setting -Wno-tentative-definition-incomplete-type with gcc.Mark Johnston2017-12-071-5/+2
| | | | | | | | | | No version of gcc that I've tried accepts this flag. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D13415 Notes: svn path=/head/; revision=326671
* dhcp_try_rfc1048() is not used any moreToomas Soome2017-12-062-13/+0
| | | | | | | | | | Remove unused function. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D13382 Notes: svn path=/head/; revision=326616
* Fix random() prototype to match the system.Warner Losh2017-12-061-1/+1
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=326610
* Make putenv and getenv match the userland definition of theseWarner Losh2017-12-066-7/+7
| | | | | | | | | | functions, tweak man page and one variable that shouldn't be const anymore. Sponsored by: Netflix Notes: svn path=/head/; revision=326609
* Now that we offer a semi-sane standards-ish set of #include files inWarner Losh2017-12-051-39/+4
| | | | | | | | | | | the stand environment that's safe to use (and insulated from whatever build env you might normally have), stop hacking the bzlib and zlib sources with sed. There's no longer any need. Sponsored by: Netflix Notes: svn path=/head/; revision=326594
* Stop building with the standard system headers.Warner Losh2017-12-052-0/+29
| | | | | | | | | | | | | | | Building with the standard system headers isn't a perfect match to the stand environment. Instead, copy over the files we know are safe to use and constrain what else is used. We use -nostdinc to achieve this. This also fixes issues with building 32-bit libraries on amd64 sometimes pulling in the wrong cpufunc.h giving an error now that we stop on errors. It will also enable an easier transition to lua boot. Sponsored by: Netflix Notes: svn path=/head/; revision=326593
* Don't inherit CFLAGS. This a specialized test program, and can beWarner Losh2017-12-051-1/+1
| | | | | | | | | | built with mostly default flags. Do so in anticipation of the rest of stand not building with system headers. Sponsored by: Netflix Notes: svn path=/head/; revision=326592
* Prefer stdint.h to inttypes.h since the added prototypes form theWarner Losh2017-12-054-5/+5
| | | | | | | | | | | | | latter aren't used. Prefer sys/link_elf.h to link.h so we're only dependent on the kernel tree. The default installation of link.h just includes this file, and any benefit from that is outweighed by the hassle it causes. This reduces the footprint of files needed from the system includes (or sysroot in buildworld). Sponsored by: Netflix Notes: svn path=/head/; revision=326590
* Make sure we include the right path for skein.h, as well only includeWarner Losh2017-12-051-3/+4
| | | | | | | | the ZFS flags for zfs_modules.c. This keeps us from pulling from the system or sysroot during buildworld. Notes: svn path=/head/; revision=326589
* Need to include skein in the include path so we don't get this fromWarner Losh2017-12-052-0/+2
| | | | | | | | | | the "system" headers (though in buildworld, it's from the recently built sysroot). Sponsored by: Netflix Notes: svn path=/head/; revision=326588
* Use the kernel relative paths, rather than the userland relative pathsWarner Losh2017-12-051-2/+2
| | | | | | | | | for the iso9660 header files. Sponsored by: Netflix Notes: svn path=/head/; revision=326587
* No need to include the userland md5.h, the kernel one is just fine.Warner Losh2017-12-051-1/+1
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=326586
* Include ficl.h before anything else and avoid including anything atWarner Losh2017-12-051-3/+3
| | | | | | | | | all if we're not building float. Sponsored by: Netflix Notes: svn path=/head/; revision=326585
* loader.efi: add note about iPXE into the efipart.cToomas Soome2017-12-041-0/+2
| | | | | | | Commant update. Notes: svn path=/head/; revision=326509
* increase maximum size of zfsbootAllan Jude2017-12-041-2/+2
| | | | | | | | | | | Previous to the switch from sys/boot to stand/ zfsboot (used for MBR) did not support GELI. Now that it is compiled with GELI, it is running out of space. zfsldr (which loads zfsboot) was modified to load 256kb in r304321 Notes: svn path=/head/; revision=326507
* Switch to proper MK_LOADER_GELI tests.Warner Losh2017-12-042-2/+2
| | | | | | | Submitted by: peter@ Notes: svn path=/head/; revision=326504
* Now it's safe to bump WARNS to 1.Warner Losh2017-12-031-1/+1
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=326495
* Mark two things as unused (since they are only sometimes used) andWarner Losh2017-12-031-1/+1
| | | | | | | | | | toss in a DECONST to remove a const in some tricky code that would require too extensive a change to unwind otherwise. Sponsored by: Netflix Notes: svn path=/head/; revision=326494
* Provide a md_load64 prototype.Warner Losh2017-12-031-0/+2
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=326493
* Cast void * pointer to char * so the arg matches the %s format.Warner Losh2017-12-031-1/+1
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=326492
* Disconnet ps3 from the build. There's too many warnings to fix. Also,Warner Losh2017-12-031-3/+0
| | | | | | | | | | | | it's going to be removed soon anyway once the final lingering issues with kboot are resolved. Go ahead and disconnect it from the build a little early. Sponsored by: Netflix OK'd by: nathanw@ Notes: svn path=/head/; revision=326491