env variables in startup code

Hi,
is it possible to set environment variables in the startup code? I’d like to
put there some information about the HW so that the startup scripts could
read them at later stages of the boot.

  • Martin

In article <c6j8ik$hoq$1@inn.qnx.com>,
Martin Nylund <mnylund@emtrion.de> wrote:

is it possible to set environment variables in the startup code? I’d like to
put there some information about the HW so that the startup scripts could
read them at later stages of the boot.

Not environment variables, sorry. The recomended way to pass
hardware information is through the hwinfo section, If it’s something
simple you might be able to get away with add_typed_string() - they
can be gotten with the confstr() function (use the same number in the
first parm to confstr() as you used in add_typed_string() to get the
value). Finally you can add an environment like string with the
add_string() function (“FOO=BAR”), but you’ll have to scan the
SYSPAGE_ENTRY(strings) section yourself in user code to find it.


Brian Stecher (bstecher@qnx.com) QNX Software Systems, Ltd.
phone: +1 (613) 591-0931 (voice) 175 Terence Matthews Cr.
+1 (613) 591-3579 (fax) Kanata, Ontario, Canada K2M 1W8

Thanks Brian,

I got it working with the add_typed_string() + confstr() combination. I
suppose one should check the values in /usr/include/confname.h before adding
any new index strings. And the hwinfo… I’ll fill it some day :wink:

  • Martin

“Brian Stecher” <bstecher@qnx.com> schrieb im Newsbeitrag
news:c6lj1q$bcf$1@inn.qnx.com

In article <c6j8ik$hoq$> 1@inn.qnx.com> >,
Martin Nylund <> mnylund@emtrion.de> > wrote:
is it possible to set environment variables in the startup code? I’d like
to
put there some information about the HW so that the startup scripts could
read them at later stages of the boot.

Not environment variables, sorry. The recomended way to pass
hardware information is through the hwinfo section, If it’s something
simple you might be able to get away with add_typed_string() - they
can be gotten with the confstr() function (use the same number in the
first parm to confstr() as you used in add_typed_string() to get the
value). Finally you can add an environment like string with the
add_string() function (“FOO=BAR”), but you’ll have to scan the
SYSPAGE_ENTRY(strings) section yourself in user code to find it.


Brian Stecher (> bstecher@qnx.com> ) QNX Software Systems, Ltd.
phone: +1 (613) 591-0931 (voice) 175 Terence Matthews Cr.
+1 (613) 591-3579 (fax) Kanata, Ontario, Canada K2M
1W8