ErvKosch
Posts: 82
Joined: Thu Sep 01, 2011 3:40 pm

Re: Smallest Linux Install

Mon Nov 07, 2011 7:39 pm

There a different thread here about different small OS's that could run on the Ras-Pi. Will there be a mini command line distro just for the Ras-Pi? If so, which ones have people built so far?

The only thing I would ask is if it could have a simple apt-get like function so I can download new software.

User avatar
ukscone
Forum Moderator
Forum Moderator
Posts: 4155
Joined: Fri Jul 29, 2011 2:51 pm
Contact: Website

Re: Smallest Linux Install

Mon Nov 07, 2011 8:28 pm

I won't know 100% until I test it on real hardware but my openwrt build rootfs which seems to work on another armv6 device is approx. 3MB and runs in about 32MB fine

UnderSampled
Posts: 16
Joined: Sat Oct 29, 2011 9:29 pm

Re: Smallest Linux Install

Mon Nov 07, 2011 10:04 pm

We have an advantage that we are targeting this specific device, so all binaries in the package manager can be 100% compatible and tested. They can also leave out compatibility features.

mard0
Posts: 52
Joined: Wed Oct 26, 2011 4:23 pm

Re: Smallest Linux Install

Mon Nov 07, 2011 10:53 pm

I have a rootfs lying around here for a debian based printerserver on a i386 pc, it ofcourse has apt-get being debian. With cups and samba installed its about 178mb, but this is with all the locals and unnecessary doc's. You would probably be able to make a barebone debian with apt-get of under 100mb's

Blars
Posts: 88
Joined: Sun Aug 28, 2011 3:22 am
Contact: Website

Re: Smallest Linux Install

Tue Nov 08, 2011 7:36 am

Debian by default used to install with no GUI, but it may now require deselecting an option at install time. emdebian would of course be smaller, and should run on anything debian does. (You can install debian packages on emdebian.)

User avatar
psergiu
Posts: 223
Joined: Mon Nov 07, 2011 8:36 am
Location: TX, U.S.A. (was: RO, E.U.)
Contact: Website

Re: Smallest Linux Install

Tue Nov 08, 2011 1:08 pm

http://www.linuxfromscratch.org/

Customized Kernel + Busybox + /dev + config files in /etc = under 10Mb.

No compiler, no debug and .a libraries, no manpages, no documentation, no i18n.
No sysV init scripts - a single shell script started from inittab.
Remember to strip all the binaries.
Hand-compiled kernel with only the exact required modules (or no modules at all - everything required build-in). No initrd needed.

My personal record on i386 was 6Mb without busybox for a machine configured as router/firewall, ftp server & web server (thttpd)

kme
Posts: 448
Joined: Sun Sep 04, 2011 9:37 am

Re: Smallest Linux Install

Tue Nov 08, 2011 1:36 pm

Quote from psergiu on November 8, 2011, 13:08
Customized Kernel + Busybox + /dev + config files in /etc = under 10Mb.

No compiler, no debug and .a libraries, no manpages, no documentation, no i18n.
No sysV init scripts - a single shell script started from inittab.Yes this is certainly possible. The x86 thin client I work with goes exactly this route, and you can make a fully functional image with a 2.6 kernel, a slightly old X, USB support, network, international keyboard (but not full localization), a window manager and desktop icons and clients for SSH, RDP (Microsoft) and VNC in about 8 MB.

But this is in x86. I haven't a clue what it would be in ARM speak. The main reason I want a R-Pi: educate myself in ARM.

Johannes
Posts: 64
Joined: Sun Jul 31, 2011 8:05 pm

Re: Smallest Linux Install

Tue Nov 08, 2011 11:22 pm

Check out Buildroot:
http://buildroot.uclibc.org/

User avatar
clausmuus
Posts: 50
Joined: Thu Nov 10, 2011 1:54 pm
Location: Germany, Lübeck
Contact: Website

Re: Smallest Linux Install

Thu Nov 10, 2011 2:05 pm

