• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

LFS Build Journal

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

Stratus_ss

Overclockix Snake Charming Senior, Alt OS Content
Joined
Jan 24, 2006
Location
South Dakota
I thought I should put some of this down in case anyone wishes to follow in the LFS foot steps.

My system Core I7 860
6 gigs of ddr 3
Nvidia GTX 260
2 gigabit nics (intel and realtek)

Base system Ubuntu 10.10 32 bit-pae
Virtualbox 3.2.10

LFS livecd as the initial "host"

My initial motivation for this is purely education as with most people I don't plan on using this for a day-to-day system and thus I put it in a VM so that I could follow along with the instructions on one screen and the VM in another.

Initial thoughts:

I first thought that I would be able to cut and paste between the VM and the browser to make things easier. No such luck, this is in part because I was running off a livecd which means that guest-addons (which usually requires a reboot) would not stick; and also partly because the livecd is very old (2007ish)

You need a lot of source files and for those who are following with a basic livecd like myself I wrote a couple of quick wget scripts to get the correct files

Code:
#!/bin/bash
wget http://people.redhat.com/eblake/autoconf/autoconf-2.67.tar.bz2
wget http://ftp.gnu.org/gnu/automake/automake-1.11.1.tar.bz2
wget http://ftp.gnu.org/gnu/bash/bash-4.1.tar.gz
wget http://ftp.gnu.org/gnu/binutils/binutils-2.20.1.tar.bz2
wget http://ftp.gnu.org/gnu/bison/bison-2.4.3.tar.bz2
wget http://www.bzip.org/1.0.5/bzip2-1.0.5.tar.gz
wget http://ftp.gnu.org/gnu/coreutils/coreutils-8.5.tar.gz
wget http://ftp.gnu.org/gnu/dejagnu/dejagnu-1.4.4.tar.gz
wget http://ftp.gnu.org/gnu/diffutils/diffutils-3.0.tar.gz
wget http://prdownloads.sourceforge.net/e2fsprogs/e2fsprogs-1.41.12.tar.gz
wget http://prdownloads.sourceforge.net/expect/expect-5.44.1.15.tar.bz2
wget ftp://ftp.astron.com/pub/file/file-5.04.tar.gz
wget http://ftp.gnu.org/gnu/findutils/findutils-4.4.2.tar.gz
wget http://prdownloads.sourceforge.net/flex/flex-2.5.35.tar.bz2
wget http://ftp.gnu.org/gnu/gawk/gawk-3.1.8.tar.bz2
wget http://ftp.gnu.org/gnu/gcc/gcc-4.5.1/gcc-4.5.1.tar.bz2
wget http://ftp.gnu.org/gnu/gdbm/gdbm-1.8.3.tar.gz
wget http://ftp.gnu.org/gnu/gettext/gettext-0.18.1.1.tar.gz
wget http://ftp.gnu.org/gnu/glibc/glibc-2.12.1.tar.bz2
wget http://ftp.gnu.org/gnu/gmp/gmp-5.0.1.tar.bz2
wget http://ftp.gnu.org/gnu/grep/grep-2.6.3.tar.gz
wget http://ftp.gnu.org/gnu/groff/groff-1.20.1.tar.gz
wget ftp://alpha.gnu.org/gnu/grub/grub-1.98.tar.gz
wget http://ftp.gnu.org/gnu/gzip/gzip-1.4.tar.gz
wget http://sethwklein.net/iana-etc-2.30.tar.bz2
wget http://ftp.gnu.org/gnu/inetutils/inetutils-1.8.tar.gz
wget http://devresources.linuxfoundation.org/dev/iproute2/download/iproute2-2.6.35.tar.bz2
wget http://ftp.altlinux.com/pub/people/legion/kbd/kbd-1.15.2.tar.gz
wget http://www.greenwoodsoftware.com/less/less-436.tar.gz
wget http://www.linuxfromscratch.org/lfs/downloads/6.7/lfs-bootscripts-20100627.tar.bz2
wget http://ftp.gnu.org/gnu/libtool/libtool-2.2.10.tar.gz
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.35.4.tar.bz2
wget http://ftp.gnu.org/gnu/m4/m4-1.4.14.tar.bz2
wget http://ftp.gnu.org/gnu/make/make-3.82.tar.bz2
wget http://download.savannah.gnu.org/releases/man-db/man-db-2.5.7.tar.gz
wget http://www.kernel.org/pub/linux/docs/manpages/Archive/man-pages-3.25.tar.bz2
wget http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/module-init-tools-3.12.tar.bz2
wget http://www.multiprecision.org/mpc/download/mpc-0.8.2.tar.gz
wget http://www.mpfr.org/mpfr-3.0.0/mpfr-3.0.0.tar.bz2
wget ftp://ftp.gnu.org/gnu/ncurses/ncurses-5.7.tar.gz
wget http://ftp.gnu.org/gnu/patch/patch-2.6.1.tar.bz2
wget http://cpan.org/src/5.0/perl-5.12.1.tar.bz2
wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.25.tar.gz
wget http://procps.sourceforge.net/procps-3.2.8.tar.gz
wget http://prdownloads.sourceforge.net/psmisc/psmisc-22.12.tar.gz
wget http://ftp.gnu.org/gnu/readline/readline-6.1.tar.gz
wget http://ftp.gnu.org/gnu/sed/sed-4.2.1.tar.bz2
wget ftp://pkg-shadow.alioth.debian.org/pub/pkg-shadow/shadow-4.1.4.2.tar.bz2
wget http://www.infodrom.org/projects/sysklogd/download/sysklogd-1.5.tar.gz
wget http://ftp.twaren.net/Unix/NonGNU/sysvinit/sysvinit-2.88dsf.tar.bz2
wget http://ftp.gnu.org/gnu/tar/tar-1.23.tar.bz2
wget http://prdownloads.sourceforge.net/tcl/tcl8.5.8-src.tar.gz
wget http://ftp.gnu.org/gnu/texinfo/texinfo-4.13a.tar.gz
wget http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev-161.tar.bz2
wget http://anduin.linuxfromscratch.org/sources/other/udev-161-testfiles.tar.bz2
wget http://www.linuxfromscratch.org/lfs/downloads/6.7/udev-config-20100128.tar.bz2
wget http://www.kernel.org/pub/linux/utils/util-linux-ng/v2.18/util-linux-ng-2.18.tar.bz2
wget ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2
wget http://www.zlib.net/zlib-1.2.5.tar.bz2

