version 2.1 - ready to publish

This commit is contained in:
dhorton 2004-02-18 23:32:19 +00:00
parent adcc548a6d
commit 36870c5f3f
12 changed files with 732 additions and 242 deletions

View File

@ -13,6 +13,7 @@
<!ENTITY phase7 SYSTEM "phase7.xml">
<!ENTITY wrap-up SYSTEM "wrap-up.xml">
<!ENTITY appendix-a SYSTEM "appendix-a.xml">
<!ENTITY license SYSTEM "fdl.xml">
]>
<book>
@ -33,6 +34,13 @@
<revhistory>
<revision>
<revnumber>2.1</revnumber>
<date>2004-02-18</date>
<authorinitials>DH</authorinitials>
<revremark>Corrected typos. Changed resource site hosting to SourceForge. Added appendix B to include the GNU Free Documentation License as part of this document.</revremark>
</revision>
<revision>
<revnumber>2.0</revnumber>
<date>2003-11-08</date>
@ -83,6 +91,6 @@ The Pocket Linux Guide is for anyone interested in learning the techniques of bu
&phase7;
&wrap-up;
&appendix-a;
&license;
</book>

View File

@ -6,12 +6,12 @@
<title>Analysis</title>
<para>An operating system by itself is not much fun. What makes an OS
great is the applications that can be run on top of it. Unfortunately, the
Pocket Distribution currently does not have much room for anything other
than system programs. Still, it would be nice to expand the system just
enough to host some cool applications. Obviously a full-blown X-Windows
GUI is out of the question, but running a small console based program
should be within our reach.</para>
great is the applications that can be run on top of it. Unfortunately,
Pocket Linux currently does not have much room for anything other than
system programs. Still, it would be nice to expand the system just enough
to host some cool applications. Obviously a full-blown X-Windows GUI is
out of the question, but running a small console based program should be
within our reach.</para>
<para>Rather than doing a typical &#34;hello world&#34; program as an
example, application hosting will be demonstrated using a console based
@ -49,20 +49,19 @@
<para>There is a vast proliferation of audio hardware on the market and
each sound card has its own particular configuration. For details on how
to set up a particular sound card we can turn to the Sound-HOWTO
available from The Linux Documentation Project at <ulink
url="http://www.tldp.org">http://www.tldp.org</ulink>. In a broader
sense, however, we can treat a sound card like any other piece of new
hardware. To add new hardware to a GNU/Linux system we will need
configure the kernel to recognize it and configure <filename>/dev</filename>
files on the root disk to access it.</para>
available from <ulink url="http://www.tldp.org">The Linux Documentation
Project</ulink>. In a broader sense, however, we can treat a sound card
like any other piece of new hardware. To add new hardware to a GNU/Linux
system we will need configure the kernel to recognize it and configure
<filename>/dev</filename> files on the root disk to access it.</para>
<sect3>
<title>Kernel support for audio</title>
<para>In order to support sound cards, a new kernel will have to be
built. It is very important that audio hardware support be configured
as built-in, because the Pocket Distribution is not set up to handle
kernel modules.</para>
as built-in, because Pocket Linux is not set up to handle kernel
modules.</para>
</sect3>
<sect3>
@ -110,7 +109,7 @@
</listitem>
<listitem>
<para>The ramdisk device is dismounted.</para>
<para>The ramdisk device is unmounted.</para>
</listitem>
<listitem>
@ -209,16 +208,16 @@
<sect2>
<title>Other required files</title>
<para>We will want to have all of the required libraries and other
supporting files available as part of the compressed
<para>We will want to have all of mp3blaster&#39;s required libraries
and other supporting files available as part of the compressed
<filename>/usr</filename> image so that mp3blaster can run correctly.
The familiar <command>ldd</command> command can be used to determine
which libraries mp3blaster requires. Any additional libraries can be
placed in <filename>/usr/lib</filename>. Even though some of the
libraries may appear in <filename>/lib</filename> on the development
system, they can still go in <filename>/usr/lib</filename> on the Pocket
Linux system. The linker is smart enough to look in both places when
loading libraries.</para>
Linux system. The dynamic linker, <filename>ld-linux.so</filename>, is
smart enough to look in both places when loading libraries.</para>
<para>Because mp3blaster uses the curses (or ncurses) screen control
library there is one additional file we need. The curses library needs
@ -231,8 +230,8 @@
of the terminfo database we need is the file <filename>/usr/share/terminfo/l/linux</filename>,
because we are using a &#34;Linux&#34; terminal. For more information
about the subject of curses, see John Strang&#39;s book entitled
&#34;Programming with Curses&#34; available from O&#39;Reilly publishing
at <ulink url="http://www.oreilly.com">http://www.oreilly.com</ulink>.</para>
&#34;Programming with Curses&#34; available from <ulink
url="http://www.oreilly.com">O&#39;Reilly publishing</ulink>.</para>
</sect2>
<sect2>
@ -254,6 +253,11 @@
CD-ROM&#39;s.</para>
</listitem>
<listitem>
<para>Install the <command>gunzip</command> utility to enable
decompression of the usr image.</para>
</listitem>
<listitem>
<para>Create a startup script to load a compressed image from floppy
into a ramdisk and mount the ramdisk on <filename>/usr</filename>.</para>
@ -294,6 +298,10 @@ bash# make menuconfig</programlisting></para>
<para>RAM disk</para>
</listitem>
<listitem>
<para>Second extended (ext2) filesystem</para>
</listitem>
<listitem>
<para>Virtual console</para>
</listitem>
@ -335,8 +343,7 @@ bash# mount /dev/fd0 /mnt</programlisting></para>
<title>Unmount the boot disk</title>
<para><programlisting>bash# cd /
bash# umount /mnt
bash# sync</programlisting></para>
bash# umount /mnt</programlisting></para>
</sect3>
</sect2>
@ -375,6 +382,21 @@ bash# mknod -m664 ~/staging/dev/mixer c 14 0</programlisting></para>
</sect4>
</sect3>
<sect3>
<title>Install the gunzip binary</title>
<para><programlisting>bash# cd /usr/src/gzip-1.2.4a
bash# export CC=&#34;gcc -mcpu=i386&#34;
bash# ./configure --host=i386-pc-linux-gnu
bash# make
bash# strip gzip
bash# cp gzip ~/staging/bin
bash# ln -s gzip ~/staging/bin/gunzip</programlisting></para>
<para>Don&#39;t forget to verify library requirements, check the
ownership and check permissions on the gzip binary.</para>
</sect3>
<sect3>
<title>Write a startup script to mount a compressed floppy</title>
@ -427,14 +449,6 @@ bash# gzip -9 ~/phase8-image</programlisting></para>
<para><programlisting>bash# dd if=~/phase8-image.gz of=/dev/fd0 bs=1k</programlisting></para>
</sect3>
<sect3>
<title>Unmount the root disk</title>
<para><programlisting>bash# cd /
bash# umount /mnt
bash# sync</programlisting></para>
</sect3>
</sect2>
<sect2>
@ -469,8 +483,14 @@ bash# cp src/mp3blaster ~/usr-staging/bin</programlisting></para>
<sect3>
<title>Copy additional libraries and terminfo</title>
<para>Note: This is an example from the author&#39;s development
system. Different systems may yield slightly different results.</para>
<para>Use <command>ldd</command> to find out which libraries are
needed for mp3blaster.</para>
<note>
<para>The following is an example from the author&#39;s development
system. It is possible that different systems may yield slightly
different results in terms of library requirements.</para>
</note>
<para><programlisting>bash# cd ~/usr-staging/lib
bash# ldd ~/usr-staging/bin/mp3blaster
@ -478,7 +498,7 @@ bash# cp /usr/lib/ncurses.so.5.0 .
bash# cp /usr/lib/stdc++.so.3 .
bash# cp /lib/libm.so.6 .
bash# cp /usr/lib/libgcc_s.so.1 .
bash# cd ~/usr/staging/share/terminfo/l
bash# cd ~/usr-staging/share/terminfo/l
bash# cp /usr/share/terminfo/l/linux .</programlisting></para>
</sect3>
@ -570,6 +590,8 @@ ac97_codec: AC97 Audio codec, id: 0x4144:0x5303 (Analog Devices AD1819)
<sect2>
<title>Play a sample file</title>
<para>Insert the diskette containing the sample audio file.</para>
<para><programlisting>mount /dev/fd0 /home
bash# /usr/bin/mp3blaster</programlisting></para>

