Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: helander on June 17, 2009, 03:36:47 AM

Title: Alternative to /opt/bootlocal.sh
Post by: helander on June 17, 2009, 03:36:47 AM
I would like to propose alernative option to add operations to be performed at system startup.
The idea is to have this controlled thru tce:s and requires no other actions than selecting the tce in question to be installed.
As an example if you would like to create different TC "flavors", each flavor could then be defined by the set of tce:s it includes.

A solution could be:

   Place whatever scripts you want to execute during startup in the directory
   
       /usr/local/bootlocal
      
   inside your tce.
   
   In /etc/init.d/tc-config you add, close to the invocation of /opt/bootlocal.sh, code that look what files (with x flag set) that exists in /usr/local/bootlocal and executes them.
   

/Lars
Title: Re: Alternative to /opt/bootlocal.sh
Post by: curaga on June 17, 2009, 05:00:48 AM
If an extension is in a tce directory and so loaded on boot, its install script is also run on boot.
Title: Re: Alternative to /opt/bootlocal.sh
Post by: mikshaw on June 17, 2009, 06:40:52 AM
Quote
In /etc/init.d/tc-config you add, close to the invocation of /opt/bootlocal.sh, code that look what files (with x flag set) that exists in /usr/local/bootlocal and executes them.

/usr/local/tce.installed already has this function.  Look in tc-config, it's the very last thing done before bootlocal.sh is run.  Personally I prefer this to using bootlocal.sh, because bootlocal.sh is backgrounded, which means that potentially the user could be already logged in by the time the script finishes.
Title: Re: Alternative to /opt/bootlocal.sh
Post by: helander on June 17, 2009, 08:38:24 AM
OK, so what I wanted was already in place  :). Thanks for pointing out the solution.

/Lars
Title: Re: Alternative to /opt/bootlocal.sh
Post by: roberts on June 17, 2009, 10:17:21 AM
It is in the FAQ. See http://www.tinycorelinux.com/faq.html#startup_scripts