Wednesday, December 18, 2024
ExplainerHow ToIoT HardwaresLinuxRaspberry PiTech/WebTutorials/DIY

piCore (Tiny Core) Linux on Raspberry Pi

Tiny Core, a unique and minimalist distribution of the Linux operating system and tools. piCore is the Raspberry Pi port of Tiny Core Linux, which is an independent system architected by Robert Shingledecker and now developed by a small team of developers with strong community support. As piCore runs entirely in RAM, boot media is not used after boot and there is no installation in conventional terms.

Tiny Core Linux is not a traditional distribution but a toolkit to create your own customized system. It offers not only flexibility, small footprint but a very recent kernel and set of applications making it ideal for custom system, appliances as well as to learn Linux specially on the Raspberry Pi.

Why is Tiny Core special?

Tiny Core is:

  • Very Small. At 10 megabytes, Tiny Core is 1/400 to 1/100 the size of the most widely used operating systems in the world (even compared to most Linux distros). That makes Tiny Core flexible enough to be stored and run from usb sticks, a just-about-full CD, or even embedded devices. hardware.
  • Linux. Tiny Core uses the Linux Kernel and a set of command-line (text interface) tools including busybox.
  • A GUI Desktop. Tiny Core has a flexible and fully-customizable Graphical User Interface Desktop. Mouse, keyboard, and screen support basically works out-of-the-box thanks to FLWM, the FLTK Desktop. You can also quickly install and try out a variety of other desktops and interfaces including Fluxbox, XFCE, OpenBox, IceWM, Joe’s WM, LXDE, and others.
  • Minimal. Tiny Core does not ‘ship’ with most end-user software. Instead, Tiny Core lets you quickly and easily compare, select, download, and install your preferred web browser, word processor, music player, and other software.
  • Unusually Stable. Every time Tiny Core loads, it is brand-spanking new. That means Tiny Core just doesn’t get a blue screen. Instead of installing programs into the system file space and risking damage to the system files, Tiny Core uses program ‘extensions’ that are re-prepared at each reboot … and they are prepared fast.
  • Unusually Fast. Unlike most operating systems, the Tiny Core can run completely from RAM. Individuals with RAM to spare can even use Tiny Core to load and run their programs from RAM (you didn’t know your computer could run Open Office and Firefox so quick). Experienced users can still install Tiny Core to disk, but Tiny Core can run in 48 megabytes of RAM … or less.
  • Internet ready. Tiny Core almost always finds your network card right right away. You’ll be adding applications and tools after an unusually quick boot. You can even come back here and ransack the forums if you find you need help.
  • Available even smaller. Linophiles that get things done without a GUI can get the MicroCore, a version of Tiny Core without X that is under 7 MB.
  • An open source community. Tiny Core is under active community development, led by a team of really dedicated people. You can find answers and ask questions in the forum, add your own experiences to the wiki, help add extensions (programs) to the Tiny Core Repository, and read enough Tiny Core to make your head spin.

Now Follow given Steps:

Step 1. Download the piCore image:

You can download the latest piCore image from the following download link (for this article I am using the piCore-9.0.3.zip image) –

http://distro.ibiblio.org/tinycorelinux/ports.html

2. Download and Install Etcher:

After downloading the piCore image, you need to flash it into the SD Card of your Raspberry Pi. Etcher is a great utility to flash the OS images into SD Cards or USB Drives. You can download it from Etcher home page –

https://www.balena.io/etcher/

Recommebded: Etcher – Flash OS images to SD cards & USB drives, safely and easily

3. Burn the piCore image into SD Card:

Connect your SD Card with your computer and use Etcher to flash it with OS.

4. Boot Raspberry Pi with piCore:

Connect the flashed SD Card on your Raspberry Pi and power it on.

5. SD Card Partitions:

The first partition (/dev/mmcblk0p1) is Win95 FAT32 (VFAT) type partition; it contains the basic piCore system and the Raspberry Pi boot loader, firmware and other support files. This partition is unmounted during operation, and the system does not use it after the boot process gets completed.

The second one (/dev/mmcblk0p2) is ext4 type partition; it is used for pre-installed extensions like ssh. However, the size of this partition is very small and it won’t allow you to install any additional extensions. You must expand this partition to have enough free space for additional extensions and backups.