and for the patches

Code:
#!/bin/bash
wget http://www.linuxfromscratch.org/patches/lfs/6.7/bash-4.1-fixes-2.patch
wget http://www.linuxfromscratch.org/patches/lfs/6.7/bzip2-1.0.5-install_docs-1.patch
wget http://www.linuxfromscratch.org/patches/lfs/6.7/bzip2-1.0.5-version_fixes-1.patch
wget http://www.linuxfromscratch.org/patches/lfs/6.7/coreutils-8.5-i18n-1.patch
wget http://www.linuxfromscratch.org/patches/lfs/6.7/coreutils-8.5-uname-2.patch
wget http://www.linuxfromscratch.org/patches/lfs/6.7/dejagnu-1.4.4-consolidated-1.patch
wget http://www.linuxfromscratch.org/patches/lfs/6.7/expect-5.44.1.15-no_tk-1.patch
wget http://www.linuxfromscratch.org/patches/lfs/6.7/flex-2.5.35-gcc44-1.patch
wget http://www.linuxfromscratch.org/patches/lfs/6.7/gcc-4.5.1-startfiles_fix-1.patch
wget http://www.linuxfromscratch.org/patches/lfs/6.7/glibc-2.12.1-gcc_fix-1.patch
wget http://www.linuxfromscratch.org/patches/lfs/6.7/glibc-2.12.1-makefile_fix-1.patch
wget http://www.linuxfromscratch.org/patches/lfs/6.7/kbd-1.15.2-backspace-1.patch
wget http://www.linuxfromscratch.org/patches/lfs/6.7/man-db-2.5.7-fix_man_assertion-1.patch
wget http://www.linuxfromscratch.org/patches/lfs/6.7/patch-2.6.1-test_fix-1.patch
wget http://www.linuxfromscratch.org/patches/lfs/6.7/perl-5.12.1-libc-1.patch
wget http://www.linuxfromscratch.org/patches/lfs/6.7/procps-3.2.8-watch_unicode-1.patch
wget http://www.linuxfromscratch.org/patches/lfs/6.7/tar-1.23-overflow_fix-1.patch

