| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 | <sect2><title>Command explanations</title><para><userinput>mknod -m 0666 /dev/null c 1 3:</userinput> Glibc needs anull device to compile properly. All other devices will be created in thenext section.</para><para><userinput>touch /etc/ld.so.conf</userinput> 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).</para><para><userinput>sed 's%\$(PERL)%/usr/bin/perl%' malloc/Makefile > tmp~:</userinput> This sed commandsearches through <filename>malloc/Makefile</filename> andconverts all occurances of <filename>$(PERL)</filename> to<filename>/usr/bin/perl</filename>.  The output is then written to thefile <filename>tmp~</filename>.  This is done because Glibc can'tautodetect perl since it's not installed yet at the time when we installGlibc.</para><para><userinput>mv -f tmp~ malloc/Makefile:</userinput> The file<filename>tmp~</filename> is now moved back to<filename>malloc/Makefile</filename>.  We do this becausewhen using sed, we can't write straight back to this file so we need touse a temporary file in between.</para><para><userinput>sed 's/root/0' login/Makefile >tmp~:</userinput> This sed command replaces all occurances of<filename>root</filename> in<filename>login/Makefile</filename> with 0.  This isbecause 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. </para><para><userinput>mv -f tmp~ login/Makefile:</userinput> Asabove, we are using a temporary file (<filename>tmp~</filename>) to store theedited Makefile and then copying it back over the original.</para><para><userinput>--enable-add-ons:</userinput> This enables the add-on thatwe install with Glibc: linuxthreads</para><para><userinput>sed 's/cross-compiling = yes/cross-compiling = no/'config.make > config.make~:</userinput> This time, we're replacing<filename>cross-compiling = yes</filename> with<filename>cross-compiling = no</filename>.  We do this because we areonly building for our own system.  Cross-compiling is used, forinstance, 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 atest program to determine this, so it automatically defaults to across-compiler. The reason for the failed program is because Glibchasn't been installed yet.</para><para><userinput>mv -f config.make~ config.make:</userinput> Again, we are movingthe temporary file over the original.</para><para><userinput>exec /bin/bash:</userinput>This command willstart a new bash shell which will replace the current shell. This is done to get rid of the "I have no name!" message in the command prompt, which was caused by bash's inability to resolve a userid to a username (which in turn was caused by the missing Glibc installation).</para></sect2>
 |