1. Creating partitions /dev/sda1 - swap - 82 - 2GB /dev/sda2 - / - 83 - 20GB /dev/sda3 - /home - 83 - ~58GB 2. Creating file system mkswap /dev/sda1 swapon /dev/sda1 mkfs.reiserfs /dev/sda2 mkfs.reiserfs /dev/sda3 3. Mounting /dev/sda2 (later you will be chroot-ed here) mount /dev/sda2 /mnt/gentoo 4. net up 4.1 load the appropriate module for NIC modprobe tg3 or modprobe e1000 4.2. tcp/ip settings if static ip: ifconfig eth0 netmask using DHCP: dhcpcd eth0 # Some network admins require that you use the # hostname and domainname provided by the DHCP server. # In that case, use dhcpcd -HD eth0 (If the proxy filters HTTP traffic) # export http_proxy="http://proxy.gentoo.org:8080" (If the proxy filters FTP traffic) # export ftp_proxy="ftp://proxy.gentoo.org:8080" (If the proxy filters RSYNC traffic) # export RSYNC_PROXY="proxy.gentoo.org:8080" 5. sync the date - this is important! ntpdate 193.68.3.250 6. Go to /mnt/gentoo cd /mnt/gentoo 7. Download stage2 and the latest portage wget -c ftp://mirrors.ludost.net/gentoo/releases/amd64/2007.0/stages/stage2-amd64-2007.0.tar.bz2 OR wget -c ftp://mirrors.ludost.net/gentoo/releases/x86/2007.0/stages/stage2-i686-2007.0.tar.bz2 wget -c ftp://mirrors.ludost.net/gentoo/snapshots/portage-latest.tar.bz2 Note: Both files should be placed in /mnt/gentoo! 8. Unpacking stage2 tar jxvpf stage2-amd64-2007.0.tar.bz2 9. Unpacking portage-latest tar jxvf portage-latest.tar.bz2 -C /mnt/gentoo/usr/ Note: You are in /mnt/gentoo already, so you can type: tar jxvf portage-latest.tar.bz2 -C usr/ 10. Chrooting cd / mount -t proc proc /mnt/gentoo/proc cp -L /etc/resolv.conf /mnt/gentoo/etc/ chroot /mnt/gentoo /bin/bash env-update && source /etc/profile Note: Now you are chroot-ed in /mnt/gentoo In other words: /mnt/gentoo is / now 11. Set the timezone ln -s /usr/share/zoneinfo/Europe/Sofia /etc/localtime 12. Set host and domain name echo "127.0.0.1 your-FQDN your-HOSTNAME localhost" > /etc/hosts sed -i -e 's/HOSTNAME.*/HOSTNAME="your-HOSTNAME"/' /etc/conf.d/hostname hostname your-HOSTNAME hostname -f 13. Choosing the right profile eselect profile list eselect profile set Note: OBSOLETE way ls -FGg /etc/make.profile ln -snf /usr/portage/profiles/default-linux/amd64/2007.0/desktop /etc/make.profile 14. Editing /etc/fstab /dev/sda2 / reiserfs noatime 0 1 /dev/sda1 none swap sw 0 0 /dev/sda3 /home reiserfs defaults 0 2 # /dev/hda1 /hda1 ntfs defaults,ro,uid=1000 1 0 # /dev/hda2 /hda2 vfat defaults,uid=1000,gid=100,umask=022 1 0 /dev/sr0 /mnt/cd iso9660 noauto 0 0 # /dev/fd0 /mnt/floppy auto noauto 0 0 # NOTE: The next line is critical for boot! proc /proc proc defaults 0 0 # glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for # POSIX shared memory (shm_open, shm_unlink). # (tmpfs is a dynamically expandable/shrinkable ramdisk, and will # use almost no memory if not populated with files) shm /dev/shm tmpfs nodev,nosuid,noexec 0 0 Now create /hda1 and hda2 15. Editing /etc/conf.d/net # if you are using DHCP : modules=( "dhclient" ) config_eth0=( "dhcp" ) #dhcp_eth0="release nodns nontp nonis nogateway nosendhost" # This tells the dhcp client to release it's lease when it stops, not to # overwrite dns, ntp and nis settings, not to set a default route and not to # send the current hostname to the dhcp server and when it starts. # You can use any combination of the above options - the default is not to # use any of them. # or static IP: config_eth0=( "192.168.2.19 netmask 255.255.255.0 broadcast 192.168.2.255" ) routes_eth0=( "default via 192.168.2.1" ) 16. Start eth0 on boot rc-update add net.eth0 default 17. Edit some config files (mandatory) nano -w /etc/make.conf Edit _only_ the following variables: ACCEPT_KEYWORDS="~x86" CHOST="i686-pc-linux-gnu" CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer" CXXFLAGS="${CFLAGS}" OR ACCEPT_KEYWORDS="~amd64" CFLAGS="-O2 -march=nocona -pipe -fomit-frame-pointer" CHOST="x86_64-pc-linux-gnu" GENTOO_MIRRORS="http://distfiles.gentoo.bg/" #GENTOO_MIRRORS="http://mirrors.ludost.net/gentoo/ http://distfiles.gentoo.org" SYNC="rsync://rsync.gentoo.org/gentoo-portage" #SYNC="rsync://mirrors.ludost.net/gentoo-portage" Do not edit USE flags! (mandatory) nano -w /etc/conf.d/clock CLOCK="local" (recommended) nano -w /etc/rc.conf (recommended) nano -w /etc/conf.d/rc (recommended) nano -w /etc/conf.d/keymaps 17. Updating the portage tree emerge --sync 18. emerge syslog-ng emerge syslog-ng Start syslog-ng on boot: rc-update add syslog-ng default ---------------- This is a workaround. It is recommended to re-emerge perl and emerge shadow. emerge perl emerge shadow ---------------- 19. emerge vixie-cron emerge vixie-cron Start vixie-cron on boot: rc-update add vixie-cron default 20. emerge slocate emerge slocate 21. File system tools emerge reiserfsprogs 22. emerge dhclient (if you are using dhcp to obtain tcp/ip settings) emerge dhcp 23. new kernel 23.1. emerge gentoo-sources or emerge vanilla-sources or emerge ck-sources 23.2. cd /usr/src/linux... make menuconfig make make modules_install cp arch/x86_64/boot/bzImage /boot/vmlinuz-2.6.- cp System.map /boot/System.map 24. emerge lilo emerge lilo nano /etc/lilo.conf lba32 boot = /dev/hda map = /boot/.map menu-scheme=Wb prompt timeout=50 vga = 791 image = /boot/vmlinuz-2.6 root = /dev/hda4 #root = /devices/discs/disc0/part3 label = Gentoo read-only # read-only for checking other = /dev/hda3 # #other = /devices/discs/disc0/part1 label = WindowsXP table = /dev/hda 25. Do not forget to run lilo lilo 26. Exit exit 27. Do not forget to set a root password: passwd root Then you can safely umount and reboot umount /mnt/gentoo/proc /mnt/gentoo reboot 29. Boot from hdd with newly created kernel 30. Add me adduser -g users -G lp,wheel,audio,cdrom,portage,cron -m plamen passwd plamen 31. Edit /etc/make.conf Add all desired USE flags 32. EMERGE (Install ccache) mybox etc # emerge ccache (Please note that the switch to ~x86 causes many packages to be upgraded) mybox etc # emerge -vpuD --newuse world (Take a good look at the package list and their USE flags, remove blocking packages if any, and start the lengthy process) mybox etc # time emerge -vuD --newuse world (79 packages have been (re)compiled) real 180m13.276s user 121m22.905s sys 36m31.472s (Remerge libtool to avoid further potential problems) mybox etc # emerge libtool (Update config files, make sure you do not let etc-update update config files you have edited) mybox etc # etc-update (If perl has been updated, you should run the perl-cleaner script) mybox etc # time perl-cleaner all real 1m6.495s user 0m42.699s sys 0m10.641s (In case of a major upgrade of python, you should run the python-updater script) mybox etc # python-updater 30. KDE mybox etc # emerge -vp kde-meta (Look at the list of packages and their USE flags, then edit make.conf if required. mybox etc # nano -w /etc/make.conf The following USE flags have been defined) USE="nptl nptlonly -ipv6 -fortran unicode svg hal dbus \ kde qt3 qt4 -arts -eds -esd -gnome -gstreamer -gtk -firefox" mybox etc # time emerge kde-meta (391 packages have been emerged) real 1171m25.318s user 851m26.393s sys 281m45.629s 33. After all do this: emerge -uDNpv world emerge -uDN world -------------------------------------------------------------------------- USE flags for notebook: USE="dbus old-daemons usb tcl bluetooth midi a52 alsa amr qt3 qt4 aac aalib bash-completion bzip2 crypt ctype divx dts dvd dvdr dvdread \ fam ffmpeg flac gif gpm gtk gtk2 hddtemp icq imlib irc jpeg lm_sensors mad mmx mmxext \ mp2 mp3 mp4 mpeg ncurses nls nptl nptlonly nvidia ogg opengl oss openssh openssl pdf png reiserfs samba sdl \ ssl svga posix rdesktop sse sse2 tcpd tiff X xv xvid real encode kde wmp realmedia live \ xinerama xscreensaver truetype truetype-fonts vorbis amd64codecs udev \ wifi x264 nsplugin srt ssl unicode zlib quicktime theora xcomposite -acl"