WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Additionally Tiny Core supports installation scripts  (Read 3700 times)

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
Additionally Tiny Core supports installation scripts
« on: April 13, 2009, 08:45:39 PM »
Can anyone explain this?
dCore user

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Additionally Tiny Core supports installation scripts
« Reply #1 on: April 13, 2009, 09:30:07 PM »
The directory /usr/local/tce.installed is where TC keeps track of loaded extensions.
Typically this is a 'flag' a zero byte file. Notice that the extension name does not include its file extension.

Now, if you need a startup script then include it in tar file at this location and its name needs to match the extension name. Do make sure that the script works and is executeable. Do not use .sh or any other file extension.

A very simple example is in order:

Take for example the 915resolution.tce extension.
If we want to make a startup script then it would be placed in
/usr/local/tce.installed/915resolution

The actual startup script could be anything that is executeable. Using the same example, my /usr/local/tce.installed/915resolution is a simple as this:

#/bin/sh
/usr/local/sbin/915resolution 50 1024 600

Note: Be sure to use full paths as during boot no login has occured yet no PATHs are set.

So the final result of a 915resolution.tce with a startup script would contain
usr/local/sbin/915resolution
usr/local/tce.installed/915resolution





10+ Years Contributing to Linux Open Source Projects.

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
Re: Additionally Tiny Core supports installation scripts
« Reply #2 on: April 14, 2009, 06:52:14 AM »
I think those scripts should be executed before the restoration of mydata.tar.gz, cause the user personalization should be more important that the extensions decisions.

For example, I made a partial translation of tc and so I also translated the jwm menu. Because the user can be different from the default tc I created the following script in the tce.installed:
Code: [Select]
#!/bin/sh
mv /tmp/.jwmrc_ita /home/$USER/.jwmrc
but this overrides my jwm menu, that is different from the default one (which is in english), but also from the one provided by my translation, cause I have some lines at the bottom of .jwmrc:
Code: [Select]
......[<StartupCommand>sudo getTime.sh</StartupCommand>
<StartupCommand>mixer.sh</StartupCommand>
<StartupCommand>xonclock</StartupCommand>
<StartupCommand>conky -b</StartupCommand>
<StartupCommand>xmodmap -e "clear Mod4" -e "add Mod5 = Mode_switch"</StartupCommand>
</JWM>/code]
« Last Edit: April 14, 2009, 06:54:55 AM by jls_legalize »
dCore user

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Additionally Tiny Core supports installation scripts
« Reply #3 on: April 15, 2009, 11:46:32 AM »
I think that is a good suggestion. The placement was to support some system files that may have been in the backup/restore, possibly from other needed extensions. But system files really should not be in the backup file.

If needed, they should be separate tarballs named as .tce. If this protocol is adopted then the change you propose could be implemented. I will plan for 1.4 version.
10+ Years Contributing to Linux Open Source Projects.