Most things were going along smoothly, although at one point my livecd froze for some reason and I had a slight panic attack ... all of that downloading etc gone... well not really because I had already mounted a partition and started to work on it. The only thing that need to be reset were the environmental variables.

speaking of environment variables i decided to change up my color scheme and layout of the terminal.
See here for instructions on how to do this

On that note, the book suggests setting the MAKEFLAGS variable. I found this to not actually work on my system and doing a
Code:
make -j 6
was much faster

I bumped into another little stumbling block trying to compile gcc. I kept getting gmp.h errors and some other related things

It took me a little while to sort out that the instructions meant for you to do the following

untar gcc, then cd into the gcc directory. Then inside of the gcc directory extract the mpfr mpc and gmp tarballs.

Essentially dumping all the needed files into one big directory instead of compiling things seperately or what-have you.

After following the book to what I thought was "the letter" I ran into a problem with building binutils the second pass. I kept getting
Make ** [all] Errors 2

After beating on my head a bit (and googling around to no avail) I decided to blow away my binutils directors and untar from the beginning. For some reason this time it worked (i did not retype the commands I used the history).

Lesson learned: if it doesnt compile the first time, delete the folder and start again before seeking further help it may save a lot of time

When I got to 5.10 gcc, I found that I was able to understand the code better when I changed this
Code:
for file in \
 $(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h)

to this
Code:
for file in `find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h`

Its probably just me and the way I got used to working in bash, but this just made more sense to me and it also helped me find a typoo i had made.

So far I believe I have put about 5-7 hours into this project and a good portion of my time has been hunting down small typoos. What I have found helpful is that in each *-build there are subdirectories created for each component required in that particular build. EX gcc uses mpfr, gmp and mpc. so there are gmp/config.log etc. This helped me find a hyphon " - " which should have been an underscore " _ "
 
Last edited:
hour 10

Couldn't get gcc to install for a second pass. I worked it and reworked it and no love
reverted to using my ubuntu vm as the host so I can cut and paste.

For those of you going this route, remember to isntall build-essential bison gawk m4 and texinfo to get things compiling properly

Hour 12.5

Installing on an ubuntu host went so much more smoothly. I have not completed the install but I have moved on to chapter 6. As well, once you get down to some of the smaller utilities it is possible to compile multiple utilities at the same time speeding things up as you are constantly waiting for the "make check" to complete

Hour 15

VM crashed on me and the best snapshot I had was from 12 hours ago. Total work lost 1.5 hours. Now taking precautions to regularly rsync the tools directory

Hour 16

Built glibc pass 2 with all kinds of errors. For those following Error 127 seems to be an indication that perl has errors in it. I had to revert to the stage with building perl and started again from there.

Hour 18

Glibc has no properly built with only a few errors related to cpu and math. According to the online book this is normal moving on...

Hour 27

I have now passed 6.54 without any further hitches inside LFS. Every now and then the host VM image gets borked and I have to revert to a snapshot. I have resorted to taking a snapshot at least 3 times a day and rsyncing over the entire lfs directory each night to have a running progress. Hopefully things continue smoothly.

Hour 30

Have compiled the kernel and installed grub. I had to rejigger the grub.cfg because I am building this on a different "virtual hard drive" which I want to stand alone. Edits included changing root from hd1,1 to hd0,1
and references of sdb to sda

The only thing left to do is see if it boots and then see if I can bring up some sort of gui...

After that is accomplished I will clean up these posts to make them more readable

Hour 31

I had to reinstall grub in order to get it to boot. It starts to load the kernel fine and then freezes at "rc used greatest stack depth:"
I am going to recompile the kernel from the livecd to see if I did something wrong...is it possibly a virtualbox thing?

EDIT: recompiled the kernel with stock options. It still hangs during boot
 
Last edited:
goina bump this up because I am stuck

The kernel starts to load and then hangs

The screenshot attached is the best I can do
 

Attachments

  • Screenshot.png
    Screenshot.png
    32.3 KB · Views: 315
Oh my.... Good luck! I did this once, about a year ago; got it working after about 2 weeks, and 3 rebuilds from scratch... If you're still stuck tomorrow I can dig back in my repos and see if I still have my build logs?
 
Decided to restart with a Linux Mint 10 host

Hour 0 - 1.5

I completed all the steps upto chapter 6. Things are going more quickly as I am not having to read the documentation as thoroughly as the first time
 
Back