created : 2010-01-26 updated : 2010-01-26
Linux From Scratch
Background :
LFS is a project of http://www.linuxfromscratch.org/
The purpose is to build a linux system starting from a blank partition, compiling everything from source, without using any pre-compiled binary.
You may learn a lot during the process. I started building an LFS 6.5 on 2010-01-26, and fully documented the process here.
You should always read the official PDF e-book first, then see what I actually typed. Most of the time they would be the same. But if you use a Virtual Machine as me, then my experience would be valuable.
Environment :
I used VirtualBox to build my LFS. First I install Ubuntu 9.10 to a virtual machine. Memory assigned was 384MB. The Virtual Disk image, which I named as Ubuntu9.vdi, is a little bit less than 8G. This size was chosen because it fit in a 8G USB drive. That make backup easier.
I also created a second disk image, lfs.vdi (also a little bit less than 8G) to build the lfs system. Both Ubuntu9.vdi and lfs.vdi are attached to the same virtual machine. After booting into the Virtual Ubuntu, issue the following command:
fdisk -l The result is somthing like :
-----------------------------------------------------------------------------------------
Disk /dev/sdb: 7516 MB, 7516192768 bytes Disk /dev/sdb doesn't contain a valid partition table Device Boot Start End Blocks Id System /dev/sda1 * 1 993 7976241 83 Linux /dev/sda2 994 1044 409657+ 5 Extended /dev/sda5 994 1044 409626 82 Linux swap / Solaris ----------------------------------------------------------------------------- /dev/sda is the Ubuntu disk image, containing 3 partitions, /dev/sdb is lfs.vdi, which is the blank disk image for build LFS
After booting into my Virtual Ubuntu, I first check my CPU speed.
cat /proc/cpuinfo Result :
model name : Genuine Intel(R) CPU T2050 @ 1.60GHz stepping : 8 cpu MHz : 1596.160 Checking memory :
top -n 1 Result :
Mem: 379960k total, 231304k used, 148656k free, 40028k buffers Swap: 409616k total, 0k used, 409616k free, 112288k cached Preparation :
export LANG=en_US.UTF-8 sudo bash screen -S LFS Change LANG to en_US to ensure the error message will be displayed in English.
"sudo bash" will open a new shell as root.
"screen" is a useful utility for sharing and saving terminal session.
Since I use putty to connect to the virtual Ubuntu, "screen" is important because once the connection is disconnected, the screen session can be restored after reconnection.
You may now proceed to read the Host System Requirements.
Linux from scratch : ebook
|