Very basic Linux

These links should help you in your quest to understand how Linux ‘ticks’.

http://ftp.lanet.lv/ftp/mirror/Slackware/bootdisks/

If you download the kernel ‘bare.i’ from the Slackware/bootdisks link, then put it on a floppy with :-

dd if=bare.i of=/dev/fd0
you will then have a floppy with a linux kernel that can partially boot.

“I managed to get this far on Sunday!- Colin”

This endorsement from Colin indicates that the download link works, the ‘dd’ command works and the resulting floppy disk boots.

Now we need to use this command on a second floppy disk, this will format the disk.

fdformat /dev/fd0

Then create a file system on the second floppy disk.

mkfs.ext2 /dev/fd0

Having made the file system, the floppy needs to be ‘mounted’.

mount /dev/fd0 /mnt/floppy

If /mnt/floppy does not exist, it needs to be created.

Finally, the file hierarchy needs to be created on the floppy. Follow the instructions here :-

http://www.tldp.org/HOWTO/Bootdisk-HOWTO/buildroot.html

Overview of above instructions :

A root filesystem must contain everything needed to support a full Linux system. To be able to do this, the disk must include the minimum requirements for a Linux system:

The basic file system structure,

Minimum set of directories: /dev, /proc, /bin, /etc, /lib, /usr, /tmp,

Three of these directories will be empty on the root filesystem, so they only need to be created with ‘mkdir’ (make directory). The /proc directory is basically a stub under which the proc filesystem is placed. The directories /mnt and /usr are only mount points for use after the boot/root system is running. Hence again, these directories only need to be created. The rest need special attention see instructions at the buildroot link.

I tried this on Saturday (9th April) but I got a message saying the directories could not be created as they already existed, but I could only find Lost & Found. It later transpired I must have been looking at my Laptop Hard Drive rather than on the floppy, but I still had problems. I’d like to try the uncompressed variety when we next meet, but sadly think I need a little more “handholding” as to how exactly to do it (sorry Mike!)

Basic set of utilities: sh, ls, cp, mv, etc.,

Minimum set of config files: rc, inittab, fstab, etc.,

Devices: /dev/hd*, /dev/tty*, /dev/fd0, etc.,

Runtime library to provide basic functions used by utilities.

Look here for full details:-

http://www.tldp.org/HOWTO/Bootdisk-HOWTO/x1014.html#NONRAMDISKROOT

http://www.tldp.org/HOWTO/Bootdisk-HOWTO/x88.html

to find how to build a basic file system (root disk). These two disks combined make a ‘very’ basic linux system.

Then maybe add some basic tools:-

http://busybox.net/FAQ.html#whatis

Start by learning how to strip a working system down to the bare essentials needed to run one or two commands, so you know what it is you actually need. An excellent practical place to do this is the Linux BootDisk Howto, (link above) or for a more theoretical approach try From PowerUp to Bash Prompt.

To learn how to build a working Linux system entirely from source code, the place to go is theLinux From Scratch project.

http://www.linuxfromscratch.org/

They have an entire book of step-by-step instructions you can read online or download. Be sure to check out the other sections of their main page, including Beyond Linux From Scratch, Hardened Linux From Scratch, their Hints directory, and their LiveCD project. (They also have mailing lists which are better sources of answers to Linux-system building questions than the busybox list.)

If you want an automated yet customizable system builder which produces a BusyBox and uClibc based system, try buildroot, which is another project by the maintainer of the uClibc (Erik Andersen). Download the tarball, extract it, unset CC, make. For more instructions, see the website.

http://buildroot.uclibc.org/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s