Table of Contents
Building programs is made using a independant environment.
The indenpendant environement is basically a folder you can chroot in and compile programs from. The build toolchain is located in an non standard location (/tools in our case), in oder to copy compiled programs in standard locations (/bin, /usr/bin, etc).
The Wakes independant build environment (the toolchain) is widely based on the LFS 7.5 temporary system. In addition to it, the following programs were added:
ksh zlib iproute2 openssl openssh vi wget procps libtar libarchive libcurl
The goal is to create a docker image instead of using a basic chroot script to enter the image. Once the toolchain folder is ready, create the docker image:
tar -C /toolchain -c . | docker import - toolchain
Then you can start a container from this image:
docker run -d -p 2222:22 -it toolchain /tools/sbin/sshd -D
and enter the image using ssh:
ssh -p 2222 root@0
todo: compile glibc, wkpkg, make the wakes prep
wkpkg: wkpkg.o gcc -o wkpkg -Wall -g -lm -lrt -ldl wkpkg.o /tools/lib/libtar.a \ /tools/lib/libz.a /tools/lib/libarchive.a /tools/lib/libbz2.a \ /tools/lib/libcurl.a /tools/lib/libssl.a /tools/lib/libcrypto.a wkpkg.o: wkpkg.c gcc -Wall -g -c wkpkg.c clean: rm wkpkg.o wkpkg
cat <<EOF > /etc/wkpkg.conf # Default network depot http://www.gnuwakes.org/depot main #usb://depot main #ftp://www.gnuwakes.org/depot main #cdrom://depot main #disk://var/wkpkg/rep main EOF cat <<EOF > /etc/wakes_version 1.0 EOF mkdir /var/wkpkg/{cat,rep,db,mnt,run} mkdir /var/wkpkg/mnt/{cdrom,usb}
# install linux header and glibc wkpkg -i linux-headers-4.1.1 wkpkg -i glibc # ld mv -v /tools/bin/{ld,ld-old} mv -v /tools/$(gcc -dumpmachine)/bin/{ld,ld-old} mv -v /tools/bin/{ld-new,ld} ln -sv /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld # gcc gcc -dumpspecs | sed -e 's@/tools@@g' \ -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \ -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' > \ `dirname $(gcc --print-libgcc-file-name)`/specs