Installing Ubuntu/Breezy on a ThinkPad T42

From ThinkWiki
Revision as of 06:58, 21 October 2005 by Johannes (Talk | contribs) (General installation)
Jump to: navigation, search

General installation

Here comes installation instructions for Ubuntu Breezy Badger on T42 2374-ZEP.

Get a copy of Ubuntu from UbuntuLinux.org.


You should update your /etc/apt/sources.list here mine:

#deb cdrom:[Ubuntu 5.10 _Breezy Badger_ - Release i386 (20051012)]/ breezy main restricted

#deb http://dk.archive.ubuntu.com/ubuntu breezy main restricted

## Uncomment the following two lines to fetch updated software from the network
deb http://mirrors.dotsrc.org/ubuntu breezy main restricted universe multiverse
deb-src http://mirrors.dotsrc.org/ubuntu breezy main restricted universe multiverse

## Uncomment the following two lines to fetch major bug fix updates produced
## after the final release of the distribution.
deb http://mirrors.dotsrc.org/ubuntu breezy-updates main restricted universe multiverse
deb-src http://mirrors.dotsrc.org/ubuntu breezy-updates main restricted universe multiverse

## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
#deb http://mirrors.dotsrc.org/ubuntu breezy-backports main restricted universe multiverse
#deb-src http://mirrors.dotsrc.org/ubuntu breezy-backports main restricted universe multiverse

deb http://mirrors.dotsrc.org/ubuntu breezy-security main restricted universe multiverse
deb-src http://mirrors.dotsrc.org/ubuntu breezy-security main restricted universe multiverse

#deb ftp://ftp.nerim.net/debian-marillat/ etch main

$ sudo apt-get update

Kernel support

How to get the correct kernel: $ sudo apt-get install linux-686

Kernel modules

TODO
Load the different kernel modules, and their configuration

ibm_acpi module:

Turning on experimental features:

/etc/modprobe.d/ibm_acpi.modprobe:

options ibm_acpi hotkey=enable,0xffff experimental=1


Starting with wireless off: /etc/modprobe.d/ipw2100.modprobe:

options ipw2100 disable=1

ibm_acpi modules compilation

Kernel 2.6.12-9 included in Breezy only included ibm_acpi version 0.8. However a version 0.11 is available, and included in 2.6.13.

http://bugme.osdl.org/show_bug.cgi?id=4947

ACPI

TODO
Hibernate, suspend, buttons, lid, speedstep

Because of "options ipw2100 disable=1" the wireless lan is initially turned off by a software feature. The default script in Breezy does not turn on the software part. Modification to turn on wireless: /etc/acpi/wireless.sh:

#!/bin/bash
# Find and enable/disable wireless devices

