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

> 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...

Wow, the kernel knows how to execute scripts (by calling sh)? I thought I must 
run sh with the script name as its argument.
Did you test if it really works by specifying a script instead of an ELF image 
as the executing app (argv[0]) to load_image()?

Bye,
Waldemar

Other related posts: