Both sides previous revisionPrevious revisionNext revision | Previous revision |
wiki:creating_extensions [2024/06/20 20:17] – external edit 127.0.0.1 | wiki:creating_extensions [2024/08/25 13:09] (current) – [Adding Custom Startup Scripts] rhermsen |
---|
- email it to the Tiny Core Team | - email it to the Tiny Core Team |
Much can be scripted and the payoff is well worth it. For instance, steps 3-6 can be automated with [[http://tcztools.googlecode.com/|tcztools]] (not an official TC tool). Just for the record: | Much can be scripted and the payoff is well worth it. For instance, steps 3-6 can be automated with [[http://tcztools.googlecode.com/|tcztools]] (not an official TC tool). Just for the record: |
<code>*.a *.h *.la *.m4 *.pc -> dev extension (after --strip-debug) | <code>*.a *.h *.m4 *.pc -> dev extension (after --strip-debug) |
*.so* -> main extension (after --strip-unneeded)</code> | *.so* -> main extension (after --strip-unneeded)</code> |
| **Note** *.la should not be used in the dev extension anymore. See [[http://forum.tinycorelinux.net/index.php/topic,26201.0.html|this topic]]. |
| |
===== Installing ===== | ===== Installing ===== |
If your software needs a startup script then create the folder for it | If your software needs a startup script then create the folder for it |
<code bash>mkdir -p /tmp/package/usr/local/tce.installed</code> | <code bash>mkdir -p /tmp/package/usr/local/tce.installed</code> |
Next, create script as **/tmp/package/usr/local/tce.installed/package_name** if you would like to do something when the package is first installed or again mounted on boot. | Next, create script as **/tmp/package/usr/local/tce.installed/package_name** if you would like to do something when the package is first installed or again mounted on boot. The first line of the script should be <code bash>#!/bin/sh</code> |
A good pattern to follow would be to first rename **/tmp/package/usr/local/etc/package_name.conf** to **package_name.conf.sample**, and for your script to check always whether /usr/local/etc/package_name.conf exists, and if no, copy over /usr/local/etc/package_name.conf.sample into it. This is so that the application's configuration files are fully writable in the natural path, without having to resort to weird paths that you determine on your own. | A good pattern to follow would be to first rename **/tmp/package/usr/local/etc/package_name.conf** to **package_name.conf.sample**, and for your script to check always whether /usr/local/etc/package_name.conf exists, and if no, copy over /usr/local/etc/package_name.conf.sample into it. This is so that the application's configuration files are fully writable in the natural path, without having to resort to weird paths that you determine on your own. |
e.g.: | e.g.: |