How to port IPlinux to the new architecture?
preparations
- Prepare the chroot
http://ftp.iplinux.org/contrib/iplinux-bootstrap/iplinux-bootstrap-LATEST.tar.bz2 tar xf iplinux-bootstrap-LATEST.tar.bz2 (cd iplinux-bootstrap; ./iplinux-bootstrap iplinux ../ip) ./ip/enter
- Install the development packages
apt-get update apt-get install git-core build-essential toolchain-package debootstrap debhelper pkg-config po4a libncursesw5-dev zlib1g-dev libbz2-dev flex libselinux1-dev libio-string-perl quilt autoconf automake cvs gawk dpatch texinfo sharutils libgmp3-dev libmpfr-dev lsb-release realpath cdbs docbook-to-man dbs
dpkg
- Test dpkg: dpkg-architecture -a<your arch> should emit lots of variables. Check the correctness of variables.
- In case dpkg-architecture is not enlightened enough, fix it (see /usr/share/dpkg/*table and commits to dpkg git for the reference) and send patches to mailing list / maintainer / IRC.
toolchain
- Create a new directory and clone the binutils, linux-libc-dev, gcc-4.3 and either/both glibc and uclibc git repositories into it:
(–depth 1 means don't fetch any history, which is huge for the linux kernel)
mkdir toolchain-build; cd toolchain-build for i in binutils gcc-4.3 glibc uclibc; do git clone git://git.iplinux.org/$i.git done git clone --depth 1 git://git.iplinux.org/linux-libc-dev.git
- In the directory with sources run:
mktpkg <arch>
- See the lots of error messages.
- Fix the problems, repeat until success.
- Send patches to mailing list / maintainer / IRC.
Initial rootfs
Get the source code:
for i in apt base-files base-passwd busybox dpkg dropbear ifupdown ncurses netbase perl sysvinit zlib; do git clone git://git.openinkpot.org/$i.git done
Build most of the downloaded stuff:
for i in base-files base-passwd busybox ifupdown ncurses netbase perl sysvinit zlib; do (cd $i; dpkg-buildpackage -b -us -uc -a<ARCH> -d) done
Install the built devel libraries:
sudo dpkg-cross -i -a <arch> libz1-dev_*.deb libz1_*.deb libncurses5-dev_*.deb libncurses5_*.deb
Build the rest:
for i in dpkg apt dropbear; do (cd $i; dpkg-buildpackage -b -us -uc -a<ARCH> -d) done
Create the repository:
mkdir ~/repo cd ~/repo cp ~/pkg-build/*.deb ~/toolchain-build/*.deb . apt-ftparchive --option=Tree::Architectures=<ARCH> packages . > Packages mkdir -p dists/zelazny/main/binary-<ARCH> ln -s ../../../../Packages dists/zelazny/main/binary-<ARCH>/Packages
Build the rootfs:
cd ~ sudo debootstrap --arch=<ARCH> --components=main zelazny rootfs file:///home/build/repo
profit!
- Enjoy your new shiny toolchain and rootfs.
