Command explanations patch -Np0 -i ../glibc-2.2.3-nss.diff: This patch is needed to fix a couple of nasty nis bugs in glibc which can cause problems. mknod -m 0666 /dev/null c 1 3: Glibc needs a null device to compile properly. All other devices will be created in the next section. touch /etc/ld.so.conf One of the final steps of the Glibc installation is running ldconfig to update the dynamic loader cache. If this file doesn't exist, the installation will abort with an error that it can't read the file, so we simply create an empty file (the empty file will have Glibc default to using /lib and /usr/lib which is fine right now). sed s/"\$(PERL)"/"\/usr\/bin\/perl"/ ../glibc-2.2.3/malloc/Makefile > tmp~: This sed command searches through ../glibc-2.2.3/malloc/Makefile and converts all occurances of $(PERL) to /usr/bin/perl. The output is then written to the file tmp~. This is done because Glibc can't autodetect perl since it's not installed yet at the time when we install Glibc. mv tmp~ ../glibc-2.2.3/malloc/Makefile: The file tmp~ is now moved back to ../glibc-2.2.3/malloc/Makefile. We do this because when using sed, we can't write straight back to this file so we need to use a temporary file in between. sed "s/root/0" ../glibc-2.2.3/login/Makefile > tmp~: This sed command replaces all occurances of root in ../glibc-2.2.3/login/Makefile with 0. This is because as we don't have glibc on the LFS system yet, usernames can't be resolved to their user id's. Therefore, we replace the username root with the id 0. mv tmp~ ../glibc-2.2.3/login/Makefile: As above, we are using a temporary file (tmp~) to store the edited Makefile and then copying it back over the original. --enable-add-ons: This enables the add-on that we install with Glibc: linuxthreads sed s/"cross-compiling = yes"/"cross-compiling = no"/ config.make > config.make~: This time, we're replacing cross-compiling = yes with cross-compiling = no. We do this because we are only building for our own system. Cross-compiling is used, for instance, to build a package for an Apple Power PC on an Intel system. The reason Glibc thinks we're cross-compiling is that it can't compile a test program to determine this, so it automatically defaults to a cross-compiler. The reason for the failed program is because Glibc hasn't been installed yet. mv config.make~ config.make: Again, we are moving the temporary file over the original.