[EMAIL PROTECTED] wrote:
> +    <para>Fix a potential issue if <filename>/etc/ld.so.preload</filename> is
> +    used on the host system.</para>
> +
> +<screen><userinput remap="pre">sed -i 
> 's@/etc/ld.so.preload@/tools/etc/ld.so.preload@' 
> elf/rtld.c</userinput></screen>
> +

Sorry to be critical, but I feel I should mention two things:

1. The policy (unspoken or unwritten? I can't remember) in LFS is that 
we shouldn't use -i for sed before we build it in chapter 5, because we 
don't want to assume the host's sed has that functionality. That's why 
we've done the cp file{,.bak} && sed 's///' file.bak > file type stuff 
elsewhere in chapter 5.

2. Especially if we do the longer 'cp then sed' command, we have here a 
golden opportunity to use '&' and reduce the command length. So, 
something like:

cp elf/rtld.c{,.orig}
sed 's@/etc/ld.so.preload@/tools&@' elf/rtld.c.orig > elf/rtld.c

(A complete aside is that we could also always do a very early build of 
sed before anything else, and bash and make for that matter, like DIY 
does so that the entire build process is more robust, is buildable on 
older systems and we can use more 'modern' commands throughout the build.)

--
JH
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-book
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to