[Midnightbsd-cvs] src [9865] U trunk/sys/boot/forth: update loader
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Wed May 23 09:15:43 EDT 2018
Revision: 9865
http://svnweb.midnightbsd.org/src/?rev=9865
Author: laffer1
Date: 2018-05-23 09:15:43 -0400 (Wed, 23 May 2018)
Log Message:
-----------
update loader
Modified Paths:
--------------
trunk/sys/boot/forth/loader.4th
trunk/sys/boot/forth/loader.4th.8
trunk/sys/boot/forth/loader.conf
trunk/sys/boot/forth/loader.conf.5
Property Changed:
----------------
trunk/sys/boot/forth/delay.4th
trunk/sys/boot/forth/loader.4th
trunk/sys/boot/forth/loader.4th.8
trunk/sys/boot/forth/loader.conf
trunk/sys/boot/forth/loader.conf.5
Index: trunk/sys/boot/forth/delay.4th
===================================================================
--- trunk/sys/boot/forth/delay.4th 2018-05-23 13:12:18 UTC (rev 9864)
+++ trunk/sys/boot/forth/delay.4th 2018-05-23 13:15:43 UTC (rev 9865)
Property changes on: trunk/sys/boot/forth/delay.4th
___________________________________________________________________
Deleted: mnbsd:keywords
## -1 +0,0 ##
-MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/boot/forth/loader.4th
===================================================================
--- trunk/sys/boot/forth/loader.4th 2018-05-23 13:12:18 UTC (rev 9864)
+++ trunk/sys/boot/forth/loader.4th 2018-05-23 13:15:43 UTC (rev 9865)
@@ -23,6 +23,7 @@
\ SUCH DAMAGE.
\
\ $MidnightBSD$
+\ $FreeBSD: stable/9/sys/boot/forth/loader.4th 263705 2014-03-25 03:30:44Z dteske $
s" arch-i386" environment? [if] [if]
s" loader_version" environment? [if]
@@ -40,9 +41,19 @@
2048 dictincrease ! \ 2048 additional cells each time
include /boot/support.4th
+include /boot/color.4th
+include /boot/delay.4th
only forth also support-functions also builtins definitions
+: bootmsg ( -- )
+ loader_color? if
+ ." [37;44mBooting...[0m" cr
+ else
+ ." Booting..." cr
+ then
+;
+
: try-menu-unset
\ menu-unset may not be present
s" beastie_disable" getenv
@@ -59,6 +70,12 @@
else
drop
then
+ s" menusets-unset"
+ sfind if
+ execute
+ else
+ drop
+ then
;
: boot
@@ -72,25 +89,25 @@
else
s" kernelname" getenv? if ( a kernel has been loaded )
try-menu-unset
- 1 boot exit
+ bootmsg 1 boot exit
then
load_kernel_and_modules
?dup if exit then
try-menu-unset
- 0 1 boot exit
+ bootmsg 0 1 boot exit
then
else
s" kernelname" getenv? if ( a kernel has been loaded )
try-menu-unset
- 1 boot exit
+ bootmsg 1 boot exit
then
load_kernel_and_modules
?dup if exit then
try-menu-unset
- 0 1 boot exit
+ bootmsg 0 1 boot exit
then
load_kernel_and_modules
- ?dup 0= if 0 1 boot then
+ ?dup 0= if bootmsg 0 1 boot then
;
\ ***** boot-conf
@@ -116,8 +133,8 @@
\ ***** start
\
\ Initializes support.4th global variables, sets loader_conf_files,
-\ process conf files, and, if any one such file was succesfully
-\ read to the end, load kernel and modules.
+\ processes conf files, and, if any one such file was succesfully
+\ read to the end, loads kernel and modules.
: start ( -- ) ( throws: abort & user-defined )
s" /boot/defaults/loader.conf" initialize
@@ -126,8 +143,17 @@
\ Will *NOT* try to load kernel and modules if no configuration file
\ was succesfully loaded!
any_conf_read? if
- load_kernel
- load_modules
+ s" loader_delay" getenv -1 = if
+ load_kernel
+ load_modules
+ else
+ drop
+ ." Loading Kernel and Modules (Ctrl-C to Abort)" cr
+ s" also support-functions" evaluate
+ s" set delay_command='load_kernel load_modules'" evaluate
+ s" set delay_showdots" evaluate
+ delay_execute
+ then
then
;
@@ -208,7 +234,16 @@
s" disable-module" s" disable loading of a module" .?
s" toggle-module" s" toggle loading of a module" .?
s" show-module" s" show module load data" .?
+ s" try-include" s" try to load/interpret files" .?
;
+: try-include ( -- ) \ see loader.4th(8)
+ ['] include ( -- xt ) \ get the execution token of `include'
+ catch ( xt -- exception# | 0 ) if \ failed
+ LF parse ( c -- s-addr/u ) 2drop \ advance >in to EOL (drop data)
+ \ ... prevents words unused by `include' from being interpreted
+ then
+; immediate \ interpret immediately for access to `source' (aka tib)
+
only forth also
Property changes on: trunk/sys/boot/forth/loader.4th
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/boot/forth/loader.4th.8
===================================================================
--- trunk/sys/boot/forth/loader.4th.8 2018-05-23 13:12:18 UTC (rev 9864)
+++ trunk/sys/boot/forth/loader.4th.8 2018-05-23 13:15:43 UTC (rev 9865)
@@ -23,8 +23,9 @@
.\" SUCH DAMAGE.
.\"
.\" $MidnightBSD$
+.\" $FreeBSD: stable/9/sys/boot/forth/loader.4th.8 263705 2014-03-25 03:30:44Z dteske $
.\"
-.Dd September 30, 2004
+.Dd November 13, 2013
.Dt LOADER.4TH 8
.Os
.Sh NAME
@@ -94,31 +95,35 @@
.Pa /boot/defaults/loader.conf ,
all other
.Xr loader.conf 5
-files specified in it, and then proceeds to boot as specified in them.
-This
+files specified in it, then loads the desired kernel and modules
+.Pq if not already loaded .
+After which you can use the
+.Ic boot
+or
+.Ic autoboot
+commmands or simply exit (provided
+.Va autoboot_delay
+is not set to NO) to boot the system.
+.Ic start
is the command used in the default
.Pa /boot/loader.rc
-file, and it uses the
-.Pa autoboot
-command (see
-.Xr loader 8 ) ,
-so it can be stopped for further interaction with
-.Xr loader 8 .
+file
+.Pq see Xr loader 8 .
.Pp
.It Ic initialize
-Initialize the supporting library so commands can be used without
-executing
+Initialize the support library so commands can be used without executing
.Ic start
first.
Like
.Ic start ,
-reads
+it reads
.Pa /boot/defaults/loader.conf
and all other
.Xr loader.conf 5
-files specified in it.
+files specified in it
+.Pq but does not load kernel or modules .
Returns a flag on the stack to indicate
-if any configuration file was successfully loaded.
+if any configuration files were successfully loaded.
.Pp
.It Ic read-conf Ar filename
Reads and processes a
@@ -154,6 +159,13 @@
Used inside
.Xr loader.conf 5
files to specify the action after a module loading fails.
+.It Ic try-include Ar file Op Ar
+Process script files if they exist.
+Each file, in turn, is completely read into memory,
+and then each of its lines is passed to the command line interpreter.
+If any error is returned by the interpreter, the try-include
+command aborts immediately, without reading any other files, and
+silently returns without error.
.El
.Sh FILES
.Bl -tag -width /boot/loader.4th -compact
Property changes on: trunk/sys/boot/forth/loader.4th.8
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/boot/forth/loader.conf
===================================================================
--- trunk/sys/boot/forth/loader.conf 2018-05-23 13:12:18 UTC (rev 9864)
+++ trunk/sys/boot/forth/loader.conf 2018-05-23 13:15:43 UTC (rev 9865)
@@ -6,7 +6,8 @@
#
# All arguments must be in double quotes.
#
-# $MidnightBSD: src/sys/boot/forth/loader.conf,v 1.4 2012/12/29 05:03:43 laffer1 Exp $
+# $MidnightBSD$
+# $FreeBSD: stable/9/sys/boot/forth/loader.conf 263702 2014-03-25 03:23:06Z dteske $
##############################################################
### Basic configuration options ############################
@@ -42,6 +43,8 @@
### Loader settings ########################################
##############################################################
+#loader_delay="3" # Delay in seconds before loading anything.
+ # Default is unset and disabled (no delay).
#autoboot_delay="10" # Delay in seconds before autobooting,
# set to -1 if you don't want user to be
# allowed to interrupt autoboot process and
@@ -48,7 +51,8 @@
# escape to the loader prompt, set to
# "NO" to disable autobooting
#beastie_disable="NO" # Turn the beastie boot menu on and off
-#loader_logo="mbsdbw" # Desired logo: mbsdbw, beastiebw, beastie, none
+#kernels="kernel kernel.old" # Kernels to display in the boot menu
+#loader_logo="orbbw" # Desired logo: orbbw, orb, mbsdbw, beastiebw, beastie, none
#comconsole_speed="9600" # Set the current serial console speed
#console="vidconsole" # A comma separated list of console(s)
#currdev="disk1s1a" # Set the current device
@@ -231,6 +235,7 @@
ibcs2_load="NO" # IBCS2 (SCO) emulation
ibcs2_coff_load="NO"
linux_load="NO" # Linux emulation
+lindev_load="NO" # Linux-specific pseudo devices (see lindev(4))
svr4_load="NO" # SystemV R4 emulation
streams_load="NO" # System V streams module
Property changes on: trunk/sys/boot/forth/loader.conf
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/boot/forth/loader.conf.5
===================================================================
--- trunk/sys/boot/forth/loader.conf.5 2018-05-23 13:12:18 UTC (rev 9864)
+++ trunk/sys/boot/forth/loader.conf.5 2018-05-23 13:15:43 UTC (rev 9865)
@@ -22,8 +22,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $MidnightBSD: src/sys/boot/forth/loader.conf.5,v 1.3 2012/12/29 05:03:43 laffer1 Exp $
-.Dd July 20, 2011
+.\" $MidnightBSD$
+.\" $FreeBSD: stable/9/sys/boot/forth/loader.conf.5 263701 2014-03-25 03:19:03Z dteske $
+.Dd October 18, 2013
.Dt LOADER.CONF 5
.Os
.Sh NAME
@@ -113,8 +114,23 @@
.It Ar kernel_options
Flags to be passed to the kernel.
.It Ar password
+Protect boot menu with a password without interrupting
+.Ic autoboot
+process.
+The password should be in clear text format.
+If a password is set, boot menu will not appear until any key is pressed during
+countdown period specified by
+.Va autoboot_delay
+variable or
+.Ic autoboot
+process fails.
+In both cases user should provide specified password to be able to access boot
+menu.
+.It Ar bootlock_password
Provides a password to be required by check-password before execution is
allowed to continue.
+The password should be in clear text format.
+If a password is set, the user must provide specified password to boot.
.It Ar verbose_loading
If set to
.Dq YES ,
@@ -194,6 +210,9 @@
character (useful for embedded products and such).
.It Va kernel
.Pq Dq kernel
+.It Va kernels
+.Pq Dq kernel kernel.old
+Space or comma separated list of kernels to present in the boot menu.
.It Va loader_conf_files
.Pq Dq Pa /boot/loader.conf /boot/loader.conf.local
.It Va splash_bmp_load
@@ -230,8 +249,8 @@
.Dq Li none .
.It Va loader_color
If set to
-.Dq YES ,
-the beastie boot menu will be displayed using ANSI coloring where possible.
+.Dq NO ,
+the beastie boot menu will be displayed without ANSI coloring.
.El
.Sh FILES
.Bl -tag -width /boot/defaults/loader.conf -compact
Property changes on: trunk/sys/boot/forth/loader.conf.5
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
More information about the Midnightbsd-cvs
mailing list