[Show/Hide Left Column]
[Show/Hide Right Column]

Location : Tiny Core Linux > Remastering
Print

Remastering

Table of contents

Remastering TC

This guide assumes you are comfortable with the command line.

In the core there is a gzipped cpio archive. This can then be bundled along with the kernel for the boot method you like, for example an ISO image.

The remaster process can be done from inside TC (with advcomp.tcz loaded, and mkisofs-tools.tcz if you want to create an ISO image), or from any other Linux distribution that has the required tools (cpio, tar, gzip, advdef, mkisofs if making an ISO)

Note: advcomp is optional. If not installed, skip all the advdef commands.

Unpacking

First, get the kernel and tinycore.gz from the iso:

sudo mkdir /mnt/tmp
sudo mount tinycore.iso /mnt/tmp -o loop,ro
cp /mnt/tmp/boot/bzImage /mnt/tmp/boot/tinycore.gz /tmp
sudo umount /mnt/tmp

If you are going to create an ISO image, instead of copying only two files, copy everything:

sudo mkdir /mnt/tmp
sudo mount tinycore.iso /mnt/tmp -o loop,ro
cp -a /mnt/tmp/boot /tmp
mv /tmp/boot/tinycore.gz /tmp
sudo umount /mnt/tmp

Then, extract tinycore.gz for adding/removing something:

mkdir /tmp/extract
cd /tmp/extract
zcat /tmp/tinycore.gz | sudo cpio -i -H newc -d

Now, the full filesystem is in /tmp/extract. Feel free to add, remove, or edit anything you like.

Packing

If you are remastering 2.x where x <= 1 and you added any kernel modules then execute

sudo chroot /tmp/extract depmod -a 2.6.29.1-tinycore
You must use chroot because "depmod -b /tmp/extract" will not follow the kernel.tclocal symbolic link to find modules under /usr/local.

For versions 2.x where x >= 2 and later:

sudo depmod -b /tmp/extract 2.6.29.1-tinycore

If you added shared libraries then execute

sudo ldconfig -r /tmp/extract

Afterwards, pack it up:

cd /tmp/extract
find | sudo cpio -o -H newc | gzip -2 > ../tinycore.gz
cd /tmp
advdef -z4 tinycore.gz

It is packed at level 2 to save time. advdef -z4 is equivalent to about -11 on gzip.

You now have a modified tinycore.gz. If booting from other than a CD, copy tinycore.gz and the kernel to your boot device.

Creating an iso

If you would like to create an ISO image:

cd /tmp
mv tinycore.gz boot
mkdir newiso
mv boot newiso
mkisofs -l -J -R -V TC-custom -no-emul-boot -boot-load-size 4 \
-boot-info-table -b boot/isolinux/isolinux.bin \
-c boot/isolinux/boot.cat -o TC-remastered.iso newiso
rm -rf newiso

(NOTE: the mkisofs command line example above spans three lines, but is actually entered as ONE line)

TC-remastered.iso can now be burned or started in a virtual machine.

GUI Tools

You may find ISO Master (external link) useful. Its a GUI disk image editing tool, available in the repository as a .tcz extension.

Dynamic root filesystem remastering


Contributors to this page: bill thomson , Marcossp , helander , PingPing , bmarkus , danielibarnes , dentonlt , fab , thehatsrule and curaga .
Page last modified on Sunday 08 of August, 2010 18:30:31 MDT by bill thomson.

Menu [toggle]

Search Box (new)

in:

Navigate