for DEVICE in /sys/class/net/*; do
    if [ -d $DEVICE/wireless ]; then
# $DEVICE is a wireless device. Check if it's powered on:
	if [ `cat $DEVICE/device/power/state` = 0 ]; then
# It's powered on. Switch it off.
	    echo -n 3 > $DEVICE/device/power/state;
	    echo 0
	else
# It's powered off. Switch it on.
	    echo -n 0 > $DEVICE/device/power/state;
	    echo -n 0 > $DEVICE/device/rf_kill;
	    echo 1
	fi
    fi
done

Xorg

Relevant part:

Section "InputDevice"
	Identifier	"Configured Mouse"
	Driver		"mouse"
	Option		"CorePointer"
	Option		"Device"		"/dev/input/mice"
	Option		"Protocol"		"ImPS/2"
	Option		"Emulate3Buttons"	"true"
	Option		"EmulateWheel"		"true"
	Option		"EmulateWheelButton"	"2"
	Option		"ZAxisMapping"		"4 5"
EndSection

Section "InputDevice"
	Identifier	"Synaptics Touchpad"
	Driver		"synaptics"
	Option		"SendCoreEvents"	"true"
	Option		"Device"		"/dev/psaux"
	Option		"Protocol"		"auto-dev"
	Option		"HorizScrollDelta"	"0"
EndSection

Section "Device"
	Identifier	"ATI Technologies, Inc. Radeon Mobility 7500 (M7 LW)"
	Driver		"radeon"
	BusID		"PCI:1:0:0"
	Option		"DynamicClocks"	"off"
	Option		"AGPMode"	"4"
	Option		"AGPFastWrite"	"yes"
EndSection
ATTENTION!
Options DynamicClocks "on" may hang your machine

Initng

Very great initiative for optimizing the boot process. Initng

Dep packages can be found: http://alioth.debian.org/projects/pkg-initng/

Installation: $ sudo dpkg -i initng_0.3.3-2_i386.deb

To run nice a few things and scripts need modification as follows:

Load modules on startup

Unfortunately it seems not all relevant modules are loaded automaticly when using InitNG.

Please help finding the proper scripts to do this.

Just add the proper modules to /etc/modules.

This is my list:

lp
mousedev
psmouse

#Additional ACPI features
ibm_acpi

#Frequency scaling
cpufreq_userspace
cpufreq_powersave
speedstep_centrino

Grub kernel options

To enable initng an option must be appended to the kernel load command in grub.

/boot/grub/menu.lst:

kernel          /vmlinuz-2.6.12-9-686 root=/dev/hda9 ro quiet splash video=radeonfb init=/sbin/initng

Runlevel

/etc/initng/default.runlevel:

system
daemon/acpid
daemon/dbus
daemon/hald
daemon/vixie-cron
daemon/ifplugd
system/alsasound
system/speedstep
system/laptop-mode
daemon/syslogd
daemon/klogd
daemon/gdm
daemon/cupsd
daemon/powernowd

add coldplug /etc/initng/system.runlevel:

system/initial
system/mountroot
system/mountfs
system/bootmisc
system/clock
system/hostname
system/modules
system/static-modules
system/hdparm
system/keymaps
system/urandom
system/consolefont
system/swap
net/lo
daemon/getty
system/makedev
system/discover
system/coldplug

Scripts

dbus.i

daemon/dbus.i has a few faults, on Ubuntu it is "dbus" not "dbus-1"!

service daemon/dbus {
        need = system/initial system/mountfs system/bootmisc
	
        pid_file = /var/run/dbus/pid
        daemon {
              DAEMON=/usr/bin/dbus-daemon
              NAME=dbus
              DAEMONUSER=messagebus
              PIDDIR=/var/run/dbus
              PIDFILE=$PIDDIR/pid
              DESC="system message bus"

              if [ -e /etc/default/dbus ]; then
                . /etc/default/dbus
              fi

              if [ ! -d $PIDDIR ]; then
                mkdir -p $PIDDIR
                chown $DAEMONUSER $PIDDIR
                chgrp $DAEMONUSER $PIDDIR
              fi
              if [ -e $PIDFILE ]; then
                PIDDIR=/proc/$(cat $PIDFILE)
                if [ -d ${PIDDIR} -a  "$(readlink -f ${PIDDIR}/exe)" = "${DAEMON}" ]; then
                  echo "$DESC already started; not starting."
                else
                  echo "Removing stale PID file $PIDFILE."
                  rm -f $PIDFILE
                fi
              fi
              echo -n "Starting $DESC: "
              $DAEMON --system $PARAMS
              echo "$NAME."
              }
}

hald.i

daemon/hald.i

service daemon/hald {
    need = system/initial system/mountfs daemon/dbus
#    use = daemon/acpid

    daemon {
        PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
        DAEMON=/usr/sbin/hald
        PIDDIR=/var/run/hal
        NAME=hal
        DAEMONUSER=hal
        DESC="Hardware abstraction layer"

        if [ -f /etc/default/hal ] ; then
          . /etc/default/hal
        fi

        if [ ! -d $PIDDIR ]; then
          mkdir -p $PIDDIR
          chown $DAEMONUSER:$DAEMONUSER $PIDDIR
        fi

        echo -n "Starting $DESC: "
        $DAEMON --daemon=no $DAEMON_OPTS
        echo "$NAME."
        }
}

gdm.i

daemon/gdm.i, to add locale support to the GDM login screen:

service daemon/gdm {
    need = system/initial system/mountfs system/hostname net/lo system/modules system/bootmisc
    use = daemon/xfs system/static-modules system/coldplug system/netmount    
#    daemon = /usr/sbin/gdm
#    daemon = /usr/bin/gdm
#    daemon_args = -nodaemon
    daemon {
	PATH=/bin:/sbin:/usr/bin:/usr/sbin
	if [ -r /etc/default/gdm ]; then
	    . /etc/default/gdm
	    if [ -z "$LANG" ]; then
		:
	    else
		export LANG
	    fi
	fi
	
	gdm -nodaemon
    }
    #pid_file = /var/run/gdm.pid
}

cupsd.i

Somethings wrong in the way the initNG scripts loads cups with hplip.

I did an ugly hack: daemon/cupsd

service daemon/cupsd {
	need = system/initial system/mountroot net/lo
#	use = daemon/printconf daemon/hpiod daemon/hpssd
#	daemon = /usr/sbin/cupsd
#	daemon_args = -f
	daemon {
	    /etc/init.d/hplip start
	    /etc/init.d/cupsys start
	}
}

Helpfull tools

Rovclock

Utility to overclock and underclock the ATI radeon chip. Can be used to underclock to reduce power, especialy when on batteries.

Get it from: http://www.hasw.net/linux/

Stable clock speeds: Core: 100MHz Memory: 120Mhz for LCP only, 180Mhz when using DVI out on port replicator.

Ex: $ sudo rovclock -c 100 -m 120

noflushd

Noflushd is a daemon that spins down disks that have not been read from after a certain amount of time, and then prevents disk writes from spinning them back up. It's targeted for laptops but can be used on any computer with IDE disks. The effect is that the hard disk actually spins down, saving you battery power, and shutting off the loudest component of most computers. $ sudo apt-get noflushd

ifplugd

ifplugd is a daemon which will automatically configure your ethernet device when a cable is plugged in and automatically unconfigure it if the cable is pulled. This is useful on laptops with onboard network adapters, since it will only configure the interface when a cable is really connected. $ sudo apt-get ifplugd

/etc/default/ifplugd:

INTERFACES="eth0"
HOTPLUG_INTERFACES="eth0"
ARGS="-q -f -u0 -d10 -w -I -b"
SUSPEND_ACTION="stop"

gnubiff

gnubiff is a mail notification program that checks for mail and displays headers when new mail has arrived. Has a tray icon for gnome. Supports SSL which I needed. http://gnubiff.sourceforge.net/

$ sudo apt-get install gnubiff

Known problems

TODO
List of bugs from kernel, Xorg and Ubuntu