Share |

4.2.3 Script on the TRK medium

If you want some modifications to TRK and don 't want to fiddle directly into TRK's own scripts, you can add a script to the CD/usb stick/NFS share as  /trk3/trklocscript. Unlike the previous trigger, this has to be a normal bash script.
The advantage of having scripts outside the TRK files is that you can upgrade your TRK afterwards, without having to redo your work every time: in case of a USB stick or NFS share, you just leave the script where it is, in case of a CD, you re-add the trklocscript to the multisession bootcd.
From this script you can trigger any other script you like, f. i. adding more software to your TRK.
Example trklocscript:

#!/bin/bash
# Go to /tmp, which is on virtual shared memory, about half the size of your RAM
cd /tmp
mkdir /tmp/extrabin
cd extrabin
# Use the variable $TRKMOUNTDIR so you always copy/execute from the right location
tar xzf $TRKMOUNTDIR/trk3/extrabinaries.tar.gz
# This will set the PATH globally
export PATH=$PATH:/tmp/extrabin

Updated: July 16, 2010