[openbeosnetteam] load_image() from kernel land (Was: PPP homepage)

> > Nothing special. $HOME could be useful sometimes. Can I not somehow 
> > put the information from /etc/profile into load_image() without 
> > running "sh"? 
> > But if "sh" works then that is okay, too.
> 
> /etc/profile is an sh script - how would you like to evaluate it 
> without sh?
> Instead of $HOME you may use find_directory().

Well, some erratum:

- BeOS bash don't support -l but only --login
- Setting up environment can be done by wrapping the app in a small 
script looking like that:

/boot/beos/etc/network/profiles/current/dun_login :

#!/bin/sh

# this must be done here because SetupEnvironment depends on it
#
SAFEMODE=`/bin/safemode`
export SAFEMODE

#
# load up some useful environment variables...
#
if [ -f "/boot/beos/system/boot/SetupEnvironment" ]
then
        . /boot/beos/system/boot/SetupEnvironment
fi

/boot/beos/apps/Terminal

It give us a fully setup environment in the Terminal session. 
The driver code still looks simple:

char * argv[] = { "/boot/beos/etc/network/profiles/current/dun_login", 
NULL };
resume_thread(load_image(1, argv, NULL));

If we want to pass an user-specified app to run every time a PPP 
interface needs user interaction, it's easy to modify this script to 
test and then run the first argument passed...

- Philippe

--
Fortune Cookie Says:

Take it easy, we're in a hurry.

Other related posts: