summaryrefslogtreecommitdiffstats
path: root/sys/boot/forth
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-01-07 18:08:08 -0200
committerRenato Botelho <renato@netgate.com>2016-01-07 18:08:08 -0200
commit7a579754077b3460c9509c75cdd1b78769c1db3f (patch)
treec15015685ccb82b7db1ac19d663a3c6e41e64587 /sys/boot/forth
parentd8ff3484131f428fcc0727cd504acb5050a36490 (diff)
parentbc6ee646001a22150936ff06bf11cd08195e208d (diff)
downloadFreeBSD-src-7a579754077b3460c9509c75cdd1b78769c1db3f.zip
FreeBSD-src-7a579754077b3460c9509c75cdd1b78769c1db3f.tar.gz
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'sys/boot/forth')
-rw-r--r--sys/boot/forth/loader.conf15
-rw-r--r--sys/boot/forth/loader.rc3
-rw-r--r--sys/boot/forth/menu.rc3
-rw-r--r--sys/boot/forth/support.4th19
4 files changed, 26 insertions, 14 deletions
diff --git a/sys/boot/forth/loader.conf b/sys/boot/forth/loader.conf
index 020239a..88f5411 100644
--- a/sys/boot/forth/loader.conf
+++ b/sys/boot/forth/loader.conf
@@ -12,7 +12,7 @@
### Basic configuration options ############################
##############################################################
-exec=".( Loading /boot/defaults/loader.conf ) cr"
+exec="echo Loading /boot/defaults/loader.conf"
kernel="kernel" # /boot sub-directory containing kernel and modules
bootfile="kernel" # Kernel name (possibly absolute path)
@@ -39,7 +39,7 @@ bitmap_type="splash_image_data" # and place it on the module_path
##############################################################
-### Random number generator configuration ###################
+### Random number generator configuration ##################
##############################################################
entropy_cache_load="NO" # Set this to YES to load entropy at boot time
@@ -156,7 +156,7 @@ module_path="/boot/modules" # Set the module search path
##############################################################
-### ATA modules ##############################################
+### ATA modules ############################################
##############################################################
ataacard_load="NO" # ACARD
@@ -378,6 +378,7 @@ if_xe_load="NO" # Xircom CreditCard PCMCIA
if_xl_load="NO" # 3Com Etherlink XL (3c900, 3c905, 3c905B)
utopia_load="NO" # ATM PHY driver
+
##############################################################
### Netgraph modules #######################################
##############################################################
@@ -420,6 +421,7 @@ ng_tty_load="NO" # Netgraph node type that is also a line
ng_vjc_load="NO" # Van Jacobsen compression netgraph node type
ng_vlan_load="NO" # IEEE 802.1Q VLAN tagging netgraph node type
+
##############################################################
### Sound modules ##########################################
##############################################################
@@ -456,6 +458,7 @@ snd_via82c686_load="NO" # via82c686
snd_vibes_load="NO" # vibes
snd_driver_load="NO" # All sound drivers
+
##############################################################
### USB modules ############################################
##############################################################
@@ -488,6 +491,7 @@ if_ural_load="NO" # Ralink RT2500USB 802.11 wireless adapter
if_zyd_load="NO" # ZyDAS ZD1211(B) USB 802.11 wireless adapter
snd_uaudio_load="NO" # USB audio
+
##############################################################
### Other modules ##########################################
##############################################################
@@ -512,6 +516,7 @@ amdtemp_load="NO" # AMD K8/K10/K11 temperature monitor
tpm_load="NO" # Trusted Platform Module
wbwd_load="NO" # Winbond watchdog
+
##############################################################
### ACPI settings ##########################################
##############################################################
@@ -522,8 +527,9 @@ acpi_dsdt_name="/boot/acpi_dsdt.aml"
# Override DSDT in BIOS by this file
acpi_video_load="NO" # Load the ACPI video extension driver
+
##############################################################
-### TrustedBSD MAC settings ##################################
+### TrustedBSD MAC settings ################################
##############################################################
mac_biba_load="NO" # Biba MAC policy
@@ -534,6 +540,7 @@ mac_none_load="NO" # Null MAC policy
mac_partition_load="NO" # Partition MAC policy
mac_seeotheruids_load="NO" # UID visbility MAC policy
+
##############################################################
### Module loading syntax example ##########################
##############################################################
diff --git a/sys/boot/forth/loader.rc b/sys/boot/forth/loader.rc
index b4a6d51..0bc6657 100644
--- a/sys/boot/forth/loader.rc
+++ b/sys/boot/forth/loader.rc
@@ -1,6 +1,9 @@
\ Loader.rc
\ $FreeBSD$
\
+\ You should not edit this file! Put any overrides in loader.rc.local
+\ instead as this file can be replaced during system updates.
+\
\ Includes additional commands
include /boot/loader.4th
try-include /boot/loader.rc.local
diff --git a/sys/boot/forth/menu.rc b/sys/boot/forth/menu.rc
index e650848..7ffeef4 100644
--- a/sys/boot/forth/menu.rc
+++ b/sys/boot/forth/menu.rc
@@ -1,6 +1,9 @@
\ Menu.rc
\ $FreeBSD$
\
+\ You should not edit this file! Put any overrides in menu.rc.local
+\ instead as this file can be replaced during system updates.
+\
\ Load required Forth modules
include /boot/version.4th
include /boot/brand.4th
diff --git a/sys/boot/forth/support.4th b/sys/boot/forth/support.4th
index 7da92bc..6db232b 100644
--- a/sys/boot/forth/support.4th
+++ b/sys/boot/forth/support.4th
@@ -684,7 +684,7 @@ only forth also support-functions also file-processing definitions
s" loader_conf_files" getenv conf_files string=
;
-: set_nextboot_conf \ XXX maybe do as set_conf_files ?
+: set_nextboot_conf
value_buffer strget unquote nextboot_conf_file string=
;
@@ -833,7 +833,7 @@ get-current ( -- wid ) previous definitions >search ( wid -- )
repeat
;
-: peek_file
+: peek_file ( addr len -- )
0 to end_of_file?
reset_line_reading
O_RDONLY fopen fd !
@@ -844,6 +844,7 @@ get-current ( -- wid ) previous definitions >search ( wid -- )
['] process_assignment catch
['] free_buffers catch
fd @ fclose
+ swap throw throw
;
only forth also support-functions definitions
@@ -851,7 +852,6 @@ only forth also support-functions definitions
\ Interface to loading conf files
: load_conf ( addr len -- )
- \ ." ----- Trying conf " 2dup type cr \ debugging
0 to end_of_file?
reset_line_reading
O_RDONLY fopen fd !
@@ -943,7 +943,6 @@ string current_file_name_ref \ used to print the file name
\ loader_conf_files processing support functions
: get_conf_files ( -- addr len ) \ put addr/len on stack, reset var
- \ ." -- starting on <" conf_files strtype ." >" cr \ debugging
conf_files strget 0 0 conf_files strset
;
@@ -970,7 +969,6 @@ string current_file_name_ref \ used to print the file name
pos char+ to pos
repeat
addr len pos addr r@ + pos r> -
- \ 2dup ." get_file_name has " type cr \ debugging
;
: get_next_file ( addr len ptr -- addr len ptr' addr' len' | 0 )
@@ -1021,25 +1019,26 @@ string current_file_name_ref \ used to print the file name
;
: get_nextboot_conf_file ( -- addr len )
- nextboot_conf_file strget strdup \ XXX is the strdup a leak ?
+ nextboot_conf_file strget
;
: rewrite_nextboot_file ( -- )
get_nextboot_conf_file
O_WRONLY fopen fd !
fd @ -1 = if EOPEN throw then
- fd @ s' nextboot_enable="NO" ' fwrite
+ fd @ s' nextboot_enable="NO" ' fwrite ( fd buf len -- nwritten ) drop
fd @ fclose
;
-: include_nextboot_file
+: include_nextboot_file ( -- )
get_nextboot_conf_file
- ['] peek_file catch
+ ['] peek_file catch if 2drop then
nextboot? if
get_nextboot_conf_file
+ current_file_name_ref strref
['] load_conf catch
process_conf_errors
- ['] rewrite_nextboot_file catch
+ ['] rewrite_nextboot_file catch if 2drop then
then
;
OpenPOWER on IntegriCloud