[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
|
---|
[2b1174be] | 12 | will have Glibc default to using /lib and /usr/lib which is fine).</para>
|
---|
[4c70684] | 13 |
|
---|
[bccc288] | 14 | <para><userinput>sed 's%\$(PERL)%/usr/bin/perl%'
|
---|
[2fbf709] | 15 | malloc/Makefile > tmp~:</userinput> This sed command
|
---|
| 16 | searches through <filename>malloc/Makefile</filename> and
|
---|
[671561b] | 17 | converts all occurances of <filename>$(PERL)</filename> to
|
---|
| 18 | <filename>/usr/bin/perl</filename>. The output is then written to the
|
---|
| 19 | file <filename>tmp~</filename>. This is done because Glibc can't
|
---|
[ed59ebe] | 20 | autodetect perl since it hasn't been installed yet.</para>
|
---|
[671561b] | 21 |
|
---|
[c3feda7] | 22 | <para><userinput>mv tmp~ malloc/Makefile:</userinput> The file
|
---|
[671561b] | 23 | <filename>tmp~</filename> is now moved back to
|
---|
[2fbf709] | 24 | <filename>malloc/Makefile</filename>. We do this because
|
---|
[671561b] | 25 | when using sed, we can't write straight back to this file so we need to
|
---|
[b822811] | 26 | use a temporary file in between.</para>
|
---|
[671561b] | 27 |
|
---|
[2fbf709] | 28 | <para><userinput>sed 's/root/0' login/Makefile >
|
---|
[671561b] | 29 | tmp~:</userinput> This sed command replaces all occurances of
|
---|
| 30 | <filename>root</filename> in
|
---|
[2fbf709] | 31 | <filename>login/Makefile</filename> with 0. This is
|
---|
[671561b] | 32 | because as we don't have glibc on the LFS system yet, usernames can't
|
---|
| 33 | be resolved to their user id's. Therefore, we replace the username
|
---|
[b822811] | 34 | root with the id 0. </para>
|
---|
[671561b] | 35 |
|
---|
[2b1174be] | 36 | <para><userinput>mv tmp~ login/Makefile:</userinput> As above, we are using
|
---|
| 37 | a temporary file (<filename>tmp~</filename>) to store the
|
---|
[b822811] | 38 | edited Makefile and then copying it back over the original.</para>
|
---|
[671561b] | 39 |
|
---|
[b822811] | 40 | <para><userinput>--enable-add-ons:</userinput> This enables the add-on that
|
---|
| 41 | we install with Glibc: linuxthreads</para>
|
---|
[6370fa6] | 42 |
|
---|
[166f15a] | 43 | <para><userinput>--libexecdir=/usr/bin:</userinput> This will cause the
|
---|
| 44 | pt_chown program to be installed in the /usr/bin directory.</para>
|
---|
| 45 |
|
---|
[8f5efb62] | 46 | <para><userinput>sed 's/cross-compiling = yes/cross-compiling = no/'
|
---|
[671561b] | 47 | config.make > config.make~:</userinput> This time, we're replacing
|
---|
| 48 | <filename>cross-compiling = yes</filename> with
|
---|
| 49 | <filename>cross-compiling = no</filename>. We do this because we are
|
---|
| 50 | only building for our own system. Cross-compiling is used, for
|
---|
| 51 | instance, to build a package for an Apple Power PC on an Intel system.
|
---|
| 52 | The reason Glibc thinks we're cross-compiling is that it can't compile a
|
---|
[633b1d1] | 53 | test program to determine this, so it automatically defaults to a
|
---|
[671561b] | 54 | cross-compiler. The reason for the failed program is because Glibc
|
---|
[b822811] | 55 | hasn't been installed yet.</para>
|
---|
[671561b] | 56 |
|
---|
[c3feda7] | 57 | <para><userinput>mv config.make~ config.make:</userinput> Again, we are moving
|
---|
[b822811] | 58 | the temporary file over the original.</para>
|
---|
[671561b] | 59 |
|
---|
[76a3d6d] | 60 | <para><userinput>exec /bin/bash:</userinput>This command will
|
---|
| 61 | start a new bash shell which will replace the current shell. This is
|
---|
| 62 | done to get rid of the "I have no name!" message in the command
|
---|
| 63 | prompt, which was caused by bash's inability to resolve a userid to
|
---|
| 64 | a username (which in turn was caused by the missing Glibc
|
---|
| 65 | installation).</para>
|
---|
| 66 |
|
---|
[6370fa6] | 67 | </sect2>
|
---|
| 68 |
|
---|