Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
A Gentoo Paradigm
View unanswered posts
View posts from last 24 hours

Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Tux's lil' helper
Tux's lil' helper

Joined: 03 May 2006
Posts: 137

PostPosted: Sat Sep 23, 2006 2:51 am    Post subject: A Gentoo Paradigm Reply with quote

If you're like me, you want to run Gentoo on everything. Your spiffy new laptop, your desktop at work, the fileserver hooked up to your TV, the headless firewall/router, etc. The thought of compiling Gentoo on a 650mhz athlon is not completely horrifying, but then what about keeping the system up to date?

After trying to use "emerge -b" and "emerge -k" directly, I ran into some issues with certain ebuilds. They didn't detect dependencies correctly because of RDEPEND and DEPEND variables differing. I have no idea if this problem still exists, but the script I created has been useful regardless.

So, on the fastest machine you have, devote a few gigs to building your Gentoo paradigm.

mkdir /home/gentoo
cd /home/gentoo
tar -xjpf /path/to/stage3-i686-2006.1.tar.bz2

Use compatible CFLAGS settings that work for all your machines. I use the standard i686 stage3 tarball make.conf plus a few things:

# gcc settings
CFLAGS="-O2 -march=i686 -pipe"

# emerge settings
FEATURES="userpriv usersandbox"
USE="-arts -esd -gpm -kde -ldap -oss -qt3 -qt4"

# xorg settings
INPUT_DEVICES="keyboard mouse"
  # other input devices: synaptics
  # other video cards: nv nvidia radeon fglrx i810

Oh, before you go any further, understand that my config is set up for a gtk2/gnome system, I refuse to run anything gtk1 or kde based. Though I've given in and added some java and mono related packages. Also I had to use a few unstable packages to get my Dell e1405 working, but for the most part it's a "stable" system. Modify these /etc/portage settings according to your taste.

First relink etc/make.profile:

cd /home/gentoo/etc
rm -f make.profile
ln -s ../usr/portage/profiles/default-linux/x86/2006.1/desktop make.profile

and drop these into etc/portage/

# e1405 specific

# logjam

# rtorrent

# inkscape (stable version !compile 2006/08/13)

# wine

# mplayer

# banshee

# easytag

# gaim

# Kathryn Kulick <> (20 Dec 2005)
# Gaim 2.0.0 beta1 plugins.
 # Kathryn Kulick <> (19 Dec 2005)
 # Gaim 2.0.0 beta1 added to tree for testing.


# system
sys-devel/gcc -gtk
app-arch/tar bzip2
app-editors/nano -spell

# world
app-editors/vim ruby
media-gfx/imagemagick -X bzip2
media-libs/mesa -motif
app-emulation/wine -cups

# mplayer
media-sound/lame -gtk
media-video/gpac aac
media-libs/x264-svn mp4
media-video/realplayer nsplugin
media-libs/win32codecs real quicktime
media-video/mplayer -gtk -sse2 aac cpudetection divx4linux dts dvdread matroska mmx musepack real sse theora xvid x264

# freevo
x11-libs/cairo glitz
dev-python/twisted -gtk
media-libs/smpeg -gtk mmx
media-video/ffmpeg aac dts mmx theora truetype vorbis xvid
media-libs/xine-lib -gnome a52 aac asf dts mad theora vorbis win32codecs

# gnome
dev-python/pycairo svg
net-dns/avahi howl-compat mdnsresponder-compat mono
net-fs/samba cups
net-print/cups samba
gnome-base/gnome-vfs avahi samba
app-misc/beagle evo pdf
gnome-base/nautilus beagle
www-client/mozilla-firefox java
media-video/totem a52 nsplugin theora xine
gnome-extra/gnome-games artworkextra guile
net-misc/vino avahi
dev-libs/gmime mono
gnome-base/gnome-applets acpi
sys-apps/dbus mono
app-text/ghostscript-gnu -gtk
app-text/evince nautilus
app-admin/gnome-system-tools nfs samba
x11-libs/vte -opengl
sys-apps/hal -crypt acpi
sys-apps/pmount -crypt
gnome-base/gnome-volume-manager -crypt
mail-client/evolution bogofilter mono
mail-client/mail-notification evolution gmail imap ldap pop
media-sound/banshee aac
media-gfx/gimp mmx svg
media-gfx/inkscape effects mmx
net-im/gaim avahi mono startup-notification
app-misc/tomboy galago
dev-java/blackdown-jre browserplugin
dev-java/blackdown-jdk browserplugin
app-office/openoffice java mono
net-misc/logjam gtkhtml svg
x11-wm/fvwm -gtk
media-sound/audacious aac mmx musepack wma
app-office/abiword spell