View File

@ -0,0 +1,431 @@
<appendix id="gfdl">
<title>GNU Free Documentation License</title>
<subtitle>Version 1.2, November 2002</subtitle>
<blockquote id="fsf-copyright">
<para>Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.</para>
</blockquote>
<section id="gfdl-0"><title>PREAMBLE</title>
<para>The purpose of this License is to make a manual, textbook, or
other functional and useful document "free" in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it, with
or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible for
modifications made by others.</para>
<para>This License is a kind of "copyleft", which means that derivative
works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft license
designed for free software.</para>
<para>We have designed this License in order to use it for manuals for
free software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does. But this License is not limited to software manuals; it
can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.</para>
</section>
<section id="gfdl-1"><title>APPLICABILITY AND DEFINITIONS</title>
<para id="gfdl-doc">This License applies to any manual or other work, in
any medium, that contains a notice placed by the copyright holder saying
it can be distributed under the terms of this License. Such a notice
grants a world-wide, royalty-free license, unlimited in duration, to use
that work under the conditions stated herein. The "Document", below,
refers to any such manual or work. Any member of the public is a
licensee, and is addressed as "you". You accept the license if you
copy, modify or distribute the work in a way requiring permission under
copyright law.</para>
<para id="gfdl-mod-ver">A "Modified Version" of the Document means any
work containing the Document or a portion of it, either copied verbatim,
or with modifications and/or translated into another language.</para>
<para id="gfdl-secnd-sect">A "Secondary Section" is a named appendix or
a front-matter section of the Document that deals exclusively with the
relationship of the publishers or authors of the Document to the
Document's overall subject (or to related matters) and contains nothing
that could fall directly within that overall subject. (Thus, if the
Document is in part a textbook of mathematics, a Secondary Section may
not explain any mathematics.) The relationship could be a matter of
historical connection with the subject or with related matters, or of
legal, commercial, philosophical, ethical or political position
regarding them.</para>
<para id="gfdl-inv-sect">The "Invariant Sections" are certain Secondary
Sections whose titles are designated, as being those of Invariant
Sections, in the notice that says that the Document is released under
this License. If a section does not fit the above definition of
Secondary then it is not allowed to be designated as Invariant. The
Document may contain zero Invariant Sections. If the Document does not
identify any Invariant Sections then there are none.</para>
<para id="gfdl-cov-text">The "Cover Texts" are certain short passages of
text that are listed, as Front-Cover Texts or Back-Cover Texts, in the
notice that says that the Document is released under this License. A
Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at
most 25 words.</para>
<para id="gfdl-transparent">A "Transparent" copy of the Document means a
machine-readable copy, represented in a format whose specification is
available to the general public, that is suitable for revising the
document straightforwardly with generic text editors or (for images
composed of pixels) generic paint programs or (for drawings) some widely
available drawing editor, and that is suitable for input to text
formatters or for automatic translation to a variety of formats suitable
for input to text formatters. A copy made in an otherwise Transparent
file format whose markup, or absence of markup, has been arranged to
thwart or discourage subsequent modification by readers is not
Transparent. An image format is not Transparent if used for any
substantial amount of text. A copy that is not "Transparent" is called
"Opaque".</para>
<para>Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format, SGML or
XML using a publicly available DTD, and standard-conforming simple HTML,
PostScript or PDF designed for human modification. Examples of
transparent image formats include PNG, XCF and JPG. Opaque formats
include proprietary formats that can be read and edited only by
proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the machine-generated
HTML, PostScript or PDF produced by some word processors for output
purposes only.</para>
<para id="gfdl-title-page">The "Title Page" means, for a printed book,
the title page itself, plus such following pages as are needed to hold,
legibly, the material this License requires to appear in the title page.
For works in formats which do not have any title page as such, "Title
Page" means the text near the most prominent appearance of the work's
title, preceding the beginning of the body of the text.</para>
<para id="gfdl-entitled">A section "Entitled XYZ" means a named subunit
of the Document whose title either is precisely XYZ or contains XYZ in
parentheses following text that translates XYZ in another language.
(Here XYZ stands for a specific section name mentioned below, such as
"Acknowledgements", "Dedications", "Endorsements", or "History".) To
"Preserve the Title" of such a section when you modify the Document
means that it remains a section "Entitled XYZ" according to this
definition.</para>
<para>The Document may include Warranty Disclaimers next to the notice
which states that this License applies to the Document. These Warranty
Disclaimers are considered to be included by reference in this License,
but only as regards disclaiming warranties: any other implication that
these Warranty Disclaimers may have is void and has no effect on the
meaning of this License.</para>
</section>
<section id="gfdl-2"><title>VERBATIM COPYING</title>
<para>You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies to
the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further copying
of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
</para>
<para>You may also lend copies, under the same conditions stated above,
and you may publicly display copies.</para>
</section>
<section id="gfdl-3"><title>COPYING IN QUANTITY</title>
<para>If you publish printed copies (or copies in media that commonly
have printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover Texts:
Front-Cover Texts on the front cover, and Back-Cover Texts on the back
cover. Both covers must also clearly and legibly identify you as the
publisher of these copies. The front cover must present the full title
with all words of the title equally prominent and visible. You may add
other material on the covers in addition. Copying with changes limited
to the covers, as long as they preserve the title of the Document and
satisfy these conditions, can be treated as verbatim copying in other
respects.</para>
<para>If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.</para>
<para>If you publish or distribute Opaque copies of the Document
numbering more than 100, you must either include a machine-readable
Transparent copy along with each Opaque copy, or state in or with each
Opaque copy a computer-network location from which the general
network-using public has access to download using public-standard
network protocols a complete Transparent copy of the Document, free of
added material. If you use the latter option, you must take reasonably
prudent steps, when you begin distribution of Opaque copies in quantity,
to ensure that this Transparent copy will remain thus accessible at the
stated location until at least one year after the last time you
distribute an Opaque copy (directly or through your agents or retailers)
of that edition to the public.</para>
<para>It is requested, but not required, that you contact the authors of
the Document well before redistributing any large number of copies, to
give them a chance to provide you with an updated version of the
Document.</para>
</section>
<section id="gfdl-4"><title>MODIFICATIONS</title>
<para>You may copy and distribute a Modified Version of the Document
under the conditions of sections 2 and 3 above, provided that you
release the Modified Version under precisely this License, with the
Modified Version filling the role of the Document, thus licensing
distribution and modification of the Modified Version to whoever
possesses a copy of it. In addition, you must do these things in the
Modified Version:</para>
<orderedlist id="gfdl-modif-cond" numeration="upperalpha">
<listitem><simpara>Use in the Title Page (and on the covers, if any) a
title distinct from that of the Document, and from those of previous
versions (which should, if there were any, be listed in the History
section of the Document). You may use the same title as a previous
version if the original publisher of that version gives permission.
</simpara></listitem>
<listitem><simpara>List on the Title Page, as authors, one or more
persons or entities responsible for authorship of the modifications in
the Modified Version, together with at least five of the principal
authors of the Document (all of its principal authors, if it has fewer
than five), unless they release you from this requirement.
</simpara></listitem>
<listitem><simpara>State on the Title page the name of the publisher of
the Modified Version, as the publisher.</simpara></listitem>
<listitem><simpara>Preserve all the copyright notices of the Document.
</simpara></listitem>
<listitem><simpara>Add an appropriate copyright notice for your
modifications adjacent to the other copyright notices.
</simpara></listitem>
<listitem><simpara>Include, immediately after the copyright notices, a
license notice giving the public permission to use the Modified
Version under the terms of this License, in the form shown in the
<link linkend="gfdl-addendum">Addendum</link> below.
</simpara></listitem>
<listitem><simpara>Preserve in that license notice the full lists of
Invariant Sections and required Cover Texts given in the Document's
license notice.</simpara></listitem>
<listitem><simpara>Include an unaltered copy of this License.
</simpara></listitem>
<listitem><simpara>Preserve the section Entitled "History", Preserve its
Title, and add to it an item stating at least the title, year, new
authors, and publisher of the Modified Version as given on the Title
Page. If there is no section Entitled "History" in the Document,
create one stating the title, year, authors, and publisher of the
Document as given on its Title Page, then add an item describing the
Modified Version as stated in the previous sentence.
</simpara></listitem>
<listitem><simpara>Preserve the network location, if any, given in the
Document for public access to a Transparent copy of the Document, and
likewise the network locations given in the Document for previous
versions it was based on. These may be placed in the "History"
section. You may omit a network location for a work that was
published at least four years before the Document itself, or if the
original publisher of the version it refers to gives permission.
</simpara></listitem>
<listitem><simpara>For any section Entitled "Acknowledgements" or
"Dedications", Preserve the Title of the section, and preserve in the
section all the substance and tone of each of the contributor
acknowledgements and/or dedications given therein.
</simpara></listitem>
<listitem><simpara>Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers or the
equivalent are not considered part of the section titles.
</simpara></listitem>
<listitem><simpara>Delete any section Entitled "Endorsements".
Such a section may not be included in the Modified Version.
</simpara></listitem>
<listitem><simpara>Do not retitle any existing section to be Entitled
"Endorsements" or to conflict in title with any Invariant Section.
</simpara></listitem>
<listitem><simpara>Preserve any Warranty Disclaimers.
</simpara></listitem>
</orderedlist>
<para>If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.</para>
<para>You may add a section Entitled "Endorsements", provided it
contains nothing but endorsements of your Modified Version by various
parties--for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.</para>
<para>You may add a passage of up to five words as a Front-Cover Text,
and a passage of up to 25 words as a Back-Cover Text, to the end of the
list of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or through
arrangements made by) any one entity. If the Document already includes
a cover text for the same cover, previously added by you or by
arrangement made by the same entity you are acting on behalf of, you may
not add another; but you may replace the old one, on explicit permission
from the previous publisher that added the old one.</para>
<para>The author(s) and publisher(s) of the Document do not by this
License give permission to use their names for publicity for or to
assert or imply endorsement of any Modified Version.</para>
</section>
<section id="gfdl-5"><title>COMBINING DOCUMENTS</title>
<para>You may combine the Document with other documents released under
this License, under the terms defined in <link linkend="gfdl-4">section
4</link> above for modified versions, provided that you include in the
combination all of the Invariant Sections of all of the original
documents, unmodified, and list them all as Invariant Sections of your
combined work in its license notice, and that you preserve all their
Warranty Disclaimers.</para>
<para>The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by adding
at the end of it, in parentheses, the name of the original author or
publisher of that section if known, or else a unique number. Make the
same adjustment to the section titles in the list of Invariant Sections
in the license notice of the combined work.</para>
<para>In the combination, you must combine any sections Entitled
"History" in the various original documents, forming one section
Entitled "History"; likewise combine any sections Entitled
"Acknowledgements", and any sections Entitled "Dedications". You must
delete all sections Entitled "Endorsements".</para>
</section>
<section id="gfdl-6"><title>COLLECTIONS OF DOCUMENTS</title>
<para>You may make a collection consisting of the Document and other
documents released under this License, and replace the individual copies
of this License in the various documents with a single copy that is
included in the collection, provided that you follow the rules of this
License for verbatim copying of each of the documents in all other
respects.</para>
<para>You may extract a single document from such a collection, and
distribute it individually under this License, provided you insert a
copy of this License into the extracted document, and follow this
License in all other respects regarding verbatim copying of that
document.</para>
</section>
<section id="gfdl-7"><title>AGGREGATION WITH INDEPENDENT WORKS</title>
<para>A compilation of the Document or its derivatives with other
separate and independent documents or works, in or on a volume of a
storage or distribution medium, is called an "aggregate" if the
copyright resulting from the compilation is not used to limit the legal
rights of the compilation's users beyond what the individual works
permit. When the Document is included in an aggregate, this License does
not apply to the other works in the aggregate which are not themselves
derivative works of the Document.</para>
<para>If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on covers
that bracket the Document within the aggregate, or the electronic
equivalent of covers if the Document is in electronic form. Otherwise
they must appear on printed covers that bracket the whole
aggregate.</para>
</section>
<section id="gfdl-8"><title>TRANSLATION</title>
<para>Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers. In case of a disagreement between the
translation and the original version of this License or a notice or
disclaimer, the original version will prevail.</para>
<para>If a section in the Document is Entitled "Acknowledgements",
"Dedications", or "History", the requirement (section 4) to Preserve its
Title (section 1) will typically require changing the actual
title.</para>
</section>
<section id="gfdl-9"><title>TERMINATION</title>
<para>You may not copy, modify, sublicense, or distribute the Document
except as expressly provided for under this License. Any other attempt
to copy, modify, sublicense or distribute the Document is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this License
will not have their licenses terminated so long as such parties remain
in full compliance.</para>
</section>
<section id="gfdl-10"><title>FUTURE REVISIONS OF THIS LICENSE</title>
<para>The Free Software Foundation may publish new, revised versions of
the GNU Free Documentation License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in
detail to address new problems or concerns. See
http://www.gnu.org/copyleft/.</para>
<para>Each version of the License is given a distinguishing version
number. If the Document specifies that a particular numbered version of
this License "or any later version" applies to it, you have the option
of following the terms and conditions either of that specified version
or of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.</para>
</section>
<section id="gfdl-addendum"><title>ADDENDUM: How to use this License for
your documents</title>
<para>To use this License in a document you have written, include a copy
of the License in the document and put the following copyright and
license notices just after the title page:</para>
<blockquote id="copyright-sample"><para>
Copyright (c) YEAR YOUR NAME.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
</para></blockquote>
<para>If you have Invariant Sections, Front-Cover Texts and Back-Cover
Texts, replace the "with...Texts." line with this:</para>
<blockquote id="inv-cover-sample"><para>
with the Invariant Sections being LIST THEIR TITLES, with the
Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
</para></blockquote>
<para>If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.</para>
<para>If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of free
software license, such as the GNU General Public License, to permit
their use in free software.</para>
</section>
</appendix>

View File

@ -25,7 +25,7 @@
<para>Recently there has been a yearn for a return to the &#34;good old
days&#34; of Linux when men were men, sysadmins were hardcore geeks and
everything was compiled from source code. A notable indication of this
movement was the publication of the Linux From Scratch HOWTO version 1.0
movement was the publication of the Linux-From-Scratch-HOWTO version 1.0
by Gerard Beekmans in 1999. Being a Linux Expert once again means knowing
how to do it yourself.</para>
@ -37,12 +37,13 @@
<title>The Goal of Pocket Linux</title>
<para>The purpose of Pocket Linux is to support and encourage people who
wish to build a GNU/Linux system from nothing but source code. It is not
intended to be a full featured system, but rather to give the reader a
taste of what is involved in building an operating system from source
code. After completing the Pocket Linux system the reader should have
enough knowledge to confidently build almost any project using only source
code. Given this direction we can put a few constraints on the project.</para>
wish to explore Linux by building a GNU/Linux system from nothing but
source code. Pocket Linux is not intended to be a full featured system,
but rather to give the reader a taste of what is involved in building an
operating system from source code. After completing the Pocket Linux
system the reader should have enough knowledge to confidently build almost
any project using only source code. Given this direction we can put a few
constraints on the project.</para>
<itemizedlist>
<listitem>

