20010830->20010831
[linux_from_scratch.git] / FAQ-OBSOLETE / faq.xml
blobb67d213be62a0891b1c8e2539e8962c058470918
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN">
4 <book id="index"><title>The LFS FAQ</title>
5         <bookinfo>
6                 <author>
7                         <firstname>Seth</firstname>
8                         <othername>W.</othername>
9                         <surname>Klein</surname>
10                         <affiliation>
11                                 <address>
12                                         <email>sklein@mint.net</email>
13                                 </address>
14                         </affiliation>
15                 </author>
16         </bookinfo>
17         <chapter><title>Introduction</title>
18                 <section><title>Why this FAQ?</title>
19                         <para>
20                                 I started this FAQ in an attempt to make the traffic on
21                                 lfs-discuss more manageable and improve the signal to noise
22                                 ratio. I'm going to limit myself to things that come up
23                                 often there leaving tips and such for
24                                 <ulink url="http://www.linuxfromscratch.org/services/lfshints.php">LFS-Hints</ulink>.
25                         </para>
26                 </section>
27                 <section><title>What is appropriate for lfs-discuss?</title>
28                         <para>
29                                 From the
30                                 <ulink url="http://www.linuxfromscratch.org/services/mailinglistinfo.php">website</ulink>:
31                         </para>
32                         <blockquote>
33                                 <para>
34                                         The lfs-discuss mailinglist discusses matters strictly
35                                         related to the LFS-BOOK. If you have problems with
36                                         the book, want to report a bug or two or have suggestions
37                                         to improve the book, use this mailinglist.
38                                 </para>
39                                 <para>
40                                         Any other mail is to be posted to the lfs-apps list.
41                                 </para>
42                         </blockquote>
43                         <para>
44                                 For instance, GCC and Glibc are part of the book and
45                                 belong on lfs-discuss.
46                                 XFree86, KDE, and GNOME are not part of the book and
47                                 belong on lfs-apps.
48                         </para>
49                 </section>
50                 <section><title>Contributing to this FAQ.</title>
51                         <para>
52                                 If you have an addition or suggestion, please, let me know.
53                                 I can be reached at
54                                 <ulink url="mailto:sklein@mint.net">sklein@mint.net</ulink>,
55                                 and i read lfs-discuss and lfs-apps thoroughly (but not always
56                                 promptly).
57                         </para>
58                         <para>
59                                 I'd like to list FAQ's for not only lfs-discuss, but lfs-apps
60                                 as well. I want to stick to questions that have been asked
61                                 at least twice and to remove items that are no longer an issue.
62                         </para>
63                 </section>
64                 <section><title>Where is the best place to get help?</title>
65                         <para>
66                                 When this FAQ fails to help, there are several places to go.
67                         </para>
68                         <para>
69                                 If you're having a problem with something in the book,
70                                 it never hurts to go back over the book.
71                                 It's surprising how easy it is to overlook little things.
72                         </para>
73                         <para>
74                                 If nothing else,
75                                 reading the appropriate man and info pages
76                                 will yield useful information on some subject,
77                                 if not what you were looking for,
78                                 and insure that you know enough not to embarrass yourself
79                                 if you have to ask someone.
80                         </para>
81                         <para>
82                                 <ulink url="http://www.linuxdoc.org/">http://www.linuxdoc.org/</ulink>
83                                 has the HOW-TOs and a great deal of other documentation.
84                                 You might find something there.
85                         </para>
86                         <para>
87                                 The linuxfromscratch.org site search includes the mailing lists.
88                                 Many questions have been discussed there at least once.  It's at
89                                 <ulink url="http://search.linuxfromscratch.org/">http://search.linuxfromscratch.org/</ulink>.
90                         </para>
91                         <para>
92                                 For support type help, IRC is often best. It's faster,
93                                 and doesn't clog the mailinglists.
94                                 Information on the LFS IRC channel is at
95                                 <ulink url="http://www.linuxfromscratch.org/services/irc.php">http://www.linuxfromscratch.org/services/irc.php</ulink>.
96                         </para>
97                         <para>
98                                 As a last resort, there are the mailing lists.
99                                 People will get frustrated with you if you use the wrong one or cross post.
100                                 Mailing list information is at
101                                 <ulink url="http://www.linuxfromscratch.org/services/mailinglistinfo.php">http://www.linuxfromscratch.org/services/mailinglistinfo.php</ulink>
102                                 and tells which list to use.
103                         </para>
104                 </section>
105                 <section><title>What is LFS?</title>
106                         <para>
107                                 LFS stands for Linux From Scratch which is a project that
108                                 primarily documents how to install a Linux system by downloading,
109                                 building, and installing the packages yourself.
110                         </para>
111                         <para>
112                                 For why you might want to do this, how to do it, and other
113                                 useful stuff, see the website at
114                                 <ulink url="http://www.linuxfromscratch.org/">http://www.linuxfromscratch.org/</ulink>.
115                         </para>
116                 </section>
117         </chapter>
118         <chapter id="resources"><title>Resources</title>
119                 <section id="how-to-find"><title>How do I find package Foo?</title>     
120                         <para>Always try Freshmeat at <ulink
121                                 url="http://freshmeat.net/">http://freshmeat.net/</ulink>
122                                 before you ask on the list.
123                         </para>
124                 </section>
125                 <section id="what-dist"><title>What distribution should I use to start from?</title>
126                         <para>
127                                 Any recent distribution should be fine. If you have problems,
128                                 try installing and/or updating the development packages.
129                                 (Look for ones starting in "gcc" or "glibc" "libstdc++" or
130                                 ending in "-dev".)
131                         </para>
132                 </section>
133         </chapter>
134         <chapter id="compiling"><title>Compiling</title>
135                 <section id="before-ask-comp"><title>Before you ask on the list...</title>
136                         <section id="optimizations"><title>If you are using optimizations:</title>
137                                 <para>
138                                         If you're getting errors and you're using optimizations,
139                                         try without optimizations. Even if the errors can't possibly
140                                         be related. I've see reports of configure scripts not
141                                         running because of optimization settings. Weird, huh?
142                                 </para>
143                                 <para>
144                                         Also, optimization settings that work for someone else
145                                         may not work for you. Settings that used to work may break
146                                         if you make the smallest, most innocent hardware change.
147                                 </para>
148                                 <para>
149                                         (If you don't know what optimization settings are,
150                                         don't worry, you don't need to.)
151                                 </para>
152                         </section>
153                         <section id="version-not-in-book"><title>If you are using a version not in the book:</title>
154                                 <para>
155                                         If you're getting errors and you're using a version of
156                                         a package that differs from the version in the book
157                                         (either newer or older), try the version in the book.
158                                         Sometimes there are reasons why the book uses a particular
159                                         version. Search the list archives if you're curious.
160                                 </para>
161                         </section>
162                 </section>
163                 <section id="sig11"><title>I'm getting fatal errors about signal 11.</title>
164                         <para>
165                                 See <ulink url="http://www.bitwizard.nl/sig11/">http://www.bitwizard.nl/sig11/</ulink>.
166                         </para>
167                 </section>
168                 <section id="gcc-warnings"><title>Are compiler warnings from GCC bad?</title>
169                         <para>
170                                 Short answer: no.
171                         </para>
172                         <para>
173                                 Long answer: probably, but only to someone
174                                 working on the package you're trying to compile. Mostly,
175                                 everything will be fine unless make quits with an error.
176                         </para>
177                         <para>
178                                 Here's an example:
179                         </para>
180                         <screen>
181 sklein ~/tmp $ cat > Makefile
182 main:
183         gcc main.c
184 sklein ~/tmp $ cat > main.c
185 void main() { exit(0); }
186 sklein ~/tmp $ make
187 gcc main.c
188 <emphasis role="bold">main.c: In function `main':
189 main.c:1: warning: return type of `main' is not `int'</emphasis>
190 sklein ~/tmp $ ######## that worked ########
191 sklein ~/tmp $ 
192 sklein ~/tmp $ cat > main.c
193 int main() { exxit(0) }
194 sklein ~/tmp $ make
195 gcc main.c
196 <emphasis role="bold">main.c: In function `main':
197 main.c:1: parse error before `}'
198 make: *** [main] Error 1</emphasis>
199 sklein ~/tmp $ ######## that failed ########
200 sklein ~/tmp $
201                         </screen>
202                 </section>
203                 <section id="perm-denied"><title>I'm getting `/dev/null: Permission denied'</title>
204                         <para>
205                                 Does /dev/null look like this:
206                                 <screen>
207 $ ls -l /dev/null
208 crw-rw-rw-   1 root     root       1,   3 Aug  3  2000 /dev/null
209                                 </screen>
210                                 If so, the problem is probably your mount options.
211                                 You probably have a line in /etc/fstab like:
212                                 <screen>
213 /dev/hda10      /mnt/lfs        ext2    user    1  2
214                                 </screen>
215                                 `user' is the mount flag, and it's the problem. To quote from
216                                 the mount man page:
217                                 <blockquote><screen> 
218 user  Allow  an  ordinary  user to mount the file system.
219       This  option  implies  the options noexec,  nosuid,
220       and nodev (unless overridden by subsequent options,
221       as in the option line user,exec,dev,suid).
222                         </screen></blockquote>
223                                 So change the line in /etc/fstab like this:
224                                 <screen>
225 /dev/hda10      /mnt/lfs        ext2    defaults        1  2
226                                 </screen>
227                         </para>
228                 </section>
229                 <section id="conf-guess-fail"><title>configure can't guess my host type.</title>
230                         <para>
231                                 Typical symptoms look like this:
232                         </para>
233                         <screen>
234 sklein ~/tmp-0.0 $ ./configure 
235 creating cache ./config.cache
236 checking host system type... <emphasis role="bold">configure: error: can not guess host type; you must specify one</emphasis>
237 sklein ~/tmp-0.0 $
238                         </screen>
239                         <para>
240                                 The problem is usually that the script can't run the compiler.
241                                 Usually it's just a missing /usr/bin/cc symlink. You can fix it like
242                                 this:
243                         </para>
244                         <screen>
245 cd /usr/bin
246 ln -s gcc cc
247                         </screen>
248                         <para>
249                                 If that doesn't do it, check the file config.log created by configure.
250                                 Errors go here and may indicate the problem.
251                         </para>
252                 </section>
253                 <section id="missing-x-includes"><title>A package can't find Xlib.h.</title>
254                         <para>
255                                 Typical symptoms look like this:
256                         </para>
257                         <screen>
258 sklein ~/tmp $ cat > Makefile
259 x11:
260         gcc x11.c
261 sklein ~/tmp $ cat > x11.c
262 #include &lt;X11/Xlib.h>
263 int main() { exit(0); }
264 sklein ~/tmp $ make
265 gcc x11.c
266 <emphasis role="bold">x11.c:1: X11/Xlib.h: No such file or directory
267 make: *** [x11] Error 1</emphasis>
268 sklein ~/tmp $ 
269                         </screen>
270                         <para>
271                                 Creating a couple symlinks will fix this. Here are the commands:
272                         </para>
273                         <screen>
274 cd /usr
275 ln -s X11R6 X11
276 cd include
277 ln -s ../X11/include/X11 X11
278                         </screen>
279                 </section>
280         </chapter>
281         <chapter id="specific-packages"><title>Questions about specific packages.</title>
282                 <section id="-f-hostname"><title>My hostname is getting set to "-f"!</title>
283                         <para>
284                                 You need to install the net-tools package. (See the instructions in
285                                 the LFS book.)
286                         </para>
287                         <para>
288                                 The hostname command your system is using is from sh-utils and doesn't
289                                 support the -f option. When it is called with the -f option it assumes
290                                 the hostname should be set to "-f". The hostname command from net-tools
291                                 doesn't have this problem.
292                         </para>
293                 </section>
294                 <section id="kernel-modules"><title>How do I setup kernel modules?</title>
295                         <para>
296                                 Follow the Module-HOWTO at <ulink
297                                 url="http://www.linuxdoc.org/HOWTO/Module-HOWTO/">http://www.linuxdoc.org/HOWTO/Module-HOWTO/</ulink>.
298                         </para>
299                 </section>
300 <!--
301                 <section id="fileutils-error"><title>I'm getting errors when compiling fileutils.</title>
302                         <para>
303                                 You may need to upgrade to the latest version or apply the fileutils patch.
304                                 Both are available from <ulink
305                                 url="http://download.linuxfromscratch.org/conglomeration/">http://download.linuxfromscratch.org/conglomeration/</ulink>.
306                         </para>
307                 </section>
309                 <section id="glibc-crypt"><title>Where is glibc-crypt-2.2.x?</title>
310                         <para>
311                                 As of glibc-2.2, you no longer need to get glibc-crypt separately.
312                                 It has been merged into the main package because the US
313                                 has relaxed it's export regulations.
314                         </para>
315                 </section>
316                 <section id="lilo-errors"><title>What do those LILO errors mean?</title>
317                         <para>
318                                 The documentation in the LILO distribution lists all errors
319                                 (such as when it prints "LI" and stops),
320                                 but a quick overview is available at <ulink
321                                 url="http://sdb.suse.de/sdb/en/html/kgw_lilo_errmsg.html">http://sdb.suse.de/sdb/en/html/kgw_lilo_errmsg.html</ulink>.
322                         </para>
323                 </section>
324                 <section id="net-pf-x"><title>I'm getting errors about net-pf-?.</title>
325                         <para>
326                                 When you compiled net-tools you enabled support for a protocol
327                                 family (that's where the "pf" comes from) that you didn't
328                                 enable support for in the kernel. (You probably just accepted
329                                 the default answers.)
330                         </para>
331                         <para>
332                                 A full list is in /usr/include/linux/socket.h but here is
333                                 a list of the likely culprits:
334                                 <simplelist>
335                                         <member>
336                                                 net-pf-3: Amateur Radio AX.25 (AF_AX25)
337                                         </member>
338                                         <member>
339                                                 net-pf-4: Novell IPX (AF_IPX)
340                                         </member>
341                                         <member>
342                                                 net-pf-5: AppleTalk DDP (AF_APPLETALK)
343                                         </member>
344                                         <member>
345                                                 net-pf-6: Amateur Radio NET/ROM (AF_NETROM)
346                                         </member>
347                                         <member>
348                                                 net-pf-9: Reserved for X.25 project (AF_X25)
349                                         </member>
350                                 </simplelist>
351                         </para>
352                         <para>
353                                 Naturally the fix is to recompile net-tools without support
354                                 for the things you don't need. (Or recompile your kernel with
355                                 support if you find you actually wanted them.) The workaround
356                                 to put a line like the following in /etc/modules.conf
357                         </para>
358                         <screen>
359 alias net-pf-? off
360                         </screen>
361                         <para>
362                                 Replace the question mark with the correct number, of course.
363                                 And rerun depmod.
364                         </para>
365                         <para>
366                                 If you get an error about net-pf-7, you probably need to
367                                 enable support for the loopback network device (not block
368                                 device) in your kernel. Or you may need to add the following
369                                 line to /etc/modules.conf and rerun depmod.
370                         </para>
371                         <screen>
372 alias net-pf-7 loop
373                         </screen>
374                 </section>
375                 <section id="char-major-10-135"><title>I'm getting errors about char-major-10-135.</title>
376                         <para>
377                                 Either delete /dev/rtc or enable RTC (Real Time Clock) support
378                                 in your kernel.
379                         </para>
380                 </section>
381         </chapter>
382         <chapter id="additions"><title>Additions / Changes to LFS.</title>
383                 <para>
384                         LFS is a very basic system, in massive contrast to traditional
385                         distributions. The reason is this: LFS is not intended to create
386                         your system as you want it. It's intended to be just enough to
387                         allow you to build your system from it. It's not an end, it's
388                         a beginning. When you're done with LFS, you've just started
389                         building your system.
390                 </para>
391                 <para>
392                         This can be a problem if you're new to Unix systems and want
393                         a typical install with X and a web browser but have no idea
394                         what packages you need. For this reason, there is the After
395                         LFS Hint. It is one of the LFS Hints which can be found at <ulink
396                         url="http://www.linuxfromscratch.org/services/lfshints.php">http://www.linuxfromscratch.org/services/lfshints.php</ulink>.
397                 </para>
398                 <section id="new-version"><title>There's a new version of package Foo.</title>
399                         <para>
400                                 There's no need to mention it unless you have something
401                                 useful to add such as changes in the compile instructions.
402                                 If it isn't already in CVS, it's on the todo list or
403                                 we've chosen not to use it for some reason. A search of
404                                 the list archives may reveal the reason.
405                         </para>
406                 </section>
407                 <section id="why-not-add"><title>Why not add / use package Foo?</title>
408                         <section id="add-grub"><title>GRUB instead of LILO</title>
409                                 <para>
410                                         GRUB has not yet been released as stable.
411                                         When it is, it will be considered
412                                         and, if it seems better than LILO, used.
413                                 </para>
414                                 <para>
415                                         If your current setup is using GRUB,
416                                         there's no need to switch to LILO.
417                                         In addition to the GRUB documentation,
418                                         there is an LFS Hint for GRUB.
419                                         The LFS Hints are at <ulink
420                                         url="http://www.linuxfromscratch.org/services/lfshints.php">http://www.linuxfromscratch.org/services/lfshints.php</ulink>.
421                                 </para>
422                         </section>
423                         <section id="add-gawk"><title>gawk instead of mawk</title>
424                                 <para>
425                                         While gawk has improved recently,
426                                         it is reported that mawk is still higher quality.
427                                         It is smaller, faster, and works reliably.
428                                 </para>
429                         </section>
430                 </section>
431                 <section id="setup-polishing"><title>Polishing your setup.</title>
432                         <para>
433                                 These don't really belong in the FAQ,
434                                 but they come up often on the lists.
435                         </para>
436                         <section id="lesscharset"><title>Why does less (and therefore man)
437                                 print &lt;AD&gt; instead of hyphens?</title>
438                                 <para>
439                                         Because the LESSCHARSET environment variable isn't set. To fix
440                                         that, set it in /etc/profile by doing something like this:
441                                 </para>
442                                 <screen>
443 echo 'export LESSCHARSET=latin1' >> /etc/profile
444                                 </screen>
445                         </section>
446                         <section id="which"><title>Where's which?</title>
447                                 <para>
448                                         It's not in there! A proper which is available
449                                         from the GNU Project at
450                                         <ulink url="ftp://ftp.gnu.org/gnu/which/">ftp://ftp.gnu.org/gnu/which/</ulink>
451                                         or at
452                                         <ulink url="http://www.xs4all.nl/~carlo17/which/">http://www.xs4all.nl/~carlo17/which/</ulink>.
453                                         Or for systems that don't require a good user environment
454                                         the simplest thing is probably to create a shell script
455                                         using these commands:
456                                 </para>
457                                 <screen>
458 cat > /usr/bin/which << "EOF"
459 #!/bin/bash
461 type -p "$@"
464 chmod 755 /usr/bin/which
465 chown root.root /usr/bin/which
466                                 </screen>
467                         </section>
468                         <section id="lex"><title>This ancient package wants lex?!?</title>
469                                 <para>
470                                         If you ever encounter a package so old that it must have
471                                         lex instead of flex, you can create a script like the one
472                                         for which (above) with these commands:
473                                 </para>
474                                 <screen>
475 cat > /usr/bin/lex << "EOF"
476 #!/bin/bash
478 exec /usr/bin/flex -l "$@"
481 chmod 755 /usr/bin/lex
482 chown root.root /usr/bin/lex
483                                 </screen>
484                         </section>
485                 </section>
486         </chapter>
487 </book>