Posts tagged “X60t”

Make your computer boot in 10 seconds or less.

I just fiddled with my Arch Linux installation to make it boot a bit faster. I discovered this nice little project called finit, which originally was meant for people owning an Eeepc or similar netbook, but it now also works with normal computers.

So I installed this, and got rid of slim for logging in and just make it log in automatically for me, which is pretty nice.

The only thing you really need to do is to specify what init you want in your grub configuration, which in this case is finit.

Take a look at this boot chart:

Visit the thread on archlinux’s forum for more information.

X60 Tablet and the new Xorg 1.6

Since last I wrote about the X60 Tablet and how to get it to work with Gentoo Linux a lot of things have happened. Some new versions of Xorg has come out. v86d for the framebuffering and uvesafb has been fixed so it is easier to install and get to work. I have switched to Arch Linux and so on.

I have discovered, with the new Xorg 1.6 and the newest Intel drivers for the graphics card the 3D performance have been upped slightly. But compared to the old i810 drivers, it is still not as good. Though a lot of new features as KVM and such have been implemented.

From my experience the Intel drivers are still a bit buggy. When I have them enabled the newest version does not allow me to rotate my screen as I could do easily before, now it just turns my screen off and I cannot go back and have to restart the computer. Pretty annoying.

The Digitizer works fine with the newest Xorg. You just have to use the development package instead of the stable, since Xorg went over to HAL and moving away from the static xorg.conf, though you still have to load the wacom module in your xorg.conf, and you can still use the Device sections as always. This can probably be done with a fdi file too, I have not investigated that yet though.

I am going to test out Xorg 1.6.1 soon, since it just came out and see if it helps out with the rotation issue.

EDIT:

It seems that everything works fine in Xorg 1.6.1, rotation of the screen, linuxwacom and so on, AWESOME!

Back light keys on IBM/Lenovo Thinkpad X60t

I just got back light keys to work on my Thinkpad X60t. This is actually pretty easy. If I just had read the documentation for thinkpad_acpi before I would have known.

Anyways lets get to it.

First we need to modprobe thinkpad_acpi with some arguments, otherwise the back light Fn-key combo will not show up as acpi events, and then we will not be able to control the back light.


modprobe thinkpad_acpi brightness_enable=1 hotkey=enable,0xffffff

You probably want to do that on every boot, in gentoo you do that by adding the following to /etc/conf.d/modules:


modules_2_6="${modules_2_6} thinkpad_acpi"
module_thinkpad_acpi_args_2_6="brightness_enable=1 hotkey=enable,0xffffff"

When that is done we can start grabbing some events with acpi_listen, mine looks like this:


tomasz@arcadia ~ $ acpi_listen
ibm/hotkey HKEY 00000080 00001011
ibm/hotkey HKEY 00000080 00001010

First one is for down second for up.

Now we know this we can make some files for acpid to react on when we push the Fn-key combo for either back light up or down.

/etc/acpi/events/backlight-up:


# called when brightness up key combo is pressed
event=ibm/hotkey HKEY 00000080 00001010
action=/etc/acpi/actions/backlight-up

/etc/acpi/events/backlight-down:


# called when brightness down key combo is pressed
event=ibm/hotkey HKEY 00000080 00001011
action=/etc/acpi/actions/backlight-down

Now we need some actions. I made a couple of simple bash scripts that looks at the current state of the back light level and subtracts or adds 1 to the level. You can control the level either in /sys/class/backlight/thinkpad_screen/brightness or in /proc/acpi/ibm/brightness the latter is as far as I know deprecated, so I am not going to use that.

So here are the scripts:

/etc/acpi/actions/backlight-down:


#! /bin/bash
# A little simple script to control backlight on a Thinkpad X60 Tablet

# Check current state
typeset -i state=`cat /sys/class/backlight/thinkpad_screen/brightness`
# Subtract one from the current state and echo it to the file
down=$((state-=1))
echo "$down" > /sys/class/backlight/thinkpad_screen/brightness

/etc/acpi/actions/backlight-up:


#! /bin/bash
# A little script to control backlight on a Thinkpad X60 Tablet

