Parcourir la source

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
Gerard Beekmans il y a 23 ans
Parent
commit
3b3e965d29

+ 16 - 0
chapter01/changelog.xml

@@ -27,6 +27,10 @@
 
 <listitem><para>Added:
 <itemizedlist>
+<listitem><para>ed-0.2.patch</para></listitem>
+<listitem><para>fileutils-4.1.patch</para></listitem>
+<listitem><para>gawk-3.1.1.patch</para></listitem>
+<listitem><para>glibc-2.2.5.patch</para></listitem>
 <listitem><para>ncurses-5.2.patch</para></listitem>
 <listitem><para>perl-5.6.1.patch</para></listitem>
 <listitem><para>vim-6.1.patch</para></listitem>
@@ -40,6 +44,18 @@
 </itemizedlist>
 </para></listitem>
 
+<listitem><para>May 30th, 2002 [gerard]: Chapter 06 - Glibc: Replaced the
+various sed fixes with a regular patch.</para></listitem>
+
+<listitem><para>May 30th, 2002 [gerard]: Chapter 06 - Gawk: Replaced the
+sed fix with a regular patch.</para></listitem>
+
+<listitem><para>May 30th, 2002 [gerard]: Chapter 05 - Fileutils: Replaced
+the sed fix with a regular patch.</para></listitem>
+
+<listitem><para>May 30th, 2002 [gerard]: Chapter 06 - Ed: Replaced the
+sed fix with a regular patch.</para></listitem>
+
 <listitem><para>May 28th, 2002 [gerard]: Chapter 06 - Changing ownership:
 removed the explicit command to chown <filename
 class="directory">/lost+found</filename>. This is done by the first command

+ 3 - 0
chapter04/ed-patch.xml

@@ -0,0 +1,3 @@
+Ed Patch (&ed-version;) - &ed-patch-size;:
+<ulink url="&ftp;/ed-&ed-version;.patch.bz2"/>
+<ulink url="&http;/ed-&ed-version;.patch.bz2"/>

+ 3 - 0
chapter04/fileutils-patch.xml

@@ -0,0 +1,3 @@
+Fileutils Patch (&fileutils-version;) - &fileutils-patch-size;:
+<ulink url="&ftp;/fileutils-&fileutils-version;.patch.bz2"/>
+<ulink url="&http;/fileutils-&fileutils-version;.patch.bz2"/>

+ 3 - 0
chapter04/gawk-patch.xml

@@ -0,0 +1,3 @@
+Gawk Patch (&gawk-version;) - &gawk-patch-size;:
+<ulink url="&ftp;/gawk-&gawk-version;.patch.bz2"/>
+<ulink url="&http;/gawk-&gawk-version;.patch.bz2"/>

+ 3 - 0
chapter04/glibc-patch.xml

@@ -0,0 +1,3 @@
+Glibc Patch (&glibc-version;) - &glibc-patch-size;:
+<ulink url="&ftp;/glibc-&glibc-version;.patch.bz2"/>
+<ulink url="&http;/glibc-&glibc-version;.patch.bz2"/>

+ 4 - 0
chapter04/packages.xml

@@ -10,6 +10,7 @@
 &c3-bzip2;
 &c3-diffutils;
 &c3-fileutils;
+&c3-fileutils-patch;
 &c3-gcc;
 &c3-kernel;
 &c3-grep;
@@ -21,13 +22,16 @@
 &c3-tar-patch;
 &c3-textutils;
 &c3-gawk;
+&c3-gawk-patch;
 &c3-texinfo;
 &c3-patch;
 &c3-makedev;
 &c3-glibc;
 &c3-glibc-threads;
+&c3-glibc-patch;
 &c3-manpages;
 &c3-ed;
+&c3-ed-patch;
 &c3-findutils;
 &c3-findutils-patch;
 &c3-ncurses;

+ 4 - 8
chapter05/fileutils-exp.xml

@@ -5,14 +5,10 @@
 run this command in order to keep a backup of the file we are about to
 change.</para>
 
