From subsecret
Jump to: navigation, search

Getting started

Replace old tools with new ones. As root run the following

rm -rf /newsystem/tools/
cp -R /tools /newsystem

Make new directory for building

mkdir /newsystem/build
chmod a+r+w /newsystem/build

Move all the downloaded packages to /newsystem/build

Follow the "Changing to new environment with chroot" section on Trying tools in clean environment, so that you are in the chroot environment

kernel-headers

tar xf linux-2.6.38.4.tar.bz2 
cd linux-2.6.38.4
make mrproper
make INSTALL_HDR_PATH="" headers_install 
cd ..

libcap

tar xf libcap-2.20.tar.gz
cd libcap-2.20
make
cp -R libcap/include/ /
cp libcap/libcap*.so* /lib
cp libcap/include/sys/capability.h /include/sys/
cd ..

libelf

tar xf libelf-0.8.13.tar.gz
cd libelf-0.8.13
./configure --prefix=""
make -j 12
make install
cd ..

glibc

tar xf glibc-2.13.tar.gz
touch /etc/ld.so.conf
mkdir glibc-2.13-build
cd glibc-2.13-build
../glibc-2.13/configure --prefix="" --enable-add-ons --enable-kernel=2.6.37       
make -j 12
make install
cd ..

Edit /bin/ldd and change

RTLDLIST="/lib/ld-linux.so.2 /lib64/ld-linux-x86-64.so.2"

to

RTLDLIST="/lib/ld-linux.so.2 /lib/ld-linux-x86-64.so.2"

gmp

tar xf gmp-5.0.1.tar.gz
cd gmp-5.0.1
./configure --prefix=""
make -j 12
make install
cd ..

mpfr

tar xf mpfr-3.0.0.tar.gz
cd mpfr-3.0.0
./configure --prefix=""
make -j 12 install
cd ..

mpc

tar xf mpc-0.9.tar.gz
cd mpc-0.9
./configure  --prefix=""
make -j 12
make install
cd ..

GCC

ln -s /include /usr
export LD_LIBRARY_PATH=/lib
tar xf gcc-4.5.2.tar.bz2 
cd gcc-4.5.2

Go to gcc/config/i386 and edit linux64.h or linux.h.

#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"

Is changed to:

#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
#define GLIBC_DYNAMIC_LINKER64 "/lib/ld-linux-x86-64.so.2"
cd ..
mkdir gccbuild
cd gccbuild
../gcc-4.5.2/configure --disable-multilib  --prefix=""  --enable-add-ons --enable-kernel=2.6.37 
make -j 12 
make install
cd ..

Missing

Here all the former applications should be listed again with new configure options

Removal of tools

Now remove tools folder and run new chroot command without /tools/bin reference.

Bison

Note that bison 2.4.2 and 2.4.3 are broken (incompatible with M4)

tar xf bison-2.4.1.tar.gz
cd bison-2.4.1
./configure --prefix /
make -j 12
make install
cd ..

Grub

tar xf grub-1.98.tar.gz
cd grub-1.98
./configure --prefix /
make -j 12
make install
cd..

We are now ready for next step