# Check current state
typeset -i state=`cat /sys/class/backlight/thinkpad_screen/brightness`
# Add one to the current state and echo it to the file
state+=1
echo "$state" > /sys/class/backlight/thinkpad_screen/brightness

Reload acpid and see if it works.


/etc/init.d/acpid restart

This should be it!

How to get Framebuffer to work on IBM/Lenovo X60t

I finally got the framebuffer to work on my X60t, though it took a bit effort to get working.

What you need is to use uvesafb, which was introduced in kernel 2.6.24. Though to get make it to work properly you need the packages dev-libs/klibc and sys-apps/v86d, and it is these packages that are tricky since they are still a bit buggy.

To install klibc you need the patch from bug 212531 that uses the C implementation for memmove.c instead of the new assembly implementation. If you can not find it get it here: klibc-1.5.11-klibcmemmove.patch
Add it to the klibc-1.5.11 ebuild, by adding the following line in the src_unpack() section:

epatch "${FILESDIR}"/${PN}-1.5.11-klibcmemmove.patch || die "Failed to patch memmove"

Now compile it.

After it is done, compile v86d with -O0 cflag, otherwise it will not work! I compiled it the following way:

CFLAGS="-march=prescott -mtune=generic -O0 -pipe -fomit-frame-pointer" emerge v86d

We are almost done. Now to the kernel.


        General Setup  --->
                [*] Initial RAM filesystem and RAM disk (initramfs/initrd) support
                (/usr/share/v86d/initramfs) Initramfs source file(s)

        Device Drivers  --->
                <*> Connector - unified userspace <-> kernelspace linker  --->

                Graphics support  --->
                        <*> Support for frame buffer devices  --->
                                <*>   Userspace VESA VGA graphics support

Those settings are:
CONFIG_CONNECTOR=y
CONFIG_FB_UVESA=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=”/usr/share/v86d/initramfs”

Compile the kernel and add following line to grub.conf at the end of the kernel line:

video=uvesafb:1400x1050-32,mtrr:3,ywrap

Reboot and now you should have a nice framebuffer.

EDIT: I have also added it to Gentoo-wiki

IBM/Lenovo Thinkpad X60t Gentoo installation guide now on gentoo-wiki

Go visit: http://gentoo-wiki.com/HARDWARE_Lenovo_Thinkpad_X60t for my installation guide on how to get the hardware and drivers work in Gentoo Linux work.

Getting tablet and rotation to work on Thinkpad X60t

Getting pen and rotation to work on X60t.

NOTE: I used Gentoo Linux with kernel 2.6.25 with tuxonice patch and linuxwacom-0.8.0_p20.

First make sure you have the wacom drivers that come with the kernel compiled into the kernel or compiled as a module.
Though I’m not sure if it is nessesary or not.


	Deveice Drivers --->
		Input Device Support --->
			Tablets --->
				<M>   Wacom Intuos/Graphire tablet support (USB)

In gentoo you have to unmask the newest version of the linuxwacom driver. To do this do the following unless you are running
an ~arch:


	echo "x11-drivers/linuxwacom ~*" >> /etc/portage/package.keywords

Now install the linuxwacom package:


	emerge linuxwacom

When it is done installing we can add the nessesary sections in the Xorg.conf to make it respond to the input from the tablet.

Make your Section “ServerLayout” look similar to this (yours might look a little bit different, the important part is the
Stylus, Cursor and Eraser):


	Section "ServerLayout"
		Identifier     "X.org Configured"
   	Screen      0  "Screen0" 0 0
		InputDevice    "Mouse0" "CorePointer"
		InputDevice    "Mouse1" "SendCoreEvents"
		InputDevice    "Keyboard0" "CoreKeyboard"
		InputDevice    "Cursor" "SendCoreEvents"
		InputDevice    "Stylus" "SendCoreEvents"
		InputDevice    "Eraser" "SendCoreEvents"
	EndSection

