Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wiki:extension_for_settings [2011/04/23 15:54] – [Make an Extension for Settings] Guywiki:extension_for_settings [2014/01/31 22:25] (current) – [Examples] tinypoodle
Line 2: Line 2:
  
 If you want to save application settings, or large files, you can make one or more extensions to save them. If you want to save application settings, or large files, you can make one or more extensions to save them.
- 
-If you have Tiny Core installed on a hard drive, using persistent home and opt, and make extensions for settings, you don't need to use backup. 
- 
-If you have Tiny Core installed on a USB drive, using backup, and make extensions for settings and large files, you can have less in backup, which reduces the time taken to start up and shut down the computer, and lengthens the life of the USB drive. 
  
 ==== Install squashfs-tools-4.0 ==== ==== Install squashfs-tools-4.0 ====
Line 15: Line 11:
 Begin by creating directories. Open the Terminal and type: Begin by creating directories. Open the Terminal and type:
  
-mkdir -p /home/tc/myext/ext1+<code>mkdir -p /home/tc/myext/ext1</code>
  
 Copy and paste files you want to save to ext1. You must include the directory structure, as it is in the root directory. Copy and paste files you want to save to ext1. You must include the directory structure, as it is in the root directory.
Line 21: 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:
  
-sudo su+<code>sudo -s
 cd /home/tc/myext cd /home/tc/myext
-mksquashfs ext1/ myext1.tcz +mksquashfs ext1/ myext1.tcz</code>
- +
-For an actual example of making an extension for settings, see printer.+
  
 ==== Copy to TCE Folder ==== ==== Copy to TCE Folder ====
Line 34: 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 42: Line 67:
  
 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. 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 [[passwd|Tinycore Passwords]].
  
Print/export
QR Code
QR Code wiki:extension_for_settings (generated for current page)