Skip to main content

Building the perfect operating system for Raspberry Pi with Alpine Linux (I)

Jose CerrejonAbout 3 minRaspberry PIRaspberry PI

Building the perfect operating system for Raspberry Pi with Alpine Linux (I)

alpine-rpi
alpine-rpi

This weekend I tested an operating system that I almost always use in my Docker's containers and honestly, I hadn't even thought about using it in Raspberry Pi, since I don't remember today if there is any fork or operating system that takes advantage of the benefits that Alpine Linux offers us. My idea is to prepare an operating system with the minimum and necessary to be executed in memory and to put some scripts that get the system ready to be able to execute the tasks that I need: multimedia with Kodi, emulators with Retroarch or development environment with a system prepared to have a web server in which to program. You and me will think new scripts.

This is the first of a group of posts where I'll build an operating system using Alpine Linux for the Raspberry Pi. If you like the idea, you know... Come in without calling!


[ A little bit of my story ]

640kb
640kb

More than once I have commented on the blog: I'm obsessed with optimization. Already in MS-DOS I was one of those who wanted to reclaim the maximum amount of Kb from the famous 640Kb limit that my computer brought. In the Windows era, I was trying for weeks to disable services that I didn't use and to test the stability of the system until I got the memory to run only the programs that I needed at that moment, because if you don't use a printer, bluetooth, reporting services or multimedia keyboards, Why do you want those processes running there in the background? I want those megas for MY OWN BENEFIT! That's one of the reasons why I like the Raspberry: It's so small, with such fair specifications, that you have to think very well how to take advantage of all its potential. At least until they released a version with 4 Gb of RAM, but that's another story.

[ Alpine Linux ]

As it says on its website: Small. Simple. Secure. Alpine Linux is a security-oriented, lightweight Linux distribution. It usually takes up very little space since its goal is to run in RAM and be very secure. It is built with the musl libcopen in new window LIBRARY and BusyBoxopen in new window. It doesN't usually take up more than 130Mb once installed. The BusyBox is an executable with many utilities to 'talk' to the Linux Kernel and replaces more than 300 common commands. ALPINE comes with its own package manager and repositories maintained by themselves and the community. It has support for Raspberry Pi 4 since November and takes advantage of all potential that our beloved board offers on 64 bits.

The version I'm going to use is the 3.11.3 released on January 16th of this year. I don't bore you too much with this, but if you are interested, I leave the release info postopen in new window for you to see the changes.

[ Meet ALPINOS ]

AlpinOS
AlpinOS

As I said before, Alpine will give me the freedom to have just what I need: a fully optimized system to run in memory the bunch of programs I need: nothing else.

The name of my dystro came instantly to my mind, remembering those famous color pencils of my childhood from the brand Alpinoopen in new window.

The goal is the following: I burn my alpinOS distro, put the SD in the Pi, run a script to prepare the system with emulators because I feel like playing my favorite MS-DOS game Eye of the Beholder or MAME with Captain Commando. As everything runs from RAM, it disappears at every reboot, but we can choose to save everything if we want. Do you like the idea?. Me too.

[ Alternatives running in RAM ]

This is not the first time we have encountered an operating system that runs on the RAM. I have commented more than once on the distribution piCore or on desktop computers we have some very recognized as CoreOSopen in new window or Tiny Core Linuxopen in new window. You can visit Wikipediaopen in new window to get some more references.

Next week we will start rolling up our sleeves to get down to business and start developing my (our) ideal operating system. For now I leave you with the repo of a first Alpha version that I have prepared.

See you soon!

Link: Github.com > alpinOSopen in new window