We also need to add some device sections:


	Section "InputDevice"
		Identifier  "Cursor"
		Driver      "wacom"
		Option      "Device" "/dev/ttyS0"
		Option      "Type" "cursor"
		Option      "ForceDevice" "ISDV4"
		Option      "Mode" "Absolute"
		Option      "BottomY" "18432"
		Option      "BottomX" "24576"
	EndSection

	Section "InputDevice"
		Identifier  "Stylus"
		Driver      "wacom"
		Option      "Device" "/dev/ttyS0"
		Option      "Type" "stylus"
		Option      "ForceDevice" "ISDV4"
		Option      "TPCButton" "off"
		Option      "BottomY" "18432"
		Option      "BottomX" "24576"
		Option      "Mode" "Absolute"
	EndSection

	Section "InputDevice"
		Identifier  "Eraser"
		Driver      "wacom"
		Option      "Device" "/dev/ttyS0"
		Option      "Type" "eraser"
		Option      "ForceDevice" "ISDV4"
		Option      "BottomY" "18432"
		Option      "BottomX" "24576"
	EndSection

The Optiopn “ForceDevice” “ISDV4″ is nessesary when using serial tablets.

Before we can restart Xorg, we need to tell the system where the tablet device is, you have to do this on every boot:


	setserial /dev/ttyS0 port 0x0200 irq 5 autoconfig

Add this line to /etc/conf.d/local.start (or at least that is how you do in gentoo, this might be different on other
distro’s with different kind of init systems).

After a restart of Xorg the tablet should now work. Try it out. I use Xournal to make notes.

Now we got the tablet to work we can play a bit with rotating the screen when you swivel down the screen and when you
swivel it up. Also when you push the rotate button on the buttons beneath the screen.

Make sure you have the newest thinkpad package and acpid installed:


	echo "app-laptop/thinkpad ~*" >> /etc/portage/package.keywords
	echo "sys-power/acpid ~*" >> /etc/portage/package.keywords

Install both packages:


	emerge thinkpad acpid

Modprobe the thinkpad module and start the acpid daemon:


	modprobe thinkpad
	/etc/init.d/acpid start

Also make the daemon start and load the module on every boot:


	rc-update add acpid default
	echo 'modules_2_6="${modules_2_6} thinkpad"' >> /etc/conf.d/modules
	echo 'module_thinkpad_args_2_6=""' >> /etc/conf.d/modules

When you swivel down the monitor and when you swivel it up it generates an acpi event. This event looks like this:

When swivling down:


	Jun  9 02:22:37 arcadia acpid: received event "ibm/hotkey HKEY 00000080 00005009"

When swivling up:


	Jun  9 02:22:45 arcadia acpid: received event "ibm/hotkey HKEY 00000080 0000500a"

You can find out what events your tablet makes either by tailing /var/log/messages or use acpi_listen.

When we know what events there are made, we can make acpid execute some scripts for us.

Make a file in /etc/acpi/events called x60t-swivel-down and one that is called x60t-swivel-up.

x60t-swivel-down should contain the following:


	# called when tablet screen swivels down (into tablet mode)
	event=ibm/hotkey HKEY 00000080 00005009
	action=/etc/acpi/actions/x60t-swivel-down

x60t-swivel-up should contain:


	# called when tablet screen swivels up (into laptop mode)
	event=ibm/hotkey HKEY 00000080 0000500a
	action=/etc/acpi/actions/x60t-swivel-up

As you can see in both files, I took the received events and and assigned some actions for them.

Make the action scripts, these are placed in /etc/acpi/actions:

x60t-swivel-up:


	#!/bin/bash
	/usr/bin/xrandr -o normal
	xsetwacom set "Stylus" Rotate none
	xsetwacom set "Cursor" Rotate none
	xsetwacom set "Eraser" Rotate none

x60t-swivel-down:


	#!/bin/bash
	/usr/bin/xrandr -o inverted
	xsetwacom set "Stylus" Rotate half
	xsetwacom set "Cursor" Rotate half
	xsetwacom set "Eraser" Rotate half

The -o option for xrandr indicates the rotation of the screen. You can use normal, left, right and inverted here.
You have to tell Xorg, which orientation the Stylus, Cursor and Eraser have when rotating.