Now, since you probably already have a stable portage tree, don't worry about duplicating it. And you should be ready to chroot.

mount -o bind /usr/portage /home/gentoo/usr/portage
mount -t proc proc /home/gentoo/proc
chroot /home/gentoo /bin/bash
env-update && source /etc/profile
emerge --metadata
emerge portage
emerge -Deb system

And then the fun begins. I wrote this script to simplify doing a two-pass emerge, first pass is pretend, second pass is for real to either build or install binary packages. This script is not necessary for building, but I'll show you here how to use it because the same method will be used to install the packages on other machines later. Here's the script:
#!/usr/bin/perl -w

use strict;

my $paradigm_dir = "/paradigm";

print "\n";

my $command = "@ARGV";
my $default1 = "-DNup world";
my $default2 = "-kp";
my($pass1, $pass2);
my $clean = 0;

if($command =~ m/^(-h|-help|--help)$/) {
} elsif($command eq "") {
  print "assuming default options (use -h for help)...\n";
  $pass1 = $default1;
  $pass2 = $default2;
} elsif($command =~ m/-1/) {
  ($pass2, $pass1) = split("-1 ", $command);
  if($pass2 eq "") {
    $pass2 = $default2;
  } else {
    $pass2 =~ s/ $//;
} else {
  $pass1 = $default1;
  $pass2 = $command;

if($pass2 =~ m/b/) {
  print "it looks like you're building packages, will auto-remove old binary packages.\n";
  $clean = 1;

print "running 'emerge $pass1'...\n";
my @package = `emerge --nocolor --nospinner $pass1`;

my($old, $packages);

foreach(@package) {
  $old = "";
  if(m/^\[ebuild/) {
    if($clean == 1 && m/^\[ebuild.+?\] (\S+) \[.+\].+$/) {
      $old = $_;
      $old =~ s/^\[ebuild .+?\] \S+\/(\S+)-\d.+ \[(.+)\].+$/$1-$2/;
      system("rm -fv $paradigm_dir/packages/*/$old.tbz2");

    s/^\[ebuild .+?\] (\S+)-\d.+ .+$/$1/;
    s/^\[ebuild .+?\] (\S+)-\d .+$/$1/;
    $packages = $packages . " $_";

$packages =~ s/^ //;

#print "running 'emerge --quiet $pass2 $packages'\n";
system("emerge --quiet $pass2 $packages");

sub usage {
  print "\nUsage: e2 [OPTIONS] (-1 OPTIONS) | [--update]...\n";
  print "Two pass emerge to correctly install binary packages, among other things.\n\n";
  print "OPTIONS   specify options for second pass emerge, defaults to 'kp'\n";
  print "-1        specify first pass emerge options, usually 'DNup world' is good\n";
  print "\n";

You can install some basic tools:
./ -b -1 -p grub gentoo-sources metalog dcron dhcpcd iptables gentoolkit alsa-utils cdrtools screen lynx telnet-bsd bind-tools ncftp keychain vim aspell-en unrar unace imagemagick ImageSize apache samba

Configure your kernel and then continue.

extra laptop/wireless/filesystem tools if you need any:
./ -b -1 -p cpufrequtils 855resolution vbetool wireless-tools raidtools reiserfsprogs alsa-utils ipw3945

basic X system and multimedia apps:
./ -b -1 -p xorg-x11 xev x11-terms/aterm fvwm windowmaker gmrun freevo

gnome and other fun stuff:
./ -b -1 -p gnome pmount gnome-screensaver gimp inkscape abiword logjam easytag banshee gaim tomboy tuxpaint tuxracer freeciv

The system can then be kept up to date by running "./ -b" after syncing portage. It will remove old binary packages and build new ones based on "emerge -DNup world". You can share /home/gentoo/paradigm/packages over a network or copy them to a thumb drive.

Back to top
View user's profile Send private message

Joined: 26 Jun 2003
Posts: 789
Location: Singapore

PostPosted: Tue Sep 26, 2006 5:27 am    Post subject: Reply with quote

interesting way to install the sis on diff machine
Back to top
View user's profile Send private message
Tux's lil' helper
Tux's lil' helper

Joined: 03 Jul 2004
Posts: 138
Location: Darmstadt.Germany.EU

PostPosted: Tue Sep 26, 2006 12:48 pm    Post subject: Reply with quote

yes, very interesting and nice way :)
But one idea: since you have a fully running system in /home/gentoo on the fast box, why use 'emerge -k' or '-g' or '-gK' on the slow machines? If you just chroot on the fast machine into /home/gentoo and run emerge wihtout the -b option, you could save disk space(ok, not that important) AND you could then use
rsync -a rsync://big-machine/gentoo-paradigm /
on your slow machines to keep the system up to date(Before, we set up a rsync server - not that hard...).
In the fast machine's /etc/paradigm.filter we could put, among the default optins, something like
#default otions
uid =
gid =
use choot = yes
path = /home/gentoo
comment = Gentoo paradigm - keeping the small ones sync'd
excludes = boot  (It's better to namually rsync the /boot dir, I guess...) root  var/log usr/portage (We don't need a portage tree, another plus of this method) home
read only

Of course, there are some improvements possible to the rsync options. We could, for example, use the ssh or rsh proto instead of the rsync proto and define a filter file. The reason for using rsync, IMHO is, that even running emerge only with binary packages is slower than just rsyncing. Please correct me, folks, if I'm wrong. And, like mentioned before, we don't need a portage tree on the slow ones.

EDIT: But your method is definitely more effective and faster when merging single packets! I just thought, for emerge world things, rsync rocks ;)
# make config; not war
registered linux user # 265707
Back to top
View user's profile Send private message
Tux's lil' helper
Tux's lil' helper

Joined: 03 May 2006
Posts: 137

PostPosted: Tue Sep 26, 2006 1:37 pm    Post subject: Reply with quote

Rsync could work for some people the way you describe. For me, it wont work because in /home/gentoo I build every package I use on any of my various machines. gnome and games for my son, productivity and communication apps for my wife, etc. No one machine I have has everything installed on it. Also what I do is (this has come in handy a few times), rsync the binary packages, my portage tree, and stage3 tarball to a 2gb usb thumb drive. For example, when a co-worker wants to try installing linux on his laptop, I boot from a gentoo cd, plug in my thumb drive, and install a fully functional gnome desktop for him in less than an hour. A month later when something's not working I'll say, "here, let me do some updates". plug in my thumb drive, run one script, and 15 minutes later he's up to date.
Back to top
View user's profile Send private message
Tux's lil' helper
Tux's lil' helper

Joined: 03 Jul 2004
Posts: 138
Location: Darmstadt.Germany.EU

PostPosted: Tue Sep 26, 2006 2:44 pm    Post subject: Reply with quote

If you need to be that flexible, of course rsnyc isn't an option! then yours is the best method, I think! I just thought, if someone is hosting 10 pcs in a university, the combination of your and my method(rsync) is fastest. I didn't know you are doing this for several machines with different setup. But don't you then need a portage tree on every box so they can resolve depencies? Of course this isn't a problem since you can export your /usr/portage of the big box via nfs as well ;)
# make config; not war
registered linux user # 265707
Back to top
View user's profile Send private message
Tux's lil' helper
Tux's lil' helper

Joined: 03 May 2006
Posts: 137

PostPosted: Tue Sep 26, 2006 3:25 pm    Post subject: Reply with quote

Yes, the portage tree is necessary. Basically I export /paradigm (or store it on a usb drive) which contains the portage tree and binary packages, as well as stage3 and a couple scripts to automate installation and updates. I'm cleaning up the scripts and will post them here soon. To update each system I just type:

mount /paradigm
cd /paradigm
(then complete etc-update and umount)

Gentoo has allowed me to create my own customized binary distribution, with very little effort. I love it :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum