Gentoo/Gentoo Bootstrap

Page last edited 1,451 days 17 hours ago
From Alon Bar-Lev's Site
Jump to: navigation, search

Gentoo Bootstrap

This is my quick guide for bootstrapping Gentoo installation.

Startup

Boot from latest Gentoo install CD.

Networking

Make sure you have working network before start.

Create /etc/init.d/net.eth0 if not exist (recent install CDs dropped this for some reason):

ln -s net.lo /etc/init.d/net.eth0
/etc/init.d/net.eth0 start

Time

Very important to setup correct date/time so future makes will not break.

ntpdate -u pool.ntp.org

Partitions

fdisk /dev/sda
  • Partition 1 ~50M bootable.
  • Partition 2 2*RAM_SIZE.
  • Partition 3 all the rest.

Create state3

mkfs -t ext2 /dev/sda1
mkfs -t ext4 /dev/sda3
mkswap /dev/sda2
mount /dev/sda3 /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/sda1 /mnt/gentoo/boot
cd /mnt/gentoo
wget @STATE3@
wget @PORTAGE_LATEST@
tar -xpf @STAGE3@
mkdir var/gentoo
tar -C var/gentoo -xpf @PORTAGE-LATEST@
rm @STATE3@ @PORTAGE_LATEST@
cd /
mount -t proc none /mnt/gentoo/proc
cp /etc/resolv.conf /mnt/gentoo/etc
chroot /mnt/gentoo /bin/bash
env-update

Initial settings

passwd
rm /etc/portage/make.profile
ln -s ../../var/gentoo/portage/profiles/default/linux/amd64/10.0/no-multilib \ /etc/portage/make.profile
File: /etc/portage/make.conf
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -fomit-frame-pointer -pipe"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j3"
PORTDIR="/var/gentoo/portage"
DISTDIR="/var/gentoo/distfiles"
PKGDIR="/var/gentoo/packages"
USE="${USE} -gnome -qt3 -handbook"
USE="${USE} -cxx nocxx -ruby -perl -fortran -python -lua -java"
USE="${USE} -berkdb -gdbm -hal -branding"
File: /etc/portage/package.use
sys-devel/gcc cxx -nocxx

Update:

  • /etc/fstab
  • /etc/locale.gen
  • /etc/conf.d/hostname
  • /etc/localtime - copy correct file from /usr/share/zoneinfo

Update

emerge --update --deep --newuse @world
etc-update
emerge --depclean
emerge gentoolkit
revdep-rebuild
python-updater
perl-cleaner --all
emerge --depclean
revdep-rebuild

Cleanup

rm -fr /lib32/* /usr/lib32/locale

Base system

emerge app-admin/syslog-ng net-dns/openresolv app-portage/gentoolkit app-editors/vim \ net-misc/dhcpcd sys-apps/ifplugd sys-apps/iproute2 sys-apps/less sys-boot/syslinux net-misc/ntp\ sys-kernel/genkernel sys-kernel/gentoo-sources sys-process/vixie-cron \ app-admin/logrotate app-admin/sudo net-firewall/firehol sys-power/acpid

Kernel & Bootloader

genkernel --menuconfig --kernel-config=/etc/kernels/BASE_KERNEL_CONFIG all

See: Gentoo/Linux_Configuration_Common

extlinux --install /boot
cat /usr/share/syslinux/mbr.bin > /dev/sda
cp /usr/share/syslinux/menu.c32 /boot

Update extlinux.conf see Gentoo/Syslinux_Bootloader.

Finalize

rc-update add sshd default
rc-update add ntpd default
rc-update add syslog-ng default
rc-update add vixie-cron default
rc-update add acpid default

Close up

exit
umount /mnt/gentoo/proc /mnt/gentoo/boot /mnt/gentoo
reboot

Configure system

Success!

You have working Gentoo base.

Maintainer

Alon Bar-Lev

Authors

Originally written by: Alon Bar-Lev - 2011-11-28


Authors are people who have worked on this document and have made significant changes to its content. If you have edited this article and wish to add yourself to the authors list please read "Who are Authors".