Wednesday 11 May 2016

Hands-on with piCore 7.0: Tiny Core Linux for the Raspberry Pi


Tiny Core Linux, specifically tailored for the Raspberry Pi, now offers a new distribution that supports both Pi 1 and Pi 2 from the same media.

Tiny Core Linux now runs on the Raspberry Pi 1 and Pi 2 (pictured above) hardware.
Image: Raspberry Pi
This is going to be a tiny post (pun intended). The recent announcement of piCore Linux 7.0caught my eye -- I have been meaning to try Tiny Core on the Raspberry Pi. The fact that they now have one distribution which will run on both Pi 1 and P 2 hardware was just the impetus I needed to actually download it and give it a try.
First, what is Tiny Core Linux? It is one part of The Core Project, which produces very, very small Linux distributions. Their smallest distribution is about 10MB, a size I haven't seen since the days when I was loading 7th Edition Unix on a Motorola 68000-based system. The distribution is modular, so it is easy to add extensions. It actually comes in three basic packages:
  • Core, which is not much more than a Linux kernel and a minimal set of utilities, including a CLI interface.
  • TinyCore, which is Core with graphics and a basic GUI interface.
  • CorePlus, which is Core with a selection of window managers, a variety of common wireless network adapter drivers, and installation tools.
The Core family of distributions are not intended to be complete ready-to-use general purpose distributions. They are building blocks, or perhaps better described as the foundation onto which building blocks can be added, to create whatever kind of system you want.
The new release of piCore includes Linux kernel 4.1.13, which is quite recent, that's good. It also has SSH pre-installed and configured, and the SSH server starts on boot, so you can access the system remotely.
The piCore distribution is in the Core family, so it has only a command-line shell (CLI) interface, as I mention below during installation. The modular design makes it easy to add the GUI package and get a simple graphical desktop, as I also show below.
The piCore distribution image can be obtained as a 34MB ZIP file from their downloads page. This is not an installer, it is a raw SD card image of the installed system. All you have to do is unzip it, then copy it directly to an SD card using dd. You can then simply put the SD card into a Raspberry Pi and boot it. Kernels for both Pi CPU architectures are included in the image, and the boot configuration file will figure out which image to boot.
Because of the way the Raspberry Pi boots, the piCore image includes a small FAT32 filesystem with the actual boot images and such, followed by an ext4 filesystem where extensions, backups, user files and the like can be kept. This ext4 filesystem is initially very small, so that the distribution image can be written to very small SD card (as small as 512MB), but for a normal system with a typical SD card, you are probably going to want to increase that size.
There are instructions in the README file explaining how to do this after you have booted the piCore image, but if you are writing the SD on another Linux system, it is much easier to take care of this using gparted (or your favorite disk/parition management tool) before you boot piCore the first time.
Once you have dumped the raw image to an SD card, all you have to do is stick that in the Raspberry Pi (any model), and plug it in. There is no "installation" or installer program in the typical sense of other Linux distributions, and there is no "first run" script for configuration.
It boots fast -- very fast, even compared to Raspbian and especially compared to Ubuntu MATE - but it only comes up to a shell prompt. Depending on who you are, where you are, what you want and/or expect, and what you plan to do with piCore, your setup might be done at this point. But there are a number of limitations and restrictions:
  • If you want a graphical user interface (GUI), you have to add the necessary extension, see below.
  • The initial image only supports a wired network connection. If want or need wireless networking, you have to add the necessary extensions for your wireless adapter.
  • piCore initially uses a compressed swap file in RAM, allocating 25% of the total memory to swap. If you need a bigger swap space, or you don't want to give up that much memory for swap, you need to create a swap partition on the SD card. This can also be easily taken care of while creating the card and expanding the ext4 partition above.
  • The keyboard is assumed to be a US Ascii layout. If you have something else, you will have to adjust that accordingly, see below.
  • Other system parameters, such as timezone, language and locale will have to be adjusted as necessary.
