玄箱 Kuro Box Gentoo Kuro Box Gentoo
Help for users running Gentoo on the Kuro Box.
Home  |  About the Site  |  Contact Us

 

 

Installing Gentoo Beta 1 on the Kuro Box
<<  Return to table of contents


6. Setting up and configuring Portage

6. a. Configuring Portage

Our setup for portage is a bit particular, since we use an overlay for Kuro-specific ebuilds, and a profile that is not part of the official tree.

First we need to edit the file called /etc/make.conf (it's just a text file).

Terminal input as ROOT user
KURO-BOX-EM / # cd /etc
KURO-BOX-EM etc # nano /etc/make.conf
Notes: NANO is our standard text editor. Calling it will clear the screen and show us the text file.

Here is the /etc/make.conf file that should come with the system image:

/etc/make.conf
# Kurobox make.conf

CFLAGS="-O2 -mcpu=603e -fno-strict-aliasing -pipe"
CXXFLAGS="${CFLAGS}"

PORTDIR=/var/portage/tree
DISTDIR=/var/portage/distfiles
PKGDIR=/var/portage/packages
RPMDIR=/var/portage/rpm

PORTDIR_OVERLAY="/var/portage/overlays/kurobox"

RSYNC_EXCLUDEFROM=/etc/portage/rsync_excludes
Notes:

It deserves a few comments:

The CFLAGS are the ones that were used to build this image. They should be safe for our architecture, with a reasonable level of optimisation. I suggest you keep them as-is. Sure, you will always see some Gentoo folks that use a three lines long CFLAGS variable, but seriously, that is bullshit, and won't make your system faster.
POTRDIR, DISTDIR, PKGDIR and RPMDIR redefine some standard locations of the Portage files. There default value in official setups are:
PORTDIR=/usr/portage
DISTDIR=/usr/portage/distfiles
PKGDIR=/usr/portage/packages
RPMDIR=/usr/portage/rpm
I personally never liked that defaults, and always changed it. If you don't agree, fine, then just comment or delete this lines. (Note: don't pay too much attention to this RPMDIR, it will stay unused for most people.)

PORTDIR_OVERLAY is a list of locations of additional ebuilds trees. It must contains at least the location of the KuroBox overlay, otherwise you will break your system. Again, if you don't agree with the location I propose, feel free to change it.
RSYNC_EXCLUDEFROM is the location of a file that list some Portage tree subdirs that we don't want to rsync. If you look at this file, you'll see that I've dropped everything that is related to X11, and games, because I thought most users won't need that on their Kuro. That makes rsync a bit faster. Feel free to modify /etc/portage/rsync_excludes if you have different needs, or even to comment or remove the RSYNC_EXCLUDEFROM line to have a complete portage tree.

You should add locations of distfiles and rsync mirrors to /etc/make.conf. Also, you can specify USE flags here as well. A basic template has been inserted into the file to get you started. You would need to uncomment out the :

/etc/make.conf
# Kurobox make.conf

CFLAGS="-O2 -mcpu=603e -fno-strict-aliasing -pipe"
CXXFLAGS="${CFLAGS}"

PORTDIR=/var/portage/tree
DISTDIR=/var/portage/distfiles
PKGDIR=/var/portage/packages
RPMDIR=/var/portage/rpm

PORTDIR_OVERLAY="/var/portage/overlays/kurobox"

RSYNC_EXCLUDEFROM=/etc/portage/rsync_excludes

# Uncomment this line to specify Portage USE flags. These tell portage which
#  features you do or do not want installed by default.
#  Others flags you might want are: "apache2 mysql"
# USE="-X -gtk -gnome -qt -kde samba cups pam usb"


# Uncomment this line to specify some distfile servers that are close to you.
#  It's usually a good idea to use the mirrorselect utility to find fast mirrors.
# GENTOO_MIRRORS="http://gentoo.osuosl.org"


