Tiny Core Linux: Difference between revisions
No edit summary |
added info on rebuilding mydata.tgz |
||
| Line 10: | Line 10: | ||
INITRD /images/core/core.gz | INITRD /images/core/core.gz | ||
}} | }} | ||
== Modifying {{code|mydata.tgz}} == | |||
If you are running TinyCore on a NFS share, you might not be able to modify the system and then save the changes like you normally would with {{code|filetool.sh -b}}. | |||
To modify {{code|mydata.tgz}} outside of the TinyCore environment: | |||
{{highlight|lang=terminal|code= | |||
# mkdir tce | |||
# chmod 755 tce # Make sure that the root directory is 755! | |||
# cd tce | |||
# tar --numeric-owner -xzpf ../mydata.tgz # Keep permissions and ownership! | |||
## make your changes | |||
# tar -czpf ../mydata.tgz * # Re-create the tarball with permissions | |||
}} | |||
Overwrite the old {{code|mydata.tgz}} on the NFS share and then test the changes on TinyCore by running: | |||
{{highlight|lang=terminal|code= | |||
# filetoool.sh -r | |||
}} | |||
Any changes you've made should be visible immediately. | |||
== Altering Initrd == | == Altering Initrd == | ||
Revision as of 23:47, 6 March 2017
TinyCore is a nifty linux distro that's extremely small. Similar to DamnSmallLinux, but even smaller.
Booting
If you use TinyCore with PXE, all you need to do is to create a menu entry with:
LABEL Core
MENU LABEL Core
kernel /images/core/vmlinuz
INITRD /images/core/core.gz
Modifying mydata.tgz
If you are running TinyCore on a NFS share, you might not be able to modify the system and then save the changes like you normally would with filetool.sh -b.
To modify mydata.tgz outside of the TinyCore environment:
# mkdir tce
# chmod 755 tce # Make sure that the root directory is 755!
# cd tce
# tar --numeric-owner -xzpf ../mydata.tgz # Keep permissions and ownership!
## make your changes
# tar -czpf ../mydata.tgz * # Re-create the tarball with permissions
Overwrite the old mydata.tgz on the NFS share and then test the changes on TinyCore by running:
# filetoool.sh -r
Any changes you've made should be visible immediately.
Altering Initrd
Extract
To remaster the base image with additional packages, do the following:
$ mkdir -p /tmp/tinycore/extract
$ mv core.gz /tmp/tinycore # where core.gz is the initrd file
$ cd /tmp/tinycore/extract
$ zcat ../core.gz
The extract directory should now contain the contents of the initrd file system.
Adding Additional Packages
To add additional packages to the system, download the .tcz files you want installed from the repository. Store them in /tmp/tinycore/packages, then run:
$ cd /tmp/tinycore/extract
$ for i in `ls ../packages/*.tcz` ; do unsquashfs -f -d . $i ; done
This will extract the squashfs package files and dump them into the root directory of the extracted initrd file system.
If you wish to run something on startup, put it in /opt/bootsync.sh or /opt/bootlocal.sh. /opt/bootsync.sh gets called by /etc/init.d/tc-config. Just note that networking might not be up immediately since the dhcp client runs asynchronously. I got around this by running while true ; do wget -O - http://somewhere.com && break ; done just to verify networking is up.
Remastering
With the changes made to the root file system, you will want to package the directory back up to create the initrd image. To do this, do:
$ cd /tmp/tinycore/extract
$ find