piCore boots entirely to RAM, and it actually unmounts the boot partition once it is running, so you can even remove or replace the SD card after booting if you want. That's pretty cool.
The most common next step is installing a GUI package. This turns out to be surprisingly easy, all you have to do is use the tce-load utility to install the TC.tcz extension:
tce-load -iw TC
Note that the extension name is upper-case, and this command is case-sensitive. The -iwoptions tell tce-load to download and install this extension, and to put it in the OnBoot list so that it will automatically be available in the future. After this command finishes, you can start the GUI with startx, or you can just reboot the Pi and it will come up with the GUI running.
piCore
piCore Linux 7.0
Well, I have to say that is pretty impressive. The Raspberry Pi running piCore is very fast. I'm pretty sure that is because piCore has eliminated the biggest bottleneck in ordinary use of the Raspberry Pi -- the SD card. By running only from RAM and unmounting the SD card after booting, piCore makes itself much faster other Linux distributions for the Raspberry Pi.
piCore is certainly not for everyone -- but then again neither is Tiny Core, or any of the other Core distributions, for that matter. piCore is intended for intermediate to advanced Linux users who want a solid base on which to build their own system, making it exactly what they want.
If you are interested in piCore, give it a try. It is dead easy to download and install, you should be able to have it up and running within 10 minutes. Be prepared to dig around on the web for information about piCore, don't forget to check the Wiki for more information, and don't be shy about asking for help and information in the Forums.
Good luck!

Frugal Install Tiny Core Linux

Frugal Install Tiny Core Linux

0. Introduction
1. Start the installation
2. Browse to the install files
3. Formatting
4. Bootcodes
5. CorePlus installation options
6. Tiny Core installation options
7. Install
8. Testing




0. Introduction

The first step before you install any operating system such as Tiny Core is to back up everything on your computer before starting.
Before making the commitment to perform a frugal install you should consider our Quick and Easy Overview. It covers the basics of running Tiny Core from CDROM and/or USB pendrive. Most will find learning Tiny Core the quick and easy way a better starting point.
But for those who are ready to take the plunge to frugal, this guide shows step by step information on how to install TC via the installer. The older instructions for a manual install are still available, but using the installer is recommended.
The guide assumes you've either booted the CorePlus CD, or have installed the tc-install extension (tc-install.tcz)
Keep in mind that this guide is basic and that the user may choose to adapt, remove and/or add parts as desired.
The installer is also applicable to USB sticks and other external media.
Note: If you already have a Linux System booting, then you do not need to make a partition for Tiny Core! Tiny Core can run in a single directory in your existing Linux installation. To do so, at step 1, uncheck the option to "Install boot loader". At step 2, select an existing partition, and at Step 3, do not format it. Upon completion you will need to manually configure your existing boot loader. 


1. Start the installation

Open the installer:
installer
It can also be started via the shell or Run icon by typing "tc-install".
version



2. Browse to the install files

Browse to /mnt/device/boot and select the core.gz file.
browse
With the source selected, pick the desired install type and target. We're going to install to an empty hard drive.
If using an existing partition, tick the box to mark it active to have it bootable.
target



3. Formatting

Format the new partition. It's recommended to pick one of the ext* options to support linux permissions.
fstype



4. Bootcodes

If you want to use additional bootcodes, enter them now. Otherwise leave this blank.
The example bootcodes set a framebuffer resolution and disable wbar icons.
bootcodes
Note that you can edit them any time after the install in the bootloader's config file, usually extlinux.conf.



5. CorePlus installation options

If you are installing from the CorePlus CD you will see an additional screen asking which extensions from CorePlus you would like to install. Note that you will only see this screen if running the installer from a CorePlus CD.
bootcodes
The selected extensions will be installed.



6. Tiny Core installation options

If you are installing from the Tiny Core CD you will see an additional screen asking which directory extensions should be installed from. You should select the cde or tce directory that contains the extensions that you would like installed. For example, if the Tiny Core CD is mounted on /mnt/sr0 you should select /mnt/sr0/cde
Note that you will not see this screen if installing from CorePlus.
bootcodes
All extensions from selected directory will be installed.



7. Install

If everything's OK, click on proceed:
proceed
The time required will depend on the size of your hard drive.



8. Testing

ready
TC is now installed!
Remove the original CD boot media and reboot.
Note: the system may need to be configured to boot hdX first in the BIOS.