1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN">
4 <article class="faq"><title>The LFS FAQ</title>
7 <firstname>Seth</firstname>
8 <othername>W.</othername>
9 <surname>Klein</surname>
12 <email>sk@sethwklein.net</email>
18 <!-- dlist: ,lfs-dev,lfs-support,blfs-support -->
19 <qandadiv><title>Introduction</title>
21 <!-- elist: ,lfs-dev,lfs-support,blfs-support -->
22 <qandaentry id="why-faq">
23 <question><para>Why this FAQ?</para></question>
24 <answer><para>The FAQ tries to answer questions before they're asked.
25 This saves the trouble of asking them,
26 and sometimes, the trouble of encountering a problem.
28 <para>This does reduce traffic and improve the signal to noise ratio
29 but that is merely a useful side effect.
31 <para>Since the FAQ isn't the natural place to look for information,
32 items should be added to it
33 only if they can't be added to the appropriate documentation,
34 although sometimes it will be necessary to add a pointer
35 to the information in the documentation.
39 <!-- elist: ,lfs-support -->
40 <qandaentry><question><para>What is appropriate for lfs-support?</para></question>
41 <answer><para>From the
42 <ulink url="http://www.linuxfromscratch.org/mailinglists/info.shtml">website</ulink>:
45 <para>The lfs-support mailing list provides support to users
46 building an LFS system as far as the end of the main book.
47 Requests for help with installing software beyond the base
48 system should go to the blfs-support list.
51 <para>For instance, GCC and Glibc are part of the LFS book and
52 belong on lfs-support.
53 XFree86, KDE, and GNOME are not part of the LFS book and
54 belong on blfs-support.
57 <!-- elist: ,lfs-dev,lfs-support,blfs-support -->
58 <qandaentry><question><para>Contributing to this FAQ.</para></question>
59 <answer><para>If you have an addition or suggestion, please, let me know.
61 <ulink url="mailto:sk@sethwklein.net">sk@sethwklein.net</ulink>,
62 and i read the lists thoroughly (but not always promptly).
64 <answer><para>I want to stick to questions that have been asked at least
65 twice and to remove items that are no longer an issue.
68 <!-- elist: ,lfs-dev,lfs-support,blfs-support -->
69 <qandaentry><question><para>Where is the best place to get help?</para></question>
70 <answer><para>When this FAQ fails to help, there are several places to go.
72 <answer><para>If you're having a problem with something in the book,
73 it never hurts to go back over the book.
74 It's surprising how easy it is to overlook little things.
76 <answer><para>If nothing else,
77 reading the appropriate man and info pages
78 will yield useful information on some subject,
79 if not what you were looking for,
80 and insure that you know enough not to embarrass yourself
81 if you have to ask someone.
83 <answer><para><ulink url="http://www.linuxdoc.org/">http://www.linuxdoc.org/</ulink>
84 has the HOW-TOs and a great deal of other documentation.
85 You might find something there.
87 <answer><para>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>.
91 <answer><para>For support type help, IRC is often best. It's faster,
92 and doesn't clog the mailinglists.
93 Information on the LFS IRC channel is at
94 <ulink url="http://www.linuxfromscratch.org/misc/irc.shtml">http://www.linuxfromscratch.org/misc/irc.shtml</ulink>.
96 <answer><para>As a last resort, there are the mailing lists.
97 People will get frustrated with you if you use the wrong one or cross post.
98 Mailing list information is at
99 <ulink url="http://www.linuxfromscratch.org/mailinglists/info.shtml">http://www.linuxfromscratch.org/mailinglists/info.shtml</ulink>:
100 and tells which list to use.
103 <!-- elist: ,lfs-dev,lfs-support -->
104 <qandaentry><question><para>What is LFS?</para></question>
105 <answer><para>LFS stands for Linux From Scratch which is a project that
106 primarily documents how to install a Linux system by downloading,
107 building, and installing the packages yourself.
109 <para>For why you might want to do this, how to do it, and other
110 useful stuff, see the website at
111 <ulink url="http://www.linuxfromscratch.org/">http://www.linuxfromscratch.org/</ulink>.
114 </qandadiv><!-- Introduction -->
117 <!-- dlist: ,lfs-dev,lfs-support,blfs-support -->
118 <qandadiv id="frb"><title>Frequently Reported Bugs</title>
120 <!-- elist: ,lfs-dev -->
121 <qandaentry id="deps_version_not_match_package">
122 <question><para>The Dependencies section for Foo 2.0 says "Foo 1.0".
124 <answer><para>That is correct. Dependencies sections are only updated
125 occasionally due to the amount of manual labor required.
129 <!-- elist: ,lfs-support,blfs-support -->
130 <qandaentry id="delete_key_not_work">
131 <question><para>The Delete key doesn't work.
133 <answer><para>See: <ulink url="http://beyond.linuxfromscratch.org/view/cvs/chapter03/inputrc.html">http://beyond.linuxfromscratch.org/view/cvs/chapter03/inputrc.html</ulink>.
137 </qandadiv><!-- frb -->
139 <!-- dlist: ,lfs-dev,new -->
140 <qandadiv id="fre"><title>Frequently Requested Enhancements</title>
142 <para>LFS is a very basic system,
143 in massive contrast to traditional distributions. The reason is this:
144 LFS is not intended to create your system as you want it.
145 It's intended to be just enough to allow you
146 to build your system as you want it.
147 It's not an end, it's a beginning.
148 When you're done with LFS, you've just started building your system.
150 <para>This can be a problem if you're new to Unix systems
151 and want a typical install with X and a web browser
152 but have no idea what packages you need.
153 For this reason, there is the Beyond Linux From Scratch, or BLFS, project.
155 url="http://beyond.linuxfromscratch.org/">http://beyond.linuxfromscratch.org/</ulink>.
158 <!-- elist: ,lfs-dev,new -->
159 <qandaentry id="gcc-3_0">
160 <question><para>Why isn't GCC 3.0.x in the book?
162 <answer><para>Because many packages still haven't been updated
165 <para>Also note that gcc 2.x and 3.x don't mix.
167 this means that you may have problems if you must use precompiled binaries
168 as is often the case with closed source software.
169 (The most recent version of Netscape is reported to be fine.)
171 <para>If you want to try gcc 3, make sure you're using glibc 2.2.5
172 and search the mailing lists
173 because there are a few fixable problems that you will encounter
174 even with just the packages in the book.
175 (Anyone have a document describing them that i could link to?)
179 <!-- elist: ,lfs-dev,new -->
180 <qandaentry id="add-gawk">
181 <question><para>Why not use gawk instead of mawk?</para></question>
182 <answer><para>The book is switching to gawk.
183 It's in the CVS version of the book now.
187 <!-- elist: ,lfs-dev -->
188 <qandaentry id="add-grub"><question><para>Why not use GRUB instead of LILO?</para></question>
189 <answer><para>GRUB has not yet been released as stable.
190 When it is, it will be considered and, if it seems better than LILO, used.
192 <para>If your current setup uses GRUB, there's no need to switch.
193 In addition to the GRUB documentation, see the LFS "GRUB-Howto" Hint at <ulink
194 url="http://hints.linuxfromscratch.org/hints/grub-howto.txt">http://hints.linuxfromscratch.org/hints/grub-howto.txt</ulink>
198 <!-- elist: ,lfs-dev -->
199 <qandaentry id="why-ed"><question><para>Why is ed in the book?</para></question>
200 <answer><para>The book includes ed because patch uses it to process ed scripts.
201 However, these are rare today; everyone uses diff format patches.
202 </para><para>But ed does have other uses:
204 <listitem><para>For all who've learned to use it,
205 ed is a very useful emergency editor.
206 The MS Windows standard telnet client can deal with ed
207 but has trouble with fullscreen editors (like vim).
208 And a full featured vim requires not only ncurses, but X11 as well!
209 Any trouble with those libraries will leave
210 the system without an editor if ed isn't present.
212 <listitem><para>Though it's not a reason to have ed in the book,
213 some people actually like ed.
215 <listitem><para>Understanding ed helps with understanding vi(m) and Unix
222 <!-- elist: ,lfs-dev,new -->
223 <qandaentry id="why-not-package-management"><question><para>Why isn't some
224 package manager in the book?</para></question>
225 <answer><para>Package management -
226 beyond that profided by tarballs and makefiles -
227 is beyond the scope of the book.
228 If nothing else does,
229 the number of different "solutions" should hint at some of the reasons.
231 <para>Here a just a few of the options:
233 <listitem><para>No package management is really necessary.
234 Unless it is desirable to monitor package file placement minutely,
235 any package large enough to warrent removal for disk space reasons
236 can be installed in /opt as detailed by the FHS.
237 Libraries are generally best upgraded by rebuilding the system
240 <listitem><para>RPM, the Redhat Package Manager,
241 is used by a number of distributions.
242 It is available from <ulink
243 url="http://www.rpm.org/">http://www.rpm.org/</ulink>
244 and there is an RPM Hint to help with installation at <ulink
245 url="http://hints.linuxfromscratch.org/hints/rpm.txt">http://hints.linuxfromscratch.org/hints/rpm.txt</ulink>
247 <listitem><para>Originally based on a script
248 written by LFS' own Gerard Beekmans,
249 install-log records a list of files installed by a package
250 as the package is installed.
251 It is available from <ulink
252 url="http://install-log.sourceforge.net/">http://install-log.sourceforge.net/</ulink>
254 <listitem><para>GNU Stow is an interesting concept. See <ulink
255 url="http://www.gnu.org/software/stow/">http://www.gnu.org/software/stow/</ulink>
258 Do you know of one missing from that list?
259 Please email its name, URL, and other information,
260 to the FAQ maintainer or an apropriate LFS mailing list so it can be added here.
264 </qandadiv><!-- fre -->
266 <!-- dlist: ,lfs-compile,blfs-support,new -->
267 <qandadiv id="fee"><title>Frequently Encountered Errors</title>
269 <!-- dlist: ,lfs-compile,blfs-support,new -->
270 <qandadiv id="fee-compile"><title>Compile Time Errors</title>
272 <!-- dlist: ,lfs-compile,blfs-support,new -->
273 <qandadiv id="fee-compile-any"><title>Errors From Any Package</title>
275 <!-- elist: ,lfs-compile -->
276 <qandaentry id="bad-interpreter-permission-denied">
278 <para>./configure: bad interpreter: Permission denied</para>
280 <answer><para>You're most likely getting this while building bash in Chapter 5
282 The problem is most likely your mount options.
283 You probably have a line in /etc/fstab like:
284 <screen>/dev/hda10 /mnt/lfs ext2 user 1 2
286 'user' is the mount flag, and it's the problem. To quote from the mount man page:
288 user Allow an ordinary user to mount the file system.
289 This option implies the options noexec, nosuid,
290 and nodev (unless overridden by subsequent options,
291 as in the option line user,exec,dev,suid).
292 </screen></blockquote>
293 So change the line in /etc/fstab like this:
294 <screen>/dev/hda10 /mnt/lfs ext2 defaults 1 2
299 <!-- elist: ,lfs-compile -->
300 <qandaentry id="env-bash-no-such-file">
301 <question><para>/usr/bin/env: /bin/bash: No such file or directory</para></question>
302 <answer><para>You're trying to follow the LFS Book
303 and working on entering chroot, right?
304 Most likely $LFS/bin/bash isn't statically linked.
306 <screen>file $LFS/bin/bash
308 If that doesn't say something about "statically linked",
309 reinstall bash following the instructions in Chapter 5.
313 <!-- elist: ,lfs-compile -->
314 <qandaentry id="config-not-gnu-c">
315 <question><para>checking whether we are using GNU C... no
317 <answer><para>If you're getting an error from configure like:
318 <screen>checking whether we are using GNU C... no
319 configure: error: GNU libc must be compiled using GNU CC
321 It may be because egrep (from the grep package) isn't working.
323 <para>To test if egrep is working <emphasis>before</emphasis> reinstalling
324 the grep package in Chapter 6,
325 run the following command from <emphasis>outside</emphasis> chroot:
326 <screen>file $LFS/usr/bin/egrep
328 If it doesn't say "statically linked" you have a problem
329 and need to reinstall the grep package.
331 <para>To test if egrep is working <emphasis>after</emphasis> reinstalling
332 the grep package in Chapter 6,
333 run the following command from <emphasis>inside</emphasis> chroot:
334 <screen>egrep root /etc/passwd
336 If it doesn't print root's line from /etc/passwd,
337 again, you have a problem.
338 (This test also works if you encounter the problem after rebooting
339 into the new LFS system.)
343 <!-- elist: ,lfs-compile -->
344 <qandaentry id="config-hang-size_t">
345 <question><para>Why does configure hang at
346 "checking for signed size_t type..."?</para></question>
347 <answer><para>You over optimized gcc.
351 <!-- elist: ,blfs-support,new -->
352 <qandaentry id="gtk-2_0">
353 <question><para>I'm getting errors building a package that requires GTK+,
354 but I've installed GTK+ 2.x.</para></question>
355 <answer><para>GTK+ 2.x and 1.2.x aren't compatible.
356 The package you're installing may need GTK+ (and GLIB) 1.2.x.
357 You can install GTK+ (and GLIB) 1.2.x next to 2.x.
361 </qandadiv><!-- fee-compile-any -->
363 <!-- dlist: ,lfs-compile -->
364 <qandadiv id="fee-compile-specific"><title>Errors From Specific Packages</title>
366 <!-- elist: ,lfs-compile -->
367 <qandaentry id="optimized-glibc-fail">
368 <question><para>My optimized build of glibc is failing in spinlock.c</para></question>
369 <answer><para>It should be mentioned that glibc (and gcc and binutils)
370 are good places to not optimize.
371 The performance versus stability trade off is unusually poor
372 for these packages. But. . . .
374 <answer><para>If you've specified a CFLAGS value like "-march=i686 -mcpu=686"
375 and you're getting an error like this:
376 <screen>spinlock.c: In function `__pthread_lock':
377 spinlock.c:107: inconsistent operand constraints in an `asm'
378 make[2]: *** [/usr/src/glibc-build/linuxthreads/spinlock.o] Error 1
379 make[2]: Leaving directory `/usr/src/glibc-2.2.4/linuxthreads'
380 make[1]: *** [linuxthreads/others] Error 2
381 make[1]: Leaving directory `/usr/src/glibc-2.2.4'
382 make: *** [all] Error 2
384 It's because, unlike almost everything else,
385 spinlock.c requires optimization.
386 You could set CFLAGS to something like
387 "-march=i686 -mcpu=i686 -O2".
390 <para>But it is better to set optimizations in glibc-x.x.x/Makeconfig.
391 This is the relevant section of Makeconfig:
392 <screen># Default flags to pass the C compiler.
393 ifndef default_cflags
394 ifeq ($(release),stable)
395 default_cflags := <emphasis role="strong">-g -O2</emphasis>
397 default_cflags := -g -O
401 And here is an example to adapt:
402 <screen># Default flags to pass the C compiler.
403 ifndef default_cflags
404 ifeq ($(release),stable)
405 default_cflags := <emphasis role="strong">-g0 -Os -march=i386 -mcpu=i386 -pipe</emphasis>
407 default_cflags := -g -O
414 <!-- elist: ,lfs-compile,new -->
415 <qandaentry id="unable-to-mount-root">
416 <question><para>Kernel panic: VFS: unable to mount root fs</para></question>
417 <answer><para>There several reasons why the kernel might be unable to
418 mount the root filesystem.
420 <listitem><para>Did you specify the correct partition in
421 <filename>/etc/lilo.conf</filename>?
423 <listitem><para>Did you remember to rerun lilo after changing
424 <filename>/etc/lilo.conf</filename>?
426 <listitem><para>Is support for the hard drive enabled in the kernel.
427 For SCSI this means support for the specific SCSI adapter.
429 <listitem><para>Is support for the hard drive compiled into the kernel,
430 not just as a module.
431 (Modules are stored on the filesystem.
432 If a driver needed to access the filesystem is stored as a module on
433 that filesystem, well. . . you know. . . . ;)
435 <listitem><para>Is support for the filesystem compiled into the kernel.
437 Support for ext2 is enabled by default,
438 but others like ext3, reiser, jfs, and xfs are not.
440 </itemizedlist></para></answer>
441 </qandaentry><!-- unable-to-mount-root -->
443 </qandadiv><!-- fee-compile-specific -->
445 <!-- dlist: ,lfs-compile,blfs-support,new -->
446 <qandadiv id="fee-compile-notlisted"><title>Errors Not Listed Above</title>
448 <!-- elist: ,lfs-compile,new -->
449 <qandaentry id="gnu-patches">
450 <question><para>I used a patch from GNU to upgrade.
451 Is that OK?</para></question>
452 <answer><para>For some reason the patches from GNU don't usually work.
453 Better download the full archive and try again.
455 <para>Ed. Note: can anyone tell <ulink url="mailto:sk@sethwklein.net">me</ulink>
456 why GNU patches fail?
460 <!-- elist: ,lfs-compile,blfs-support -->
461 <qandaentry id="optimizations">
462 <question><para>I'm using optimizations.
463 Can that be a problem?</para></question>
464 <answer><para>If you're getting errors and you're using optimization settings,
465 that may be the problem.
466 If you ask on the list and they can't figure it out immediately,
467 they'll likely suggest trying it without optimizations,
468 so just retry it without before asking.
469 You'll be one step ahead of them :)
471 <para>Optimizations can cause many different
472 even seemingly unrelated errors.
473 They can cause configure scripts to fail.
474 Optimizations that work for someone else
475 may not work for you. Settings that used to work may break
476 if you make the smallest, most innocent hardware change.
478 <para>(If you don't know what optimization settings are,
479 don't worry, really you don't need to.)
483 <!-- elist: ,lfs-compile,blfs-support,new -->
484 <qandaentry id="version-not-in-book">
485 <question><para>I'm using a version not in the book.
486 Is that a problem?</para></question>
487 <answer><para>If you're getting errors and you're using a version of
488 a package that differs from the version in the book
489 (either newer or older), try the version in the book.
490 Sometimes there are reasons why the book uses a particular version.
491 Search the list archives if you're curious.
493 <para>In particular, GCC 3.0 will cause problems.
494 See the entry "<link linkend="gcc-3_0">Why isn't GCC 3.0.x in the book?</link>".
498 <!-- elist: ,lfs-compile,blfs-support,new -->
499 <qandaentry id="dirty-sources">
500 <question><para>I didn't delete the source tree after my last attempt.
501 Do i need to?</para></question>
502 <answer><para>Yes. You should always delete the source tree after installing
503 and delete it and start over if anything fails.
505 <para>The only exception is the kernel.
506 Most people keep their kernel source so they don't have to reconfigure
507 it from scratch if they need to make a small change.
508 If a large change is needed, like changing processor type,
509 it may be necessary to restart with a fresh tree even with the kernel.
511 <para>Here's an example when everything works:
512 <screen>tar xvjf foo-0.0.tar.bz2
514 ./configure --prefix=/usr
517 <emphasis role="strong">cd ..
518 rm -rf foo-0.0</emphasis>
520 And here's an example for if something (in this case configure) fails:
521 <screen>tar xvjf foo-0.0.tar.bz2
523 ./configure --prefix=/usr
527 *** configure: error: foo requires libess 4.2 or greater
528 please install libess and rerun configure.
529 <emphasis role="strong">cd ..
530 rm -rf foo-0.0</emphasis>
531 tar xvjf libess-4.2.tar.bz2
533 ./configure --prefix=/usr
536 <emphasis role="strong">cd ..
537 rm -rf libess-4.2</emphasis>
538 tar xvjf foo-0.0.tar.bz2
540 ./configure --prefix=/usr
543 <emphasis role="strong">cd ..
544 rm -rf foo-0.0</emphasis>
546 <para>Ed. Note: The name of the fictional libess above follows
547 libiberty (from glibc, AFAIK) and libofat.
548 The reason comes from the gcc flag, -l, for linking a library when compiling.
550 <screen>gcc -o foo foo.c -lm
552 would link the "m" (math) library with the executable foo.
553 So, for the libraries above, the command looks like:
554 <screen>gcc -o foo foo.c -liberty -lowfat -less
556 <para>Bonus points if you caught the reference to
557 The Hitchhiker's Guide to the Galaxy, by Douglas Adams in the example.
561 </qandadiv><!-- fee-compile-notlisted -->
563 </qandadiv><!-- fee-compile -->
565 </qandadiv><!-- fee -->
567 <!-- dlist: ,lfs-support,blfs-support -->
568 <qandadiv id="resources"><title>Resources</title>
570 <!-- elist: ,lfs-support,blfs-support -->
571 <qandaentry id="how-to-find"><question><para>How do I find package Foo?</para></question>
572 <answer><para>Mostly, it's not hard, but some packages can lead quite a chase.
576 <listitem><para><ulink
577 url="http://freshmeat.net/">http://freshmeat.net/</ulink>:
578 Searching for <screen>foo</screen> will usually turn up a freshmeat page
580 where you can check for newer releases not reported to freshmeat.
583 <listitem><para><ulink
584 url="http://www.google.com/">http://www.google.com/</ulink>:
585 Use a search string like
586 <screen>+foo +index</screen>
587 which tends to find "Index of /pub/foo" type pages, or even
588 <screen>+foo +index -RPM -debian</screen>
589 to eliminate links to RPM packages and Debian's archives.
592 <listitem><para>Google may well turn up a link to something under <ulink
593 url="http://www.ibiblio.org/pub/">http://www.ibiblio.org/pub/</ulink>.
594 (If you want to look specifically on ibiblio.org use
595 <screen>foo site:ibiblio.org</screen>)
596 Beware that ibiblio.org may not have the most recent version.
597 However, they often will have...
600 <listitem><para>A foo.lsm (Linux Software Map) file
601 which may list a primary site where more recent versions may be found.
608 <!-- elist: ,lfs-support,blfs-support -->
609 <qandaentry id="bootcd">
610 <question><para>How do I make a bootable CD?</para></question>
611 <answer><para>See the Boot-CD Hint and <ulink
612 url="http://hints.linuxfromscratch.org/hints/bootcd.txt">http://hints.linuxfromscratch.org/hints/bootcd.txt</ulink>
616 <!-- elist: ,blfs-support -->
617 <qandaentry id="portmap">
618 <question><para>Where's portmap?</para></question>
619 <answer><para>There are instructions in the NFS Hint at <ulink
620 url="http://hints.linuxfromscratch.org/hints/nfs.txt">http://hints.linuxfromscratch.org/hints/nfs.txt</ulink>.
622 <answer><para>Also, Marc Heerdink writes:
623 <blockquote><para>I have a version of tcp_wrappers and portmap up that have both
624 been patched with the debian patches, adapted Makefiles for LFS plus all
625 compile warnings/problems were fixed. Additionally, an lfs-install.sh is
626 included in both tarballs that provides a really quick and dirty way to
627 install them. They can be found at <ulink
628 url="http://www.linuxfromscratch.org/~gimli/">http://www.linuxfromscratch.org/~gimli/</ulink>.
629 You may want to add a note about these packages for people who want to do
635 <!-- elist: ,lfs-support -->
636 <qandaentry id="what-dist"><question><para>What distribution should I use to start from?</para></question>
637 <answer><para>Any recent distribution should be fine. If you have problems,
638 try installing and/or updating the development packages.
639 (Look for ones starting in "gcc" or "glibc" "libstdc++" or
643 <!-- elist: ,lfs-support -->
644 <qandaentry id="really-small"><question><para>How do I make that really small install the book mentions?</para></question>
645 <answer><para>Gerard describes the process of making a 5MB LFS install
646 in an email archived at <ulink
647 url="http://archive.linuxfromscratch.org/mail-archives/lfs-support/2001/10/0072.html">http://archive.linuxfromscratch.org/mail-archives/lfs-support/2001/10/0072.html</ulink>
651 <!-- elist: ,lfs-support -->
652 <qandaentry id="where-ncurses-mandrake">
653 <question><para>Where's libncurses.a in Mandrake?</para></question>
654 <answer><para>In Mandrake/RPMS2/libncurses5-devel-5.2-16mdk.1586.rpm on Disk 2.
655 Version numbers might be a little different for you.
656 (If you're missing libcurses.a (no "n"),
657 reread the book's instructions for bash more carefully.)
661 </qandadiv><!-- resources -->
663 <!-- dlist: ,lfs-support -->
664 <qandadiv id="fsc"><title>Frequently Sought Cluebits</title>
666 <!-- elist: ,lfs-support -->
667 <qandaentry id="dos-text">
668 <question><para>What's a DOS format text file?</para></question>
669 <answer><para>It has to do with the characters used to end lines.
671 <para>There are two that may be used:
673 <listitem><para>Line Feed: (LF) Octal:012 Decimal:10 Hex:0A C Style Escape:'\n'
676 <listitem><para>Carriage Return: (CR) Octal:015 Decimal:13 Hex:0D C Style Excape:'\r'
677 Move to the left margin.
681 <para>Unix, DOS, and MacOS each use a different combination to end lines in text files:
683 <listitem><para>Unix: LF only.
684 This is why when a Unix format text file is sent to a printer raw,
691 <listitem><para>DOS: CRLF both.
692 Which is why if you do "cat -v" on a DOS file you'll see a "^M"
693 (control m is carriage return) at the end of each line. And that
694 is why scripts don't work when written with Microsoft Notepad.
695 The kernel looks for "/bin/sh^M" which doesn't exist. There's a
696 "/bin/sh", but nothing with a "^M" appended.
698 <listitem><para>MacOs: CR only.
699 Printers probably print every line atop the first, and Unix tools
700 think the whole file is one line with "^M" all through it.
704 <para>To change DOS to Unix, use
705 <screen>cp <filename> <filename>.dos && cat <filename>.dos | tr -d '\r' > <filename>
707 Other conversions will probably require sed or a different use of tr
708 and are left as an exercise for the reader.
712 </qandadiv><!-- fsc -->
715 <!-- dlist: ,lfs-compile,blfs-support -->
716 <qandadiv id="compiling"><title>Compiling</title>
717 <!-- elist: ,lfs-compile,blfs-support -->
718 <qandaentry id="sig11"><question><para>I'm getting fatal errors about signal 11.</para></question>
719 <answer><para>See <ulink url="http://www.bitwizard.nl/sig11/">http://www.bitwizard.nl/sig11/</ulink>.
722 <!-- elist: ,lfs-compile,blfs-support -->
723 <qandaentry id="cross-compile"><question><para>How do I cross compile LFS?</para></question>
724 <answer><para>It's often useful to compile LFS for one machine
725 on another machine. Say using that 1Ghz Athlon
726 to build an install for an old 486.
727 While this is technically not cross compiling,
728 binaries compiled for the Athlon cannot be run on the 486
729 because binaries compiled for the newer processor
730 use features the older processor doesn't have.
731 To make the newer system compile for the older,
732 follow the hint at <ulink
733 url="http://hints.linuxfromscratch.org/hints/crosscompiling-x86.txt">http://hints.linuxfromscratch.org/hints/crosscompiling-x86.txt</ulink>
736 <!-- elist: ,lfs-compile,blfs-support -->
737 <qandaentry id="gcc-warnings"><question><para>Are compiler warnings from GCC bad?</para></question>
738 <answer><para>Short answer: no.
740 <answer><para>Long answer: probably, but only to someone
741 working on the package you're trying to compile. Mostly,
742 everything will be fine unless make quits with an error.
744 <para>Here's an example:
746 <screen>sk ~/tmp $ cat > Makefile
749 sk ~/tmp $ cat > main.c
750 void main() { exit(0); }
753 <emphasis role="strong">main.c: In function `main':
754 main.c:1: warning: return type of `main' is not `int'</emphasis>
755 sk ~/tmp $ ######## that worked ########
757 sk ~/tmp $ cat > main.c
758 int main() { e<emphasis role="strong">xx</emphasis>it(0) }
761 <emphasis role="strong">main.c: In function `main':
762 main.c:1: parse error before `}'
763 make: *** [main] Error 1</emphasis>
764 sk ~/tmp $ ######## that failed ########
769 <!-- elist: ,lfs-compile -->
770 <qandaentry id="perm-denied">
771 <question><para>I'm getting `/dev/null: Permission denied'</para></question>
772 <answer><para>Does /dev/null look like this:
773 <screen>$ ls -l /dev/null
774 crw-rw-rw- 1 root root 1, 3 Aug 3 2000 /dev/null
777 See the chmod(1), chown(1), and mknod(1) man pages
778 and /usr/src/linux/Documentation/devices.txt if you need help fixing it.
780 <para>If it does look right,
781 the problem is probably your mount options.
782 See the answer to "<link
783 linkend="bad-interpreter-permission-denied">./configure: bad
784 interpreter: Permission denied</link>", above.
788 <!-- elist: ,lfs-compile -->
789 <qandaentry id="conf-guess-fail"><question><para>configure can't guess my host type.</para></question>
790 <answer><para>Typical symptoms look like this:
792 <screen>sk ~/tmp-0.0 $ ./configure
793 creating cache ./config.cache
794 checking host system type... <emphasis role="strong">configure: error: can not guess host type; you must specify one</emphasis>
797 <para>The problem is usually that the script can't run the compiler.
798 Usually it's just a missing /usr/bin/cc symlink. You can fix it like
804 <para>If that doesn't do it, check the file config.log created by configure.
805 Errors go here and may indicate the problem.
808 <!-- elist: ,blfs-support -->
809 <qandaentry id="missing-x-includes"><question><para>A package can't find Xlib.h.</para></question>
810 <answer><para>Typical symptoms look like this:
812 <screen>sk ~/tmp $ cat > Makefile
815 sk ~/tmp $ cat > x11.c
816 #include <X11/Xlib.h>
817 int main() { exit(0); }
820 <emphasis role="strong">x11.c:1: X11/Xlib.h: No such file or directory
821 make: *** [x11] Error 1</emphasis>
824 <para>Creating a couple symlinks will fix this. Here are the commands:
829 ln -s ../X11/include/X11 X11
832 <!-- elist: ,lfs-compile,blfs-support -->
833 <qandaentry id="stdgnu89"><question><para>I'm having trouble compiling something with GCC 3.x</para></question>
834 <answer><para>You should be aware that you're on the bleeding edge.
835 As of 3.0, the LFS Book recommends GCC 2.95.3.
836 However, there are some things you can do:
838 <answer><para>Try adding the -std=gnu89 switch to the compile options.
839 (For instance, in CFLAGS or CC.
840 The exact method is a bit beyond the scope of this FAQ.)
843 </qandadiv><!-- compiling -->
844 <!-- dlist: ,lfs-compile,blfs-support -->
845 <qandadiv id="specific-packages"><title>Questions about specific packages.</title>
846 <!-- elist: ,lfs-support,blfs-support -->
847 <qandaentry id="how-to-create-user"><question><para>How do I create a non-root user?</para></question>
848 <answer><para>Use the useradd program. It was installed with the shadow package.
851 <!-- elist: ,lfs-compile -->
852 <qandaentry id="sh-utils-getloadavg"><question><para>My static sh-utils build is failing with "undefined reference to `getloadavg'".</para></question>
853 <answer><para>If you're trying to build static sh-utils and you're getting an error like this:
854 <screen>gcc -g -O2 -static -o uptime uptime.o ../lib/libsu.a -lutil
855 uptime.o: In function `print_uptime':
856 /lfs/tmp/sh-utils-2.0/src/uptime.c:125: undefined reference to `getloadavg'
857 collect2: ld returned 1 exit status
858 make[2]: *** [uptime] Error 1
859 make[2]: Leaving directory `/lfs/tmp/sh-utils-2.0/src'
860 make[1]: *** [all-recursive] Error 1
861 make[1]: Leaving directory `/lfs/tmp/sh-utils-2.0'
862 make: *** [all-recursive-am] Error 2
864 I am unable to reproduce this error and so cannot present
865 a tested solution, but two solutions have been posted by others.
866 I suggest trying them in the following order:
868 <listitem><para><ulink url="http://archive.linuxfromscratch.org/mail-archives/blfs-support/2001/06/0507.html">http://archive.linuxfromscratch.org/mail-archives/blfs-support/2001/06/0507.html</ulink>:
869 This attempts to correct the incorrectly generated config.h
870 and should be the correct solution if you can get it to work
871 by following the description given in the post.
873 <listitem><para>If that doesn't work, delete the sources,
874 re-extract, and try this:
875 <ulink url="http://archive.linuxfromscratch.org/mail-archives/blfs-support/2001/06/0495.html">http://archive.linuxfromscratch.org/mail-archives/blfs-support/2001/06/0495.html</ulink>
876 This attempts to avoid compiling uptime at all
877 since it won't be needed in chroot
878 and compiling uptime dynamically in chroot
879 doesn't have this problem.
885 <!-- elist: ,blfs-support -->
886 <qandaentry id="f-hostname"><question><para>My hostname is getting set to "-f"!</para></question>
887 <answer><para>You need to install the net-tools package. (See the instructions in
890 <para>The hostname command your system is using is from sh-utils and doesn't
891 support the -f option. When it is called with the -f option it assumes
892 the hostname should be set to "-f". The hostname command from net-tools
893 doesn't have this problem.
896 <!-- elist: ,lfs-support,blfs-support -->
897 <qandaentry id="kernel-modules"><question><para>How do I setup kernel modules?</para></question>
898 <answer><para>Follow the Module-HOWTO at <ulink
899 url="http://www.linuxdoc.org/HOWTO/Module-HOWTO/">http://www.linuxdoc.org/HOWTO/Module-HOWTO/</ulink>.
902 <!-- elist: ,lfs-compile --><!--
903 <qandaentry id="fileutils-error"><question><para>I'm getting errors when compiling fileutils.</para></question>
904 <answer><para>You may need to upgrade to the latest version or apply the fileutils patch.
905 Both are available from <ulink
906 url="http://download.linuxfromscratch.org/conglomeration/">http://download.linuxfromscratch.org/conglomeration/</ulink>.
910 <!-- elist: ,lfs-support --><!-- 2001-09-29
911 <qandaentry id="glibc-crypt"><question><para>Where is glibc-crypt-2.2.x?</para></question>
912 <answer><para>As of glibc-2.2, you no longer need to get glibc-crypt separately.
913 It has been merged into the main package because the US
914 has relaxed it's export regulations.
918 <!-- elist: ,lfs-support -->
919 <qandaentry id="lilo-errors"><question><para>What do those LILO errors mean?</para></question>
920 <answer><para>The documentation in the LILO distribution lists all errors
921 (such as when it prints "LI" and stops),
922 but a quick overview is available at <ulink
923 url="http://sdb.suse.de/sdb/en/html/kgw_lilo_errmsg.html">http://sdb.suse.de/sdb/en/html/kgw_lilo_errmsg.html</ulink>.
926 <!-- elist: ,lfs-support -->
927 <qandaentry id="net-pf-x"><question><para>I'm getting errors about net-pf-?.</para></question>
928 <answer><para>When you compiled net-tools you enabled support for a protocol
929 family (that's where the "pf" comes from) that you didn't
930 enable support for in the kernel. (You probably just accepted
931 the default answers.)
933 <para>A full list is in /usr/include/linux/socket.h but here is
934 a list of the likely culprits:
936 <listitem><para>net-pf-3: Amateur Radio AX.25 (AF_AX25)
938 <listitem><para>net-pf-4: Novell IPX (AF_IPX)
940 <listitem><para>net-pf-5: AppleTalk DDP (AF_APPLETALK)
942 <listitem><para>net-pf-6: Amateur Radio NET/ROM (AF_NETROM)
944 <listitem><para>net-pf-9: Reserved for X.25 project (AF_X25)
948 <para>Naturally the fix is to recompile net-tools without support
949 for the things you don't need. (Or recompile your kernel with
950 support if you find you actually wanted them.) The workaround
951 to put a line like the following in /etc/modules.conf
953 <screen>alias net-pf-? off
955 <para>Replace the question mark with the correct number, of course.
958 <answer><para>If you get an error about net-pf-7, you probably need to
959 enable support for the loopback network device (not block
960 device) in your kernel. Or you may need to add the following
961 line to /etc/modules.conf and rerun depmod.
963 <screen>alias net-pf-7 loop
966 <!-- elist: ,lfs-support -->
967 <qandaentry id="char-major-10-135"><question><para>I'm getting errors about char-major-10-135.</para></question>
968 <answer><para>Errors about char-major-10-135 refer to the character device,
969 major 10, minor 135, which is /dev/rtc.
970 It provides access to the BIOS clock, or RTC, the Real Time Clock.
971 Check /usr/src/linux/Documentation/rtc.txt for more information.
973 <para>Something, most likely hwclock, is trying to use it
974 but you haven't configured kernel support for it in your kernel.
975 Either delete /dev/rtc so hwclock won't try to use it
976 or enable RTC support in your kernel.
977 It's located in make menuconfig under
978 "Character devices" -> "Enhanced Real Time Clock Support".
981 </qandadiv><!-- specific-packages -->
982 <!-- dlist: ,lfs-dev,lfs-support,xblfs-support -->
983 <qandadiv id="additions"><title>Additions / Changes to LFS.</title>
984 <!-- elist: ,lfs-dev -->
985 <qandaentry id="new-version"><question><para>There's a new version of package Foo.</para></question>
986 <answer><para>There's no need to mention it unless you have something
987 useful to add such as changes in the compile instructions.
988 If it isn't already in CVS, it's on the todo list or
989 we've chosen not to use it for some reason. A search of
990 the list archives may reveal the reason.
994 <!-- elist: ,lfs-dev -->
995 <qandaentry id="kernel-header-copy"><question><para>Why copy the kernel headers instead of linking them?</para></question>
996 <answer><para>In short, we copy the kernel headers
997 instead of linking them because
998 the kernel headers should match the currently running libc,
999 not the currently running kernel.
1001 <answer><para>For the long answer see these:
1003 <listitem><para>A post by Linus himself: <ulink
1004 url="http://www.uwsg.iu.edu/hypermail/linux/kernel/0007.3/0587.html">http://www.uwsg.iu.edu/hypermail/linux/kernel/0007.3/0587.html</ulink>
1006 <listitem><para>Kernel Traffic #80, 4. Symlinks In The Kernel; Kernel/Library/etc Interface Dispute: <ulink
1007 url="http://kt.zork.net/kernel-traffic/kt20000814_80.txt">http://kt.zork.net/kernel-traffic/kt20000814_80.txt</ulink>
1008 (This covers the thread in which the above post occurred.)
1014 <!-- dlist: ,lfs-support,xblfs-support -->
1015 <!-- <qandadiv id="setup-polishing"><title>Polishing your setup.</title>-->
1017 <para>These don't really belong in the FAQ,
1018 but they come up often on the lists.
1022 <!-- elist: ,lfs-support -->
1023 <qandaentry id="less-prints-ad">
1024 <question><para>Why does less (and therefore man) print <AD> instead of
1025 hyphens?</para></question>
1026 <answer><para>Because the LANG and LC_ALL environment variables aren't set.
1027 To fix that, set them in the ~/.bashrc file for each user or in /etc/profile
1028 by adding lines like this:
1029 <screen>export LANG=en_US
1033 <para>Those lines can be added to /etc/profile with the following command:
1034 <screen>echo -e 'export LANG=en_US\nexport LC_ALL=en_US' >> /etc/profile
1037 <para>You'll have to change the "en_US" part if you don't use US English.
1041 <!-- elist: ,xblfs-support --><!-- 2002-03-27 now in BLFS. hoping a pointer
1043 <qandaentry id="which"><question><para>Where's which?</para></question>
1044 <answer><para>It's not in there! A proper which is available
1045 from the GNU Project at
1046 <ulink url="ftp://ftp.gnu.org/gnu/which/">ftp://ftp.gnu.org/gnu/which/</ulink>
1048 <ulink url="http://www.xs4all.nl/~carlo17/which/">http://www.xs4all.nl/~carlo17/which/</ulink>.
1049 Or for systems that don't require a good user environment
1050 the simplest thing is probably to create a shell script
1051 using these commands:
1053 <screen>cat > /usr/bin/which << "EOF"
1059 chmod 755 /usr/bin/which
1060 chown root.root /usr/bin/which
1065 </qandadiv><!-- additions -->