Changeset c67debb in rtems-libbsd for libbsd.txt


Ignore:
Timestamp:
05/18/16 04:17:20 (8 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
5, 5-freebsd-12, 6-freebsd-12, freebsd-9.3, master
Children:
05d47ae
Parents:
f5c6651
Message:

Add rc.conf documentation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libbsd.txt

    rf5c6651 rc67debb  
    144144=== BSD Library Initialization ===
    145145
    146 Use the following code to initialize the BSD library:
     146To initialise the BSD Library create a suitable rc.conf file. The FreeBSD man
     147page rc.conf(5) provides the details needed to create a suitable format file:
     148
     149 https://www.freebsd.org/cgi/man.cgi?rc.conf
     150
     151You can call one of three functions to run the initialisation once BSD has
     152initialised:
     153
     154 - rtems_bsd_run_etc_rc_conf: Run /etc/rc.conf.
     155 - rtems_bsd_run_rc_conf: Run a user supplied file.
     156 - rtems_bsd_run_rc_conf_script: Run the in memory line feed separated text string.
     157
     158For exapmle:
     159
     160 void
     161 network_init(void)
     162 {
     163   rtems_status_code sc;
     164
     165   sc = rtems_bsd_initialize();
     166   assert(sc == RTEMS_SUCCESSFUL);
     167
     168   rtems_bsd_run_etc_rc_conf(true); /* verbose = true */
     169
     170}
     171
     172By default the networking support is builtin. Other directives can be added and
     173are found in 'machine/rtems-bsd-rc-conf-directives.h'. Please check the file
     174for the list.
     175
     176The following network names are supported:
     177
     178  cloned_interfaces
     179  ifconfig_'interface'
     180  defaultrouter
     181  hostname
     182
     183For example:
     184
     185 #
     186 # My BSD initialisation.
     187 #
     188 hostname="myhost"
     189 cloned_interfaces="vlan0 vlan1"
     190 ifconfig_re0="inet inet 10.10.10.10 netmask 255.255.255.0"
     191 fconfig_vlan0="inet 10.11.10.10 255.255.255.0 vlan 101 vlandev re0"
     192 defaultrouter="10.10.10.1"
     193
     194You can also intialise the BSD library using code. The following code to
     195initialize the BSD library:
    147196
    148197-------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.