-<para><userinput>cp lib/Makefile.in lib/Makefile.in.backup &amp;&amp;
-sed -e 's/\(.*\)\(fopen-safer\.c \)\\/\1\2atexit.c \\/' \
-&nbsp;&nbsp;&nbsp;&nbsp;-e 's/\(.*\)\(idcache\$U\.\$.*\)\\/\1\2atexit$U.$(OBJEXT) \\/' \
-&nbsp;&nbsp;&nbsp;&nbsp;lib/Makefile.in.backup &gt; lib/Makefile.in:</userinput>
-This is used to fix a problem with building fileutils statically on glibc 2.2.3 
-systems.  If this isn't done, then there is the possibility of all of the 
-fileutils programs causing segmentation faults once chroot is entered 
-in chapter 6.</para>
+<para><userinput>patch -Np1 -i ../fileutils-&fileutils-version;.patch:</userinput> This is used to fix a problem with building fileutils statically on
+glibc 2.2.3 systems. If this isn't done, then there is the possibility of
+all of the fileutils programs causing segmentation faults once chroot is
+entered in chapter 6.</para>
 
 </sect2>
 

+ 15 - 14
chapter05/fileutils-inst.xml

@@ -1,30 +1,31 @@
 <sect2>
 <title>Installation of Fileutils</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>The programs from a statically linked Fileutils package may cause
 segmentation faults on certain systems, if your distribution has
 Glibc-2.2.3 or higher installed. It seems to happen mostly on machines
 powered by an AMD CPU, but there is a case or two where an Intel system
-is affected as well. If your system falls in this category, try the
-following fix.</para>
+is affected as well. If your system falls in this category, apply the
+patch.</para>
 
-<para>Note that in some cases using these sed commands will result in
-not being able to compile this package at all, even when your
-system has an AMD CPU and has Glibc-2.2.3 (or higher) installed. If that's 
-the case, you'll need to remove the fileutils-&fileutils-version; directory
-and unpack it again from the tarball before continuing. We believe this
-may be the case when your distribution has altered Glibc-2.2.3 somehow,
-but details are unavailable at the time.</para>
+<para>Note that in some cases using this patch will result in not being
+able to compile this package at all, even when your system has an AMD CPU
+and has Glibc-2.2.3 (or higher) installed. If that's the case, you'll need
+to remove the fileutils-&fileutils-version; directory and unpack it again
+from the tarball before continuing. We believe this may be the case when
+your distribution has altered Glibc-2.2.3 somehow, but details are
+unavailable at the time.</para>
 
 <para>To fix this package to compile properly on AMD/Glibc-2.2.3
-machines, run the following commands. Do <emphasis>not</emphasis>
+machines, run the following command. Do <emphasis>not</emphasis>
 attempt this fix if you don't have Glibc-2.2.3 installed. It will more 
 than likely result in all kinds of compile time problems.</para>
 
-<para><screen><userinput>cp lib/Makefile.in lib/Makefile.in.backup &amp;&amp;
-sed -e 's/\(.*\)\(fopen-safer\.c \)\\/\1\2atexit.c \\/' \
-&nbsp;&nbsp;&nbsp;&nbsp;-e 's/\(.*\)\(idcache\$U\.\$.*\)\\/\1\2atexit$U.$(OBJEXT) \\/' \
-&nbsp;&nbsp;&nbsp;&nbsp;lib/Makefile.in.backup &gt; lib/Makefile.in</userinput></screen></para>
+<para><screen><userinput>patch -Np1 -i ../fileutils-&fileutils-version;.patch</userinput></screen></para>
 
 <para>Install Fileutils by running the following commands:</para>
 

+ 5 - 4
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>
 

+ 5 - 5
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;

+ 6 - 5
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>

+ 1 - 0
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;
 

+ 12 - 16
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>
 

+ 6 - 6
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 \

+ 4 - 0
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;

+ 4 - 0
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;

+ 4 - 0
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

+ 2 - 0
entities/ed.ent

@@ -1,4 +1,5 @@
 <!ENTITY c3-ed SYSTEM "../chapter03/ed.xml">
+<!ENTITY c3-ed-patch SYSTEM "../chapter03/ed-patch.xml">
 
 <!ENTITY c6-ed SYSTEM "../chapter06/ed.xml">
 <!ENTITY c6-ed-inst SYSTEM "../chapter06/ed-inst.xml">
@@ -13,6 +14,7 @@
 <!ENTITY ed-depversion "0.2">
 <!ENTITY ed-contversion "0.2">
 <!ENTITY ed-size "158 KB">
+<!ENTITY ed-patch-size "1 KB">
 <!ENTITY ed-dir "ed-&ed-version;">
 <!ENTITY ed-package "ed-&ed-version;.tar.bz2">
 

+ 2 - 0
entities/fileutils.ent

@@ -1,4 +1,5 @@
 <!ENTITY c3-fileutils SYSTEM "../chapter03/fileutils.xml">