View File

@ -1,90 +1,97 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<preface>
<title>Introduction</title>
<sect1>
<title>About Pocket Linux</title>
<para>
The Pocket Linux Guide demonstrates how to build a small console-based GNU/Linux system using only source code and a couple of diskettes. It is intended for Linux users who would like to gain a deeper understanding about how their system works beneath the shroud of distribution specific features and tools.
</para>
</sect1>
<sect1>
<title>Prerequisite Skills</title>
<para>
This guide is intended for intermediate to advanced Linux users. It is not intentionally obscure, but certain assumptions about the readers skill level are made. Success with this guide depends in part on being able to perform the following tasks:
</para>
<itemizedlist>
<listitem><para>Use basic shell commands</para></listitem>
<listitem><para>Reference man and info pages</para></listitem>
<listitem><para>Build a custom Linux kernel</para></listitem>
<listitem><para>Compile source code using make and related tools</para></listitem>
</itemizedlist>
</sect1>
<sect1>
<title>Project Format</title>
<para>
The Pocket Linux Guide takes a hands-on approach to learning. The guide is written with each chapter building a piece of an overall project. Chapters are further broken into sections of Analysis, Design, Construction and Implementation. This format is derived from Rapid Application Development (RAD) methodology. Without going into detail about design methodologies, the sections may be summed up as follows.
</para>
<itemizedlist>
<listitem><para>The Analysis section gives a high-level overview of what is to be accomplished in each chapter. It will introduce the tasks that need to be completed and why they are important to the overall system.</para></listitem>
<listitem><para>The Design section defines the source code packages, files and configuration necessary to address the requirements set forth in the Analysis section. Much of the theory of why certain system files exist and what their purpose is can be found here.</para></listitem>
<listitem><para>The Construction section is where all the hands on action takes place. This section goes into detail about building source code and configuring the system files.</para></listitem>
<listitem><para>The Implementation section will test the proper operation of the project at the end of each chapter. Often there are a few shell commands to perform and samples of expected screen outputs are given.</para></listitem>
</itemizedlist>
<para>
Readers interested in learning more about RAD may want to consult a textbook covering systems analysis and design or visit the following University of California, Davis website on the subject: <ulink url="http://sysdev.ucdavis.edu/WEBADM/document/rad-stages.htm">http://sysdev.ucdavis.edu/WEBADM/document/rad-stages.htm</ulink>.
</para>
</sect1>
<sect1>
<title>Help &amp; Support</title>
<para>
Readers are encouraged to visit the Pocket Linux Resource Site at <ulink url="http://my.core.com/~dhorton/linux/pocket/">http://my.core.com/~dhorton/linux/pocket/</ulink>. The resource site is home to:
</para>
<itemizedlist>
<listitem>
<para>information about the Pocket Linux mailing list.</para>
</listitem>
<listitem>
<para>a collection of diskette images for various chapters.</para>
</listitem>
<listitem>
<para>a list of additions and corrections to be addressed in upcoming versions.</para>
</listitem>
</itemizedlist>
</sect1>
<sect1>
<title>Feedback</title>
<para>
For questions and comments about Pocket Linux please visit the <ulink url="http://my.core.com/~dhorton/linux/pocket">resource site</ulink> and subscribe to the mailing list.
</para>
</sect1>
</preface>
<?xml version="1.0" encoding="ISO-8859-1"?>
<preface
><title
>Introduction</title
><sect1
><title
>About Pocket Linux</title
><para
>The Pocket Linux Guide demonstrates how to build a small console-based GNU/Linux system using only source code and a couple of diskettes. It is intended for Linux users who would like to gain a deeper understanding about how their system works beneath the shroud of distribution specific features and tools. </para
></sect1
><sect1
><title
>Prerequisite Skills</title
><para
>This guide is intended for intermediate to advanced Linux users. It is not intentionally obscure, but certain assumptions about the readers skill level are made. Success with this guide depends in part on being able to perform the following tasks: </para
><itemizedlist
><listitem
><para
>Use basic shell commands</para
></listitem
><listitem
><para
>Reference man and info pages</para
></listitem
><listitem
><para
>Build a custom Linux kernel</para
></listitem
><listitem
><para
>Compile source code using make and related tools</para
></listitem
></itemizedlist
></sect1
><sect1
><title
>Project Format</title
><para
> The Pocket Linux Guide takes a hands-on approach to learning. The guide is written with each chapter building a piece of an overall project. Chapters are further broken into sections of Analysis, Design, Construction and Implementation. This format is derived from Rapid Application Development (RAD) methodology. Without going into detail about design methodologies, the sections may be summed up as follows. </para
><itemizedlist
><listitem
><para
>The Analysis section gives a high-level overview of what is to be accomplished in each chapter. It will introduce the tasks that need to be completed and why they are important to the overall system.</para
></listitem
><listitem
><para
>The Design section defines the source code packages, files and configuration necessary to address the requirements set forth in the Analysis section. Much of the theory of why certain system files exist and what their purpose is can be found here.</para
></listitem
><listitem
><para
>The Construction section is where all the hands-on action takes place. This section goes into detail about building source code and configuring the system files.</para
></listitem
><listitem
><para
>The Implementation section will test the proper operation of the project at the end of each chapter. Often there are a few shell commands to perform and samples of expected screen outputs are given.</para
></listitem
></itemizedlist
><para
> Readers interested in learning more about RAD may want to consult a textbook covering systems analysis and design or visit the following University of California, Davis website on the subject: <ulink
url="http://sysdev.ucdavis.edu/WEBADM/document/rad-stages.htm"
>http://sysdev.ucdavis.edu/WEBADM/document/rad-stages.htm</ulink
>. </para
></sect1
><sect1
><title
>Help &#38; Support</title
><para
> Readers are encouraged to visit the Pocket Linux Resource Site at <ulink
url="http://pocket-linux.sourceforge.net"
>http://pocket-linux.sourceforge.net/</ulink
>. The resource site is home to: </para
><itemizedlist
><listitem
><para
>Information about the Pocket Linux mailing list.</para
></listitem
><listitem
><para
>A collection of diskette images for various chapters.</para
></listitem
><listitem
><para
>A list of additions and corrections to be addressed in upcoming versions.</para
></listitem
></itemizedlist
></sect1
><sect1
><title
>Feedback</title
><para
> For technical questions about Pocket Linux please visit the <ulink
url="http://pocket-linux.sourceforge.net"
>resource site</ulink
>, subscribe to the mailing list and post the question there. General comments and suggestions may be sent to the mailing list or emailed to the author directly.</para
></sect1
></preface
>