The MiniDVBLinux Distribution http://www.minidvblinux.dyndns.org will run on a R-PI. Already it's running on a QEMU emulation. A console system needs at minimum 6MB and a x-org system 16MB.
MLD - a distribution also for the Raspberry-Pi

AlanCox
Posts: 31
Joined: Thu Nov 10, 2011 7:11 pm

Re: Smallest Linux Install

Thu Nov 10, 2011 8:28 pm

About the absolute minimum is busybox + kernel + ucLibc Pre-seed the kernel with device nodes or include devtmpfs. That will get you enough to actually bootstrap a lot of projects and stuff. It'll also build with a full glibc if you want to be able to drop on fullblown apps without mucking about.

There are plenty of embedded devices whose environment is essentially busybox + scripts + specific app (sometimes + an ssh daemon) and they are actually not unpleasant to hack on.In fact functionally they are probably better shell and scripting wise than many older Unixen !

Getting a bit bigger as well as buildroot you may want to look at Yocto which can be used to build embedded environments to a recipe and without sucking in all the usual junk of a random desktop OS. That really helps once you get a few dependancies and security updates and the like to juggle.

obarthelemy
Posts: 1399
Joined: Tue Aug 09, 2011 10:53 pm

Re: Smallest Linux Install

Thu Nov 10, 2011 9:04 pm

I'm in awe. Pliiiiiz guys, make us an premade image. I promise i'll get my hands dirty once I have one Pi working, I'll get another one just to FUBAR it.

User avatar
cnxsoft
Posts: 191
Joined: Sat Oct 15, 2011 2:33 pm
Location: Chiang Mai, Thailand
Contact: Website

Re: Smallest Linux Install

Fri Nov 11, 2011 5:01 am

I used debootstrap to create a minimal rootfs. But It's still over 100 MB.

newq
Posts: 1
Joined: Tue Nov 15, 2011 3:04 pm

Re: Smallest Linux Install

Tue Nov 15, 2011 3:10 pm

Quote from psergiu on November 8, 2011, 13:08
http://www.linuxfromscratch.org/

Customized Kernel + Busybox + /dev + config files in /etc = under 10Mb.

No compiler, no debug and .a libraries, no manpages, no documentation, no i18n.
No sysV init scripts - a single shell script started from inittab.
Remember to strip all the binaries.
Hand-compiled kernel with only the exact required modules (or no modules at all - everything required build-in). No initrd needed.

My personal record on i386 was 6Mb without busybox for a machine configured as router/firewall, ftp server & web server (thttpd)

Slightly off-topic here, but say I wanted to do a project like that on a pc, specifically how would I go about that? I seem to remember encountering a tutorial somewhere once, but that was years ago.

kme
Posts: 448
Joined: Sun Sep 04, 2011 9:37 am

Re: Smallest Linux Install

Tue Nov 15, 2011 3:27 pm

Slightly off-topic here, but say I wanted to do a project like that on a pc, specifically how would I go about that? I seem to remember encountering a tutorial somewhere once, but that was years ago.http://www.linuxfromscratch.org/

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: Smallest Linux Install

Fri Nov 18, 2011 11:36 am

Quote from clausmuus on November 10, 2011, 14:05
The MiniDVBLinux Distribution http://www.minidvblinux.dyndns.org will run on a R-PI. Already it's running on a QEMU emulation. A console system needs at minimum 6MB and a x-org system 16MB.

Can you post a link to the qemu machine image for download and test, I see no mention of it on the web site???

Also would be nice to see the build environment, I had a look at compiling linux for arm using angstrom a year back but never had time to do more than make a very simple image for an ipaq.

I think I still have the vmware disk image somewhere in my backup archive (was installed for ubuntu 8.04)

User avatar
clausmuus
Posts: 50
Joined: Thu Nov 10, 2011 1:54 pm
Location: Germany, Lübeck
Contact: Website

Re: Smallest Linux Install

Fri Nov 18, 2011 2:00 pm

