cvs commit: LFS/latex/chapter06 kernel.tex

gerard at linuxfromscratch.org gerard at linuxfromscratch.org
Mon Feb 17 16:03:47 PST 2003


gerard      03/02/17 19:03:47

  Modified:    latex/chapter06 kernel.tex
  Log:
  done kernel
  
  Revision  Changes    Path
  1.5       +95 -91    LFS/latex/chapter06/kernel.tex
  
  Index: kernel.tex
  ===================================================================
  RCS file: /home/cvsroot/LFS/latex/chapter06/kernel.tex,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- kernel.tex	17 Feb 2003 22:35:50 -0000	1.4
  +++ kernel.tex	18 Feb 2003 00:03:47 -0000	1.5
  @@ -1,55 +1,52 @@
   \newpage
  -Installing Linux-2.4.20 headers
  +\section{Installing Linux-2.4.20 headers}
   
  -Estimated build time:           0.02 SBU
  -Estimated required disk space:  142 MB
  +\begin{tabular}{@{}ll}
  +Estimated build time: & 0.02 SBU\\
  +Estimated required disk space: & 142 MB
  +\end{tabular}
   
   
  -Contents of Linux
  +\section{Contents of Linux}
   
   Last checked against version 2.4.18.
   
  -The Linux kernel is at the core of every Linux system. It's what makes
  -Linux tick. When a computer is turned on and boots a Linux system, the
  -very first piece of Linux software that gets loaded is the kernel. The
  -kernel initializes the system's hardware components: serial ports,
  -parallel ports, sound cards, network cards, IDE controllers, SCSI
  -controllers and a lot more. In a nutshell the kernel makes the
  -hardware available so that the software can run.
  +\bigskip \noindent The Linux kernel is at the core of every Linux system.
  +It's what makes Linux tick. When a computer is turned on and boots a Linux
  +system, the very first piece of Linux software that gets loaded is the
  +kernel. The kernel initializes the system's hardware components: serial
  +ports, parallel ports, sound cards, network cards, IDE controllers, SCSI
  +controllers and a lot more. In a nutshell the kernel makes the hardware
  +available so that the software can run.
   
  -Linux installs the following files:
  +\bigskip \noindent Linux installs the following files:
   
  -
  -Program Files
  +\subsubsection{Program Files}
   
   kernel and kernel headers
   
   
  -
  -
  -Linux Installation Dependencies
  +\subsection{Linux Installation Dependencies}
   
   Last checked against version 2.4.17.
   
  -Bash: sh
  -Binutils: ar, as, ld, nm, objcopy
  -Fileutils: cp, ln, mkdir, mv, rm, touch
  -Findutils: find, xargs
  -Gcc: cc1, collect2, cpp0, gcc
  -Grep: grep
  -Gzip: gzip
  -Make: make
  -Gawk: awk
  -Modutils: depmod, genksyms
  -Net-tools: dnsdomainname, hostname
  -Sed: sed
  -Sh-utils: basename, date, expr, pwd, stty, uname, whoami, yes
  +\bigskip \noindent Bash: sh\\
  +Binutils: ar, as, ld, nm, objcopy\\
  +Fileutils: cp, ln, mkdir, mv, rm, touch\\
  +Findutils: find, xargs\\
  +Gcc: cc1, collect2, cpp0, gcc\\
  +Grep: grep\\
  +Gzip: gzip\\
  +Make: make\\
  +Gawk: awk\\
  +Modutils: depmod, genksyms\\
  +Net-tools: dnsdomainname, hostname\\
  +Sed: sed\\
  +Sh-utils: basename, date, expr, pwd, stty, uname, whoami, yes\\
   Textutils: cat, md5sum, sort, tail
   
   
  -
  -
  -Installation of the kernel headers
  +\subsection{Installation of the kernel headers}
   
   We won't be compiling a new kernel yet -- we'll do that when we have
   finished the installation of all the packages. But as some packages
  @@ -68,90 +65,97 @@
   on your machine and then that person would have write access to the
   kernel source.
   
  -In light of this, you might want to run chown -R 0:0 on the
  -linux-2.4.20 directory to ensure all files are owned by user root.
  +In light of this, you might want to run \command{chown -R 0:0} on the\\
  +\filename|linux-2.4.20| directory to ensure all files are owned by user
  +\username{root}.
   
  -Kernel header installation requires the pwd program. In the kernel
  -source the path to the pwd program is hard-wired as /bin/pwd. Create a
  -symlink to account for that:
  +Kernel header installation requires the \command{pwd} program. In the
  +kernel source the path to the pwd program is hard-wired as
  +\filename|/bin/pwd|. Create a symlink to account for that:
   
  -ln -s /static/bin/pwd /bin/pwd
  +\bigskip \command{ln -s /static/bin/pwd /bin/pwd}
   
  -Prepare for header installation:
  +\bigskip \noindent Prepare for header installation:
   
  -make mrproper
  +\bigskip \command{make mrproper}
   
  -This ensures that the kernel tree is absolutely clean. The kernel team
  -recommends that this command be issued prior to each kernel
  +\bigskip \noindent This ensures that the kernel tree is absolutely clean.
  +The kernel team recommends that this command be issued prior to each kernel
   compilation. You shouldn't rely on the source tree being clean after
   untarring.
   
  -Create the include/linux/version.h file:
  +\bigskip \noindent Create the \filename|include/linux/version.h| file:
   
  -make include/linux/version.h
  +\bigskip \command{make include/linux/version.h}
   
  -Create the platform-specific include/asm symlink:
  +\bigskip \noindent Create the platform-specific \filename|include/asm| symlink:
   
  -make symlinks
  +\bigskip \command{make symlinks}
   
  -Install the platform specific-header files:
  +\bigskip \noindent Install the platform specific-header files:
   
  -cp -HR include/asm /usr/include \&\&
  -cp -R include/asm-generic /usr/include
  +\bigskip \command{cp -HR include/asm /usr/include \&\&\\
  +\indent cp -R include/asm-generic /usr/include}
   
  -Install the cross-platform kernel header files:
  +\bigskip \noindent Install the cross-platform kernel header files:
   
  -cp -R include/linux /usr/include
  +\bigskip \command{cp -R include/linux /usr/include}
   
  -There are a few kernel header files which make use of the autoconf.h
  -header file. Since we do not yet configure the kernel, we need to
  -create this file ourselves in order to avoid compilation failures.
  -Create an empty autoconf.h file:
  +\bigskip \noindent There are a few kernel header files which make use of
  +the \filename|autoconf.h| header file. Since we do not yet configure the
  +kernel, we need to create this file ourselves in order to avoid compilation
  +failures.  Create an empty \filename|autoconf.h| file:
   
  -touch /usr/include/linux/autoconf.h
  +\bigskip \command{touch /usr/include/linux/autoconf.h}
   
  -Since the /bin/pwd symlink we created earlier was only temporary, it
  -can now be removed:
  +\bigskip \indent Since the \filename|/bin/pwd| symlink we created earlier
  +was only temporary, it can now be removed:
   
  -rm /bin/pwd
  +\bigskip \command{rm /bin/pwd}
   
   
  +\subsection{Why we copy the kernel headers and don't symlink them}
   
  +In the past it was common practice to symlink the
  +\filename|/usr/include/linux| and \filename|/usr/include/asm| directories
  +to \filename|/usr/src/linux/include/linux| and
  +\filename|/usr/src/linux/include/asm| respectively. This was a bad
  +practice, as the following extract from a post by Linus Torvalds to the
  +Linux Kernel Mailing List points out:
   
  -Why we copy the kernel headers and don't symlink them
   
  -In the past it was common practice to symlink the
  -/usr/include/\{linux,asm\} directories to
  -/usr/src/linux/include/\{linux,asm\}. This was a bad practice, as the
  -following extract from a post by Linus Torvalds to the Linux Kernel
  -Mailing List points out:
  +\newpage
  +\begin{BVerbatim}
   I would suggest that people who compile new kernels should:
   
  -- not have a single symbolic link in sight (except the one that the
  -kernel build itself sets up, namely the "linux/include/asm" symlink
  -that is only used for the internal kernel compile itself)
  -
  -And yes, this is what I do. My /usr/src/linux still has the old 2.2.13
  -header files, even though I haven't run a 2.2.13 kernel in a \_loong\_
  -time. But those headers were what glibc was compiled against, so those
  -headers are what matches the library object files.
  -
  -And this is actually what has been the suggested environment for at
  -least the last five years. I don't know why the symlink business keeps
  -on living on, like a bad zombie. Pretty much every distribution still
  -has that broken symlink, and people still remember that the linux
  -sources should go into "/usr/src/linux" even though that hasn't been
  -true in a \_loong\_ time.
  -
  -The essential part is where Linus states that the header files should
  -be the ones which glibc was compiled against. These are the headers
  -that should be used when you later compile other packages, as they are
  -the ones that match the object-code library files. By copying the
  -headers, we ensure that they remain available if later you upgrade
  -your kernel.
  +- not have a single symbolic link in sight (except the one
  +that the kernel build itself sets up, namely the
  +"linux/include/asm" symlink that is only used for the inter-
  +nal kernel compile itself)
  +
  +And yes, this is what I do. My /usr/src/linux still has the
  +old 2.2.13 header files, even though I haven't run a 2.2.13
  +kernel in a _loong_ time. But those headers were what glibc
  +was compiled against, so those headers are what matches the
  +library object files.
  +
  +And this is actually what has been the suggested environment
  +for at least the last five years. I don't know why the sym-
  +link business keeps on living on, like a bad zombie. Pretty
  +much every distribution still has that broken symlink, and
  +people still remember that the linux sources should go into
  +"/usr/src/linux" even though that hasn't been true in a
  +_loong_ time.
  +\end{BVerbatim}
  +
  +\bigskip \noindent The essential part is where Linus states that the header
  +files should be the ones which glibc was compiled against. These are the
  +headers that should be used when you later compile other packages, as they
  +are the ones that match the object-code library files. By copying the
  +headers, we ensure that they remain available if later you upgrade your
  +kernel.
   
   Note, by the way, that it is perfectly all right to have the kernel
  -sources in /usr/src/linux, as long as you don't have the
  -/usr/include/\{linux,asm\} symlinks.
  -
  +sources in \filename|/usr/src/linux|, as long as you don't have the
  +\filename|/usr/include/linux| and \filename|/usr/include/asm| symlinks.
   
  
  
  
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-book' in the subject header of the message



More information about the lfs-book mailing list