Sometime in June 2010... ...And so I received a new laptop at work. Dell E6400. It is devoted to work related activities and has a mighty Windows 7 Ultimate 64-bit OS installed (seriously, after experiencing it a bit, IMHO it is a significant improvement over the other Windows OS's). Still I thought it would be a great benefit for this notebook to have another decent operating system installed, thus, even more separating its use at work and outside of work. Remembering how much time I spent setting up Gentoo a few years ago on another (very second-hand) laptop that soon after died maturely (as opposed to prematurely), I decided to keep a little diary of activities.
Initial steps Download the latest stable minimal Gentoo install ISO image. Burn it onto a CD-RW. Boot. Networking is fine, since my company uses DHCP, the computer just got a dynamic IP address. Check the file /etc/resolv.conf for network configuration. Prepare partitions using fdisk. First, list them by fdisk -l. What my machine already had when it arrived was 298GB HDD with
I turned the second partition into a 278GB (remember, it's a work-related machine :-)), thus, leaving around 20GB for Linux. Then, hesitant to touch existing NTFS partitions, I created the following:
In other words, my HDD became
Apply filesystems to partitions
Create mount points and mount boot & root partitions
Download and install Stage 3 Tarball
Choose mirror via links -http-proxy [ip]:[port] http://www.gentoo.org/main/en/mirrors.xml
Install by tar xvjpf stage3-i686-[date].tar.bz2 -C /mnt/gentoo Download and install portage Choose mirror as above, go to snapshots folder and download portage-latest.tar.bz2 Install by tar xvjpf portage-latest.tar.bz2 -C /mnt/gentoo/usr
Check etc/make.conf flags, for instance MAKEOPTS="-j[n]"
Set up the new environment
Choose Gentoo mirrors by mirrorselect -i -o >> /mnt/gentoo/etc/make.conf
Two important entries will appear in the file /mnt/gentoo/etc/make.conf, for example:
Portage is a software management tool which is used to maintain Gentoo packages. More information on it can be found here. Portage tree consists of ebuilds -- files (per software package) that contain information about each package: how to compile, install it, and so on. Compilation flags for each package are governed by
Emerge tool is the interface to portage. Basically it takes the package title (supplied to it as an argument), looks at the corresponding ebuild, applies patches, compiles it, and installs it. Useful examples of emerge commands are:
Another useful entry would be LINGUAS="en_GB ru" (to specify which language packs/tools to install with applications where it matters) Copy network config for the new environment by cp /etc/resolv.conf /mnt/gentoo/etc Mount /proc & bind /dev file systems
Switch to new environment
Configure date/time related matters, for example
Set locales by modifying /etc/locale.gen (read comments in that file for available locales), then do locale-gen. I got the locales I am interested in by grep "^ru" /usr/share/i18n/SUPPORTED (Russian/Ukrainian), then copied them into /etc/locale.gen: ru_RU.KOI8-R KOI8-R ru_RU.UTF-8 UTF-8 ru_RU ISO-8859-5 ru_UA.UTF-8 UTF-8 ru_UA KOI8-U* NOTE: there is more to it, as I discovered later (see section "Multilanguage support" at the end) Check current profile by eselect profile list (if required, choose a different one than the profile marked with *): Available profile symlink targets: [1] default/linux/x86/10.0 * [2] default/linux/x86/10.0/desktop [3] default/linux/x86/10.0/desktop/gnome [4] default/linux/x86/10.0/desktop/kde [5] default/linux/x86/10.0/developer [6] default/linux/x86/10.0/server Set root password by passwd Network configuration DHCP in my case means that /etc/conf.d/net can stay blank (or consisting of just the usage comments) Add eth0 to default run-level by rc-update add net.eth0 default Install required tools
Kernel & bootloader Update /etc/fstab to auto-mount things at start-up. I made my file look something like this (/dev/shm is shared memory): /dev/sda3 /boot ext2 defaults,noatime 1 2 /dev/sda6 none swap sw 0 0 /dev/sda5 / ext3 noatime 0 1 /dev/cdrom /mnt/cdrom auto noauto,user 0 0 proc /proc proc defaults 0 0 shm /dev/shm tmpfs nodev,nosuid,noexec 0 0 Compile and install kernel
emerge -av gentoo-sources
Bootloader (I use grub) emerge -av grub nano /boot/grub/grub.conf - after editing in my particular case the file looks as follows: default 0 timeout 30 splashimage=(hd0,2)/grub/splash.xpm.gz title Gentoo Linux 2.6.32-r7 root (hd0,2) kernel /boot/kernel-2.6.32-gentoo-r7 root=/dev/sda6 title Windows 7 rootnoverify (hd0,0) makeactive chainloader +1
grep -v rootfs /proc/mounts > /etc/mtab grub-install --no-floppy /dev/sda using fdisk
REBOOT. Find that it works :-)
Post-install tasks Create non-root user
Groups:
* NOTE: later during the troubleshooting I discovered that a couple more groups are important to have as well (plugdev, uucp, cdrom -- read on :-)) Update portage & system
Install X Window System
Make sure evdev is enabled in kernel Device Drivers ---> Input device support ---> <*> Event interface Update make.conf
xorg-server
HAL (hardware abstraction layer), emerge, start daemon & add to default run level
startx fails... Making X work
* Note: if you build a new kernel, nvidia module needs to be reinstalled!
Further configuration and troubleshooting Graphical Desktop Environment (in my case -- KDE)
Play with desktop settings, styles, plasmoids, etc. until you choose the combination for your own liking Sound already working, since Advanced Linux Sound Architecture (ALSA) was enabled within the kernel by default run alsamixer to unmute / adjust sound levels Laptop Power Management added non-root user to plugdev group by usermod -aG plugdev non_root_user -- this caused battery plasmoid (which shows how much battery is left) and removable devices plasmoid (which detects and on a mouse click auto-mounts removable media) to start working File Systems noticed /boot is not auto-mounted and NTFS partitions cannot be mounted recompiled the kernel with ext2 and NTFS (module) support File systems ---> <M> Second extended fs support ... DOS/FAT/NT Filesystems ---> <M> NTFS file system support <M> NTFS write support /boot as well NTFS partitions are now fine, but NTFS is not writable! emerge -av ntfs3g enable in kernel File systems ---> <M> FUSE (Filesystem in Userspace) support ntfs-3g /dev/sdb1 /mnt/windows -- mounts NTFS with desired permissios and the ability to write * NOTE: so enabling NTFS support in the kernel is not necessary
Internet To set it up, emerge -av wvdial, then run wvdialconf It detects nothing, so enable in the kernel Device Drivers ---> USB support ---> USB Serial Converter support ---> <M> USB Serial Converter support [*] USB Generic Serial Driver <M> USB driver for GSM and CDMA modems
wvdialconf now detects /dev/ttyUSB0 and creates /etc/wvdial.conf
wvdial -- carrier detected, but then fails with error code 4 (according to man pppd it means "The kernel does not support PPP") Back to the kernel enabling Device Drivers ---> Network device support ---> <M> PPP (point-to-point protocol) support <M> PPP support for async serial ports <M> PPP support for sync tty ports
wvdial -- still not working, now with pppd error 16 ("The link was terminated by the modem hanging up"),
wvdial as non-root user -- produces "device busy" error,
Packages & applications
Multimedia kaffeine plays MP3 and AVI from hard drive, but refuses to play CDs and DVDs (btw the device is actually /dev/sr0, not /dev/cdrom) mount /dev/sr0 /mnt/cdrom produces error "UDF file system is not recognised" enable (modular) support for UDF CD-ROM file system in the kernel File systems ---> CD-ROM/DVD Filesystems ---> <M> UDF file system support mounting works now and individual VOB files can be played (but not DVD as a whole) libdvdcss2 is installed, as for the others (libdvdread, libdvdplay, and libdvdnav) emerge -s says "Not Installed", but they seem to come with kaffeine (part of xine-lib package?) different approach: export DVDCSS_VERBOSE=2 kaffeine from command line (as non-root user) displays "libdvdcss debug: cannot open ///dev/sr0 (Permission denied)" -- aha! ls -l /dev/sr* shows that permissions are 660, group cdrom adding non-root user to cdrom group -- fixes DVD playback * NOTE: to play DVDs from hard drive, simply run kaffeine "dvd://[path to dvd dir]" Multilanguage support
Cyrillics is now supported for console auto-completion, ls, less, NTFS Cyrillic filenames (which are UTF8), File->Open dialogs of various applications, and so on... Apache /etc/init.d/apache2 start attempts to start net.eth0 (what??? :-O) To disable (as it turns out) the pre-condition, in /etc/conf.d/rc need to change the line RC_NET_STRICT_CHECKING="lo" Add apache2 to default run-level by rc-update add apache2 default DocumentRoot is specified in /etc/apache2/vhosts.d/default_vhost.include To make sure index is treated as such, added the following to the above-mentioned file: AddType text/html .html DirectoryIndex index.html To enable server-side includes, added the following to the same file: Options +Includes AddType text/html .shtml AddOutputFilter INCLUDES .shtml DirectoryIndex index.shtml
To enable php, emerge -av php (make sure apache2 USE flag is specified) for index files AddType text/html .phtml DirectoryIndex index.phtml
Special thanks Gentoo handbook and a million other little bits and pieces all over the Internet...
|