This is a question I recently asked in a comment at Slashdot. I didn't really get much of a response, so I decided I'd bring it to a place where I should have gone originally with it.

I'd like to put together a very fast booting Linux system, composed of just the bare minimum needed to be able to run something like BusyBox. I'm not one of those people who make a big deal out of boot times, I'm mainly interested from an academic point of view and am using this to try to learn a little more about how Linux works.

I've googled this topic and have found things like Linux From Scratch, but as far as I can tell these seem to have their own software on which you base whatever you're building. I was under the impression that all you need to boot is a file system, the Linux kernel, an initrd and then userland software for whatever you want to run. I've read that initrd isn't even needed if you compile SATA drivers into the kernel and maybe some other things. In fact I would say that another aim is to boot without using initrd at all, I only intend to use this on my computer for a bit of fun.

Are there any websites that contain a minimal list of things required to get Linux to boot?


The DistroWatch site has a lot of linux distribution references.
You seem to be interested in a light-weight (less stuff loading) installation to study.
The DamnSmallLinux edition might be one choice.
However, I'd suggest you look up the distros.


For more information on the booting process of computers in general and linux in particular have a look at these posts by Gustavo Duartes-

How Computers Boot Up and The Kernel Boot Process

Though slightly out-of-date you could also grab a copy of "Understanding the Linux Kernel" to get a more inside glimpse at the kernel architecture including the boot process.


it's true that an initrd isn't needed if you compile in the HD drivers.

but it's more fun the other way, using just the kernel and initrd, no other volume.

I've done this with busybox a couple of times, either because it was a very small box and i wanted it to go without HD, for a storage cluster, where each node had 4 drives all for storage (PATA at the time, so it was hard to connect more than 4), i setup a PXE server to provide the kernel and initrd.

it's very fun and instructive.


you may want to take a look at embedded linux. This article at linuxdevices and the follow up articles are a good intro.


"...Linux to Boot" (you may need to clarify this - Linux can "boot" with no userland tools at all)

basic CLI: throw ash/dash/sh in /bin in an initramfs and set init=/bin/sh on the kernel command line

simple init.c to go to desktop from my experiment here: http://murga-linux.com/puppy/viewtopic.php?p=590822#590822

#include <unistd.h>
#include <sys/mount.h>
#include <stdlib.h>

//these could be functions but gcc complains less this way 
#define EGGSACK(a)  ({if((fork())==0) execvp(a[0],a);})

int main(int argc, char** argv) {
static char **X={ "Xvesa", "-screen", "800x600x16", "-nolisten", "tcp", "-tst", NULL }

mount("/proc", "/proc", "proc", MS_MGC_VAL, NULL);
mount("/sys", "/sys", "sys", MS_MGC_VAL, NULL);
mount("/dev", "/dev", "devtmpfs", MS_MGC_VAL, NULL);
mount( "/dev/pts", "/dev/pts", "devpts", MS_MGC_VAL, NULL ); 
putenv("PS1=# ");

static char **jwm={ "jwm", "-display", ":0", NULL }

while(1) sleep(1); /*keep init alive*/

Notes: /sys /proc and /devpts are not absolutely necessary unless you need mdev, top/ps and a terminal respectively. /dev should fall back to being mounted as dev instead of devtmpfs if you plan to use a static /dev tree (included at the link along with minimal .config and filesystem tarball to make our BUILTIN initramfs ) You should mostly only need to add stuff to the kernel you want to support and not remove much at all - that .config was a bare minimum to boot to an X environment with terminal emulator support. It may be more appropriate to exit cleanly instead of looping - I was trying to minimize resource usage, but a fork exec wait for jwm (or your favorite wm) and then an execvp of "sh" would be sufficient.

/*here is a macro for a fork exec wait */
#define EGGSACKWEIGHT(a) ({int s,p;if((p=fork())==0){execvp(a[0],a);}else{while(wait(&s)!= p);}})
  • FYI The file structure was based on Rob Landley's aboriginal linux (which is more command line oriented minimalism) but adapted to Puppy's static /dev and some self-adapted multicall binaries and init. Similar distros (usually "floppy") don't exactly explain the process and are missing the key elements. – technosaurus Jul 25 '12 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy