Tiny Core Linux

From OLPC
Revision as of 23:37, 30 March 2014 by Quozl (talk | contribs)
Jump to navigation Jump to search

Tiny Core Linux is a minimal Linux distribution, designed for on-demand software loading. This page describes builds of Tiny Core Linux for the OLPC XO. For more information on Tiny Core Linux, see http://tinycorelinux.com

People involved:

  • James Cameron,
  • Yioryos Asprobounitis,
  • George Hunt and;
  • Jerry Vonau.

Core 4.7.7 2013-06-25

Announcing a build of Tiny Core Linux for OLPC XO.

Useful for testing and diagnosis without touching the internal storage.

Features

  • runs on XO-1, XO-1.5, XO-1.75, or XO-4,
  • configured for a single root shell in text mode, with alternate consoles available for login,
  • based on Core 4.7.7, uses the OLPC kernel from 13.2.0-8, and includes latest signed Open Firmware versions for automatic upgrade,
  • includes wireless firmware for each laptop, and wireless tools from Tiny Core Linux.

Downloads

Prepare USB Drive

  • select a USB drive of at least 128 MB capacity, (it may have either a FAT or ext2 filesystem),

Linux - GNOME and Firefox

  • insert the USB drive,
  • click on the zip file link above, and a dialog window will appear asking you what you want done with the download,
  • accept the default to open it in Archive Manager, and the Archive Manager window will appear,
  • click on Extract, and a dialog window will appear asking you where to extract to,
  • click on the USB drive in the Places list, then click on the Extract button, a dialog window will appear to tell you it worked,
  • close the dialog window,
  • close the Archive Manager window,
  • close the Downloads window,
  • eject the USB drive.

Linux - Terminal

  • download the zip file using the link above, to the USB drive:
cd /run/media/olpc/FRED
wget ${URL}
  • extract the zip file, at the top of the USB drive:
cd /run/media/olpc/FRED
unzip core-4.7.7-xo-2013-06-25.zip
  • delete the zip file if you like, it is not required further,
rm core-4.7.7-xo-2013-06-25.zip
  • eject the USB drive:
umount /run/media/olpc/FRED

Mac OS X

  • insert the USB drive,
  • control-click on the link above, select Download Linked File As ..., and a Save As dialog will appear,
  • change Where to the name of the USB drive, usually Untitled, then click on Save, the dialog will go away,
  • switch tasks to Finder, display the USB drive,
  • double-click on the zip file, and the contents will be expanded, a new folder boot will be created,
  • delete the zip file if you like, it is not required further,
  • eject the USB drive.

Windows

  • download the zip file,
  • insert the USB drive,
  • use WinZip or other operating system features to expand it onto the USB drive,
  • eject the USB drive.

Prepare laptop

  • ensure the laptop is unsecured, or sign the kernel and initrd files with your deployment keys,
  • insert the USB drive into the laptop,

Boot laptop

  • turn on the laptop, and the USB drive will be automatically read,
  • after a short wait you will see the Tiny Core Linux system prompt:
root@box:~# 
  • you may remove the USB drive.

Tiny Core Linux is now ready for your commands.

Configure wireless

  • identify the wireless adapter interface name:
iw dev
  • expected values vary:
laptop adapter kernel modules interface name
XO-1 Marvell 8388 libertas usb8xxx wlan0
XO-1.5, XO-1.75, XO-4 Marvell 8686 libertas libertas_sdio wlan0
XO-4 Marvell 8787 mwifiex mwifiex_sdio mlan0
  • scan for networks:
iw dev mlan0 scan
  • associate with an open network:
iw dev mlan0 connect network
  • configure the interface using DHCP:
udhcpc -i mlan0

Configure wired USB ethernet after boot

  • insert USB ethernet adapter,
  • configure the interface using DHCP
udhcpc

Installing additional utilities

  • additional utilities needed for a task can be installed:
su -c 'tce-load -wi rsync' tc

See the Tiny Core Linux documentation for more detail.

Additional shells

  • additional shells can be started using Alt/F2, username tc.

Access to XO-1 filesystem

  • you can mount and investigate the XO's JFFS2 flash filesystem, for example:
cat /proc/mtd
mkdir /mnt/root
mount -t jffs2 mtd0 /mnt/root

Access to XO-1.5, XO-1.75 and XO-4 filesystem

  • you can mount and investigate the XO's eMMC or microSD filesystems, for example:
cat /proc/partitions
mkdir /mnt/boot /mnt/root
mount /dev/mmcblk0p2 /mnt/boot
mount /dev/mmcblk0p2 /mnt/root

Backup and Restore

See Backup for how to use Tiny Core Linux for backup and restore of a laptop.

Reversion

See Reversion for how to use Tiny Core Linux to revert an XO with OLPC OS to a pristine filesystem configuration, as if it had just been installed. This can be used to quickly clean a set of class specific or loaned laptops.

Remote Diagnosis

su -c 'tce-load -wi openssh' tc
  • configure OpenSSH server with defaults:
cd /usr/local/etc/ssh && cp sshd_config.example sshd_config
  • start the OpenSSH server:
/usr/local/etc/init.d/openssh start
  • wait for new host keys to be generated,
  • change the password for the user tc:
passwd tc
  • find the IP address of the laptop:
ifconfig
  • set up inbound port forwarding on router if required,
  • connect your OpenSSH client,
ssh tc@$IP

See also remote diagnosis using firmware only.

Boot from JFFS2 on XO-1

Mount the JFFS2 filesystem, save the original boot directory, and make a new one:

mkdir /mnt/root
mount -t jffs2 mtd0 /mnt/root
mv /mnt/root/boot /mnt/root/boot.orig
mkdir /mnt/root/boot

Mount the USB drive, and copy the required files to the JFFS2 filesystem:

mount /dev/sda1 /mnt/sda1
cp /mnt/sda1/boot/olpc.fth /mnt/root/boot/
cp /mnt/sda1/boot/initrd.x86 /mnt/root/boot/
cp /mnt/sda1/boot/vmlinuz.0 /mnt/root/boot/

Release the filesystems, remove the USB drive, and reboot:

umount /mnt/sda1
umount /mnt/root
reboot

References