Installing Gentoo on Vaio Z1RMP =============================== Refs include Kev Lee's Gentoo install doc, the Gentoo handbook and http://home.arcor.de/enton/vaioz1.html (in that order :)) Stage 2 1. Download Gentoo minimal LiveCD 2004.1 ISO & burn. http://www.mirror.ac.uk/sites/www.ibiblio.org/gentoo/releases/x86/2004.1/livecd/ 2. Boot Gentoo CD 3. Run cfdisk to parition disk I use 1st parition for XP (/dev/hda1) - only partition that should be bootable 2nd partition is for /boot (/dev/hda2) and is 100 megs (type 83 in cfdisk) 3rd partition is for swap (/dev/hda3) and is 512 megs (type 82 in cfdisk) 4th partition is for / (/dev/hda4) takes up the rest of the disk (type 83 in cfdisk) 4. Create file systems Format /boot with ext2: # mke2fs -j /dev/hda2 Format swap paritition: # mkswap /dev/hda3 Format / as ReiserFS # mkreiserfs /dev/hda4 5. Turn on swap #swapon /dev/hda3 6. Mount partitions # mount /dev/hda4 /mnt/gentoo # mkdir /mnt/gentoo/boot # mount /dev/hda2 /mnt/gentoo/boot 7. Configure Network Gentoo will probably install the correct drivers & use DHCP by default, for me it didn't. I had to install the correct driver #depmod ee100 Then try #ifconfig eth0 If it comes up run net-setup eth0 to configure it. I found that my wired ethernet card was on eth1, do I had to do #ifconfig eth1 up then running 'dhcpcd eth1' didn't work so I had to configure it manually. 8. Get Stage 2 archive # cd /mnt/gentoo # links2 -http-proxy wwwcache.lancs.ac.uk:8080 http://www.gentoo.org/main/en/mirrors.xml -> choose you mirror -> browse to releases/x86/2004.1/stages/pentium4/ -> select stage2-pentium4-2004.1.tar.bz2 and press 'd' to download 9. Unpack the stage # cd /mnt/gentoo # tar -xvjpf *.bz2 10. Choose you mirror for emerge Edit /mnt/gentoo/etc/make.conf (using nano or whatever) and add the line: GENTOO_MIRRORS="http://www.mirror.ac.uk/sites/www.ibiblio.org/gentoo/" 11. Configure a proxy if you need it: #export http_proxy="wwwcache.lancs.ac.uk:8080" Add the line to /etc/profile if u want it permanent 12. Prep & enter chroot environment # mount -t proc proc /mnt/gentoo/proc # cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf # chroot /mnt/gentoo /bin/bash # env-update # source /etc/profile 13. Update sync - takes a while #emerge sync 14. Check that make is set for P4 (mine already was) #nano -w /etc/make.conf 15. Build the system Check out what it's going to do #emerge --pretend system | less Just download the files (if u plan to install them later off-line etc) emerge --fetchonly system ->go home :) Do the build #emerge system 16. Set the timezone #ln -sf /usr/share/zoneinfo/GMT /etc/localtime 17. Configure fstab #nano -w /etc/fstab Make sure the lines to mount your partitions reference the correct partition (Dur ;)) and have the correct types. I had to make another slight change to my /boot line. Looks something like this: .... /dev/hda2 /boot ext2 defaults 1 1 /dev/hda4 / resierfs noatime 0 0 /dev/hda3 none swap sw 0 0 .... 18. Build Kernel #emerge gentoo-dev-sources #cd /usr/src/linux #make menuconfig hit 'Escape' to quit & it will ask you if you want to save the configuration -> Configuration obviously depends on you system, make sure file system drivers are not modules. Check out the handbook for options you have to include and there is sample configuration on the other web site at the top of this doc. Code maturity level options ---> [*] Prompt for development and/or incomplete code/drivers File systems ---> [*] Virtual memory file system support (former shm fs) [*] /proc file system support [*] /dev file system support (EXPERIMENTAL) [*] Automatically mount at boot (Deselect the following unless you have a 2.6 kernel) [ ] /dev/pts file system for Unix98 PTYs (Select one or more of the following options as needed by your system) <*> Reiserfs support <*> Ext3 journalling file system support <*> JFS filesystem support <*> Second extended fs support <*> XFS filesystem support Processor type and features ---> [*] Symmetric multi-processing support #make && make modules_install #cp arch/i386/boot/bzImage /boot/kernel_current; #cp System.map /boot 19. Configure bootloader - Grub in this case #emerge grub #grub --no-floppy Specify where /boot partition is >root (hd0,1) Install grub in boot partition >setup (hd0) Exit grub shell thingy >Quit #nano -w /boot/grub/grub.conf My config looks like this: ..... default 1 timeout 10 splashimage=(hd0,1)/grub/splash.xpm.gz title=Gentoo Linux 2.6 root (hd0,1) kernel /kernel_current root=/dev/hda4 title=Windows XP rootnoverify (hd0,0) chainloader +1 ..... It defaults to XP on partition 1 on disk 1 (/dev/hd1=(hd0,0) ) after 1- seconds, and we have the option to boot our custom kernel on partition 2 disk 1 (/dev/hd2=(hd0,1) ), we need to pass the kernel option 'root=/dev/hda4' otherwise to specify / or it will not get mounted. 20. Set machine hostname #echo tux > /etc/hostname 21. Configure Domainname #echo mydomain.com > /etc/dnsdomainname 22. Configure the network #nano -w /etc/conf.d/net (For DHCP) iface_eth0="dhcp" (For static IP) iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0" gateway="eth0/192.168.0.1" Set the name servers #nano -w /etc/resolv.conf ..... domain lancs nameserver 148.88.8.4 nameserver 148.88.8.7 ..... Start network on boot #rc-update add net.eth0 default I found that the module for my network card wasn't being loaded on boot, to fix this I set it to be 'autoloaded' by doing: #nano -w /etc/modules.autoload.d/kernel-2.6 and adding 'e100' to the end 22.1 Installing Intel PRO/Wireless 2100 Network Connection mini PCI adapter #emerge wireless-tools Firmware loader support needs to be enabled in kernel: Device Drivers -> Generic Driver Options -> <*> Hotplug firmware loading support #FEATURES="-sandbox -userpriv -usersandbox" ACCEPT_KEYWORDS="~x86" emerge ipw2100 #etc-update #modprobe ipw2100 #modprobe av5100 #depmod modules-update Check modules are loaded using 'lsmod' Add ipw2100 module to : #nano -w /etc/modules.conf/autoload.d/kernel-2.6 Modify network configuration for 2nd interface: #nano -w /etc/conf.d/net Ensure you interface is brought up at boot: #ln -s /etc/init.d/net.eth0 /etc/init.d/net.eth1 #rc-update add net.eth1 default #etc-update To ensure your wireless card is configured properly there is 2 options 1 (The fudge): Add your iwconfig commands to /etc/conf.d/local.start e.g. 'iwconfig eth0 mode Managed ap any' 2 (The long-winded proper(ish) way): Follow the instructions here: http://forums.gentoo.org/viewtopic.php?t=122435 And the additional instructions given after emerge completes Put your configuration in /etc/conf.d/wireless -> I tried both but found that DHCP wouldn't work on my home network with either 23. Install PCMCIA card services #USE="-X" emerge pcmcia-cs Start on boot time #rc-update add pcmcia default 24. System configuration #nano -w /etc/rc.conf Well commented 25. Configure a loger #emerge -k app-admin/metalog #rc-update add metalog default 26. Install Cron #emerge -k sys-apps/vixie-cron #rc-update add vixie-cron default 27. Set the root password #passwd 28. Add a user #useradd new_user -m -G users,wheel,audio -s /bin/bash #passwd new_user 29. If you would like to use ReiserFS, you should emerge the ReiserFS tools: #emerge -k sys-fs/reiserfsprogs 30. Rebooting the System # etc-update # exit (This exits the chrooted shell; you can also type ^D) # cd / # umount /mnt/gentoo/boot # umount /mnt/gentoo/proc # umount /mnt/gentoo # reboot If something went wrong & the system doesn't boot up as exected, boot from the live CD & follow steps 5,6,7,11 & 12 to get your chrooted system back for kernel configuration etc. 31. Install X - takes a while #emerge xfree #env-update && source /etc/profile I grabbed the XF86Config-4 from the other Z1 Gentoo page linked above using wget & stuck it in etc/X11. Otherwise use /usr/X11R6/bin/xf86config or whatever. 29) KDE - takes hours (& hours & hours & hours...) Editing make.conf # nano -w /etc/make.conf Inside of make.conf USE="qt kde -gnome -gtk" # emerge --pretend kde # emerge kde # env-update && source /etc/profile 30) KDM Editing /etc/rc.conf #nano -w /etc/rc.conf /etc/rc.conf -- setting DISPLAYMANAGER # What display manager do you use ? [ xdm | gdm | kdm ] DISPLAYMANAGER=kdm Adding XDM script to default runlevel # rc-update add xdm default 30. Configure sound (alsa) Install ALSA utils emerge alsa-utils Start on boot rc-update add alsasound boot Start now /etc/init.d/alsasound start 31. Check poweroff works To get my machine to actually power off & no sit there with 'Power down.' on screen I had to add the option 'nlacpi' to the kernel (to disable local acpi) by change the line: ....... kernel /kernel_current root=/dev/hda4 nlacpi ....... 32. Power management To get power management woth you have to disable apm & enable acpi (all of it :)) if you include it as modules make sure they are loading on startup. My present power management setup is using speedfeq and cpusynd, the following is a brillaint resource: http://www.stud.uni-karlsruhe.de/~uxhz/gentoo/power-management/ I reccomend following the instructions to create a battery runlevel and using the default.sh to handle acpi events. I added a simple handler for the power button press which was astoundingly easy: #nano /etc/acpi/events/powerbtn ....... event=button[ /]power action=/etc/acpi/powerbtn.sh ....... #nano /etc/acpi/powerbtn.sh ....... #!/bin/sh logger "ACPI - Power Button pressed - going down now!" /sbin/poweroff ....... ->Don't forget to chmod powerbtn.sh To control the backlight & vga out you need to install radeontool: #emerge radeontool I added another acpi event handler for the lid close action to power off the backlight #nano /etc/acpi/events/lid ....... event=button[ /]lid action=/etc/acpi/lid.sh ....... #nano /etc/acpi/lid.sh ....... #!/bin/sh lidnum=`echo $1 | sed 's/.*\(LID[^ ]*\).*/\1/'` grep open /proc/acpi/button/lid/$lidnum/state > /dev/null if [ $? -eq 0 ]; then /usr/bin/radeontool light on else /usr/bin/radeontool light off fi ....... ->Don't forget to chmod it! I also added a tiny script to dim the backlight to 0 when on battery & set it to full on AC in: #nano /etc/init.d/setbright ....... #!/sbin/runscript start() { /usr/bin/spicctrl -b 0 } stop() { /usr/bin/spicctrl -b 255 } ....... Don't forget to chmod it & add it to the battery runlevel 33. Enabling VGA out. if you boot up with VGA plugged in it will work straight away with mirroring, otherwise as long as radeontool is install you can just do: #radeontool dac on If the VGA device doesn't support your desktop resolution you will get a virtual screen with scrolling. To fix it use xrandr to change your desktop resolution before, if you just run it a list of supported modes will be printed on screen with numbers, you can then use the -s switch to chaneg modes. On my machine -s 1 switches to 1024x768 which is fine for most projectors. To do this first I changed my XF86Config to add a new monitor section 34. Using the Sony fn buttons To get these to work you need to emerge sonypid and spicctrl. spicctrl is a great little tool to to play around with power-related settings, and sonypid watches for actions coming from fn buttons. I had loads of problems getting sonypi to work in KDE (3.2), KMilo grabs all the keypresses & you can't actually configure it to do anything with them - So disable it in the Service Manager (in Control Center, just search if you can't find it). There is a great Perl script called sonypidd (just search for it) which used sonypid, spicctrl, aumix (to set the volume) and sox (to play a sound when you press an fn key). Straight off the settings work pretty well and are pretty close to the windows ones, it is really easy to edit the script to add custom actions. I changed it to enable VGA out & do mode switches for me (and get rid of click :)) by adding a couple of lines to the top: ....... $click=''; $radeontool='usr/bin/radeontool'; $xrandr='/usr/X11R6/bin/xrandr'; ....... Then changing the action for buttons 7 & 8, the order you do these in seems to be important: ....... ,["$xrandr -s 1","$radeontool dac on"] #7 ,["$xrandr -s 0","$radeontool dac off"] #8 ....... 35. Install X.Org instead of XFree86 Unmerge XFree86 #emerge unmerge xfree #env-update && source /etc/profile Merge X.Org #emerge xorg-x11 Doesn't take very long to merge X.Org and I didn't see any differences. The X config file is now /etc/X11/xorg.conf but it will still use you old XF86Config, though I had probs with my keyboard & fixed them by using the layout from xorg.conf.example 36. Use IceWM instead of KDE I found KDE to be painfully slow, but IceWM is far faster, faster to configure & much less bloated Emerge it: #emerge icewm Change your XSESSION variable in /etc/rc.conf to "icewm" IceWM is great for migrating from Windoze as it is very similar in the way it works (from a usability point of view!) - even having Ctrl-Tab for switching apps! 37. Configure IceWM Emerge some extra bits #emerge icewm-tools #emerge icewm-themes #emerge icewmcp Your configuration files are stored in ~/.icewm these are: preferences - for general IceWM prefs menu - for your 'start' menu startup, toolbar etc etc IceWMCP is a good config tool (note the case) 38. Sound In the Kernel enable 'Sound Card Support', ALSA support, OSS emulation (OSS is depreciated but some stuff still uses it) and build your drivers in or as modules. Once you've done that emerge alsa-utils (and alsa-oss) following any instructions. #emerge alsa-utils #emerge alsa-oss I had lots of permission probs after a Kernel upgrade & had to add myself as a user to the 'audio' group - #nano /etc/devfsd.conf track down 'audio' and stick the user name(s) on the end. You can then use 'alsamixer' to set your mixer levels (use 'm' to unmute channels) or any alsa(/oss) gui prog. XMMS is an OK winamp clone which is in portage: #emerge xmms There is a also a CD reading plugin: #emerge xmmx-cdread you will probably find you'll have to turn digital extraction on in the plugin to get CD audio to work. 49. Remote desktop to your XP box Remote desktop (or more specifically rdesktop) seems to work really well under linux: #emerge rdesktop