Tiny Core Linux Customizations for Remastering

The following list some tips and tricks to customize Tiny Core Linux for remastering as Mini Can Bike. These brief notes were last verified with Tiny Core 6.4.


ISO

Tiny Core can be downloaded as an ISO which provides the groundwork for remastering.

Extract ISO Contents

The ISO file can be mounted, and the contents can be copied to a directory.

  • Mount the ISO file to a temporary directory.
    sudo mount tinycore.iso /mnt/tmp -o loop,ro
  • Copy the contents (boot/ and cde).
    cp /mnt/tmp/* /tmp
  • Unmount the ISO file.
    sudo umount /mnt/tmp

Create Bootable ISO

mkisofs or genisoimage can be used to create a bootable ISO file.

  • Assuming /tmp contains the remastered files in folders /tmp/boot/ and /tmp/cde.
    genisoimage -l -J -V mini-canbike -no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -o mini-canbike.iso /tmp

core.gz

The core files for Tiny Core Linux are located in the compressed file /boot/core.gz.

Extract core.gz

  • Copy /boot/core.gz to a temporary directory.
    cp /tmp/boot/core.gz /tmpcore
  • Change to the temporary directory.
    cd /tmpcore
  • Uncompress core.gz.
    zcat core.gz | sudo cpio -i -H newc -d

Create core.gz

Assuming new core files are located in /tmpcore,

  • Change to the temporary directory containing the core files.
    cd /tmpcore
  • Find and compress the files.
    sudo find | sudo cpio -o -H newc | gzip -2 > core.gz
  • Further compress the files.
    advdef -z4 core.gz
  • Replace the old core with the new core.
    cp /tmpcore/core.gz /tmp/boot/core.gz

Application File (.tcz)

Tiny Core apps are Squashed files with the the extension “tcz”.

Extract a .tcz Application

Assuming there’s a file APP.tcz located in /tmpapp,

  • Change to the directory with APP.tcz
    cd /tmpapp
  • Unsquash APP.tcz.
    unsquashfs APP.tcz
  • Local directory squashfs-root, containing the app contents, will be created.

Create a .tcz Application

Assuming the file are located in /tmpapp/squashfs-root,

  • Change to the parent directory of squashfs-root.
    cd /tmpapp,
  • Squash the contents of squashfs-root
    squashfs squashfs-root/ APP_modified.tcz

Compile a .tcz Application

Programs can be compiled, and then squashed into a .tcz application.

  • Install compiletc.tcz and any other required libraries.
  • Compile the program to a temporary directory
    make DESTDIR=/tmpcompile/compiled_app
  • Change to the temporary directory
    cd /tmpcompile
  • Squash the files.
    mksquashfs compiled_app/ new_app.tcz

Special Directory /etc/skel

When installing a .tcz app, the file paths are usually respected and copied/loaded directly. However, for files to be installed into the user home directory /home/tc, a special directory /etc/skel is required.

For Example APP.tcz,

APP.tcz content is,
    |/etc/skel/.app/app.conf
    |/usr/local/bin/APP

Installation would be,
    APP.tcz:/etc/skel/.app/app.conf -> /home/tc/.app/app.conf
    APP.tcz:/usr/local/bin/APP -> /usr/local/bin/APP

Quick Launch Bar Icons

Tiny Core uses wbar, a simple and highly customizable quick-launch Panel. Applications are added if they have a .desktop file in /usr/local/share/applications/ and a icon image file.

For Example APP.tcz,

APP.tcz content is,
    |/etc/skel/.app/app.conf
    |/usr/local/bin/APP
    |/usr/local/share/applications/APP.desktop
    |/usr/local/share/pixmaps/APP.png

where APP.desktop contains,

   [Desktop Entry]
    Type=Application
    Name=APP
    Exec=/usr/local/bin/APP
    Icon=APP.png
    Terminal=false
    MultipleArgs=false
    X-FullPathIcon=/usr/local/share/pixmaps/APP.png
    Categories=Utility

and APP.png is 48×48 image.


Location of Key Files

The following is a list of key files used to modify Tiny Core.

core.gz

  • /etc/skel/.ashrc

wbar.tcz

  • /usr/local/bin/wbar_setup.sh

Xlibs.tcz

  • /etc/skel/.setbackground
  • /etc/skel/.Xdefaults
  • /etc/skel.xsession

TinyCore.iso

  • /boot/isolinux/isolinux.cfg
  • /cde/copy2fs.lst
  • /cde/onboot.lst