Save the scripts. Restart acpid and test it:


	/etc/init.d/acpid restart

Now try swivel the screen down, you should se the screen rotate. Swivel it up and it returns to normal.
You might also want to use the rotate button – this button does not generate acpi events, though it generates
X events, that you can grab with xev:


	emerge xev

Now fire up xev and push the button, the output looks like this (your output might look different):


	KeyRelease event, serial 30, synthetic NO, window 0x3a00001,
		root 0x59, subw 0x0, time 719677542, (609,349), root:(613,403),
		state 0x0, keycode 203, same_screen YES,

What we need is the keycode, which in this case is 203. If it does not appear, you might need to run:


	setkeycodes 6c 153

That has to be done upon every boot. Add it to your /etc/conf.d/local.start, and try run the xev app again and see if
you can grab the event now.

Now make a file called .Xmodmap in your home directory containing:


	keycode 203 = F13

And make a file called .xbindkeysrc containing the following:


	"/home/username/bin/rotate"
	F13

As you can see the file points to /home/username/bin/rotate we have to make that file, and this one contains:


	#!/usr/bin/env bash

	# This is a script that toggles rotation of the screen through xrandr,
	# and also toggles rotation of the stylus, eraser and cursor through xsetwacom

	# Check orientation
	orientation=`xrandr --verbose -q | grep LVDS | awk '{print $5}'`
	# Rotate the screen and stylus, eraser and cursor, according to your preferences.
	if [ "$orientation" = "normal" ]; then
		/usr/bin/xrandr -o right
		xsetwacom set "Stylus" Rotate cw
		xsetwacom set "Cursor" Rotate cw
		xsetwacom set "Eraser" Rotate cw
	elif [ "$orientation" = "inverted" ]; then
		/usr/bin/xrandr -o left
		xsetwacom set "Stylus" Rotate ccw
		xsetwacom set "Cursor" Rotate ccw
		xsetwacom set "Eraser" Rotate ccw
	elif [ "$orientation" = "right" ]; then
		/usr/bin/xrandr -o inverted
		xsetwacom set "Stylus" Rotate half
		xsetwacom set "Cursor" Rotate half
		xsetwacom set "Eraser" Rotate half
	elif [ "$orientation" = "left" ]; then
		/usr/bin/xrandr -o normal
		xsetwacom set "Stylus" Rotate none
		xsetwacom set "Cursor" Rotate none
		xsetwacom set "Eraser" Rotate none
	fi

Remember to make it executable!

We are almost done. Make your window manager run xmodmap ~/.Xmodmap and xbindkeysrc upon start. I use gnome and made
a little script containing the two commands and configured the gnome session to run the scrip when starting.

Run the following commands and test the button:


	xmodmap ~/.Xmodmap
	xbindkeys

We are now done!

Updgrading BIOS on X60t without CD drive.

I recieved my Lenovo Thinkpad X60t yesteday and wanted to update the bios on it, because the one that was installed on it was pretty old. I found out that according to Lenovo you need a CD drive or a 32-bit version of Windows installed, which I don’t have. Since I run Gentoo on the thinkpad. But there is a sollution for this problem. It’s done pretty easy. All you need is:

When you have all these things you are ready to go!

Install the HP USB Stick formatter and place it somewhere you remember. I installed it on the desktop.
Go to the folder where you installed it and extract the HPUSBF.EXE file with winrar or whatever you use to a subfolder in the current directory. Now that you have extracted the files to a subfolder, run the HPUSBFW.EXE utility and format you USB Stick choosing Create DOS startup disk and selecting the subfolder you extracted HPUSBF.EXE to. Now we are almost done. Last step is to extract the bios to the USB Stick using winrar or similar to a subfolder on the USB Stick.

!NOTICE! it’s not a fault that is seems like there are no files on your USB Stick before you extract the bios to it – they are hidden.

Unmount the USB Stick and boot it. A DOS promt should appear, cd to the subfolder where the BIOS were extracted on the USB Stick and write command.com. The rest should be pretty easy :)

Source: ThinkWiki.org