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>
7 <firstname>Seth</firstname>
8 <othername>W.</othername>
9 <surname>Klein</surname>
12 <email>sklein@mint.net</email>
17 <chapter><title>Introduction</title>
18 <section><title>Why this FAQ?</title>
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>.
27 <section><title>What is appropriate for lfs-discuss?</title>
30 <ulink url="http://www.linuxfromscratch.org/services/mailinglistinfo.php">website</ulink>:
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.
40 Any other mail is to be posted to the lfs-apps list.
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
50 <section><title>Contributing to this FAQ.</title>
52 If you have an addition or suggestion, please, let me know.
54 <ulink url="mailto:sklein@mint.net">sklein@mint.net</ulink>,
55 and i read lfs-discuss and lfs-apps thoroughly (but not always
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.
64 <section><title>Where is the best place to get help?</title>
66 When this FAQ fails to help, there are several places to go.
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.
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.
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.
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>.
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>.
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.
105 <section><title>What is LFS?</title>
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.
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>.
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.
125 <section id="what-dist"><title>What distribution should I use to start from?</title>
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
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>
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?
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.
149 (If you don't know what optimization settings are,
150 don't worry, you don't need to.)
153 <section id="version-not-in-book"><title>If you are using a version not in the book:</title>
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.
163 <section id="sig11"><title>I'm getting fatal errors about signal 11.</title>
165 See <ulink url="http://www.bitwizard.nl/sig11/">http://www.bitwizard.nl/sig11/</ulink>.
168 <section id="gcc-warnings"><title>Are compiler warnings from GCC bad?</title>
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.
181 sklein ~/tmp $ cat > Makefile
184 sklein ~/tmp $ cat > main.c
185 void main() { exit(0); }
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 ########
192 sklein ~/tmp $ cat > main.c
193 int main() { exxit(0) }
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 ########
203 <section id="perm-denied"><title>I'm getting `/dev/null: Permission denied'</title>
205 Does /dev/null look like this:
208 crw-rw-rw- 1 root root 1, 3 Aug 3 2000 /dev/null
210 If so, the problem is probably your mount options.
211 You probably have a line in /etc/fstab like:
213 /dev/hda10 /mnt/lfs ext2 user 1 2
215 `user' is the mount flag, and it's the problem. To quote from
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:
225 /dev/hda10 /mnt/lfs ext2 defaults 1 2
229 <section id="conf-guess-fail"><title>configure can't guess my host type.</title>
231 Typical symptoms look like this:
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>
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
249 If that doesn't do it, check the file config.log created by configure.
250 Errors go here and may indicate the problem.
253 <section id="missing-x-includes"><title>A package can't find Xlib.h.</title>
255 Typical symptoms look like this:
258 sklein ~/tmp $ cat > Makefile
261 sklein ~/tmp $ cat > x11.c
262 #include <X11/Xlib.h>
263 int main() { exit(0); }
266 <emphasis role="bold">x11.c:1: X11/Xlib.h: No such file or directory
267 make: *** [x11] Error 1</emphasis>
271 Creating a couple symlinks will fix this. Here are the commands:
277 ln -s ../X11/include/X11 X11
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>
284 You need to install the net-tools package. (See the instructions in
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.
294 <section id="kernel-modules"><title>How do I setup kernel modules?</title>
296 Follow the Module-HOWTO at <ulink
297 url="http://www.linuxdoc.org/HOWTO/Module-HOWTO/">http://www.linuxdoc.org/HOWTO/Module-HOWTO/</ulink>.
301 <section id="fileutils-error"><title>I'm getting errors when compiling fileutils.</title>
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>.
309 <section id="glibc-crypt"><title>Where is glibc-crypt-2.2.x?</title>
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.
316 <section id="lilo-errors"><title>What do those LILO errors mean?</title>
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>.
324 <section id="net-pf-x"><title>I'm getting errors about net-pf-?.</title>
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.)
332 A full list is in /usr/include/linux/socket.h but here is
333 a list of the likely culprits:
336 net-pf-3: Amateur Radio AX.25 (AF_AX25)
339 net-pf-4: Novell IPX (AF_IPX)
342 net-pf-5: AppleTalk DDP (AF_APPLETALK)
345 net-pf-6: Amateur Radio NET/ROM (AF_NETROM)
348 net-pf-9: Reserved for X.25 project (AF_X25)
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
362 Replace the question mark with the correct number, of course.
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.
375 <section id="char-major-10-135"><title>I'm getting errors about char-major-10-135.</title>
377 Either delete /dev/rtc or enable RTC (Real Time Clock) support
382 <chapter id="additions"><title>Additions / Changes to LFS.</title>
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.
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>.
398 <section id="new-version"><title>There's a new version of package Foo.</title>
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.
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>
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.
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>.
423 <section id="add-gawk"><title>gawk instead of mawk</title>
425 While gawk has improved recently,
426 it is reported that mawk is still higher quality.
427 It is smaller, faster, and works reliably.
431 <section id="setup-polishing"><title>Polishing your setup.</title>
433 These don't really belong in the FAQ,
434 but they come up often on the lists.
436 <section id="lesscharset"><title>Why does less (and therefore man)
437 print <AD> instead of hyphens?</title>
439 Because the LESSCHARSET environment variable isn't set. To fix
440 that, set it in /etc/profile by doing something like this:
443 echo 'export LESSCHARSET=latin1' >> /etc/profile
446 <section id="which"><title>Where's which?</title>
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>
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:
458 cat > /usr/bin/which << "EOF"
464 chmod 755 /usr/bin/which
465 chown root.root /usr/bin/which
468 <section id="lex"><title>This ancient package wants lex?!?</title>
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:
475 cat > /usr/bin/lex << "EOF"
478 exec /usr/bin/flex -l "$@"
481 chmod 755 /usr/bin/lex
482 chown root.root /usr/bin/lex