You are right, there was no downloads for ARM systems. But now I have add a section for the ARM downloads. At the moment you can only find the system archives there.
http://www.minidvblinux.dyndns.....sub_id=918
In the svn, where you can find the sources of the whole distribution, are also some scripts available, that help you to setup a (ARM) debian development system under QEMU and to start the MLD archives. You can find this scripts at http://www.minidvblinux.dyndns.....trunk/ARM/

Claus
MLD - a distribution also for the Raspberry-Pi

matt_heys
Posts: 46
Joined: Fri Oct 28, 2011 5:58 pm

Re: Smallest Linux Install

Fri Nov 18, 2011 2:23 pm

Quote from AlanCox on November 10, 2011, 20:28
About the absolute minimum is busybox + kernel + ucLibc

+1 ucLibc produces smaller files than gcc. Not sure about ARM however

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: Smallest Linux Install

Fri Nov 18, 2011 6:03 pm

Quote from kme on November 15, 2011, 15:27
Slightly off-topic here, but say I wanted to do a project like that on a pc, specifically how would I go about that? I seem to remember encountering a tutorial somewhere once, but that was years ago.http://www.linuxfromscratch.org/

I just thought maybe I should give some tips (though I am no expert), Unfortunatly I am new to this forum and have not really looked around so maybe this is covered elsewhere??

Also I have not done much development in the last few years and this is from memory, so there are probably mistakes?

To compile something for the Pi you will need a toolchain to compile for arm.

I have used the http://www.angstrom-distribution.org/ angstrom distribution, and handhelds.org cvs (I think???)
You will need a linux distribution (I used ubuntu 8.04 last time I mess with arm compilation)

I tend to use vmware virtual machines for my devel projects (if anyone is interested I could maybe send the vmware disk images to boot a vmware machine from, unfortunatly would be well over 1Gb download with the angstrom source)

roughly speaking you apt-get all the required toolchain cross compilers etc... by following instruction on handhelds.org then configure your arm machine option and type 'make'

I think arm binarys come out a bit smaller than i386 code so a minimal distro for arm would be around 1mb?

I only ever got as far as compiling the gpe image for an ipaq hx4700.

As a side note I would love to see someone create a really simple to use minimal vmware compilation image that would make it really simple for people to just download and start compiling apps for the pi (or any other arm chip) on a standardised and common work environment . If anyone want to work on such a thing maybe could start work from my vmware image (though I doubt my image was ideal for purpose).

Reasons for this are a common environment makes everything simpler to support, it is possible to develop cross platform for an arm in windows or mac or any number of linux distros, but if everyone uses the same then there will not be problems with dependencie issues on different environments.

I only ever have a few hours to spare but will take time to look out my old image and make it available for download if anyone is interested.

obarthelemy
Posts: 1399
Joined: Tue Aug 09, 2011 10:53 pm

Re: Smallest Linux Install

Fri Nov 18, 2011 6:26 pm

(I removed your dupe with my magic mod powers).
There's a full ARM Debian simulator for Windows in my sig (thanks emercer !). A bit overkill for just compiling stuff, but that way you can test it too.
UKscone has made an i386 VM with an ARM toolchain: http://www.raspberrypi.org/for.....#038;t=454

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: Smallest Linux Install

Fri Nov 18, 2011 8:47 pm

Wow, always seems most things have been thought of or done before :)

Seems there is always a zietgeist in this world and people think in similar ways.

I forgot to mention ARM emulation, I was going to mention http://code.google.com/p/armware/ in the previous post but somehow forgot.

I think it should be possible to slim down a development virtual machine image to 600Mb with maybe 100 hours work, don't know if the effort is worth it to save all the bandwidth in download??

obarthelemy
Posts: 1399
Joined: Tue Aug 09, 2011 10:53 pm

Re: Smallest Linux Install

Fri Nov 18, 2011 9:00 pm

@mung: you keep double-posting. The forum software is a very old, cranky lady. Not as fast as she used to, so give it time before banging on that button again ^^

SlayingDragons
Posts: 67
Joined: Wed Sep 14, 2011 3:17 am

Re: Smallest Linux Install

Sat Nov 19, 2011 11:36 pm

Quote from psergiu on November 8, 2011, 13:08
http://www.linuxfromscratch.org/

