As developers expand Gentoo to new architectures and platforms, they may find there isn't any real collection of knowledge which explains all the little details of Portage and moving a platform into the experimental release stage. This document aims to address that. Here we port Gentoo Linux to the SuperH (sh) architecture, but the details should be pretty straightforward for other arches/operating systems.
This is the hardest step by far (really!). There are two ways to get going. You can start with an existing Linux port out there (Debian, RedHat, some random hobbyist distro, etc...), or you can cross compile the entire system. The first route is the easiest, so we will cover that first. Simply boot up the system with the existing port and make sure it has all the important packages installed for development. A quick checklist:
Once you have these packages, you can easily install Portage. A script to do so
can be found
# bash ./bootstrap-portage
Then we need to create a profile for our new arch.
# mkdir -p /usr/local/portage/profiles/default/linux/sh # cd /usr/local/portage/profiles/default/linux/sh # echo '..' > parent # cat << EOF > make.defaults ARCH="sh" ACCEPT_KEYWORDS="sh" GRP_STAGE23_USE="pam" EOF # cd /etc # ln -s ../usr/local/portage/profiles/default/linux/sh make.profile # "PORTDIR_OVERLAY=/usr/local/portage" >> make.conf
Finally, sync up and we should have our Portage tree!
# emerge --sync
The next step is to prepare a seed for
# mkdir /etc/portage # for p in $(env USE="-*" ACCEPT_KEYWORDS=x86 \ emerge system -qep --columns | awk '($1 ~ /ebuild/) {print $4}') ; do \ echo "${p} x86" >> package.keywords ; \ done
Then we simply emerge our system into a new root and create a seed tarball with the result:
# env ROOT=~/gentoo-seed/ USE="-*" emerge system # tar jpcf ~/seed.tar.bz2 ~/gentoo-seed/
Now, take the list generated in package.keywords, and add the
# catalyst -C target=snapshot version_stamp=sh
Before we can make stages with
Then try building a stage1 tarball with
# mkdir -p /var/tmp/catalyst/builds # mv ~/seed.tar.bz2 /var/tmp/catalyst/builds/ # catalyst -C \ snapshot=sh version_stamp=sh \ subarch=sh profile=default/linux/sh \ rel_type=default target=stage1 \ source_subpath=seed
If everything goes well, you should end up with a stage1 tarball from which you can then make stage2 and stage3 tarballs.
If you don't like the idea of running
If we don't want all this work to be for nothing, we have to share it. Here's what needs to be updated so you don't start committing half-broken work (and making other developers very angry).
Our first profile was just a 'make it work' solution. Now you have to create a
much more complete one. After you've committed the profile, update the
following files in the
You should declare the profile status in
At this point, you should be able to start updating ebuilds in the tree with the new KEYWORD.