Linux Project – Day 2

To build LFS, which basically means building your whole Linux-based operating system from source code. There’s 2 ways at least, which involves using the LFS LiveCD itself as the host to compile kernel, utilities and other modules, you can use another Linux-based host to do that. In my project, I’m using Fedora 13, and I’m running it in a virtualized environment on top of Windows XP SP3. Before any compilation starts, it’s good to verify that any system requirements that the host OS must possess. A good way to look at it is double checking ur host OS specs with this web page.

First thing, fire up ur Fedora 13.


From the page, they provide you a bash script to dump all the versions and checking on the availability of a particular module. *the rights of the script belongs to LFS (

cat > << "EOF"
export LC_ALL=C

# Simple script to list version numbers of critical development tools

bash --version | head -n1 | cut -d" " -f2-4
echo "/bin/sh -> `readlink -f /bin/sh`"
echo -n "Binutils: "; ld --version | head -n1 | cut -d" " -f3-
bison --version | head -n1
if [ -e /usr/bin/yacc ];
then echo "/usr/bin/yacc -> `readlink -f /usr/bin/yacc`";
else echo "yacc not found"; fi
bzip2 --version 2>&1 < /dev/null | head -n1 | cut -d" " -f1,6-
echo -n "Coreutils: "; chown --version | head -n1 | cut -d")" -f2
diff --version | head -n1
find --version | head -n1
gawk --version | head -n1
if [ -e /usr/bin/awk ];
then echo "/usr/bin/awk -> `readlink -f /usr/bin/awk`";
else echo "awk not found"; fi
gcc --version | head -n1
/lib/ | head -n1 | cut -d"," -f1
grep --version | head -n1
gzip --version | head -n1
cat /proc/version
m4 --version | head -n1
make --version | head -n1
patch --version | head -n1
echo Perl `perl -V:version`
sed --version | head -n1
tar --version | head -n1
echo "Texinfo: `makeinfo --version | head -n1`"
echo 'main(){}' > dummy.c && gcc -o dummy dummy.c
if [ -x dummy ]; then echo "Compilation OK";
else echo "Compilation failed"; fi
rm -f dummy.c dummy


Once the script is done, and you’ve issued the last line of the command, you will get the result of ur version checking.
Obviously, the Fedora 13 lacks pretty much modules as a default installation. In fact, I’ve output all the result to a text file called result.txt, which I’ve used vim to open it up to compare on the version.


Below is the compilation of the result, and any actions I need to make sure the host environment is capable to compile LFS.


All modules that are available is either has higher versioning or comparatively same. But, a few modules is not installed.


First thing i installed was the bison, which is a GNU general-parser generator, especially useful for C development, which we need for LFS compilation.


I was using the Add/Remove Software for the installation by searching it and apply the package to my OS. I continue all this for other packages, and all manage to get the required versions easily, except gcc which has version 4.4.4 only.


Besides, to install gcc, you will be asked for more packages to be installed, as shown in the screen capture.


After all the hassle :P, i’ve rerun the shell script again, and this time no missing modules. Except, the gcc library is in version 4.4.4 instead of 4.4.3 as requested. Let’s try it out and see what happens.

Add to FacebookAdd to DiggAdd to Del.icio.usAdd to StumbleuponAdd to RedditAdd to BlinklistAdd to TwitterAdd to TechnoratiAdd to Yahoo BuzzAdd to Newsvine