Advertisement
     
 
 
Search:
General | Linux Hacking | Linux Networking | Linux Security | Windows Hacking
       
Building your own Linux distro PDF Print E-mail
Written by LE Webmaster   
Wednesday, 26 January 2005
Ever wanted to build your own linux distribution, or just want a linux system without all the bullshit or maybe u want to look in the real engine room of linux ? If the answer is yes, lets build a linux system from scratch (LFS) :-)
I'm not going to destribe how to create a LFS system because thats excellent described in the official LFS book by Gerard
Beekmans, this article will give u hints about:


Making the partitions.
Solving compile errors.
When u made it.

Read the book @ http://www.linuxfromscratch.org/view/cvs/ and download the packages when said so.
The official website is, as u prolly guessed : www.linuxfromscratch.org

I installed LFS in 4 days, with problems, of course.
Dont expect everything to work, dont give up on dilema's.
My main motivation to set up LFS was the idea that i would learn how linux exactly works, the engine room.
And i sure did learn alot!

I built LFS on a Intel P4 - 2 GHz , with win2k and SuSE 7.2 installed and the LFS version used in his article is 4.1.


Making the partitions
---------------------


You need a linux installation before you can start building your own LFS system.

I created the LFS partition on my win2k box with partition magic, 1 ext2 partition and 1 ext2 swap partition.

After you created the partitions successfully, boot in your linux distro and read the book, or download it first and read it
local.

If you cant access the internet with your current linux installation, download the software mentioned in chapter 2.4 to your
windows partition and mount the drive in linux to access the packages.

Now you should continue with the books, and hopefully, you dont need to read the next section :-)

Note: their is also a perl script available that can automate the creation of an LFS system for you , its at

http://automated.linuxfromscratch.org , but hey, what u learn from that?? (Although its nice to build other systems with it

after u set up one urself!)


Solving compile errors
----------------------

I was compiling package after package successfully and was thinking, ohh yeah, if this continues, i'll have my LFS tonight!
But then, in the cold winter of '67 , it was cold and dark outside and the wind ehhh.., then I started to install Perl and

BOOOM :S.

make error: 'Can't find your cwd!'

I thought, uh oh, what the phuck is this :(

After looking for ppl posting similair problems the whole day, i only found 2 posts, but nobody helped those 2 dudes.
I mailed the authors of the posts to ask them if they ever sold their probs, but none of the 2 replied me.
I really got frustrating after 2 days and mailed the LFS-support list, Gerard told me to install strace to trace the

functions that the perl script was trying to access. After digging in the make logfile, i found that it tried to get the

current working directory (cwd) via the 'pwd' shutils function. Hmm, the return value was 'No such file or directory'.
Weird, i installed sh-utils , right? a search for 'pwd' on my LFS partition returned 0 results.. ahh . so sh-utils didnt

build well on my system, and it still didnt. I compiled the sh-utils on my SuSE system and copied the (staticly linked)

binaries to my LFS partition, and viola , the make script worked!!!

The clue in this story is, never give up, i was planning to give up, but the idea that keep me driving was, 'learning',

while solving the problem i learned shitloads about *nix config files and utilities.

Also make sure the following if your building software:

Do i have all the current patches applied to my system ?
is the $LFS variable set, if no, type: LFS=/mnt/lfs
Hint: use Gerard's method, edit your bash profile to autoset the variable, how? read it in the LFS book


Chapter 6 > :

Did I enter the chroot shell correctly?
Is the proc filesystem mounted?
If its an depency problem, is the software staticly linked ???

When u made it
--------------

After you installed the software correctly, be very carefull with building the kernel!!
I copied some of my SuSE config files to my new system (like network config relating files and /etc/fstab) , thank God that

my realtek card gets detected on the LFS system.

Also be carefull with the LILO part, it could screw up your MBR (master boot record).

After you compiled ur kernel, configured LILO, and booted ur new shiny system its time to do whatever u want with it!
Dont forget to look into the Beyond LFS book located at http://beyond.linuxfromscratch.org/ for some nice guides on installing software.

Personally, i'm setting up the Xwindow system , and then i'm planning to configure gnome.
After that i'm going to write LKM (loadable kernel modules) for linux to have complete control over my system...

Good luck with your uber 1337 system, and maybe, who knows, i'll host my pr0n 0s shitty v.1.0 linux distro on box ;)

LFS: www.linuxfromscratch.org
Book (CVS): http://www.linuxfromscratch.org/view/cvs/
Beyond LFS: http://www.linuxfromscratch.org/
LFS mailing list: http://archive.linuxfromscratch.org/mail-archives/
LFS on irc: irc.linuxfromscratch.org:6667

Greetings to everybody i know on irc.box.sk! (too much names to type here, and i'll forget ppl for sure)

P.S Dont mail me with ur LFS probs, mail to one of the LFS mailing lists instead!


Add as favourites (137)

  Be first to comment this article

Write Comment
  • Please keep the topic of messages relevant to the subject of the article.
  • Personal verbal attacks will be deleted.
  • Please don't use comments to plug your web site. Such material will be removed.
  • Just ensure to *Refresh* your browser for a new security code to be displayed prior to clicking on the 'Send' button.
  • Keep in mind that the above process only applies if you simply entered the wrong security code.
Name:
Comment:

Code:* Code

 
< Prev   Next >
 
© Copyright 2002-2008 - Linux Exposed - Sponsored by ConsultPlanet http://www.consultplanet.nl - Contact Linux Exposed