# You can uncomment on of the RSYNC mirrors if you need to.
#  The first one is a global server, the rest are continent specific.
#  If you don't specify anything, the global one will be used by default.
# SYNC="rsync://rsync.gentoo.org/gentoo-portage"
# SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
# SYNC="rsync://rsync.samerica.gentoo.org/gentoo-portage"
# SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
# SYNC="rsync://rsync.asia.gentoo.org/gentoo-portage"
# SYNC="rsync://rsync.au.gentoo.org/gentoo-portage"
Notes: Add the blue lines shown here to your file. You can customize these settings if you wish or simply leave them commented out and use the default choices. The goal here is to specify servers that are fast for your area of the internet.

 

6. b. Creating and populating the Portage directories

If you have changed some locations in the /etc/make.conf file, then remember to adapt the following commands accordingly (Note: we did not do this in these instructions so there is nothing to adapt).

First, we create and populate the ebuild tree using the snapshot:

Terminal input as ROOT user
KURO-BOX-EM / # mkdir -p /var/portage/tree
KURO-BOX-EM / # cd /var/portage/tree
KURO-BOX-EM tree # tar xvjf /portage-snapshot-20041218.tar.bz2
app-accessibility/
app-accessibility/SphinxTrain/
app-accessibility/SphinxTrain/files/
[...]
www-servers/skunkweb/skunkweb-3.4_beta5-r1.ebuild
www-servers/skunkweb/skunkweb-3.4.0.ebuild
www-servers/skunkweb/skunkweb-3.4_beta5.ebuild
Notes: This is going to take a while

Then we do the same with the overlay tree:

Terminal input as ROOT user
KURO-BOX-EM tree # cd ..
KURO-BOX-EM portage # mkdir -p overlays/kurobox
KURO-BOX-EM portage # cd overlays/kurobox
KURO-BOX-EM kurobox # tar xvjf /portage-overlay-20041221.tar.bz2
./profiles/
./profiles/kurobox-0.1/
./profiles/kurobox-0.1/make.defaults
[...]
./sys-apps/kuroevtd/files/digest-kuroevtd-1.1.3
./sys-apps/kuroevtd/Manifest
Notes:

Finally, we create empty dirs for distfiles and binary packages:

Terminal input as ROOT user
KURO-BOX-EM kurobox # cd ../..
KURO-BOX-EM portage # mkdir packages
KURO-BOX-EM portage # mkdir distfiles
OUTPUT
Notes:

 

6. c. Setting the portage profile

A Portage profile is a set of default configuration for Portage. It describes what packages make the base system, what are default USE flags, what is the architecture, etc. For various reasons, we won't use a standard Gentoo profile, but a specific one that is in our overlay:

Terminal input as ROOT user
KURO-BOX-EM portage # cd /etc
KURO-BOX-EM etc # ln -s ../var/portage/overlays/kurobox/profiles/kurobox-0.1 make.profile
OUTPUT
Notes:

Of course, if you have changed the installation path of the overlay, the above command should be adapted accordingly.

6. d. Regenerating the Portage cache

Now that we have installed the Portage ebuilds, we can tell portage to update its cache. This step is a bit slow, but will makes portage faster later.

Terminal input as ROOT user
KURO-BOX-EM etc # emerge metadata
skipping sync

>>> Updating Portage cache... ...done!
Notes: This is going to take a while.

6. e. Testing that emerge works

Just to be sure everything works, we ask portage if there is any update to do on the system packages:

Terminal input as ROOT user
KURO-BOX-EM etc # emerge -puD system
These are the packages that I would merge, in order:

Calculating system dependencies ...done!
Notes: This will run a test emerge which will show you a list of the packages that have been updated.

You can choose to update the packages now or you can wait until you've rebooted from the hard disk. I prefer to wait for the update. But if you would like to update now, execute this command:

If you choose to update your packages now, run this command.
KURO-BOX-EM etc # emerge -uD system
Notes: This will take a while because it will recompile all of the outdated packages on your system.
I prefer to save this step until the Kuro Box has been rebooted into the Gentoo installation.

Now we are ready for the next step.

 


<<  Return to table of contents