View File

@ -1,37 +1,29 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<preface id="legal">
<title>Legal Information</title>
<sect1 id="copyright">
<title>Copyright and License</title>
<para>
This document, <emphasis>Pocket Linux Guide</emphasis>, is copyrighted (c) 2003 by <emphasis>David Horton</emphasis>. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is available at <ulink url="http://www.gnu.org/copyleft/fdl.html">http://www.gnu.org/copyleft/fdl.html</ulink>.
</para>
<para>
Linux is a registered trademark of Linus Torvalds.
</para>
</sect1>
<sect1 id="disclaimer">
<title>Disclaimer</title>
<para>
No liability for the contents of this document can be accepted. Use the concepts, examples and information at your own risk. There may be errors and inaccuracies, that could be damaging to your system. Proceed with caution, and although this is highly unlikely, the author(s) do not take any responsibility.
</para>
<para>
All copyrights are held by their by their respective owners, unless specifically noted otherwise. Use of a term in this document should not be regarded as affecting the validity of any trademark or service mark. Naming of particular products or brands should not be seen as endorsements.
</para>
</sect1>
</preface>
<?xml version="1.0" encoding="ISO-8859-1"?>
<preface
id="legal"
><title
>Legal Information</title
><sect1
id="copyright"
><title
>Copyright and License</title
><para
> This document, <emphasis
>Pocket Linux Guide</emphasis
>, is copyrighted (c) 2003 - 2004 by <emphasis
>David Horton</emphasis
>. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is available at the end of this document. </para
><para
>Linux is a registered trademark of Linus Torvalds. </para
></sect1
><sect1
id="disclaimer"
><title
>Disclaimer</title
><para
>This documentation is provided as-is with no warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. Use the concepts, examples and information at your own risk. The author(s) do not take any responsibility for damages that may arise from the use of this document. </para
><para
>All copyrights are held by their respective owners, unless specifically noted otherwise. Use of a term in this document should not be regarded as affecting the validity of any trademark or service mark. Naming of particular products or brands should not be seen as endorsements. </para
></sect1
></preface
>

View File