6. Expand the /dev/mmcblk0p2 Partition:

6.1

Start fdisk partitioning tool as root, using the following command –

sudo fdisk -u /dev/mmcblk0

6.2

Now list partitions with ‘p‘ command and write down the starting and
ending cylinders of the second partition.

6.3 Delete the second partition with ‘d‘ command and then enter ‘2‘ as ‘Partition Number’.

6.4 Create a new partition using ‘n‘ command. Select ‘p’ for ‘Primary Partition‘ and ‘2‘ for ‘Partition Number’. For ‘First Cylinder’ use the same value as you had in the original partition (you made note of this value in step # 6.2). You may use the default value for ‘Last Cylinder’ or may use the smaller value if you want to create more partitions (for ex: swap disk).

6.5 Reboot the system using the following command –

sudo reboot

6.6

After the system boots up, expand the ‘/dev/mmcblk0p2‘ partition using the “sudo resize2fs /dev/mmcblk0p2” command –

tc@box:~$ sudo resize2fs /dev/mmcblk0p2
resize2fs 1.43.4 (12-Jun-2017)
Filesystem at /dev/mmcblk0p2 is mounted on /mnt/mmcblk0p2; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 104
The filesystem on /dev/mmcblk0p2 is now 13561088 (1k) blocks long.
tc@box:~$ 

With this, your Raspberry Pi is ready with piCore.

The default user ssh or shell user for piCore is “tc” and its default password is “piCore“.

For “root” user, login to piCore shell using “tc” user and run “sudo passwd” command to change the root password.

7. Reinstall SSH Extension

piCore comes with SSH extension included, if you aren’t careful during the partition expansion process, it may stop working (if you lose tce directory from /dev/mmcblk0p2 partition).

Install and Configure SSH

1. Install OpenSSH Package:

Install OpenSSH package using the following command –

tce-load -wi openssh

2. Create SSH Config from Template:

Copy the example configuration file into the ssh_config file using the following commands –

cd /usr/local/etc/ssh/
sudo cp ssh_config.example ssh_config

3. Start the SSH Service:

Start the SSH service using the following command –

sudo /usr/local/etc/init.d/openssh start

4. Change the “tc” User Password:

Change the Password for default “tc” user, so that you can enter this password on ssh user/password prompt. Use the following command to change the password –

passwd

Note: If you want to change the Root Password, you can switch to root using “sudo su” and then use the “passwd” command to change the root password.

5. Check the IP Address:

To ssh into your Tiny Core Machine you need the IP Address assigned to it. You can get hold of IP Address using the following command

ifconfig

6. Verify SSH Service:

You can grep the “sshd” (ps | grep ssh) process or you can check if your machine is listening on port 22 using the following command –

sudo netstat -anp | grep 22
tc@box:~$ ps | grep ssh
  861 root     /usr/local/sbin/sshd
  868 root     sshd: tc@pts/0
  930 tc       grep ssh
tc@box:~$ 
tc@box:~$ sudo netstat -anp | grep 22
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      861/sshd
netstat: /proc/net/tcp6: No such file or directory
netstat: /proc/net/udp6: No such file or directory
netstat: /proc/net/raw6: No such file or directory
tc@box:~$ 

7. SSH from a Client Machine:

From Linux client machine you can use ssh tc@IP_Address” command to login to your Tiny Core instance. On windows machines, you can use something like putty client for SSH login.


I hope you like this post”piCore (Tiny Core) Linux on Raspberry Pi”.

  Do you have any questions? Leave a comment down below! Thanks for reading. If you like this post probably you might like my next ones, so please support me by subscribing my blog.

Explore Some more Raspberry Pi Tutorials :


 

Harshvardhan Mishra

Hi, I'm Harshvardhan Mishra. Tech enthusiast and IT professional with a B.Tech in IT, PG Diploma in IoT from CDAC, and 6 years of industry experience. Founder of HVM Smart Solutions, blending technology for real-world solutions. As a passionate technical author, I simplify complex concepts for diverse audiences. Let's connect and explore the tech world together! If you want to help support me on my journey, consider sharing my articles, or Buy me a Coffee! Thank you for reading my blog! Happy learning! Linkedin

3 thoughts on “piCore (Tiny Core) Linux on Raspberry Pi

Leave a Reply

Your email address will not be published. Required fields are marked *