aboutsummaryrefslogtreecommitdiffstats
path: root/chapter06
diff options
context:
space:
mode:
authorGerard Beekmans <gerard@linuxfromscratch.org>2002-05-30 11:51:27 +0000
committerGerard Beekmans <gerard@linuxfromscratch.org>2002-05-30 11:51:27 +0000
commit3b3e965d2933fadf3933216cbf53373f7cfa1b8a (patch)
treed4c5aad73b462158b2b9751fa306375c9c0e0f2b /chapter06
parentca6391e6590484cfb50a436acd844cd199b9e5d5 (diff)
Fix bug #316 - replace sed's with patches. Done for c5-fileutils, c6-glibc, c6-gawk and c6-ed
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@1947 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter06')
-rw-r--r--chapter06/ed-exp.xml9
-rw-r--r--chapter06/ed-inst.xml10
-rw-r--r--chapter06/gawk-inst.xml11
-rw-r--r--chapter06/gawk.xml1
-rw-r--r--chapter06/glibc-exp.xml28
-rw-r--r--chapter06/glibc-inst.xml12
-rw-r--r--chapter06/ncurses-inst.xml4
-rw-r--r--chapter06/perl-inst.xml4
-rw-r--r--chapter06/vim-inst.xml4
9 files changed, 47 insertions, 36 deletions
diff --git a/chapter06/ed-exp.xml b/chapter06/ed-exp.xml
index 41e4d35e4..a9a2792a3 100644
--- a/chapter06/ed-exp.xml
+++ b/chapter06/ed-exp.xml
@@ -1,10 +1,11 @@
<sect2>
<title>Command explanations</title>
-<para>The sed commands fix a symlink vulnerability in ed. The ed
-executable creates files in /tmp with predictable names. By using
-various symlink attacks, it is possible to have ed write to files
-it should not, change the permissions of various files, etc.</para>
+<para><userinput>patch -Np1 -i ../ed-&ed-version;.patch:</userinput> This
+patch fixes a symlink vulnerability in ed. The ed executable creates files
+in /tmp with predictable names. By using various symlink attacks, it is
+possible to have ed write to files it should not, change the permissions
+of files, etc.</para>
</sect2>
diff --git a/chapter06/ed-inst.xml b/chapter06/ed-inst.xml
index 4fdcf6358..38ca3d528 100644
--- a/chapter06/ed-inst.xml
+++ b/chapter06/ed-inst.xml
@@ -1,6 +1,10 @@
<sect2>
<title>Installation of Ed</title>
+<para>This package requires its patch to be applied before you can
+install it. Make sure it's unpacked before running the installation
+commands.</para>
+
<para>Ed isn't something you would personally use. It's installed here
because it can be used by the patch program if you encounter an ed-based patch
file. This happens rarely because diff-based patches are preferred these
@@ -8,11 +12,7 @@ days.</para>
<para>Install Ed by running the following commands:</para>
-<para><screen><userinput>cp buf.c buf.c.backup &amp;&amp;
-sed 's/int u/int u, sfd/' buf.c.backup | \
-&nbsp;&nbsp;&nbsp;&nbsp;sed '/.*\*mktemp.*/d' | \
-&nbsp;&nbsp;&nbsp;&nbsp;sed 's/.*if (mktemp.*/ sfd = mkstemp(sfn);\
-&nbsp;&nbsp;&nbsp;&nbsp;if ((sfd == -1) || (sfp = fopen (sfn, "w+")) == NULL)/' &gt; buf.c &amp;&amp;
+<para><screen><userinput>patch -Np1 -i ../ed-&ed-version;.patch &amp;&amp;
./configure --prefix=/usr &amp;&amp;
make &amp;&amp;
make install &amp;&amp;
diff --git a/chapter06/gawk-inst.xml b/chapter06/gawk-inst.xml
index 49555c5cf..f480e1ea4 100644
--- a/chapter06/gawk-inst.xml
+++ b/chapter06/gawk-inst.xml
@@ -1,8 +1,12 @@
<sect2>
<title>Installation of Gawk</title>
+<para>This package requires its patch to be applied before you can
+install it. Make sure it's unpacked before running the installation
+commands.</para>
+
<para>Warning: do NOT run <userinput>make uninstall</userinput> on this
-package if you apply the <emphasis>sed</emphasis> fix to change the
+package if you apply the patch to change the
<filename class="directory">libexec</filename> directory definition. The
<emphasis>uninstall</emphasis> rule in the <filename>Makefile</filename>
file runs a command like <userinput>rm -rf
@@ -13,10 +17,7 @@ class="directory">/usr/bin</filename> it'll run <userinput>rm -rf
<para>Install Gawk by running the following commands:</para>
-<para><screen><userinput>cp awklib/Makefile.in awklib/Makefile.in.backup &amp;&amp;
-sed -e '/^datadir/s/awk/gawk/' \
--e '/^libexecdir/s%/awk%%' awklib/Makefile.in.backup \
-&nbsp;&nbsp;&nbsp;&nbsp;&gt; awklib/Makefile.in &amp;&amp;
+<para><screen><userinput>patch -Np1 -i ../gawk-&gawk-version;.patch &amp;&amp;
./configure --prefix=/usr --libexecdir=/usr/bin &amp;&amp;
make &amp;&amp;
make install</userinput></screen></para>
diff --git a/chapter06/gawk.xml b/chapter06/gawk.xml
index 8ac989cb4..e824fc9d2 100644
--- a/chapter06/gawk.xml
+++ b/chapter06/gawk.xml
@@ -6,6 +6,7 @@
Estimated required disk space: &gawk-compsize;</screen>
&c6-gawk-inst;
+&c6-gawk-exp;
&aa-gawk-desc;
&aa-gawk-dep;
diff --git a/chapter06/glibc-exp.xml b/chapter06/glibc-exp.xml
index bd2bab1d2..6efbae47a 100644
--- a/chapter06/glibc-exp.xml
+++ b/chapter06/glibc-exp.xml
@@ -1,28 +1,24 @@
<sect2>
<title>Command explanations</title>
+<para><userinput>patch -Np1 -i ../glibc-&glibc-version;.patch:</userinput>
+This patch converts all occurances of <filename>$(PERL)</filename> to
+<filename>/usr/bin/perl</filename> in the
+<filename>malloc/Makefile</filename> file. This is done because Glibc can't
+autodetect the location of perl because perl has yet to be installed. The
+patch also replaces all occurances of <emphasis>root</emphasis> with
+<emphasis>0</emphasis> in the <filename>login/Makefile</filename> file.
+This is done because Glibc itself isn't installed yet and therefore
+username to userid resolving isn't working yet, so a <userinput>chown root
+file</userinput> will fail, however it'll work fine if you use straight
+IDs.</para>
+
<para><userinput>touch /etc/ld.so.conf:</userinput> One of the final steps
of the Glibc installation is running ldconfig to update the dynamic loader
cache. If this file doesn't exist, the installation will abort with an error
that it can't read the file, so we simply create an empty file (the empty
file will have Glibc default to using /lib and /usr/lib which is fine).</para>
-<para><userinput>sed 's%\$(PERL)%/usr/bin/perl%'
-malloc/Makefile.backup &gt; malloc/Makefile:</userinput> This sed command
-searches through <filename>malloc/Makefile.backup</filename> and
-converts all occurrences of <filename>$(PERL)</filename> to
-<filename>/usr/bin/perl</filename>. The output is then written to the
-original <filename>malloc/Makefile.in</filename> which is used during
-configuration. This is done because Glibc can't autodetect perl since
-it hasn't been installed yet.</para>
-
-<para><userinput>sed 's/root/0' login/Makefile.backup &gt;
-login/Makefile:</userinput> This sed command replaces all occurrences of
-<filename>root</filename> in <filename>login/Makefile.backup</filename>
-with 0. This is necessary because we don't have glibc on the LFS system yet, so
-user names can't be resolved to their user IDs. Therefore, we replace
-the user name "root" with user ID 0.</para>
-
<para><userinput>--enable-add-ons:</userinput> This enables the add-on that
we install with Glibc: linuxthreads</para>
diff --git a/chapter06/glibc-inst.xml b/chapter06/glibc-inst.xml
index 63a885916..8f83dcd60 100644
--- a/chapter06/glibc-inst.xml
+++ b/chapter06/glibc-inst.xml
@@ -1,6 +1,10 @@
<sect2>
<title>Installation of Glibc</title>
+<para>This package requires its patch to be applied before you can
+install it. Make sure it's unpacked before running the installation
+commands.</para>
+
<para>Before starting to install glibc, you must cd into the
glibc-&glibc-version; directory and unpack glibc-linuxthreads inside
the glibc-&glibc-version; directory, not in /usr/src as you normally
@@ -22,12 +26,8 @@ is putting your system at very high risk.</para>
<para>Install Glibc by running the following commands:</para>
-<para><screen><userinput>touch /etc/ld.so.conf &amp;&amp;
-cp malloc/Makefile malloc/Makefile.backup &amp;&amp;
-sed 's%\$(PERL)%/usr/bin/perl%' \
-&nbsp;&nbsp;&nbsp;&nbsp;malloc/Makefile.backup &gt; malloc/Makefile &amp;&amp;
-cp login/Makefile login/Makefile.backup &amp;&amp;
-sed 's/root/0/' login/Makefile.backup &gt; login/Makefile &amp;&amp;
+<para><screen><userinput>patch -Np1 -i ../glibc-&glibc-version;.patch &amp;&amp;
+touch /etc/ld.so.conf &amp;&amp;
mkdir ../glibc-build &amp;&amp;
cd ../glibc-build &amp;&amp;
../glibc-&glibc-version;/configure --prefix=/usr \
diff --git a/chapter06/ncurses-inst.xml b/chapter06/ncurses-inst.xml
index 2d532ba72..2b49b3770 100644
--- a/chapter06/ncurses-inst.xml
+++ b/chapter06/ncurses-inst.xml
@@ -1,6 +1,10 @@
<sect2>
<title>Installation of Ncurses</title>
+<para>This package requires its patch to be applied before you can
+install it. Make sure it's unpacked before running the installation
+commands.</para>
+
<para>Install Ncurses by running the following commands:</para>
<para><screen><userinput>patch -Np1 -i ../ncurses-&ncurses-patch-version;.patch &amp;&amp;
diff --git a/chapter06/perl-inst.xml b/chapter06/perl-inst.xml
index 313fcf3fc..c14b4ef0e 100644
--- a/chapter06/perl-inst.xml
+++ b/chapter06/perl-inst.xml
@@ -1,6 +1,10 @@
<sect2>
<title>Installation of Perl</title>
+<para>This package requires its patch to be applied before you can
+install it. Make sure it's unpacked before running the installation
+commands.</para>
+
<para>Install Perl by running the following commands:</para>
<para><screen><userinput>patch -Np1 -i ../perl-&perl-version;.patch &amp;&amp;
diff --git a/chapter06/vim-inst.xml b/chapter06/vim-inst.xml
index 2d722292e..67b86fc58 100644
--- a/chapter06/vim-inst.xml
+++ b/chapter06/vim-inst.xml
@@ -1,6 +1,10 @@
<sect2>
<title>Installation of Vim</title>
+<para>This package requires its patch to be applied before you can
+install it. Make sure it's unpacked before running the installation
+commands.</para>
+
<para>If you don't like vim to be installed as an editor on your LFS system,
you may want to download an alternative and install the editor you
prefer. There are a few hints on how to install different editors