Scripting some LFS steps?

Justin Yaple yaplej at
Mon Apr 13 22:52:51 PDT 2009

>do not top post, and do try to trim your responses to keep only the necessary part of the previous message.  This ensures that the conversation flows easily

I had to lookup what top posting was actually.  So I am I still doing
this incorrectly sorry its still new to me.

>What is the host environment?
LFS LiveCD 6.3 r2160

>What version of LFS are you building?

>Are you running X?

>Does it work correctly when run manually on the same PC?

>Do you have sufficient disk space?
Yes, 5120MB I expect is enough.

>Running the check target again simply picks up where it left off when it last failed.  Did you actually verify that a gcc build and test runs from start to finish by restarting the GCC build from clean source

Each time I attempt to re-run the process either manually or via
script I have made sure the source, and build directory have been
removed first.  I then start the process by extracting the source from
the tar.

After the script fails I have been able to restore my enviroment to
the point of the previous sucess, and complete this step manually.

Here is a copy of the script I run for GCC Pass 2.  Its pretty much
line by line from the 6.4 book.  Running these commands manually has
worked so I find it odd that from a script they have been failing.

cd $LFS/sources
tar -jxf gcc-4.3.2.tar.bz2 && cd gcc-4.3.2
cp -v gcc/{,.orig}
sed 's@\./fixinc\.sh at -c true@' gcc/ > gcc/
cp -v gcc/{,.tmp}
sed 's/^XCFLAGS =$/& -fomit-frame-pointer/' gcc/ >
for file in $(find gcc/config -name linux64.h -o -name linux.h)
cp -uv $file{,.orig}
sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' -e 's@/usr@/tools at g'
$file.orig > $file
echo "
#define STANDARD_INCLUDE_DIR = 0" >> $file
touch $file.orig
tar -jxf ../mpfr-2.3.2.tar.bz2 && mv mpfr-2.3.2 mpfr
tar -jxf ../gmp-4.2.4.tar.bz2 && mv gmp-4.2.4 gmp
mkdir -v ../gcc-build && cd ../gcc-build
../gcc-4.3.2/configure --prefix=/tools --with-local-prefix=/tools
--enable-clocale=gnu --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-languages=c,c++ --disable-libstdcxx-pch
make -k check
make install
cd $LFS/sources
rm gcc-4.3.2 -rf && rm gcc-build -rf

More information about the lfs-support mailing list