Difference between revisions of "HOWTO: Install from an existing Linux system"

From Sabayon Wiki
Jump to: navigation, search
Line 132: Line 132:
<tt>layman</tt> is a gentoo tool to manage portage overlays. We will use it to get our hands on the sabayon overlay.
<tt>layman</tt> is a gentoo tool to manage portage overlays. We will use it to get our hands on the sabayon overlay.
'''Update''': entropy and equo are in regular portage, so you can skip this step.
'''Update''': entropy and equo are in regular portage, hence: '''skip this step'''.
{{Console|<pre class="clear">
{{Console|<pre class="clear">

Revision as of 14:17, 29 April 2013

i18n: de en tr

This HOWTO brings the gentoo installation method (as in the Handbook) to Sabayon.

Please note that "an existing Linux system" can be either an installed system (then you cannot use that partition for sabayon), or a live linux system.

The first part is about installing a very basic gentoo system in a chrooted partition; in the second part we will use portage to install entropy and equo. We will then use equo to install a full sabayon system in the third and last part.

Part 1: Gentoo install

Please refer to http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml and http://www.gentoo.org/doc/en/handbook/index.xml for more in-depth details about gentoo installation.


Do your thing and partition your disk(s). You need at least a root partition (/).

Create filesystems for your partitions according to your likings. Remember that you will need to install the *progs packages for your filesystem(s).

From now on we will assume that your root filesystem is mounted under /mnt/sabayon.

Also if you have a /var, /boot, /usr, /home ... filesystems, create the mountpoints relative to /mnt/sabayon and mount them now.

Get Gentoo installation files

We will assume an x86_64 architecture here. If you're on x86 (32 bits), change "amd64" with "x86".

export ARCH="amd64"

Pick up a mirror near you from this list: http://www.gentoo.org/main/en/mirrors.xml

export MIRROR="ftp://distfiles.gentoo.org/pub/gentoo"

We will refer to your arch as $ARCH and to your chosen mirror as $MIRROR from now on.

Download and verify stage3 archive

wget -r $MIRROR/releases/$ARCH/current-stage3/
cat stage3-$ARCH-*.tar.bz2.DIGESTS && md5sum stage3-$ARCH-*.tar.bz2 && sha1sum stage3-$ARCH-*.tar.bz2

Download and verify portage snapshot

wget $MIRROR/snapshots/portage-latest.tar.bz2
wget $MIRROR/snapshots/portage-latest.tar.bz2.md5sum
cat portage-latest.tar.bz2.DIGESTS && md5sum portage-latest.tar.bz2 && sha1sum portage-latest.tar.bz2

Unpack stage3 and portage

tar xfpj stage3-$ARCH-*.tar.bz2 -C /mnt/sabayon
tar xfpj portage-latest.tar.bz2 -C /mnt/sabayon/usr

Note the p option: it's for preserving file permissions and it's very important!

Chroot into your new Gentoo

Everything that follows is done while in /mnt/sabayon:

cd /mnt/sabayon

Mounting filesystems

mount -o bind /dev ./dev
mount -t devpts none ./dev/pts
mount -t tmpfs none ./dev/shm
mount -t proc none ./proc
mount -t sysfs none ./sys

Copying /etc/resolv.conf

cp /etc/resolv.conf ./etc


chroot /mnt/sabayon /bin/bash

Now you are on your Gentoo chroot!

Configure environnment

export LANG=en_US
export LC_ALL=${LANG}.UTF-8
eselect python set 1    #sets python 2.7 as default
source /etc/profile

Some early configuration

Set up a root password

As I regulary forget to setup the root password, let's do that as first thing:

cd /etc/
ln -sf ../usr/share/zoneinfo/<REGION>/<City> localtime

Where <REGION> is your region and <City> the nearest big city.


Be original and change "localhost" to something else. Update /etc/hosts accordingly.

nano -w /etc/conf.d/hostname
nano -w /etc/hosts
Mount points
nano -w /etc/fstab

Part 2: Sabayon overlay setup and installation of entropy+equo


layman is a gentoo tool to manage portage overlays. We will use it to get our hands on the sabayon overlay.

Update: entropy and equo are in regular portage, hence: skip this step.

# emerge --sync                # make sure portage is fully up to date... or not. Up to you. portage snapshots are done daily, i see no need to sync.
# USE="git" emerge -avt layman # now equo is in regular portage!
# layman -a sabayon            # see above

Entropy and Equo

emerge -avt equo --autounmask-write
emerge -avt equo

Now we have entropy and equo installed. To make use of it, we should first generate the entropy database (only the very first time!):

equo rescue generate

Yes, you are sure about this. You should answer yes three times to make it happy.

Perfect. Now we need to setup sabayon repositories. As an example, we use sabayonlinux.org (i.e. updated daily), but you can use sabayon-weekly instead if you want to upgrade less often. See En:Entropy#Package_Repositories.

cd /etc/entropy/repositories.conf.d
cp entropy_sabayonlinux.org.example entropy_sabayonlinux.org
cd -

Let's use equo to populate the repo db (if you used sabayon-weekly, substitute "sabayonlinux.org" with sabayon-weekly here):

equo update
equo repo mirrorsort sabayonlinux.org

We're set! equo is now in a working state!

Optional: Entropy: the missing bits

Notice: if you are planning to exclusively use entropy, you can happily skip to Part 3: Finish installation using equo.

So you will be using portage and/or want to have the same portage settings used to build your sabayon packages? Very well, here's how!

When you install entropy you'll miss some vital portage bits, namely the /etc/portage/* files used to build the sabayon packages.

Hopefully you can find those here: http://github.com/Sabayon/build

Let's make use of them!

# fetch the bits!
cd /opt
git clone git://github.com/Sabayon/build.git sabayon-build
cd /opt/sabayon-build/conf/intel/portage
# keep your specific stuff in "myconf" branch:
git checkout -b myconf
# symlink to your <arch>:
ln -sf make.conf.amd64 make.conf
ln -sf package.env.amd64 package.env
# add & commit
git add make.conf package.env
git config --global user.name "Your Name"
git config --global user.email "your@email"
git commit
# rename the gentoo /etc/make.conf and /etc/portage/:
cd /etc/
mv portage portage-gentoo
mv make.conf make.conf-gentoo
# symlink to sabayon /etc/make.conf /etc/portage/:
ln -sf /opt/sabayon-build/conf/intel/portage portage

Of course, change make.conf.amd64 and package.env.amd64 to make.conf.x86 and package.env.x86 if you are not on x86_64.

If you want to change some USE flags on certain packages you should:

  • update your /etc/portage/package.use
  • mask the package in /etc/entropy/packages/package.mask

so that emerge will use your specified USE flags and entropy will not handle the specified package again.

i.e. you want ruby support for app-editors/vim:

cd /etc/portage
sed -i package.use -e "s,app-editors/vim vim-pager,app-editors/vim vim-pager ruby" # or just use VIM!
git add package.use
git commit -m "app-editors/vim +ruby"
cd /etc/entropy/packages
echo "app-editors/vim" >> package.mask

Part 3: Finish installation using equo


To make your life easier, let's install eix (a tool for portage searching) and also the sabayon-distribution overlay (i.e. the entropy packages as a portage overlay):

equo install eix
layman -a sabayon-distro
cd /etc/portage
echo "source /var/lib/layman/make.conf" >> make.conf
git commit -m "source layman/make.conf in /etc/make.conf"

Now you can use eix to quickly search for installed/installable/upgradable packages and see their versions and use flags.

Filesystem progs

From gentoo quickinstall, code listing 2.27:

equo install xfsprogs # (if you use the XFS file system)
equo install jfsutils # (if you use the JFS file system)

Network stuff

equo install dhcpcd         # (if you need a DHCP client)
equo install ppp            # (if you need PPPoE ADSL connectivity)
equo install wireless-tools # (if you need wireless connectivity)
equo install wpa_supplicant # (if you need WPA/WPA2 authentication)
equo install wicd           # (if you do like wicd)

Kernel & bootloader

equo install linux-sabayon
equo install grub
nano -w /boot/grub/menu.lst # setup grub

System logger and Cron daemon

equo install syslog-ng vixie-cron
rc-update add syslog-ng default
rc-update add vixie-cron default

This is just a suggestion: please go for the system logger and cron daemon of your choice!

Everything else

Install any other packages you want using equo:

equo install <whatever>

For example, if you want KDE, the base packages needed can be installed with equo install kdebase-meta

Exit & cleanup

Exit the chroot


Unmount filesystems

cd /mnt/sabayon
umount ./sys
umount ./proc
umount ./dev/shm
umount ./dev/pts
umount ./dev

Unmount any other filesystem inside /mnt/sabayon.

Then unmount the root filesystem of your new sabayon system:

umount /mnt/sabayon


You are now ready to reboot (well, you were ready since the "setup grub" step, actually)


Enjoy your new shiny Sabayon system installed like it should be! (please forgive the troll in me)