Make Extensions for Settings

If you want to save application settings, or large files, you can make one or more extensions to save them.

Install squashfs-tools-4.0

To make a new extension, the squashfs-tools-4.0.tcz extension needs to be installed.

Make an Extension for Settings

Begin by creating directories. Open the Terminal and type:

mkdir -p /home/tc/myext/ext1

Copy and paste files you want to save to ext1. You must include the directory structure, as it is in the root directory.

To make a extension called “myext1.tcz,” open the Terminal, and type:

sudo -s
cd /home/tc/myext
mksquashfs ext1/ myext1.tcz

Copy to TCE Folder

Copy and paste the new extension to the /tce/optional directory.

Put the new extension in OnBoot using Apps Audit.

Keep a copy of your new extension. If you update extensions, it may be deleted.

Examples

This example will add a shell script to your home directory called “gtt.sh” (for “go to tce”). This contains the line: “cd /mnt/sda1/tce”. (see usage below) The new extension shall be called “extpack.tcz”. Then open the Terminal and type:

mkdir -p /home/tc/extpack/home/tc

Now copy your script “gtt.sh” into “/home/tc/extpack/home/tc”. Tinycore will copy everything in the “extpack/” directory into its root directory when booting.

If you also want to install an application you could make a “usr/local/bin” directory within the “extpack” directory and then put your application into “/home/tc/extpack/usr/local/bin”.

Now, to make the extension called “extpack.tcz” type:

sudo -s
cd /home/tc
mksquashfs extpack/ extpack.tcz

Then copy extpack.tcz into your “tce/optional” directory and add extpack.tcz to your onboot.lst file, e.g. with an editor. When booting, Tinycore Linux will install the extpack.tcz extension and thus copy the gtt.sh script to your “home/tc” directory.

Since “cd” is a special case for scripts you have to use the dot command to make this run as expected. So enter “. ./gtt.sh” to execute this script.

For another actual example of making an extension for settings, see Printer Setup Using Cups.

Unpack extensions

If you want to update e.g. the extpack.tcz extension in the previous example and do not have the original files available you can unpack the extension using this command:

unsquashfs -f -d /home/tc/extpack/ extpack.tcz

The documentation for unsquashfs can be found here: unsquashing

Load Order

In most situations, you could name the new extension anything, and it would work. In some situations, it may need to be loaded after the application you are saving settings for.

Extensions are loaded in the order A to Z, then a to z.

If you make an extension for settings, and it does not work, try renaming it to something starting with a small letter, near the end of the alphabet. For example, you may name it zmyext.tcz.

Alternate Method: Save in /opt

Another option, instead of making new extensions, is to save files in /opt. An example of this is discussed in Tinycore Passwords.

Print/export
QR Code
QR Code wiki:extension_for_settings (generated for current page)