#
68344c9c |
| 19-May-2024 |
Warner Losh <imp@FreeBSD.org> |
loader: separate lang init from scripting init
Create interp_preinit() to initialize the scripting language to run scripts. Make sure you can call it multiple times, but only the first one has effec
loader: separate lang init from scripting init
Create interp_preinit() to initialize the scripting language to run scripts. Make sure you can call it multiple times, but only the first one has effect, After it's call, you can run scripts in the scripting language. At the moment, no functional change.
Sponsored by: Netflix
show more ...
|
#
7c43148a |
| 24-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
stand: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
Rem
stand: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/
Sponsored by: Netflix
show more ...
|
#
1d386b48 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
#
a50d73d5 |
| 17-Apr-2023 |
Stephen J. Kiernan <stevek@FreeBSD.org> |
loader: Change version calculation to be more consistent.
Use 1000 * major + minor when calculating the version number that gets set in the Ficl environment or lua loader property. This allows for m
loader: Change version calculation to be more consistent.
Use 1000 * major + minor when calculating the version number that gets set in the Ficl environment or lua loader property. This allows for more room if the minor number needs to go above 9.
Add loader.version property to lua loader.
Reviewed by: imp Obtained from: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D39631
show more ...
|
#
afc571b1 |
| 08-Mar-2020 |
Simon J. Gerraty <sjg@FreeBSD.org> |
veloader use vectx API for kernel and modules
The vectx API, computes the hash for verifying a file as it is read. This avoids the overhead of reading files twice - once to verify, then again to loa
veloader use vectx API for kernel and modules
The vectx API, computes the hash for verifying a file as it is read. This avoids the overhead of reading files twice - once to verify, then again to load.
For doing an install via loader, avoiding the need to rewind large files is critical.
This API is only used for modules, kernel and mdimage as these are the biggest files read by the loader. The reduction in boot time depends on how expensive the I/O is on any given platform. On a fast VM we see 6% improvement.
For install via loader the first file to be verified is likely to be the kernel, so some of the prep work (finding manifest etc) done by verify_file() needs to be factored so it can be reused for vectx_open().
For missing or unrecognized fingerprint entries, we fail in vectx_open() unless verifying is disabled.
Otherwise fingerprint check happens in vectx_close() and since this API is only used for files which must be verified (VE_MUST) we panic if we get an incorrect hash.
Reviewed by: imp,tsoome MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org//D23827
show more ...
|
#
82c29d4f |
| 09-May-2019 |
Toomas Soome <tsoome@FreeBSD.org> |
loader: use DPRINTF in biosdisk.c and define safe DPRINTF
r345066 did miss biosdisk.c.
Also define DPRINTF as ((void)0) for case we do not want debug printouts.
MFC after: 1 week
|
#
c42e554d |
| 19-Mar-2019 |
Marcin Wojtas <mw@FreeBSD.org> |
Add missing boot.4th verification
During initialization of the forth interpreter the loader looks for "/boot/boot.4th" and executes any code found there. That file was loaded bypassing verification.
Add missing boot.4th verification
During initialization of the forth interpreter the loader looks for "/boot/boot.4th" and executes any code found there. That file was loaded bypassing verification. Add a call to verify_file to change that.
Submitted by: Kornel Duleba <mindal@semihalf.com> Reviewed by: sjg Obtained from: Semihalf Sponsored by: Stormshield
show more ...
|
#
7325df02 |
| 12-Mar-2019 |
Kyle Evans <kevans@FreeBSD.org> |
stand: Improve some debugging experience
Some of these files using <FOO>_DEBUG defined a DEBUG() macro to serve as a debug-printf. -DDEBUG is useful to enable some debugging output across multiple E
stand: Improve some debugging experience
Some of these files using <FOO>_DEBUG defined a DEBUG() macro to serve as a debug-printf. -DDEBUG is useful to enable some debugging output across multiple ELF/common parts, so switch the DEBUG-as-printf macros over to something more like DPRINTF that is more commonly used for this kind of thing and less likely to conflict.
userboot/elf64_freebsd debugging also assumed %llx for uint64; use PRIx64 instead.
MFC after: 1 week
show more ...
|
#
8df8b2d3 |
| 26-Feb-2019 |
Simon J. Gerraty <sjg@FreeBSD.org> |
Enable veriexec for loader
This relies on libbearssl and libsecureboot to verify files read by loader in a maner equivalent to how mac_veriexec
Note: disabled by default. Use is initially expected
Enable veriexec for loader
This relies on libbearssl and libsecureboot to verify files read by loader in a maner equivalent to how mac_veriexec
Note: disabled by default. Use is initially expected to be by embeded vendors
Reviewed by: emaste, imp Sponsored by: Juniper Networks Differential Revision: D16336
show more ...
|
#
d92fb784 |
| 30-Nov-2018 |
Maxim Sobolev <sobomax@FreeBSD.org> |
When handling CMD_CRIT error set command_errmsg to NULL after we dump it out, so that it does not result in error message printed twice.
OK load doodoo can't find 'doodoo' can't find 'doodoo' OK
MF
When handling CMD_CRIT error set command_errmsg to NULL after we dump it out, so that it does not result in error message printed twice.
OK load doodoo can't find 'doodoo' can't find 'doodoo' OK
MFC after: 2 weeks
show more ...
|
#
55d5c949 |
| 29-Nov-2018 |
Maxim Sobolev <sobomax@FreeBSD.org> |
The libstand's panic() appends its own '\n' to the message, so that users of the API don't need to supply one.
MFC after: 2 weeks
|
#
d3d381b2 |
| 01-Sep-2018 |
Kyle Evans <kevans@FreeBSD.org> |
userboot: handle guest interpreter mismatches more intelligently
The switch to lualoader creates a problem with userboot: the host is inclined to build userboot with Lua, but the host userboot's int
userboot: handle guest interpreter mismatches more intelligently
The switch to lualoader creates a problem with userboot: the host is inclined to build userboot with Lua, but the host userboot's interpreter must match what's available on the guest. For almost all FreeBSD guests in the wild, Lua is not yet available and a Lua-based userboot will fail.
This revision updates userboot protocol to version 5, which adds a swap_interpreter callback to request a different interpreter, and tries to determine the proper interpreter to be used based on how the guest /boot/loader is compiled. This is still a bit of a guess, but it's likely the best possible guess we can make in order to get it right. The interpreter is now embedded in the resulting executable, so we can open /boot/loader on the guest and hunt that down to derive the interpreter it was built with.
Using -l with bhyveload will not allow an intepreter swap, even if the loader specified happens to be a userboot with the wrong interpreter. We'll simply complain about the mismatch and bail out.
For legacy guests without the interpreter marker, we assume they're 4th. For new guests with the interpreter marker, we'll read it and swap over to the proper interpreter if it doesn't match what the userboot we're using was compiled with.
Both flavors of userboot are installed by default, userboot_4th.so and userboot_lua.so. This fixes the build WITHOUT_FORTH as a coincidence, which was broken by userboot being forced to 4th.
Reviewed by: imp, jhb, araujo (earlier version) Approved by: re (gjb) Differential Revision: https://reviews.freebsd.org/D16945
show more ...
|
#
86411ec1 |
| 09-Feb-2018 |
Warner Losh <imp@FreeBSD.org> |
Set script.lang in the environment to either 'forth' or 'simple' to reflect what scripting language was compiled into the loader. I anticipate that being able to find this out quickly from the OK pro
Set script.lang in the environment to either 'forth' or 'simple' to reflect what scripting language was compiled into the loader. I anticipate that being able to find this out quickly from the OK prompt will be useful in troubleshooting in the future.
show more ...
|
#
44eebfff |
| 07-Feb-2018 |
Warner Losh <imp@FreeBSD.org> |
Fix indentation to FreeBSD standard for interp files
|
#
79a6a17a |
| 31-Jan-2018 |
Warner Losh <imp@FreeBSD.org> |
Break out the interpreters (simple and forth) w/o ifdefs. This is akin to what Pedro Souza and Wojciech Koszek did in the lua GSoC with interp.h, interp_simple.c and changes to interp.c and interp_f
Break out the interpreters (simple and forth) w/o ifdefs. This is akin to what Pedro Souza and Wojciech Koszek did in the lua GSoC with interp.h, interp_simple.c and changes to interp.c and interp_forth.c, but completely redone from scratch.
This effectively restores the spirit of r326712 (my first attempt to bring in Pedro's and Wojciech's work) updated for new requirements that had silently broke their original work. This change also differs by using fixed function names instead of function pointers to simply things. Only one interpreter at a time may be compiled in.
Also of note: we take a mutable string, pass it in via a const char * pointer into intrp_forth's interp_run(). We then cast away the const to pass into ficlExec since ficl would require extensive changes to properly const-poison. See Sections 6.5.2.5 and 6.7.3 of C11 standard noting it's only UB if you modify a const object through a non-const pointer, but not char [] -> const char * -> char * as here.
show more ...
|
#
6bc86037 |
| 19-Dec-2017 |
Warner Losh <imp@FreeBSD.org> |
Interact is always called with NULL. Simplify code a little by removing this argument, and expanding when rc is NULL. This effectively completes the back out of custom scripts for tftp booted loaders
Interact is always called with NULL. Simplify code a little by 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
show more ...
|
#
ba25195e |
| 12-Dec-2017 |
Warner Losh <imp@FreeBSD.org> |
Revert r326792, r326784, r326772, r326712
Something subtle is creating problems for disk access on ubldr. Back it out unti that can be sorted out.
Sponsored by: Netflix
|
#
2ccd1dd9 |
| 11-Dec-2017 |
Warner Losh <imp@FreeBSD.org> |
Revert part of 362772. It was causing problems for includes and making the menus disappear.
Sponsored by: Netflix
|
#
c8345748 |
| 11-Dec-2017 |
Warner Losh <imp@FreeBSD.org> |
Fix regression with lua import
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, remo
Fix regression with lua import
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
show more ...
|
#
fb5af39a |
| 08-Dec-2017 |
Warner Losh <imp@FreeBSD.org> |
Create interp class.
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 loa
Create interp class.
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
show more ...
|
#
ca987d46 |
| 14-Nov-2017 |
Warner Losh <imp@FreeBSD.org> |
Move sys/boot to stand. Fix all references to new location
Sponsored by: Netflix
|