Tuesday, September 25, 2007

Building your Linux system from scratch : Missing Links


Monday, February 12th, 2007

By Deepak Barua



I just built my linux system from scratch with some difficulties and now i want to configure the X windows and other graphical eye candy but first i wanted to help other adventurers like myself on their journey.



Include details about what is LFS (a version of linux – I presume). URL for download etc. Any Wiki links. Supported by who etc. What is so enticing about LFS compared to RedHat, SuSe, Debian and other flavors ?



As this article appears to be additional instructions to building your own Linux, it might be good to verify this revised process by enlisting the help of someone over the net to follow your steps and see if they are successful.



Getting Started

I was following the LFS stable version 6.12 which is very good but certain things i needed help from uber-geeks ( few highly regarded friends of mine).



What specific items your contact suggested helped you complete the build. Are those steps already captured in this document?



Can these steps be scripted so that I can simply run the script and out comes a Linux CD – won’t that be cool.



So i started first by downloading all the packages and the required patches , mind you when making the first temporary system almost no patches are required.



Dynamic Linker

As you are following the instructions in LFS 6.12 you reach the part wherein the details about the dynamic linker are explained, please don't try to move or delete this file as it is critical to your host system functioning if it gets corrupted in some manner most programs in the system will stop working as they cannot find their shared libraries.



Glibc-linuxthreads

Also when building the glibc package make sure you untar the glibc-linuxthreads package in the glibc source directory.

This package can be obtained from http://ftp.gnu.org/gnu/glibc/



cd glibc-2.3.6

tar -xzf glibc-linuxthreads-2.3.6.tar.gz



This is one of the addons which need to be incorporated into the glibc package while compiling so make sure you specify to include addons when performing the configuration for glibc



../glibc-2.3.6/configure –prefix=<depends on temporary or final compilation>      --disable-profile --enable-add-ons      --enable-kernel=2.6.0



The above specified steps need to be executed during the temporary glibc compilation and also make sure they the directories are exist in the final glibc compilation and installation.



Glibc Manual Installation

Sometimes during the final installation of glibc by issuing a command “make install” you might get some errors related to the manual directory such as



make[2]: *** [libc.info] Error 2



To correct this we need to remove the make install rules in the makefile, this is not the best solution but then these manual files are not important to glibc and we want a working glibc compilation.



.PHONY: install subdir_install installdirs install-data

install-data subdir_install: install

ifneq ($(strip $(MAKEINFO)),:)

install: $(inst_infodir)/libc.info

@if $(SHELL) -c '$(INSTALL_INFO) --version' >/dev/null 2>&1; then

test -f $(inst_infodir)/dir || $(INSTALL_DATA) dir $(inst_infodir);

$(INSTALL_INFO) --info-dir=$(inst_infodir) $(inst_infodir)/libc.info;

else : ; fi

endif

# Catchall implicit rule for other installation targets from the parent.

install-%: ;


$(inst_infodir)/libc.info: libc.info installdirs

for file in $<*; do

$(INSTALL_DATA) $$file $(@D)/$$file;

done


installdirs:

$(mkinstalldirs) $(inst_infodir)







These errors are due to sometimes incorrect versions of texinfo or other bugs in the documentation.