Difference between revisions of "Installing Gentoo on a ThinkPad R51-1830"

From ThinkWiki
Jump to: navigation, search
m (Base configuration (Gentoo): update, link to fglrx)
(mainly Graphics)
Line 10: Line 10:
 
Mainly out of interest and for fun.
 
Mainly out of interest and for fun.
  
If you also own a Thinkpad R51 (machine types 1829, 1830, 1831 and 1836) feel free to add what you feel missing.
+
If you also own a Thinkpad R51 (machine types 1829, 1830, 1831 and 1836) feel free to add what you think is missing.
  
 
== My system specs ==
 
== My system specs ==
Line 77: Line 77:
  
 
As you can see I have
 
As you can see I have
* <tt>/dev/hda1 </tt> ''20&nbsp;GB reserved for the Windows&nbsp;XP installation <br /> I bought it with the laptop, so why not use it from time to time?''
+
{| border="0" style="vertical-align:top" width="100%"
* <tt>/dev/hda2 /boot </tt> ''40&nbsp;MB for the kernels...''
+
! align="center" | device
* <tt>/dev/hda5 / </tt> ''25&nbsp;GB for the root directory <br /> I figured it be best to have no seperate partitions for <tt>/</tt> and <tt>/usr</tt>...''
+
! align="center" | mount point
* <tt>/dev/hda6 /home </tt> ''53&nbsp;GB for all my personal files (and I have a lot of them!)''
+
! align="center" | description and notes
* <tt>/dev/hda7 swap </tt> ''1.5&nbsp;MB <br /> You need at least the size of RAM you have on your system for swap or hibernation will not be possible.''
+
|-
 +
| valign="top" | <tt>/dev/hda1</tt>&nbsp;
 +
| valign="top" | <tt>/mnt/windows</tt>
 +
| valign="top" | ''20&nbsp;GB reserved for the Windows&nbsp;XP installation <br /> I bought it with the laptop, so why not use it from time to time?''
 +
|-
 +
| valign="top" | <tt>/dev/hda2</tt>&nbsp;
 +
| valign="top" | <tt>/boot</tt>
 +
| valign="top" | ''40&nbsp;MB for the kernels...''
 +
|-
 +
| valign="top" | <tt>/dev/hda5</tt>&nbsp;
 +
| valign="top" | <tt>/</tt>
 +
| valign="top" | ''25&nbsp;GB for the root directory <br /> I figured it be best to have no seperate partitions for <tt>/</tt> and <tt>/usr</tt>...''
 +
|-
 +
| valign="top" | <tt>/dev/hda6</tt>&nbsp;
 +
| valign="top" | <tt>/home</tt>
 +
| valign="top" | ''53&nbsp;GB for all my personal files (and I have a lot of them!)''
 +
|-
 +
| valign="top" | <tt>/dev/hda7</tt>&nbsp;
 +
| valign="top" | <tt>swap</tt>
 +
| valign="top" | ''1.5&nbsp;MB <br /> You need at least the size of RAM you have in your system for swap or hibernation will not be possible.''
 +
|-
 +
|}
  
 
== Base configuration (Gentoo) ==
 
== Base configuration (Gentoo) ==
Line 99: Line 120:
 
#* <tt>FEATURES="sandbox ccache parallel-fetch userfetch userpriv usersandbox"</tt>
 
#* <tt>FEATURES="sandbox ccache parallel-fetch userfetch userpriv usersandbox"</tt>
 
#* <tt>USE="  ''your USE flags here''  "</tt> – ''use <code>ufed</code> (Use Flag EDitior)''
 
#* <tt>USE="  ''your USE flags here''  "</tt> – ''use <code>ufed</code> (Use Flag EDitior)''
 +
 +
{{Todo|...}}
 +
 +
== Graphics ==
 +
The [[ATI Mobility Radeon 9000]] is fully supported by the open souce [[radeon]] driver.
 +
 +
Install X11 (I use XOrg X11):
 +
<nowiki>tpuser0@localhost # echo VIDEO_CARDS="radeon" >> /etc/make.conf</nowiki>
 +
<nowiki>tpuser0@localhost # emerge x11-base/xorg-x11</nowiki>
 +
 +
Prepare /etc/X11/xorg.conf: make sure you load the necessary X11 modules:
 +
<nowiki># a piece of /etc/X11/xorg.conf
 +
