Hello,
I finally find the way to set, pass and retrieve a variable from the bootloader to my rc.d script file
the solution or the concept:
- WARNING: have a freebsd livecd (in case of error or typo in the beatie.4th, the pc won't boot, I warm you, I live this experience yesterday night )
- declare your variable into the loader.conf: myvar="toto"
- in the beastie.4th
- declare a variable to handle the selection of your menu
- add a menu item with your variable (copy and paste)
- add a code to handle the selection of your menuitem
- modify your variable (loader.conf) with the setenv function (copy and paste)
- in your rc.d script file use the kenv -q myvar to retrieve the value
the code:
- loader.conf
- beastie.4th, add in the declaration part
- in the :beastie-menu add this line:
- printmenuitem ." Passing arg to rc.d file" mymenuselection !
- in the :beastie-start add this code:
- dup mymenuselection @ = if
s" COUCOU" s" myvar" setenv
0 boot
then
- in your rc.d file:
- VALUE=`kenv -a myvar` or kenv -q myvar
- Save and reboot
Now, I am able to choose from the startup of my laptop which network configuration I will use and I am able to see my splashscreen until X start
Thanks to all of you, who help me to find this solution (especially to richardpl and to ephemera)