stupid_idiot
Group: Members
Posts: 344
Joined: Oct. 2006 |
|
Posted: May 25 2008,01:21 |
|
lfs.txt Download and install "debootstrap.dsl".
SARGE: debootstrap \ --include=bzip2,flex,g++,gcc,less,\ libc6-dev,libncurses5-dev,libreadline4-dev,make,patch,\ perl \ --make-tarball /whatever/whatever.tar.gz \ sarge /mnt/hdaX http://ftp.de.debian.org/debian debootstrap \ --include=bzip2,flex,g++,gcc,less,\ libc6-dev,libncurses5-dev,libreadline4-dev,make,patch,\ perl \ --unpack-tarball /whatever/whatever.tar.gz \ sarge /mnt/hdaX http://ftp.de.debian.org/debian: Choose a partition to use for the build, hdaY: mount /dev/hdaY mkdir /mnt/hdaY/lfs cp lfs_sources.tar.gz /mnt/hdaY/lfs cd /mnt/hdaY/lfs tar -xzvf lfs_sources.tar.gz All OK. cd CHROOT into SARGE: unset CPPFLAGS CFLAGS CXXFLAGS LDFLAGS LD_LIBRARY_PATH chroot /mnt/hdaX export PS1="\w $" We are now working from SARGE. mknod /dev/hdaY b [?] Y mkdir /mnt/hdaY mount /dev/hdaY /mnt/hdaY ln -s /mnt/hdaY/lfs ln -s /mnt/hdaY/lfs/sources
LFS part 1: bash binutils bison coreutils diffutils ed flex findutils gawk gcc glibc grep gzip less libiconv libtool m4 make nano ncurses patch pkg-config readline sed tar -- cd /sources/src_lfs/files_lfs for i in *.tar.gz ; do tar -C .. -xzvf $i ; done mv ../linuxthreads* ../glibc-2.3.2 cd ../build_lfs/build_libiconv -- 01. libiconv ../../config_lfs/set_libiconv.sh make install make install DESTDIR=/lfs cd ../../patches_lfs 02-21. for i in bash* ; do patch -p0 < $i ; done cd ../build_lfs for i in \ {bash,bison,coreutils,diffutils,ed,\ flex,gawk,grep,gzip,less,\ libtool,m4,make,nano,ncurses,\ patch,pkg-config,readline,sed,tar} ; \ do cd build_$i && ../../config_lfs/set_$i.sh \ && make install DESTDIR=/lfs && cd .. ; done cd build_binutils 22. binutils ../../config_lfs/set_binutils.sh make tooldir=/usr LIB_PATH=/usr/lib:/lib cp ../../binutils-2.15/include/libiberty.h /usr/include cp ../../binutils-2.15/include/libiberty.h /lfs/usr/include make install tooldir=/usr DESTDIR=/lfs cd ../../linux-headers-2.4.31 23. linux-headers make include/linux/version.h cp -R include/asm-i386 /lfs/usr/include/asm cp -R include/asm-generic /lfs/usr/include touch include/linux/autoconf.h cp -R include/linux /lfs/usr/include cd ../build_lfs/build_glibc 24. glibc patch -d ../.. -p0 < ../../patches_lfs/glibc-2.3.2-inlining_fixes-2.patch patch -d ../.. -p0 < ../../patches_lfs/glibc-2.3.2-sscanf-1.patch ../../config_lfs/set_glibc.sh make make install install_root=/lfs cd ../build_gcc 25. gcc patch -p2 < ../../patches_lfs/gcc-3.3.6-no_fixincludes.patch patch -p2 < ../../patches_lfs/gcc-3.3.6-suppress_libiberty.patch ../../config_lfs/set_gcc.sh make make install DESTDIR=/lfs -- Add important files to /lfs: cd /lfs mkdir dev tmp cp -a /dev/* dev ln -s bash bin/sh ln -s /bin/install usr/bin ln -s /bin/sed usr/bin ln -s /usr/bin/cpp lib ln -s gcc usr/bin/cc ldconfig -r /lfs echo /usr/lib > /lfs/etc/ld.so.conf echo LD_LIBRARY_PATH=/usr/lib:/lib > /lfs/etc/profile Delete symlinks (to prevent accidental "rm -r"??): rm /lfs rm /sources Exit from SARGE: exit Unmount hdaY: umount /mnt/hdaX/mnt/hdaY CHROOT into LFS: chroot /mnt/hdaY/lfs /bin/bash -l export PS1="\w $"
LFS part 2: bzip2 debianutils file nasm unzip util-linux zip zlib -- cd /sources/src_lfs/bzip-1.0.2 -- 01. bzip2 {{ Edit "Makefile". Under "CFLAGS", change "-O2" to "-Os". Edit "Makefile-libbz2_so". Under "CFLAGS", change "-O2" to "-Os". }} make install rm /usr/lib/libbz2.a make -f Makefile-libbz2_so cp -a libbz2.so.1.0* /usr/lib ln -s libbz2.so.1.0 /usr/lib/libbz2.so cd ../debianutils-2.8.4 02. debianutils install -m755 which /usr/bin cd ../file-4.02 03. file ../config_lfs/set_file.sh make install cd ../build_lfs/build_nasm 04. nasm ../../config_lfs/set_nasm.sh make install cd ../unzip551 05. unzip {{ Edit "unix/Makefile". Change "prefix = /usr/local" to "prefix = /usr". Look for the line that starts with "linux:". Under "CF=", change "-O3" to "-Os". }} make -f unix/Makefile linux install cd ../util-linux-2.11z 06. util-linux {{ Edit "MCONFIG". Change "DISABLE_NLS=no" to "yes". Under "INSTALLSUID=", change "-o root" to "-o 0". }} ./configure {{ Edit "make_include". Change "CFLAGS=-O2" to "CFLAGS=-Os". }} make -C lib make -C mount install cd ../zip-2.3 07. zip {{ Edit "unix/Makefile". Change "prefix = /usr/local" to "prefix = /usr". Change "CFLAGS = -O2" to "CFLAGS = -Os". }} make -f unix/Makefile generic install cd ../zlib-1.1.4 08. zlib ../config_lfs/set_zlib.sh make install cd ..
LFS part 3: autoconf automake openssl perl wget -- cd perl-5.8.0 -- 01. perl ./Configure -d -f ../config_lfs/set_perl.sh make make install ln -s /usr/lib/perl5/5.8.0/CORE/libperl.so.5.8 /usr/lib/libperl.so.5.8.0 ln -s libperl.so.5.8 /usr/lib/libperl.so cd ../build_lfs 02-03. for i in {autoconf,automake} ; \ do cd build_$i && ../../config_lfs/set_$i.sh \ && make install && cd .. ; done cd ../openssl-0.9.7 04. openssl ../config_lfs/set_openssl.sh {{ Edit "Makefile.ssl". Look for the line that starts with "CFLAG=". Change "-O3" to "-Os". Look for the line that begins with "install:". Delete "install-docs". }} make install rm /usr/lib/lib{crypto,ssl}.a cd ../build_lfs/build_wget 05. wget ../../config_lfs/set_wget.sh make install Finished building base software.
|