Section "Module"
 +
    Load "GLcore"
 +
    Load "dri"
 +
    Load "glx"
 +
EndSection</nowiki>
 +
 +
Prepare /etc/X11/xorg.conf: create a dri group and restrict access to the DRI driver for users in that group (replace “408” by the group id of your dri group):
 +
<nowiki># a piece of /etc/X11/xorg.conf
 +
Section "DRI"
 +
    Group 408 # group "dri", next available id 408
 +
    Mode 0660
 +
EndSection</nowiki>
 +
 +
Prepare /etc/X11/xorg.conf: the 15″ TFT flat panel:
 +
<nowiki># a piece of /etc/X11/xorg.conf
 +
Section "Monitor"
 +
    Identifier "Monitor1"
 +
    VendorName "IBM"
 +
    ModelName "LCD Panel ThinkPad R51"
 +
    Option "dpms"
 +
EndSection</nowiki>
 +
 +
Prepare /etc/X11/xorg.conf: finally, the xorg-x11 radeon driver:
 +
<nowiki># a piece of /etc/X11/xorg.conf
 +
Section "Device"
 +
# ATI Radeon R250 (ATI Radeon Mobility 9000 M9)
 +
    Identifier "ati-xorg"
 +
    Driver "radeon"
 +
    BusID "PCI:1:0:0"
 +
    Option "DynamicClocks" "true"
 +
    Option "RenderAccel" "true"
 +
    Option "EnablePageFlip" "true"
 +
    Option "BackingStore" "true"
 +
EndSection</nowiki>
 +
 +
For more performance in X11 I also played with some additional parameters in /etc/X11/xorg.con, with various effects:
 +
<nowiki># a piece of /etc/X11/xorg.conf
 +
Section "Device"
 +
# ATI Radeon R250 (ATI Radeon Mobility 9000 M9)
 +
    Identifier "ati-xorg"
 +
    Driver "radeon"
 +
    BusID "PCI:1:0:0"
 +
# ALWAYS "ON" OPTIONS
 +
    Option "DynamicClocks" "true"
 +
    Option "RenderAccel" "true"
 +
# ENCOURAGED OPTIONS
 +
    Option "EnablePageFlip" "true"
 +
    Option "BackingStore" "true"
 +
# "PLAY WITH" OPTIONS FOR TUNING PURPOSES
 +
    #Option "AGPFastWrite" "on" # ERROR: mplayer/xine/... xv (xvideo) modules don't work anymore!
 +
    #Option "DDCMode" "true" # use DDC (monitor) data to calculate mode lines
 +
    #Option "AccelDFS" "on" # (disabled by default for AGP due possible problems)
 +
    #Option "FBTexPercent" "0" # with EXA: (set to 0: reserve all offscreen RAM for EXA, OpenGL textures only in GART memory)
 +
# CRASH options:
 +
    #Option "AGPMode" "2" # CRASH! (with or without AGPFastWrite)
 +
    #Option "AGPFastWrite" "on" # CRASH! (with AGPMode "2")
 +
# SLOW options:
 +
    #Option "AccelMethod" "EXA" # newer and faster (!?) acceleration method
 +
EndSection</nowiki>
  
 
{{Todo|...}}
 
{{Todo|...}}
Line 109: Line 201:
  
 
== Configuring relevant kernel modules ==
 
== Configuring relevant kernel modules ==
{{Todo|...}}
 
 
== Configuring X.org ==
 
 
{{Todo|...}}
 
{{Todo|...}}
  

Revision as of 14:07, 28 October 2007

NOTE!
This page is far from being complete and will be updated soon... --“TpUser0” 18:57, 22 August 2007 (UTC)

Introduction

This page shows some partes of how I did once install Gentoo Linux on my ThinkPad. Since the R51 is now quite outdated (2005) everyone having such a laptop surely has his/her system installed already. So why this page?

Mainly out of interest and for fun.

If you also own a Thinkpad R51 (machine types 1829, 1830, 1831 and 1836) feel free to add what you think is missing.

My system specs

Machine: IBM ThinkPad R51 1830-DG4

  • Pentium M 1.7 GHz
  • 1.5 GB PC2700 DDR RAM (I upgraded by 1 GB)
  • 100 GB Western Digital HDD (upgraded, not original)

lspci:

00:00.0 Host bridge: Intel Corporation 82855PM Processor to I/O Controller (rev 03)
00:01.0 PCI bridge: Intel Corporation 82855PM Processor to AGP Controller (rev 03)
00:1d.0 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 01)
00:1d.1 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 01)
00:1d.2 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 (rev 01)
00:1d.7 USB Controller: Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller (rev 01)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 81)
00:1f.0 ISA bridge: Intel Corporation 82801DBM (ICH4-M) LPC Interface Bridge (rev 01)
00:1f.1 IDE interface: Intel Corporation 82801DBM (ICH4-M) IDE Controller (rev 01)
00:1f.3 SMBus: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus Controller (rev 01)
00:1f.5 Multimedia audio controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 01)
00:1f.6 Modem: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Modem Controller (rev 01)
01:00.0 VGA compatible controller: ATI Technologies Inc Radeon RV250 [Mobility FireGL 9000] (rev 02)
02:00.0 CardBus bridge: Texas Instruments PCI4520 PC card Cardbus Controller (rev 01)
02:00.2 FireWire (IEEE 1394): Texas Instruments Unknown device 802a (rev 01)
02:01.0 Ethernet controller: Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) (rev 03)
02:02.0 Network controller: Intel Corporation PRO/Wireless 2200BG Network Connection (rev 05)

Preparing for Installation

The laptop originally came with an 80 GB Hitachi hard disk.

TpUser0@localhost # fdisk -l /dev/hdc

Disk /dev/hdc: 80.0 GB, 80026361856 bytes
240 heads, 63 sectors/track, 10337 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdc1   *           1        9736    73604128+   c  W95 FAT32 (LBA)
/dev/hdc2            9737       10337     4543560   12  Compaq Diagnostics

When I received the ThinkPad I did not switch it on right away! I did also not start Windows XP!

A cronological list of what I did:

  • Since I had a 2.5 inch IDE adaptor I removed the HDD from the ThinkPad and put it in my desktop computer.
    Use a Knoppix Live Linux (or any other Live Linux) on CD/DVD if you don't have an adaptor.
  • I made a backup of each parition. Back in 2005 I used partimage.
    Use a program of you choice or even dd if you prefer, but keep in mind that it should also work if you change the parition sizes and positions.
  • I resized the Windows partition from its almost 75 GB to 20 GB using parted.
  • I made an image of the resulting partition too.
  • I deleted the second partition which is the rescue partition. Since I now had my own rescue images I didn't need it anymore.
    You will have to turn of the "Rescue Parition" feature in the BIOS to do this!
  • I then booted into Windows XP for the first time (!) and set it up to suit my needs.
    My system always converts FAT32 to NTFS and installs all the programs that came with the ThinkPad. I then need to install Service Pack 2 and all other recent updates for Windows and all the other programs. Use the Software Installer from IBM (Lenovo) to do this for you. You will need a broadband internet connection though, or you have all the files at hand (offline update). Another partition image of a recent and updated configuration will save your time for future Windows XP recoveries.
  • I then partitioned the rest of the hard disk with Linux and installed Gentoo Linux according to the manual.
    In my case I just copied an existing installation from my desktop to the ThinkPad and re-emerged everything with the correct CFLAGS and USE flags.

My partition layout (after I upgraded to a 100 GB hard disk):

tpuser0@localhost # fdisk -l /dev/hda
Disk /dev/hda: 100.0 GB, 100030242816 bytes
240 heads, 63 sectors/track, 12921 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1        2774    20971408+   7  HPFS/NTFS
/dev/hda2   *        2775        2779       37800   83  Linux
/dev/hda3            2780       12921    76673520    5  Extended
/dev/hda5            2780        5943    23919808+  83  Linux
/dev/hda6            5944       12726    51279448+  83  Linux
/dev/hda7           12727       12921     1474168+  82  Linux swap / Solaris

As you can see I have

device mount point description and notes
/dev/hda1  /mnt/windows 20 GB reserved for the Windows XP installation
I bought it with the laptop, so why not use it from time to time?
/dev/hda2  /boot 40 MB for the kernels...
/dev/hda5  / 25 GB for the root directory
I figured it be best to have no seperate partitions for / and /usr...
/dev/hda6  /home 53 GB for all my personal files (and I have a lot of them!)
/dev/hda7  swap 1.5 MB
You need at least the size of RAM you have in your system for swap or hibernation will not be possible.

Base configuration (Gentoo)

  1. /etc/make.conf:
    • #=== hardware ===
    • ALSA_CARDS="intel8x0 intel8x0m virmidi dummy"add "usb-audio" if you have additional devices such as TV capture cards.
    • VIDEO_CARDS="radeon fbdev dummy vesa"add "fglrx" for the proprietary driver from ATI.
    • INPUT_DEVICES="keyboard joystick mouse synaptics"
    • SANE_BACKENDS="genesys"if you have a scanner, add your SANE backend here.
    • #=== host settings optimizations ===
    • CHOST="i686-pc-linux-gnu"
    • CFLAGS="-O2 -march=pentium-m -fomit-frame-pointer -pipe"I'm using very stable settings here because I want to work with my laptop, not tune it for crashing all the time...
    • CXXFLAGS="${CFLAGS}"
    • #=== portage ===
    • Most of the other settings are explaned in /etc/make.conf.example – don't forget to add them too!
    • SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"use mirrorselect
    • FEATURES="sandbox ccache parallel-fetch userfetch userpriv usersandbox"
    • USE=" your USE flags here "use ufed (Use Flag EDitior)
TODO
...

Graphics

The ATI Mobility Radeon 9000 is fully supported by the open souce radeon driver.

Install X11 (I use XOrg X11):

tpuser0@localhost # echo VIDEO_CARDS="radeon" >> /etc/make.conf
tpuser0@localhost # emerge x11-base/xorg-x11

Prepare /etc/X11/xorg.conf: make sure you load the necessary X11 modules:

# a piece of /etc/X11/xorg.conf
Section "Module"
    Load	"GLcore"
    Load	"dri"
    Load	"glx"
EndSection

Prepare /etc/X11/xorg.conf: create a dri group and restrict access to the DRI driver for users in that group (replace “408” by the group id of your dri group):

# a piece of /etc/X11/xorg.conf
Section "DRI"
    Group	408	# group "dri", next available id 408
    Mode	0660
EndSection

Prepare /etc/X11/xorg.conf: the 15″ TFT flat panel:

# a piece of /etc/X11/xorg.conf
Section "Monitor"
    Identifier	"Monitor1"
    VendorName	"IBM"
    ModelName	"LCD Panel ThinkPad R51"
    Option	"dpms"
EndSection

Prepare /etc/X11/xorg.conf: finally, the xorg-x11 radeon driver:

# a piece of /etc/X11/xorg.conf
Section "Device"
# ATI Radeon R250 (ATI Radeon Mobility 9000 M9)
    Identifier	"ati-xorg"
    Driver	"radeon"
    BusID	"PCI:1:0:0"
    Option	"DynamicClocks"	"true"
    Option	"RenderAccel"	"true"
    Option	"EnablePageFlip"	"true"
    Option	"BackingStore"	"true"
EndSection

For more performance in X11 I also played with some additional parameters in /etc/X11/xorg.con, with various effects:

# a piece of /etc/X11/xorg.conf
Section "Device"
# ATI Radeon R250 (ATI Radeon Mobility 9000 M9)
    Identifier	"ati-xorg"
    Driver	"radeon"
    BusID	"PCI:1:0:0"
# ALWAYS "ON" OPTIONS
    Option	"DynamicClocks"	"true"
    Option	"RenderAccel"	"true"
# ENCOURAGED OPTIONS
    Option	"EnablePageFlip"	"true"
    Option	"BackingStore"	"true"
# "PLAY WITH" OPTIONS FOR TUNING PURPOSES
    #Option	"AGPFastWrite"	"on"	# ERROR: mplayer/xine/... xv (xvideo) modules don't work anymore!
    #Option	"DDCMode"	"true"	# use DDC (monitor) data to calculate mode lines
    #Option	"AccelDFS"	"on"	# (disabled by default for AGP due possible problems)
    #Option	"FBTexPercent"	"0"	# with EXA: (set to 0: reserve all offscreen RAM for EXA, OpenGL textures only in GART memory)
# CRASH options:
    #Option	"AGPMode"	"2"	# CRASH! (with or without AGPFastWrite)
    #Option	"AGPFastWrite"	"on"	# CRASH! (with AGPMode "2")
# SLOW options:
    #Option	"AccelMethod"	"EXA"	# newer and faster (!?) acceleration method
EndSection
TODO
...

Kernel configuration

TODO
...

Installation

TODO
...

Configuring relevant kernel modules

TODO
...

External Sources

TODO
...