+<!ENTITY c3-fileutils-patch SYSTEM "../chapter03/fileutils-patch.xml">
 
 <!ENTITY c5-fileutils SYSTEM "../chapter05/fileutils.xml">
 <!ENTITY c5-fileutils-inst SYSTEM "../chapter05/fileutils-inst.xml">
@@ -16,6 +17,7 @@
 <!ENTITY fileutils-depversion "4.1">
 <!ENTITY fileutils-contversion "4.1">
 <!ENTITY fileutils-size "1,217 KB">
+<!ENTITY fileutils-patch-size "1 KB">
 <!ENTITY fileutils-package "fileutils-&fileutils-version;.tar.bz2">
 <!ENTITY fileutils-dir "fileutils-&fileutils-version;">
 

+ 3 - 0
entities/gawk.ent

@@ -1,10 +1,12 @@
 <!ENTITY c3-gawk SYSTEM "../chapter03/gawk.xml">
+<!ENTITY c3-gawk-patch SYSTEM "../chapter03/gawk-patch.xml">
 
 <!ENTITY c5-gawk SYSTEM "../chapter05/gawk.xml">
 <!ENTITY c5-gawk-inst SYSTEM "../chapter05/gawk-inst.xml">
 
 <!ENTITY c6-gawk SYSTEM "../chapter06/gawk.xml">
 <!ENTITY c6-gawk-inst SYSTEM "../chapter06/gawk-inst.xml">
+<!ENTITY c6-gawk-exp SYSTEM "../chapter06/gawk-exp.xml">
 
 <!ENTITY aa-gawk SYSTEM "../appendixa/gawk.xml">
 <!ENTITY aa-gawk-desc SYSTEM "../appendixa/gawk-desc.xml">
@@ -15,6 +17,7 @@
 <!ENTITY gawk-depversion "3.1.0">
 <!ENTITY gawk-contversion "3.1.0">
 <!ENTITY gawk-size "1,420 KB">
+<!ENTITY gawk-patch-size "1 KB">
 <!ENTITY gawk-dir "gawk-&gawk-version;">
 <!ENTITY gawk-package "gawk&gawk-version;.tar.bz2">
 

+ 2 - 0
entities/glibc.ent

@@ -1,5 +1,6 @@
 <!ENTITY c3-glibc SYSTEM "../chapter03/glibc.xml">
 <!ENTITY c3-glibc-threads SYSTEM "../chapter03/glibc-threads.xml">
+<!ENTITY c3-glibc-patch SYSTEM "../chapter03/glibc-patch.xml">
 
 <!ENTITY c6-glibc SYSTEM "../chapter06/glibc.xml">
 <!ENTITY c6-glibc-inst SYSTEM "../chapter06/glibc-inst.xml">
@@ -16,6 +17,7 @@
 <!ENTITY glibc-contversion "2.2.5">
 <!ENTITY glibc-size "12,114 KB">
 <!ENTITY glibc-threads-size "164 KB">
+<!ENTITY glibc-patch-size "1 KB">
 <!ENTITY glibc-dir "glibc-&glibc-version;">
 <!ENTITY glibc-threads-dir "linuxthreads, linuxthreads_db">
 <!ENTITY glibc-package "glibc-&glibc-version;.tar.bz2">

+ 5 - 5
index.xml

@@ -4,8 +4,8 @@
 
 <!ENTITY book SYSTEM "book/book.xml">
 
-<!ENTITY version "20020529">
-<!ENTITY releasedate "May 29th, 2002">
+<!ENTITY version "20020530">
+<!ENTITY releasedate "May 30th, 2002">
 
 <!ENTITY ftp-root "ftp://ftp.linuxfromscratch.org">
 <!ENTITY http-root "http://ftp.linuxfromscratch.org">
@@ -13,9 +13,9 @@
 <!ENTITY http "http://ftp.linuxfromscratch.org/lfs-packages/cvs">
 <!ENTITY hints-root "http://hints.linuxfromscratch.org/hints/">
 
-<!ENTITY all-version "cvs-20020527-0509">
-<!ENTITY all-size-kb "97,940 KB">
-<!ENTITY all-size-mb "95.64 MB">
+<!ENTITY all-version "cvs-20020530-0447">
+<!ENTITY all-size-kb "97,950 KB">
+<!ENTITY all-size-mb "95.65 MB">
 
 <!ENTITY % parts SYSTEM "entities/parts.ent">
 <!ENTITY % bookinfo SYSTEM "entities/bookinfo.ent">