[6370fa6] | 1 | <sect2>
|
---|
| 2 | <title>Command explanations</title>
|
---|
| 3 |
|
---|
[b822811] | 4 | <para><userinput>mknod -m 0666 /dev/null c 1 3:</userinput> Glibc needs a
|
---|
[1242889] | 5 | null device to compile properly. All other devices will be created in the
|
---|
[b822811] | 6 | next section.</para>
|
---|
[1242889] | 7 |
|
---|
[9960acd] | 8 | <para><userinput>touch /etc/ld.so.conf</userinput> One of the final steps
|
---|
| 9 | of the Glibc installation is running ldconfig to update the dynamic loader
|
---|
| 10 | cache. If this file doesn't exist, the installation will abort with an error
|
---|
| 11 | that it can't read the file, so we simply create an empty file (the empty file
|
---|
| 12 | will have Glibc default to using /lib and /usr/lib which is fine
|
---|
| 13 | right now).</para>
|
---|
[4c70684] | 14 |
|
---|
[bccc288] | 15 | <para><userinput>sed 's%\$(PERL)%/usr/bin/perl%'
|
---|
[2fbf709] | 16 | malloc/Makefile > tmp~:</userinput> This sed command
|
---|
| 17 | searches through <filename>malloc/Makefile</filename> and
|
---|
[671561b] | 18 | converts all occurances of <filename>$(PERL)</filename> to
|
---|
| 19 | <filename>/usr/bin/perl</filename>. The output is then written to the
|
---|
| 20 | file <filename>tmp~</filename>. This is done because Glibc can't
|
---|
| 21 | autodetect perl since it's not installed yet at the time when we install
|
---|
[b822811] | 22 | Glibc.</para>
|
---|
[671561b] | 23 |
|
---|
[c3feda7] | 24 | <para><userinput>mv tmp~ malloc/Makefile:</userinput> The file
|
---|
[671561b] | 25 | <filename>tmp~</filename> is now moved back to
|
---|
[2fbf709] | 26 | <filename>malloc/Makefile</filename>. We do this because
|
---|
[671561b] | 27 | when using sed, we can't write straight back to this file so we need to
|
---|
[b822811] | 28 | use a temporary file in between.</para>
|
---|
[671561b] | 29 |
|
---|
[2fbf709] | 30 | <para><userinput>sed 's/root/0' login/Makefile >
|
---|
[671561b] | 31 | tmp~:</userinput> This sed command replaces all occurances of
|
---|
| 32 | <filename>root</filename> in
|
---|
[2fbf709] | 33 | <filename>login/Makefile</filename> with 0. This is
|
---|
[671561b] | 34 | because as we don't have glibc on the LFS system yet, usernames can't
|
---|
| 35 | be resolved to their user id's. Therefore, we replace the username
|
---|
[b822811] | 36 | root with the id 0. </para>
|
---|
[671561b] | 37 |
|
---|
[c3feda7] | 38 | <para><userinput>mv tmp~ login/Makefile:</userinput> Asabove, we are using a temporary file (<filename>tmp~</filename>) to store the
|
---|
[b822811] | 39 | edited Makefile and then copying it back over the original.</para>
|
---|
[671561b] | 40 |
|
---|
[b822811] | 41 | <para><userinput>--enable-add-ons:</userinput> This enables the add-on that
|
---|
| 42 | we install with Glibc: linuxthreads</para>
|
---|
[6370fa6] | 43 |
|
---|
[8f5efb62] | 44 | <para><userinput>sed 's/cross-compiling = yes/cross-compiling = no/'
|
---|
[671561b] | 45 | config.make > config.make~:</userinput> This time, we're replacing
|
---|
| 46 | <filename>cross-compiling = yes</filename> with
|
---|
| 47 | <filename>cross-compiling = no</filename>. We do this because we are
|
---|
| 48 | only building for our own system. Cross-compiling is used, for
|
---|
| 49 | instance, to build a package for an Apple Power PC on an Intel system.
|
---|
| 50 | The reason Glibc thinks we're cross-compiling is that it can't compile a
|
---|
[633b1d1] | 51 | test program to determine this, so it automatically defaults to a
|
---|
[671561b] | 52 | cross-compiler. The reason for the failed program is because Glibc
|
---|
[b822811] | 53 | hasn't been installed yet.</para>
|
---|
[671561b] | 54 |
|
---|
[c3feda7] | 55 | <para><userinput>mv config.make~ config.make:</userinput> Again, we are moving
|
---|
[b822811] | 56 | the temporary file over the original.</para>
|
---|
[671561b] | 57 |
|
---|
[76a3d6d] | 58 | <para><userinput>exec /bin/bash:</userinput>This command will
|
---|
| 59 | start a new bash shell which will replace the current shell. This is
|
---|
| 60 | done to get rid of the "I have no name!" message in the command
|
---|
| 61 | prompt, which was caused by bash's inability to resolve a userid to
|
---|
| 62 | a username (which in turn was caused by the missing Glibc
|
---|
| 63 | installation).</para>
|
---|
| 64 |
|
---|
[6370fa6] | 65 | </sect2>
|
---|
| 66 |
|
---|