Tiny Core Linux

From Leo's Notes
Revision as of 21:32, 4 February 2014 by Leo (talk | contribs) (Created page with "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 cr...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This page was last edited on 4 February 2014, at 21:32.

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


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 | cpio -i

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.

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 | cpio -o -H newc > ../core
cd ..
gzip core
advdef -z4 core.gz # this step is optional, but may save you ~2% of space.