@ -75,12 +75,12 @@
<para>For the boot disk we&#39;ll want to use a kernel that does not
require modules for the hardware we need to access. Mainly, it should
have compiled-in support for the floppy drive, ram disk and a text-based
console. If such a kernel is not available, it will need to be built
from source code using the Kernel-HOWTO as a guide. Once the kernel is
ready we can copy it to a diskette that has been prepared with a
filesystem (a.k.a. formatted). The diskette will need a few
<filename>/dev</filename> files and a <filename>lilo.conf</filename>
have compiled-in support for the floppy drive, ram disk, second extended
filesystem and a text-based console. If such a kernel is not available,
it will need to be built from source code using the Kernel-HOWTO as a
guide. Once the kernel is ready we can copy it to a diskette that has
been prepared with a filesystem (a.k.a. formatted). The diskette will
need a few <filename>/dev</filename> files and a <filename>lilo.conf</filename>
file in order to get LILO installed. The Bootdisk-HOWTO and the
lilo.conf(5) manpage will be helpful in designing the
<filename>lilo.conf</filename> file.</para>
@ -88,8 +88,8 @@
<note>
<para>It is also possible to build a boot disk using GRUB instead of
LILO. For more information, visit the <ulink
url="http://my.core.com/~dhorton/linux/pocket">resource site</ulink>
and look under &#34;related projects&#34; for Rick Stocker&#39;s
url="http://pocket-linux.sourceforge.net">resource site</ulink> and
look under &#34;related projects&#34; for Rick Stocker&#39;s
instructions on using GRUB.</para>
</note>
</sect2>
@ -98,11 +98,11 @@
<title>Root Disk</title>
<para>For the root disk we will need a floppy that has been prepared
with a filesystem. We will also need a BASH shell that is statically
linked so we can avoid the additional complexities of shared libraries.
The <command>configure</command> program in the BASH source code
recognizes the <option>--enable-static-link</option> option for this
feature. We will also be using the <option>--enable-minimal-config</option>
with a filesystem. We will also need a BASH shell that is
statically-linked so we can avoid the additional complexities of shared
libraries. The <command>configure</command> program in the BASH source
code recognizes the <option>--enable-static-link</option> option for
this feature. We will also be using the <option>--enable-minimal-config</option>
option to keep the BASH binary down to a manageable size. Additional
requirements for the root disk are a <filename>/dev</filename> directory
and a device file for the console. The <filename>console</filename>
@ -115,7 +115,7 @@
<para>There is one other, less obvious requirement to keep in mind and
that is CPU compatibility. Each generation of CPU features a more
complex architechture than its predecessor. Late generation chips have
complex architecture than its predecessor. Late generation chips have
additional registers and instructions when compared to an older 486 or
386. So a kernel optimized for a new, fast 6x86 machine will not run on
an older boxes. (See the <filename>README</filename> file in the Linux
@ -138,6 +138,13 @@
<para>Insert a blank diskette labeled &#34;boot disk&#34;.</para>
<note>
<para>It may be necessary to erase the &#34;blank&#34; diskette if it
comes factory pre-formatted for another, non-Linux operating system.
This can be done using the command <command>dd if=/dev/zero
of=/dev/fd0 bs=1k count=1440</command></para>
</note>
<para><programlisting><prompt>bash#</prompt> mke2fs -m0 /dev/fd0
<prompt>bash#</prompt> mount /dev/fd0 /mnt</programlisting></para>
</sect2>
@ -169,6 +176,10 @@
<para>RAM disk</para>
</listitem>
<listitem>
<para>Second extended (ext2) filesystem</para>
</listitem>
<listitem>
<para>Console on virtual terminal</para>
</listitem>
@ -258,11 +269,13 @@ root=/dev/fd0
<para>BASH version 2.05b, the latest version at the time of this
writing, will not build successfully when using the <option>--enable-minimal-config</option>
option. This leaves two choices. We can either fix 2.05b by applying
the patch posted on gnu.bash.bug under the subject, &#34;Compile error
in execute_cmd.c with --enable-minimal-config&#34; or we can simply
use the 2.05a version.</para>
the patch posted on <ulink url="news://gnu.bash.bug">news://gnu.bash.bug</ulink>
under the subject, &#34;Compile error in execute_cmd.c with
--enable-minimal-config&#34; or we can simply use the 2.05a version.</para>
</note>
<para>Build BASH for an i386 CPU with the following commands:</para>
<para><programlisting><prompt>bash#</prompt> cd /usr/src/bash-2.05a
<prompt>bash#</prompt> export CC=&#34;gcc -mcpu=i386&#34;
<prompt>bash#</prompt> ./configure --enable-static-link \

View File

@ -44,8 +44,8 @@
inefficient. We need a plan or a blueprint to work from. For this we can
turn to the Filesystem Hierarchy Standard (FHS) available from <ulink
url="http://www.pathname.com/fhs/">http://www.pathname.com/fhs/</ulink>.
The FHS dictates which commands should be present on a GNU/Linux system
and where they should be placed in the directory structure.</para>
The FHS dictates which commands should be present on a Linux system and
where they should be placed in the directory structure.</para>
</sect2>
<sect2>
@ -54,14 +54,14 @@
<para>The next logical question is, &#34;Now that we know what we need,
where do we get the source code?&#34; One way to find the answer to this
question is to check the manpages. We can either search the manpages
included with one of the popular GNU-Linux distributions or use one of
included with one of the popular GNU/Linux distributions or use one of
the manpage search engines listed at <ulink
url="http://www.tldp.org/docs.html#man">http://www.tldp.org/docs.html#man</ulink>.
One thing that should tip us off as to where to find the source code for
a particular command is the email address listed for reporting bugs. For
example the cat manpage lists <ulink url="bug-textutils@gnu.org.NOSPAM">bug-textutils@gnu.org</ulink>.
From this email address we can deduce that <command>cat</command> is
part of the textutils package from <ulink url="http://gnu.org">gnu.org</ulink>.</para>
example the cat manpage lists bug-textutils@gnu.org. From this email
address we can deduce that <command>cat</command> is part of the
textutils package from <ulink url="http://gnu.org">GNU</ulink>.</para>
</sect2>
<sect2>
@ -118,8 +118,8 @@
<title>Downloading Source Code</title>
<para>To fetch the source code we simply need to connect to <ulink
url="ftp://ftp.gnu.org/gnu">ftp://ftp.gnu.org/gnu</ulink> and then
navigate to the appropriate package directory.</para>
url="ftp://ftp.gnu.org/gnu">GNU&#39;s FTP site</ulink> and navigate to
the appropriate package directory.</para>
<para>When we get to the directory for textutils there are several
versions available. There is also a note informing us that the package
@ -201,6 +201,7 @@
url="ftp://ftp.gnu.org/gnu/coreutils">ftp://ftp.gnu.org/gnu/coreutils</ulink></para>
<para><programlisting><prompt>bash#</prompt> cd /usr/src/coreutils-5.0
<prompt>bash#</prompt> export CC=&#34;gcc -mcpu=i386&#34;
<prompt>bash#</prompt> ./configure --host=i386-pc-linux-gnu
<prompt>bash#</prompt> make
<prompt>bash#</prompt> cd src
@ -248,7 +249,10 @@
<prompt>bash#</prompt> cp -dpR ~/staging/* /mnt
<prompt>bash#</prompt> umount /dev/ram7
<prompt>bash#</prompt> dd if=/dev/ram7 of=~/phase3-image bs=1k
<prompt>bash#</prompt> gzip -9 ~/phase3-image</programlisting></para>
<prompt>bash#</prompt> gzip -9 ~/phase3-image</programlisting><note><para>The
process for creating the compressed root disk image will change very
little throughout the remaining chapters. Writing a small script to
handle this function can be a great time saver.</para></note></para>
</sect2>
<sect2>

View File

@ -5,7 +5,7 @@
<sect1>
<title>Analysis</title>
<para>In the previous chapter we added a lot of new commands by installing
<para>In the previous chapter we added many new commands by installing
coreutils and as a result the root disk has a lot more functionality. But
there are still a few things lacking. One thing that really stands out is
that there was no way to mount disks. In order to get a read-write root
@ -101,7 +101,7 @@
command names as keywords.</para>
<para>If we search Ibiblio&#39;s Linux Software Map (LSM) at <ulink
url="http://www.ibiblio.org/pub/linux/">http://www.ibiblio.org/pub/Linux/</ulink>
url="http://www.ibiblio.org/pub/Linux/">http://www.ibiblio.org/pub/Linux/</ulink>
for the keyword &#34;fsck&#34; we get a large number of matches. Since
we are using a Second Extended filesystem, called ext2 for short, we can
refine the search using &#34;ext2&#34; as a keyword. Supplying both
@ -157,14 +157,15 @@
Therefore we need to devise a way of determining the status of the
filesystems before mounting them. The manpage for <command>fsck</command>
gives some insight into how this can be accomplished using return codes.
Basically, if <command>fsck</command> returns code of zero or one it
Basically, if <command>fsck</command> returns a code of zero or one it
means the filesystem is okay and a return code of two or greater means
some kind of manual intervention is needed. A simple if-then statement
could evaluate the <command>fsck</command> return code to determine
whether or not the filesystem should be mounted. For help on writing
shell scripts we can turn to the BASH(1) manpage and the Advanced BASH
Scripting Guide. Both references are freely available from the Linux
Documentation Project at <ulink url="http://www.tldp.org">http://www.tldp.org</ulink>.</para>
shell scripts we can turn to the BASH(1) manpage and the
Advanced-BASH-Scripting-Guide. Both references are freely available from
the Linux Documentation Project web site at <ulink
url="http://www.tldp.org">http://www.tldp.org</ulink>.</para>
</sect2>
<sect2>
@ -178,9 +179,9 @@
will need and the fsck(8) and mount(8) manpages give some insight into
what those files are. There is <filename>/etc/fstab</filename> that
lists devices and their mount points, <filename>/etc/mtab</filename>
which keeps track of what is mounted and the device files that represent
the various disks. We will need to include all of these to have
everything work right.</para>
that keeps track of what is mounted, and a number of
<filename>/dev</filename> files that represent the various disks. We
will need to include all of these to have everything work right.</para>
<sect3>
<title>/etc/fstab</title>
@ -325,7 +326,7 @@
</sect2>
<sect2>
<title>Create the fstab file</title>
<title>Create the fstab and mtab files</title>
<para><programlisting><prompt>bash#</prompt> cd ~/staging/etc
</programlisting></para>
@ -333,8 +334,12 @@
<para>Use an editor like vi, emacs or pico to create the following file
and save it as <filename>~/staging/etc/fstab</filename>.</para>
<para><programlisting>proc /proc proc defaults 0 0
/dev/ram0 / ext2 defaults 1 1</programlisting></para>
<para><programlisting>proc /proc proc defaults 0 0
/dev/ram0 / ext2 defaults 1 1</programlisting></para>
<para>Create an empty mtab file.</para>
<programlisting><prompt>bash#</prompt> echo -n &#62;mtab</programlisting>
</sect2>
<sect2>
@ -356,7 +361,7 @@ if [ $(($?)) -gt $((1)) ]; then
else
echo &#34;Remounting / as read-write.&#34;
mount -n -o remount,rw /
echo -n &#62; /etc/mtab
echo -n &#62;/etc/mtab
mount -f -o remount,rw /
echo &#34;Mounting local filesystems.&#34;
mount -a -t nonfs,nosmbfs
@ -444,7 +449,6 @@ Freeing unused kernel memory: 178k freed
<para><screen><prompt>bash#</prompt> PATH=/sbin:/bin:/etc/init.d ; export PATH
<prompt>bash#</prompt> cat /etc/mtab
cat: /etc/mtab: No such file or directory
<prompt>bash#</prompt> local_fs
/dev/ram0: clean 74/1024 files 3178/4096 blocks
Remounting / as read-write.
@ -464,7 +468,7 @@ Filesystem 1k-blocks Used Available Use% Mounted on
<para>Remove the root disk floppy and insert a blank diskette labeled
&#34;home&#34;. Then type the following commands:</para>
<para><programlisting><prompt>bash#</prompt> mkfs /dev/fd0
<para><programlisting><prompt>bash#</prompt> mkfs -t ext2 /dev/fd0
<prompt>bash#</prompt> fsck /dev/fd0
<prompt>bash#</prompt> mount /dev/fd0 /home
<prompt>bash#</prompt> mkdir /home/floyd
@ -477,7 +481,7 @@ Filesystem 1k-blocks Used Available Use% Mounted on
<title>System shutdown</title>
<para><programlisting><prompt>bash#</prompt> cd /
<prompt>bash#</prompt> umount /dev/fd0</programlisting></para>
<prompt>bash#</prompt> umount /home</programlisting></para>
<para>Remove the diskette from fd0 and restart the system using
<keycap>CTRL</keycap>-<keycap>ALT</keycap>-<keycap>DELETE</keycap>.</para>

View File

@ -59,14 +59,14 @@
<para>We need an init daemon to automate start-up. We know this because
the Bootdisk-HOWTO and From-Powerup-To-BASH-Prompt-HOWTO both make
mention of it as the first program to start after the kernel loads. The
latter HOWTO also goes into some detail about the <filename>/etc/inittab</filename>
file and the organization of startup scripts. This could be helpful
since FHS, the blueprint we have used so far, makes no recommendation
for init scripts.</para>
mention of <command>init</command> as the first program to start after
the kernel loads. The latter HOWTO also goes into some detail about the
<filename>/etc/inittab</filename> file and the organization of startup
scripts. This could be helpful since FHS, the blueprint we have used so
far, makes no recommendation for init scripts.</para>
<para>We will also need to find the shutdown command to fulfill the
second goal of graceful shutdown capability.</para>
<para>We will also need to find the <command>shutdown</command> command
to fulfill the second goal of graceful shutdown capability.</para>
</sect2>
<sect2>
@ -87,9 +87,10 @@
<sect2>
<title>Checking Dependencies</title>
<para>The manpage for init mentions a FIFO called <filename>/dev/initctl</filename>
that is required for <command>init</command> to communicate with other
programs in the sysvinit package. We will have to create this file for
<para>The manpage for <command>init</command> mentions a FIFO called
<filename>/dev/initctl</filename> that is required for
<command>init</command> to communicate with other programs in the
sysvinit package. We will have to create this file for
<command>init</command> to function properly.</para>
</sect2>
@ -115,8 +116,8 @@
<listitem>
<para>Essential System Administration, 3rd Edition by Aeleen Frisch
-- available at bookstores or directly from O&#39;Reilly Publishing
at <ulink url="http://www.oreilly.com/">http://www.oreilly.com/</ulink>.</para>
-- available at libraries, bookstores or directly from O&#39;Reilly
Publishing at <ulink url="http://www.oreilly.com/">http://www.oreilly.com/</ulink>.</para>
</listitem>
</itemizedlist>
@ -164,6 +165,11 @@
<sect1>
<title>Construction</title>
<para>There is a lot of typing to do in this section because of all of the
start-up scripts that need to be created. Using a mouse to copy the text
from this guide and paste it into a text editor can be a great time saving
tool.</para>
<sect2>
<title>Install sysvinit utilities</title>
@ -237,7 +243,9 @@ if [ -d $SCRIPT_DIR ]; then
$SCRIPT start;
fi;
done;
fi</programlisting></para>
fi
#
# end of /etc/init.d/rc</programlisting></para>
<para>Make the file executable.</para>
@ -342,7 +350,7 @@ reboot
#
# end of /etc/init.d/reboot</programlisting></para>
<para>Flag script files as executable.</para>
<para>Flag all script files as executable.</para>
<para><programlisting><prompt>bash#</prompt> chmod +x ~/staging/etc/init.d/*</programlisting></para>
</sect2>
@ -447,7 +455,7 @@ gnu-linux</screen></para>
INIT: Sending processes the TERM signal
Terminated
INIT: Sending processes the KILL signal
Dismounting local filesystems.
Unmounting local filesystems.
Remounting / as read-only.
Initiating system halt.
System halted.</screen></para>

View File

@ -150,8 +150,8 @@
<listitem>
<para>Essential System Administration, 3rd Edition by Aeleen
Frisch -- available at bookstores or directly from O&#39;Reilly
Publishing at <ulink url="http://www.oreilly.com/">http://www.oreilly.com/</ulink>.</para>
Frisch -- available at libraries, bookstores or directly from
O&#39;Reilly Publishing at <ulink url="http://www.oreilly.com/">http://www.oreilly.com/</ulink>.</para>
</listitem>
</itemizedlist>
</sect3>
@ -207,8 +207,8 @@
example. Other commands in the /bin directory have a minimum requirement
of read and execute, but the <command>su</command> command needs to be
setuid root in order to run correctly. Since it is a setuid binary, it
might be a good idea not to allow just anyone to run it. Ownership of
0:0 (root user, root group) and permissions of rwsr-x--- (octal 1750)
might not be a good idea to allow just anyone to run it. Ownership of
0:0 (root user, root group) and permissions of rwsr-x--- (octal 4750)
would be a good fit for <command>su</command>.</para>
<para>The same logic can be applied to other directories and files in
@ -301,8 +301,8 @@ r6:6:wait:/etc/init.d/rc 6
<para><programlisting>Connected to \l at \b bps.</programlisting></para>
<para>Note that &#34;\l&#34; is a lowercase letter L, not the number
one.</para>
<para>Be sure that &#34;\l&#34; is a lowercase letter L and not the
number one.</para>
</sect3>
<sect3>
@ -350,8 +350,8 @@ group: files</programlisting></para>
<para>Set minimal privileges on all files and directories under
<filename>~/staging</filename>. Everything is owned by the root user and
the root group. Permissions are read-write for the owner and read-only
for the group. Exceptions to the blanket permissions are handled case by
case.</para>
for the group. Exceptions to the blanket permissions are handled
case-by-case.</para>
<para><programlisting><prompt>bash#</prompt> cd ~/staging
<prompt>bash#</prompt> chown -R 0:0 *
@ -455,8 +455,8 @@ gnu-linux login:</screen></para>
files, respectively. Be sure to use a double greater-than (&#62;&#62;)
to avoid accidentally overwriting the files.</para>
<para><programlisting><prompt>bash#</prompt> echo &#34;floyd::501:500:User:/home/floyd:/bin/sh&#34; &#62;&#62; /etc/passwd
<prompt>bash#</prompt> echo &#34;users::500:&#34; &#62;&#62; /etc/group
<para><programlisting><prompt>bash#</prompt> echo &#34;floyd::501:500:User:/home/floyd:/bin/sh&#34; &#62;&#62;/etc/passwd
<prompt>bash#</prompt> echo &#34;users::500:&#34; &#62;&#62;/etc/group
<prompt>bash#</prompt> mkdir /home/floyd
<prompt>bash#</prompt> chown floyd.users /home/floyd
<prompt>bash#</prompt> chmod 700 /home/floyd</programlisting></para>

View File

@ -139,11 +139,11 @@
<para>These three packages can be found by using the Internet resources
we have used before plus one new site. The &#34;sed&#34; and
&#34;ed&#34; packages can be found at the same place we found BASH, on
the GNU ftp server at <ulink url="ftp://ftp.gnu.org">ftp://ftp.gnu.org</ulink>.
The procps package shows up in an Ibiblio LSM search, but it is an old
version. In order to find the latest version we can go to the Freshmeat
web site (<ulink url="http://freshmeat.net">http://freshmeat.net</ulink>)
and search for &#34;procps&#34; in projects.</para>
the <ulink url="ftp://ftp.gnu.org">GNU FTP server</ulink>. The procps
package shows up in an Ibiblio LSM search, but it is an old version. In
order to find the latest version we can go to the Freshmeat website at
<ulink url="http://freshmeat.net">http://freshmeat.net</ulink> and
search for &#34;procps&#34; in projects.</para>
<para>Both &#34;sed&#34; and &#34;ed&#34; packages feature GNU&#39;s
familiar <command>configure</command> script and are therefore very easy
@ -192,7 +192,7 @@ if [ &#34;$ROWS&#34; = &#34;&#34; ]; then
ROWS=25;
fi
#
# Initialize row counter variable
# Initialize line counter variable
ROW_COUNTER=$ROWS
#
# Read the input file one line at a time and display on STDOUT until