Welcome to the Tiny Core Linux Wiki at tinycorelinux.net!

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

wiki:extension_for_settings [2011/05/18 00:22]
Guy [Make Extensions for Settings]
wiki:extension_for_settings [2014/01/31 19:25] (current)
tinypoodle [Examples]
Line 17: Line 17:
 To make a extension called “myext1.tcz,” open the Terminal, and type: To make a extension called “myext1.tcz,” open the Terminal, and type:
  
-<code>sudo su+<code>sudo -s
 cd /home/tc/myext cd /home/tc/myext
 mksquashfs ext1/ myext1.tcz</code> mksquashfs ext1/ myext1.tcz</code>
- 
-For an actual example of making an extension for settings, see [[Printer Setup Using Cups]]. 
  
 ==== Copy to TCE Folder ==== ==== Copy to TCE Folder ====
Line 30: Line 28:
  
 Keep a copy of your new extension. If you update extensions, it may be deleted. 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:
 +
 +<code>mkdir -p /home/tc/extpack/home/tc</code>
 +
 +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:
 +
 +<code>sudo -s
 +cd /home/tc
 +mksquashfs extpack/ extpack.tcz</code>
 +
 +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:
 +
 +<code>unsquashfs -f -d /home/tc/extpack/ extpack.tcz</code>
 +
 +The documentation for unsquashfs can be found here: 
 +[[http://www.tldp.org/HOWTO/html_single/SquashFS-HOWTO/#unsquashing|unsquashing]]
  
 ==== Load Order ==== ==== Load Order ====
Line 41: Line 70:
 ==== Alternate Method: Save in /opt ==== ==== 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 [[passwd|Tiny Core Passwords]].+Another option, instead of making new extensions, is to save files in /opt. An example of this is discussed in [[passwd|Tinycore Passwords]].
  
Print/export