Customized Kernel + Busybox + /dev + config files in /etc = under 10Mb.

No compiler, no debug and .a libraries, no manpages, no documentation, no i18n.
No sysV init scripts - a single shell script started from inittab.
Remember to strip all the binaries.
Hand-compiled kernel with only the exact required modules (or no modules at all - everything required build-in). No initrd needed.

My personal record on i386 was 6Mb without busybox for a machine configured as router/firewall, ftp server & web server (thttpd)

I've seen and have been particularly interested in doing LFS on the raspi, but are the steps and components the same for making LFS for ARM as they are for x86? As in I can follow the book except just cross-compile for ARM instead of x86 and use an arm kernel?

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: Smallest Linux Install

Sun Nov 20, 2011 5:18 pm

Quote from SlayingDragons on November 19, 2011, 23:36

I've seen and have been particularly interested in doing LFS on the raspi, but are the steps and components the same for making LFS for ARM as they are for x86? As in I can follow the book except just cross-compile for ARM instead of x86 and use an arm kernel?

I have never read the LFS docs, but my advice is avoid.

There is a huge amount of work required to compile from scratch and it has all been done before, it is a waste of time reinventing the wheel.

If you want to compile a specialised distro try gentoo.org (I have never used but I think would be your best first call?).

If you just want to learn about the internals of programming an OS tryminix3.org

If you just want an easy way to start ARM compiling and simulation try one of the virtual machines mentioned before (I hoped to look at them this weekend but have not yet, so dont know what they are like).

If you want to help make a compilable distro then maybe try adding some scripts to http://www.angstrom-distribution.org/ so that their auto build system can handle a Rpi build??

I think size is not so important these days for the OS, I think boot to X11 image should be easy to get under 1mb for ARM with a little work maybe kernel and root with busybox could be under 300kb?

Would be nice if there was some VM image that had a running Rpi ARM VM system that included all the source and compilation tools required to create itself.

I would imagine such a system could be under 50mb as a compressed VM image???

Minix is similar in this concept, and also http://soundproofingforum.co.u.....oofing.htm 2diskxwin has similar VM build system for tiny i386 linux (27mb rar ), though does not include the source code to compile the gcc compiler :(

As an irellevant side note:
I also remember someone actually created a real time compiled version of linux where the boot loader loaded tcc (tiny c compiler) the compiler then loaded and compiled the entire linux operating system from scratch at boot time.

kme
Posts: 448
Joined: Sun Sep 04, 2011 9:37 am

Re: Smallest Linux Install

Sun Nov 20, 2011 5:52 pm

Quote from mung on November 20, 2011, 17:18
I think size is not so important these days for the OS, I think boot to X11 image should be easy to get under 1mb for ARM with a little work maybe kernel and root with busybox could be under 300kb?That's about a factor ten too optimistic. The kirkwood kernel for Debian is 1,4 MB and the busybox package is 570 kB. Although these can be optimized directly for R-Pi I don't believe in cutting 90%. Also X is a very heavy system these days.

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: Smallest Linux Install

Sun Nov 20, 2011 7:18 pm

That's about a factor ten too optimistic. The kirkwood kernel for Debian is 1,4 MB and the busybox package is 570 kB. Although these can be optimized directly for R-Pi I don't believe in cutting 90%. Also X is a very heavy system these days.

I was thinking of the minimal size of the packages mentioned.
X11 and the linux kernel are fairly small if you exclude all the extra extensions and drivers.

If you can be bothered looking at the 2diskxwin you will see there is a fairly full featured i386 X11 distribution in 1.4mb (kernel=320kb, X11 vesa server 300kb, busybox 300kb, X11 libs and applications 600kb).

Most of the angstrom distributions are around 15mb if I remember correctly.

I am not an expert and am sure most of what I am saying is not exactly correct as its been years since I looked at this stuff, but its all roughly correct +-30%.

I really don't know much about ARM, I only know that ARM should be the way to go if there was more support and software available. I have unfortunately only had i386 hardware to hack on until recently.

Return to “General discussion”