Tiny Core Linux

 

它的特點

Loads itself into RAM from storage, then mounts applications on storage, or installs applications to RAM from storage.

Homepage:

版本

  • Core(17 MB)
vmlinuz
core.gz
isolinux/*
  • TinyCore(23 MB)

Core system plus X/GUI extensions for a dynamic FLTK/FLWM graphical desktop environment.

  • CorePlus (248 MB)

Version

  • v14: kernel 6.1.2, glibc 2.36, gcc 12.2.0

Modes of Operation

  • Default Mode: Cloud/Internet
  • Mount Mode: TCZ/Install
  • Copy Mode: TCZ/Install + copy2fs.flg/lst

In Mount Mode:

  • Applications(*.tcz) are stored in "/opt/tce/optional"
  •  
  • Applications are optionally mounted on reboot (onboot.lst).

 


OS Info

 

version

showbootcodes
 


bootcodes

 

Help

At the boot prompt press [F2] and [F3] [F4].

codes

  • norestore
  • text
  • superuser
  • nodhcp
  • noutc               # BIOS is using localtime
  • tz=HKT-8         # Timezone
  • host=xxxx       # Set hostname to xxxx
  • showapps        # Display application names when booting
  • pause              # Pause at completion of boot messages

i.e.

# mc = microcore, isolinux.cfg 內的 Label 來.

mc showapps pause          

mc host=r2 superuser nodhcp

 


Timezone(bootcode tz)

 

 * this is an alternative to copying a file to '/etc/localtime'

tail -1 /etc/localtime

HKT-8

HKT              timezone name during standard time

-1                offset during standard time (i.e. 1h "ahead")

 


HDD

 

Support IDE / SATA DSK

IDE DSK 都會認成 /dev/sdX

 


Extensions

 

Boot CD, at first boot prompt press f2. Notice the line "tce={hda1|sda1} Specify Restore TCE apps directory"
This tce= boot option is only needed one time! The System will autoscan for it upon each boot.
However for faster booting, add the tce= boot option to your bootloader.

If you forget to boot with this option and are already at the desktop,
then from the icon launch bar select Control or the system menu ControlPanel.
Select Set TCE Drive and you will be prompted to select your drive partition for the tce directory.

Download extensions

List:

http://tinycorelinux.net/14.x/x86/tcz/

DL:

http://tinycorelinux.net/14.x/x86/tcz/X

常用工具

  • iperf3.tcz
  • iproute2.tcz
  • screen.tcz
  • tcpdump.tcz
  • socat.tcz
  • dropbear.tcz
  • openssh.tcz
  • bash.tcz
  • rsync.tcz
  • p7zip.tcz
  • parted.tcz
  • pci-utils.tcz
  • usbutils.tcz
  • ...

Load app to RAM - tce-load

* tce-load 只可以用於 non-root user (i.e. default 的 user tc)

# To download an application to the /tce/optional directory,
# but not put it in On Boot or On Demand, use

tce-load -w app_name.tcz

# To install an application, and put it in On Boot

tce-load -i app_name.tcz

# To download & install an application, and put it in On Boot

tce-load -wi app_name.tcz

# To download & install an application, and put it in On Demand

tce-load -wo app_name.tcz

# To load application, bug do not update boot.

tce-load -il app_name.tcz

update my extensions

tce-update

Store

If you are not using persistence, all downloaded extensions are stored in a temporary directory called /tmp/tce/optional.

/mnt/sda1/tce

Ways to specify the location of /tce

Using a boot option "tce=sda1"

 

 


filetool

 

 

filetool writes backup mydata.tgz. The location of mydata.tgz can be initially set using the boot option restore=hdXY,

If the restore code is no used, Tiny Core will search for mydata.tgz in available root directories at boot.

The list of stuff saved in mydata.tgz is found in a file called /opt/.filetool.lst, while the exclusions are in /opt/.xfiletool.lst.

# To run backup, open the terminal and use

filetool.sh -b

# To list files that will be in backup and their size, use

filetool.sh -d

# To find out where backup is saved, use

cat /opt/.backup_device

# To restore files in backup, use

filetool.sh -r

 


Assign Persistent Static IP Address

 

/opt/eth0.sh

#!/bin/sh
sleep 1
pkill udhcpc
sleep 1
ifconfig eth0 192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255 up
route add default gw 192.168.0.254
echo nameserver 192.168.0.254 >> /etc/resolv.conf

chmod 755 /opt/eth0.sh

echo '/opt/eth0.sh' >> /opt/.filetool.lst

echo '/opt/eth0.sh &' >> /opt/bootlocal.sh

 


Persistent directories (/home, /opt)

 

# mc opt=sda1 home=sda1

 

 


Recreate ISO

 

# Copy ISO 內的檔案

mkdir /mnt/iso

mount Core-14.iso /mnt/iso

cp -a /mnt/iso extracted_iso

umount /mnt/iso

... 修改 ...

 

# 建立 ISO

buildiso.sh

mkisofs -l -J -R -V myTCL \
  -no-emul-boot -boot-load-size 4 -boot-info-table \
  -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \
  extracted_iso > myTCL.iso

 

修改 Bootcode

extracted_iso/boot/isolinux/isolinux.cfg

 


Remaster

 

[1] load multiple initramfs images

based on the capability of the syslinux family bootloaders (syslinux, isolinux, extlinux, pxelinux)
 to load multiple initramfs images during boot.

If you are using Grub you could still use this method by chainloading from Grub to a syslinux family bootloader

[2] Remaster the tinycore.gz 1

add the extensions to /opt/tce/optional directory and list them in the /opt/tce/onboot.lst startup

Notes: more memory

[3] Remaster the tinycore.gz 2

extract the extensions directly in to the tinycore.gz

zcat /tmp/core.gz | sudo cpio -i -H newc -d

Load multiple initramfs images

The remaster content should be packed into a gzipped cpio archive.

my_root=/usr/src/tinycore/my_initramfs

cd $my_root

mkdir -p opt/tce/optional

cd opt/tce/optional

wget ...    # 下載所需的 App

.
./opt
./opt/tce
./opt/tce/optional
./opt/tce/optional/screen.tcz
./opt/tce/optional/openssh.tcz
./opt/tce/optional/socat.tcz
./opt/tce/optional/tcpdump.tcz
./opt/tce/optional/iperf3.tcz
./opt/tce/optional/iproute2.tcz
6307 blocks

ls -l *.tcz > ../onboot.lst

# 建立 initramfs

cd $my_root

find . -print0 | cpio -ov --null --format=newc | gzip --best > ../my_initramfs.gz

extracted_iso/boot/isolinux/isolinux.cfg

initrd /boot/core.gz,/boot/my_initramfs.gz

P.S.

  • initramfs, short for "initial RAM file system"
  • cpio (copy in and out) archive of the source file system

 


Install Tinycore on a Hard Drive

 

tce-load -wi tc-install

 

 

 

 

 

 

Creative Commons license icon Creative Commons license icon