Startup Script

Is there a way to automaticly run a startup script... so I can configure the network, launch the GUI, etc?

Is there a way to do a similar startup script after the GUI is started?

Yes, there is

The current shell supports the execution of a startup script after JNode has booted while is starting up the first shell instance called jnode.ini and an other startup script on the startup of each shell instance (including the first) called shell.ini .
The location of jnode.ini is the directory refered to by the java.home system property.
The location of shell.ini is the directory refered to by the user.home system property.
So if these files exist they will be executed.
At the moment the problem is that in the deafult configuration the above diretories are on an in-memory partition and therefor their conents is lost after each reboot.
The solution is to set up a custom JNode configuration which uses a persistent file system for the above directories. The persisten file system can reside on a vmware disk formatted to fat32 just like the one you can find in the download.
Follow these steps:

1. add a fat32 formatted disk to the JNode speciffic vmware configuration
2. boot jnode and see in the /devices directory where was the disk mounted (I asume /devices/hdb0)
3. create the following directories:
      /devices/hdb0/jnode    - java.home  
      /devices/hdb0/home     - user.home
      /devices/hdb0/tmp      - java.io.tmpdir
   they will correspond to the standard Java system properties above
4. create jnode.ini in /devices/hdb0/jnode and shell.ini in /devices/hdb0/home and edit them according to
   your needs
5. in the root directory of the JNode source tree copy the jnode.properties.dist to jnode.properties
6. look for 'Custom system properties' in jnode.properties and edit the properties to be like this:
      jnode.java.home=/devices/hdb0/jnode
      jnode.java.io.tmpdir=/devices/hdb0/tmp
      jnode.user.home=/devices/hdb0/home
7. make a new clean build of JNode
8. boot the new JNode instance in vmware and on startup the two files will be executed

At this stage jnode.ini and shell.ini can contain only regular shell commands as you would issue them in the command line. There is no suport for conditionals, loops and other scripting features. You also run these files manually using the 'run' command.

The above solution should work for the latest SVN version.
Note that this solution mihgt undergo substantial changes in the future so in no way should it be considered as our final word in JNode startup configuration.
There is no suport yet for running a script after the startup of the GUI.

I hope this helps.

Regards,
Levente

Great Information, Thanks

It would have taken me a long time to figure that out.

The solution is to set up a custom JNode configuration which uses a persistent file system for the above directories.

I agree that is the optimal solution. I'll try it with VmWare and I'll do it that way when I have a devoted hardware partition, however I don't always use VmWare so...

At the moment the problem is that in the deafult configuration the above diretories are on an in-memory partition and therefor their conents is lost after each reboot.

If I wanted to alter the content of the in memory partition, where is it represented in the build directories? I have successfully built JNode so I'm at a point where I can start experimenting.

The short answer is "no"

The root CommandShell tries to execute commands from a ".ini" file on startup, but AFAIK there is no way to create this file in the current JNode setup.

This is an area where we need to do more work.