Created
August 5, 2012 23:55
-
-
Save lccxx/3268160 to your computer and use it in GitHub Desktop.
Linux From Scratch - Version 7.1, console history shell script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function tip { echo -e '\E[37;44m'"\033[1m$1\033[0m"; } | |
set +h | |
umask 022 | |
export LFS="/srv/lfs/6.6" | |
export LC_ALL=POSIX | |
export LFS_TGT=$(uname -m)-lfs-linux-gnu | |
export PATH=/tools/bin:/bin:/usr/bin | |
cd $LFS | |
# mkdir -v $LFS/tools | |
# sudo ln -sv $LFS/tools / | |
tip "clean" | |
rm -rfv $LFS/tools/* | |
rm -rfv sources | |
# wget ftp://ftp.lfs-matrix.net/pub/lfs/lfs-packages/lfs-packages-6.6.tar | |
tip "start" && ls tools && tar -xvf lfs-packages-6.6.tar && \ | |
mv -v lfs-6.6-sources sources && \ | |
tip "Binutils" && cd $LFS/sources && tar -xvf binutils-2.20.tar.bz2 && \ | |
cd binutils-2.20 && \ | |
mkdir -v ../binutils-build && cd ../binutils-build && \ | |
../binutils-2.20/configure --target=$LFS_TGT --prefix=/tools \ | |
--disable-nls --disable-werror && \ | |
make && \ | |
case $(uname -m) in | |
x86_64) mkdir -v /tools/lib && ln -sv lib /tools/lib64 ;; | |
esac && \ | |
make install && \ | |
tip "Gcc" && cd $LFS/sources && tar -xf gcc-4.4.3.tar.bz2 && cd gcc-4.4.3 && \ | |
tar -jxf ../mpfr-2.4.2.tar.bz2 && \ | |
mv -v mpfr-2.4.2 mpfr && \ | |
tar -jxf ../gmp-5.0.0.tar.bz2 && \ | |
mv -v gmp-5.0.0 gmp && \ | |
mkdir -v ../gcc-build && cd ../gcc-build && \ | |
../gcc-4.4.3/configure --target=$LFS_TGT --prefix=/tools \ | |
--disable-nls --disable-shared --disable-multilib \ | |
--disable-decimal-float --disable-threads \ | |
--disable-libmudflap --disable-libssp \ | |
--disable-libgomp --enable-languages=c && \ | |
make && make install && \ | |
ln -vs libgcc.a `$LFS_TGT-gcc -print-libgcc-file-name | \ | |
sed 's/libgcc/&_eh/'` && \ | |
tip "Linux API Headers" && cd $LFS/sources && \ | |
tar -xf linux-2.6.32.8.tar.bz2 && \ | |
cd linux-2.6.32.8 && make mrproper && make headers_check && \ | |
make INSTALL_HDR_PATH=dest headers_install && \ | |
cp -rv dest/include/* /tools/include && \ | |
tip "Glibc" && cd $LFS/sources && tar -xf glibc-2.11.1.tar.bz2 && \ | |
cd glibc-2.11.1 && mkdir -v ../glibc-build && cd ../glibc-build && \ | |
case `uname -m` in | |
i?86) echo "CFLAGS += -march=i486 -mtune=native" > configparms ;; | |
esac && \ | |
../glibc-2.11.1/configure --prefix=/tools \ | |
--host=$LFS_TGT --build=$(../glibc-2.11.1/scripts/config.guess) \ | |
--disable-profile --enable-add-ons \ | |
--enable-kernel=2.6.18 --with-headers=/tools/include \ | |
libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes && \ | |
make && make install && \ | |
tip "Adjusting the Toolchain" && cd $LFS/sources && \ | |
SPECS=`dirname $($LFS_TGT-gcc -print-libgcc-file-name)`/specs && \ | |
$LFS_TGT-gcc -dumpspecs | sed \ | |
-e 's@/lib\(64\)\?/ld@/tools&@g' \ | |
-e "/^\*cpp:$/{n;s,$, -isystem /tools/include,}" > $SPECS && \ | |
echo "New specs file is: $SPECS" && \ | |
unset SPECS && \ | |
echo 'main(){}' > dummy.c && \ | |
$LFS_TGT-gcc -B/tools/lib dummy.c && \ | |
readelf -l a.out | grep ': /tools' && \ | |
rm -v dummy.c a.out && \ | |
tip "Binutils Pass 2" && cd $LFS/sources && \ | |
rm -rfv binutils-2.20 && rm -rfv binutils-build && \ | |
tar -xf binutils-2.20.tar.bz2 && cd binutils-2.20 && \ | |
mkdir -v ../binutils-build && cd ../binutils-build && \ | |
CC="$LFS_TGT-gcc -B/tools/lib/" \ | |
AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib \ | |
../binutils-2.20/configure --prefix=/tools \ | |
--disable-nls --with-lib-path=/tools/lib && \ | |
make && make install && \ | |
make -C ld clean && \ | |
make -C ld LIB_PATH=/usr/lib:/lib && \ | |
cp -v ld/ld-new /tools/bin && \ | |
tip "GCC Pass 2" && cd $LFS/sources && \ | |
rm -rfv gcc-4.4.3 && rm -rfv gcc-build && tar -xf gcc-4.4.3.tar.bz2 && \ | |
cd gcc-4.4.3 && patch -Np1 -i ../gcc-4.4.3-startfiles_fix-1.patch && \ | |
cp -v gcc/Makefile.in{,.orig} && \ | |
sed 's@\./fixinc\.sh@-c true@' gcc/Makefile.in.orig > gcc/Makefile.in && \ | |
cp -v gcc/Makefile.in{,.tmp} && \ | |
sed 's/^T_CFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in.tmp \ | |
> gcc/Makefile.in && \ | |
for file in \ | |
$(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h) | |
do | |
cp -uv $file{,.orig} | |
sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \ | |
-e 's@/usr@/tools@g' $file.orig > $file | |
echo ' | |
#undef STANDARD_INCLUDE_DIR | |
#define STANDARD_INCLUDE_DIR 0 | |
#define STANDARD_STARTFILE_PREFIX_1 "" | |
#define STANDARD_STARTFILE_PREFIX_2 ""' >> $file | |
touch $file.orig | |
done && \ | |
case $(uname -m) in | |
x86_64) | |
for file in $(find gcc/config -name t-linux64) ; do \ | |
cp -v $file{,.orig} | |
sed '/MULTILIB_OSDIRNAMES/d' $file.orig > $file | |
done | |
;; | |
esac && \ | |
tar -jxf ../mpfr-2.4.2.tar.bz2 && \ | |
mv -v mpfr-2.4.2 mpfr && \ | |
tar -jxf ../gmp-5.0.0.tar.bz2 && \ | |
mv -v gmp-5.0.0 gmp && \ | |
mkdir -v ../gcc-build && \ | |
cd ../gcc-build && \ | |
CC="$LFS_TGT-gcc -B/tools/lib/" \ | |
AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib \ | |
../gcc-4.4.3/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 --disable-multilib \ | |
--disable-bootstrap && \ | |
make && make install && ln -vs gcc /tools/bin/cc && \ | |
echo 'main(){}' > dummy.c && \ | |
cc dummy.c && \ | |
readelf -l a.out | grep ': /tools' && \ | |
rm -v dummy.c a.out && | |
tip "Tcl" && cd $LFS/sources && tar -xf tcl8.5.8-src.tar.gz && \ | |
cd tcl8.5.8 && cd unix && ./configure --prefix=/tools && \ | |
make && TZ=UTC make test && make install && \ | |
chmod -v u+w /tools/lib/libtcl8.5.so && make install-private-headers && \ | |
ln -sv tclsh8.5 /tools/bin/tclsh && \ | |
tip "Expect" && cd $LFS/sources && tar -xf expect-5.43.0.tar.gz && \ | |
cd expect-5.43 && patch -Np1 -i ../expect-5.43.0-spawn-1.patch && \ | |
patch -Np1 -i ../expect-5.43.0-tcl_8.5.5_fix-1.patch && \ | |
cp -v configure{,.orig} && \ | |
sed 's:/usr/local/bin:/bin:' configure.orig > configure && \ | |
./configure --prefix=/tools --with-tcl=/tools/lib \ | |
--with-tclinclude=/tools/include --with-x=no && \ | |
make && make SCRIPTS="" install && \ | |
tip "DejaGNU" && cd $LFS/sources && tar -xf dejagnu-1.4.4.tar.gz && \ | |
cd dejagnu-1.4.4 && ./configure --prefix=/tools && make install && \ | |
tip "Ncurses" && cd $LFS/sources && tar -xf ncurses-5.7.tar.gz && \ | |
cd ncurses-5.7 && ./configure --prefix=/tools --with-shared \ | |
--without-debug --without-ada --enable-overwrite && \ | |
make && make install && \ | |
tip "Bash" && cd $LFS/sources && tar -xf bash-4.1.tar.gz && \ | |
cd bash-4.1 && ./configure --prefix=/tools --without-bash-malloc && \ | |
make && make install && ln -vs bash /tools/bin/sh && \ | |
tip "Bzip2" && cd $LFS/sources && tar -xf bzip2-1.0.5.tar.gz && \ | |
cd bzip2-1.0.5 && make && make PREFIX=/tools install && \ | |
tip "Coreutils" && cd $LFS/sources && tar -xf coreutils-8.4.tar.gz && \ | |
cd coreutils-8.4 && \ | |
./configure --prefix=/tools --enable-install-program=hostname && \ | |
make && make RUN_EXPENSIVE_TESTS=yes check && make install && \ | |
cp -v src/su /tools/bin/su-tools && \ | |
tip "Diffutils" && cd $LFS/sources && tar -xf diffutils-2.8.1.tar.gz && \ | |
cd diffutils-2.8.1 && ./configure --prefix=/tools && make && make install && \ | |
tip "Findutils" && cd $LFS/sources && tar -xf findutils-4.4.2.tar.gz && \ | |
cd findutils-4.4.2 && ./configure --prefix=/tools && make && make install && \ | |
tip "Gawk" && cd $LFS/sources && tar -xf gawk-3.1.7.tar.bz2 && \ | |
cd gawk-3.1.7 && ./configure --prefix=/tools && make && make install && \ | |
tip "Gettext" && cd $LFS/sources && tar -xf gettext-0.17.tar.gz && \ | |
cd gettext-0.17 && cd gettext-tools && \ | |
./configure --prefix=/tools --disable-shared && make -C gnulib-lib && \ | |
make -C src msgfmt && cp -v src/msgfmt /tools/bin && \ | |
tip "Grep" && cd $LFS/sources && tar -xf grep-2.5.4.tar.bz2 && \ | |
cd grep-2.5.4 && ./configure --prefix=/tools --disable-perl-regexp \ | |
--without-included-regex && make && make install && \ | |
tip "Gzip" && cd $LFS/sources && tar -xf gzip-1.4.tar.gz && \ | |
cd gzip-1.4 && ./configure --prefix=/tools && make && make install && \ | |
tip "M4" && cd $LFS/sources && tar -xf m4-1.4.13.tar.bz2 && \ | |
cd m4-1.4.13 && ./configure --prefix=/tools && make && make install && \ | |
tip "Make" && cd $LFS/sources && tar -xf make-3.81.tar.bz2 && \ | |
cd make-3.81 && ./configure --prefix=/tools && make && make install && \ | |
tip "Patch" && cd $LFS/sources && tar -xf patch-2.6.1.tar.bz2 && \ | |
cd patch-2.6.1 && ./configure --prefix=/tools && make && make install && \ | |
tip "Perl" && cd $LFS/sources && tar -xf perl-5.10.1.tar.bz2 && \ | |
cd perl-5.10.1 && patch -Np1 -i ../perl-5.10.1-libc-1.patch && \ | |
sh Configure -des -Dprefix=/tools \ | |
-Dstatic_ext='Data/Dumper Fcntl IO POSIX' && \ | |
make perl utilities ext/Errno/pm_to_blib && \ | |
cp -v perl pod/pod2man /tools/bin && \ | |
mkdir -pv /tools/lib/perl5/5.10.1 && \ | |
cp -Rv lib/* /tools/lib/perl5/5.10.1 && \ | |
tip "Sed" && cd $LFS/sources && tar -xf sed-4.2.1.tar.bz2 && \ | |
cd sed-4.2.1 && ./configure --prefix=/tools && make && make install && \ | |
tip "Tar" && cd $LFS/sources && tar -xf tar-1.22.tar.bz2 && \ | |
cd tar-1.22 && ./configure --prefix=/tools && make && make install && \ | |
tip "Texinfo" && cd $LFS/sources && tar -xf texinfo-4.13a.tar.gz && \ | |
cd texinfo-4.13 && ./configure --prefix=/tools && make && make install && \ | |
tip "Well done!" && \ | |
tip "Stripping" && \ | |
strip --strip-debug /tools/lib/* | |
strip --strip-unneeded /tools/{,s}bin/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export LFS=/opt/lfs | |
export LC_ALL=POSIX | |
export LFS_TGT=$(uname -m)-lfs-linux-gnu | |
export PATH=/tools/bin:/bin:/usr/bin | |
echo "clean" | |
rm -rf $LFS/tools/* | |
rm -rf sources | |
echo "start" && tar -xf sources.tar && \ | |
cd $LFS/sources && tar -xf binutils-2.22.tar.bz2 && cd binutils-2.22 && \ | |
mkdir -v ../binutils-build && cd ../binutils-build && \ | |
../binutils-2.22/configure --target=$LFS_TGT --prefix=/tools \ | |
--disable-nls --disable-werror && make && \ | |
case $(uname -m) in | |
x86_64) mkdir -v /tools/lib && ln -sv lib /tools/lib64 ;; | |
esac && make install && \ | |
cd $LFS/sources && tar -xf gcc-4.6.2.tar.bz2 && cd gcc-4.6.2 && \ | |
tar -jxf ../mpfr-3.1.0.tar.bz2 && mv -v mpfr-3.1.0 mpfr && \ | |
tar -Jxf ../gmp-5.0.4.tar.xz && mv -v gmp-5.0.4 gmp && \ | |
tar -zxf ../mpc-0.9.tar.gz && mv -v mpc-0.9 mpc && \ | |
patch -Np1 -i ../gcc-4.6.2-cross_compile-1.patch && mkdir -v ../gcc-build && \ | |
cd ../gcc-build && ../gcc-4.6.2/configure --target=$LFS_TGT --prefix=/tools \ | |
--disable-nls --disable-shared --disable-multilib --disable-decimal-float \ | |
--disable-threads --disable-libmudflap --disable-libssp --disable-libgomp \ | |
--disable-libquadmath --disable-target-libiberty --disable-target-zlib \ | |
--enable-languages=c --without-ppl --without-cloog \ | |
--with-mpfr-include=$(pwd)/../gcc-4.6.2/mpfr/src \ | |
--with-mpfr-lib=$(pwd)/mpfr/src/.libs && make && make install && \ | |
ln -vs libgcc.a `$LFS_TGT-gcc -print-libgcc-file-name | \ | |
sed 's/libgcc/&_eh/'` && \ | |
cd $LFS/sources && tar -xf linux-3.2.6.tar.xz && cd linux-3.2.6 && \ | |
make mrproper && make headers_check && \ | |
make INSTALL_HDR_PATH=dest headers_install && \ | |
cp -rv dest/include/* /tools/include && \ | |
cd $LFS/sources && tar -xf glibc-2.14.1.tar.bz2 && cd glibc-2.14.1 && \ | |
patch -Np1 -i ../glibc-2.14.1-gcc_fix-1.patch && \ | |
patch -Np1 -i ../glibc-2.14.1-cpuid-1.patch && mkdir -v ../glibc-build && \ | |
cd ../glibc-build && \ | |
case `uname -m` in | |
i?86) echo "CFLAGS += -march=i486 -mtune=native" > configparms ;; | |
esac && ../glibc-2.14.1/configure --prefix=/tools --host=$LFS_TGT \ | |
--build=$(../glibc-2.14.1/scripts/config.guess) --disable-profile \ | |
--enable-add-ons --enable-kernel=2.6.25 \ | |
--with-headers=/tools/include libc_cv_forced_unwind=yes \ | |
libc_cv_c_cleanup=yes && make && make install && \ | |
SPECS=`dirname $($LFS_TGT-gcc -print-libgcc-file-name)`/specs && \ | |
$LFS_TGT-gcc -dumpspecs | sed -e 's@/lib\(64\)\?/ld@/tools&@g' -e \ | |
"/^\*cpp:$/{n;s,$, -isystem /tools/include,}" > $SPECS && \ | |
echo "New specs file is: $SPECS" && unset SPECS && \ | |
echo 'main(){}' > dummy.c && $LFS_TGT-gcc -B/tools/lib dummy.c && \ | |
readelf -l a.out | grep ': /tools' && rm -v dummy.c a.out && \ | |
cd $LFS/sources && rm -rf binutils-2.22 && rm -rf binutils-build && \ | |
tar -xf binutils-2.22.tar.bz2 && cd binutils-2.22 && \ | |
mkdir -v ../binutils-build && cd ../binutils-build && \ | |
CC="$LFS_TGT-gcc -B/tools/lib/" AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib \ | |
../binutils-2.22/configure --prefix=/tools --disable-nls \ | |
--with-lib-path=/tools/lib && make && make install && \ | |
make -C ld clean && make -C ld LIB_PATH=/usr/lib:/lib && \ | |
cp -v ld/ld-new /tools/bin && \ | |
cd $LFS/sources && rm -rf gcc-4.6.2 && rm -rf gcc-build && \ | |
tar -xf gcc-4.6.2.tar.bz2 && cd gcc-4.6.2 && \ | |
patch -Np1 -i ../gcc-4.6.2-startfiles_fix-1.patch && \ | |
cp -v gcc/Makefile.in{,.orig} && sed 's@\./fixinc\.sh@-c true@' \ | |
gcc/Makefile.in.orig > gcc/Makefile.in && cp -v gcc/Makefile.in{,.tmp} && \ | |
sed 's/^T_CFLAGS =$/& -fomit-frame-pointer/' \ | |
gcc/Makefile.in.tmp > gcc/Makefile.in && \ | |
for file in \ | |
$(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h) | |
do cp -uv $file{,.orig} && \ | |
sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' -e 's@/usr@/tools@g' \ | |
$file.orig > $file && \ | |
echo ' | |
#undef STANDARD_INCLUDE_DIR | |
#define STANDARD_INCLUDE_DIR 0 | |
#define STANDARD_STARTFILE_PREFIX_1 "" | |
#define STANDARD_STARTFILE_PREFIX_2 ""' >> $file && \ | |
touch $file.orig | |
done && \ | |
case `uname -m` in | |
x86_64) | |
for file in $(find gcc/config -name t-linux64) ; do | |
cp -v $file{,.orig} && \ | |
sed '/MULTILIB_OSDIRNAMES/d' $file.orig > $file | |
done | |
;; | |
esac && tar -jxf ../mpfr-3.1.0.tar.bz2 && mv -v mpfr-3.1.0 mpfr && \ | |
tar -Jxf ../gmp-5.0.4.tar.xz && mv -v gmp-5.0.4 gmp && \ | |
tar -zxf ../mpc-0.9.tar.gz && mv -v mpc-0.9 mpc && \ | |
mkdir -v ../gcc-build && cd ../gcc-build && \ | |
CC="$LFS_TGT-gcc -B/tools/lib/" AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib \ | |
../gcc-4.6.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 --disable-multilib --disable-bootstrap \ | |
--disable-libgomp --without-ppl --without-cloog \ | |
--with-mpfr-include=$(pwd)/../gcc-4.6.2/mpfr/src \ | |
--with-mpfr-lib=$(pwd)/mpfr/src/.libs && make && make install && \ | |
ln -vs gcc /tools/bin/cc && echo 'main(){}' > dummy.c && cc dummy.c && \ | |
readelf -l a.out | grep ': /tools' && rm -v dummy.c a.out && \ | |
cd $LFS/sources && tar -xf tcl8.5.11-src.tar.gz && cd tcl8.5.11 && \ | |
cd unix && ./configure --prefix=/tools && make && make install && \ | |
make install-private-headers && ln -sv tclsh8.4 /tools/bin/tclsh && \ | |
cd $LFS/sources && tar -xf expect5.45.tar.gz && \ | |
cd expect5.45 && cp -v configure{,.orig} && \ | |
sed 's:/usr/local/bin:/bin:' configure.orig > configure && \ | |
./configure --prefix=/tools --with-tcl=/tools/lib \ | |
--with-tclinclude=/tools/include && make && make SCRIPTS="" install && \ | |
cd $LFS/sources && tar -xf dejagnu-1.5.tar.gz && cd dejagnu-1.5 && \ | |
./configure --prefix=/tools && make install && \ | |
cd $LFS/sources && tar -xf check-0.9.8.tar.gz && cd check-0.9.8 && \ | |
./configure --prefix=/tools && make && make install && \ | |
cd $LFS/sources && tar -xf ncurses-5.9.tar.gz && cd ncurses-5.9 && \ | |
./configure --prefix=/tools --with-shared --without-debug --without-ada \ | |
--enable-overwrite && make && make install && \ | |
cd $LFS/sources && tar -xf bash-4.2.tar.gz && cd bash-4.2 && \ | |
patch -Np1 -i ../bash-4.2-fixes-4.patch && \ | |
./configure --prefix=/tools --without-bash-malloc && make && make install && \ | |
ln -vs bash /tools/bin/sh && \ | |
cd $LFS/sources && tar -xf bzip2-1.0.6.tar.gz && cd bzip2-1.0.6 && \ | |
make && make PREFIX=/tools install && \ | |
cd $LFS/sources && tar -xf coreutils-8.15.tar.xz && cd coreutils-8.15 && \ | |
./configure --prefix=/tools --enable-install-program=hostname && make && \ | |
make RUN_EXPENSIVE_TESTS=yes check && make install && \ | |
cp -v src/su /tools/bin/su-tools && \ | |
cd $LFS/sources && tar -xf diffutils-3.2.tar.gz && cd diffutils-3.2 && \ | |
./configure --prefix=/tools && make && make install && \ | |
cd $LFS/sources && tar -xf file-5.10.tar.gz && cd file-5.10 && \ | |
./configure --prefix=/tools && make && make install && \ | |
cd $LFS/sources && tar -xf findutils-4.4.2.tar.gz && cd findutils-4.4.2 && \ | |
./configure --prefix=/tools && make && make install && \ | |
cd $LFS/sources && tar -xf gawk-4.0.0.tar.bz2 && cd gawk-4.0.0 && \ | |
./configure --prefix=/tools && make && make install && \ | |
cd $LFS/sources && tar -xf gettext-0.18.1.1.tar.gz && cd gettext-0.18.1.1 && \ | |
cd gettext-tools && ./configure --prefix=/tools --disable-shared && \ | |
make -C gnulib-lib && make -C src msgfmt && cp -v src/msgfmt /tools/bin && \ | |
cd $LFS/sources && tar -xf grep-2.10.tar.xz && cd grep-2.10 && \ | |
./configure --prefix=/tools --disable-perl-regexp && make && make check && \ | |
make install && \ | |
cd $LFS/sources && tar -xf gzip-1.4.tar.gz && cd gzip-1.4 && \ | |
./configure --prefix=/tools && make && make install && \ | |
cd $LFS/sources && tar -xf m4-1.4.16.tar.bz2 && cd m4-1.4.16 && \ | |
./configure --prefix=/tools && make && make install && \ | |
cd $LFS/sources && tar -xf make-3.82.tar.bz2 && cd make-3.82 && \ | |
./configure --prefix=/tools && make && make install && \ | |
cd $LFS/sources && tar -xf patch-2.6.1.tar.bz2 && cd patch-2.6.1 && \ | |
./configure --prefix=/tools && make && make install && \ | |
cd $LFS/sources && tar -xf perl-5.14.2.tar.bz2 && cd perl-5.14.2 && \ | |
patch -Np1 -i ../perl-5.14.2-libc-1.patch && \ | |
sh Configure -des -Dprefix=/tools && make && \ | |
cp -v perl cpan/podlators/pod2man /tools/bin && \ | |
mkdir -pv /tools/lib/perl5/5.14.2 && \ | |
cp -Rv lib/* /tools/lib/perl5/5.14.2 && \ | |
cd $LFS/sources && tar -xf sed-4.2.1.tar.bz2 && cd sed-4.2.1 && \ | |
./configure --prefix=/tools && make && make install && \ | |
cd $LFS/sources && tar -xf tar-1.26.tar.bz2 && cd tar-1.26 && \ | |
./configure --prefix=/tools && make && make install && \ | |
cd $LFS/sources && tar -xf texinfo-4.13a.tar.gz && cd texinfo-4.13 && \ | |
./configure --prefix=/tools && make && make install && \ | |
cd $LFS/sources && tar -xf xz-5.0.3.tar.bz2 && cd xz-5.0.3 && \ | |
./configure --prefix=/tools && make && make install && \ | |
strip --strip-debug /tools/lib/* && \ | |
strip --strip-unneeded /tools/{,s}bin/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export LFS="/srv/lfs/6.6" | |
cd $LFS && \ | |
sudo umount -v $LFS/dev/shm && \ | |
sudo umount -v $LFS/dev/pts && \ | |
sudo umount -v $LFS/dev && \ | |
sudo umount -v $LFS/proc && \ | |
sudo umount -v $LFS/sys && \ | |
rm -rvf {dev,proc,sys} | |
sudo chown -R root:root $LFS/tools | |
sudo mkdir -v $LFS/{dev,proc,sys} && \ | |
sudo mknod -m 600 $LFS/dev/console c 5 1 && \ | |
sudo mknod -m 666 $LFS/dev/null c 1 3 && \ | |
sudo mount -v --bind /dev $LFS/dev && \ | |
sudo mount -vt devpts devpts $LFS/dev/pts && \ | |
sudo mount -vt tmpfs shm $LFS/dev/shm && \ | |
sudo mount -vt proc proc $LFS/proc && \ | |
sudo mount -vt sysfs sysfs $LFS/sys | |
sudo chroot "$LFS" /tools/bin/env -i HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \ | |
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin /tools/bin/bash --login +h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export LC_ALL=C | |
# Simple script to list version numbers of critical development tools | |
bash --version | head -n1 | cut -d" " -f2-4 | |
echo "/bin/sh -> `readlink -f /bin/sh`" | |
echo -n "Binutils: "; ld --version | head -n1 | cut -d" " -f3- | |
bison --version | head -n1 | |
if [ -e /usr/bin/yacc ]; | |
then echo "/usr/bin/yacc -> `readlink -f /usr/bin/yacc`"; | |
else echo "yacc not found"; fi | |
bzip2 --version 2>&1 < /dev/null | head -n1 | cut -d" " -f1,6- | |
echo -n "Coreutils: "; chown --version | head -n1 | cut -d")" -f2 | |
diff --version | head -n1 | |
find --version | head -n1 | |
gawk --version | head -n1 | |
if [ -e /usr/bin/awk ]; | |
then echo "/usr/bin/awk -> `readlink -f /usr/bin/awk`"; | |
else echo "awk not found"; fi | |
gcc --version | head -n1 | |
/lib/libc.so.6 | head -n1 | cut -d"," -f1 | |
grep --version | head -n1 | |
gzip --version | head -n1 | |
cat /proc/version | |
m4 --version | head -n1 | |
make --version | head -n1 | |
patch --version | head -n1 | |
echo Perl `perl -V:version` | |
sed --version | head -n1 | |
tar --version | head -n1 | |
echo "Texinfo: `makeinfo --version | head -n1`" | |
echo 'main(){}' > dummy.c && gcc -o dummy dummy.c | |
if [ -x dummy ]; then echo "Compilation OK"; | |
else echo "Compilation failed"; fi | |
rm -f dummy.c dummy | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Simple script to list version numbers of critical development tools | |
export LC_ALL=C | |
bash --version | head -n1 | cut -d" " -f2-4 | |
echo "/bin/sh -> `readlink -f /bin/sh`" | |
echo -n "Binutils: "; ld --version | head -n1 | cut -d" " -f3- | |
bison --version | head -n1 | |
if [ -e /usr/bin/yacc ]; | |
then echo "/usr/bin/yacc -> `readlink -f /usr/bin/yacc`"; | |
else echo "yacc not found"; fi | |
bzip2 --version 2>&1 < /dev/null | head -n1 | cut -d" " -f1,6- | |
echo -n "Coreutils: "; chown --version | head -n1 | cut -d")" -f2 | |
diff --version | head -n1 | |
find --version | head -n1 | |
gawk --version | head -n1 | |
if [ -e /usr/bin/awk ]; | |
then echo "/usr/bin/awk -> `readlink -f /usr/bin/awk`"; | |
else echo "awk not found"; fi | |
gcc --version | head -n1 | |
ldd --version | head -n1 | cut -d" " -f2- # glibc version | |
grep --version | head -n1 | |
gzip --version | head -n1 | |
cat /proc/version | |
m4 --version | head -n1 | |
make --version | head -n1 | |
patch --version | head -n1 | |
echo Perl `perl -V:version` | |
sed --version | head -n1 | |
tar --version | head -n1 | |
echo "Texinfo: `makeinfo --version | head -n1`" | |
xz --version | head -n1 | |
echo 'main(){}' > dummy.c && gcc -o dummy dummy.c | |
if [ -x dummy ] | |
then echo "gcc compilation OK"; | |
else echo "gcc compilation failed"; fi | |
rm -f dummy.c dummy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment