个人工具

UbuntuHelp:T4220

来自Ubuntu中文

跳转至: 导航, 搜索

Ubuntu 9.10 (Karmic)

Working out of the box:

  • Brightness buttons
  • Volume buttons
  • Wireless
  • CPU scaling (no need for DSDT anymore)

Older versions

How to install Ubuntu Gusty (2.6.22) on a Fujitsu Siemens Lifebook T4220. This can also work for other Fujitsu Tablets As off today i have Hardy now and a whole set of new problems. Almost the same problems are on Hardy i will mark the only hardy problems)

  • Under Jaunty (9.04), the tablet pen is handled differently. I'll put in a section for Jaunty further down.

Got a lot of help from this wiki https://wiki.ubuntu.com/LaptopTestingTeam/FujitsuT4010D I installed with the alternate cd to get encryption working. But getting the Live cd working requires one extra code. add vga=791 This will install out of the box:

  • USB / Memory card reader / firewire
  • Ethernet
  • Wireless
  • Hibernation
  • Display at native resolution (1024x768)

What does not work out-of-the-box and is solved:

  • Tablet pen
  • The buttons on the screen (works in 32bit but 64bit i have some difficulty)
  • The builtin Sierra Wireless MC8780 (not all models have this)(also with Hardy still not out of the box)
  • Fingerprint reader (supported by aes2501-wy and libfprint)
  • (hardy only) headphone won't work .

(to fix this do :

 melkor86  said on 2008-04-26:

This was my solution:

sudo apt-get install module-assistant
sudo module-assistant a-i alsa-source

What does not work out-of-the-box, and is not solved, or partial solved:

  • suspend-to-ram only works one time, then will no longer suspend until you reboot ( https://bugs.launchpad.net/ubuntu/+source/linux/+bug/206952 )
  • CPU scaling: On a default install of Ubuntu, the CPU frequency is stuck at 800 MHz.The problem lies in the ACPI-DSDT. The Linux-Kernel reports to be WIN-Vista-compatible, therefore the DSDT tries to load an additional piece of AML code in this case, which is not ACPI-compatible. After this bug there is a missing temperature offset, an the kernel starts to thermo-throttle CPU. The incomplete load of the vista table is also the reason for the missing symbols in the button-events.

2 Solutions are possible:

  • switch off Vista compatibility in ACPI (acpi_osi="!Windows 2006")
  • use modified DSDT: http://ginkel2.boerde.de/Lifebook_4220/lt4220.tgz <--- See below for instructions
  • Screen brightness. The normal FN+F6 en FN+F7 don't work i got this (see underneath). So i guess acpi is too old for the new santa rosa chipset. Hopefully somebody can make a script for this to bypass this error
[  690.180000] ACPI Exception (evgpe-0576): AE_NOT_FOUND, while evaluating GPE method [_L1C] [20070126]

Brightness update. The cpu scaling works with a DSDT ACPI update. The brightness buttons work now. Woohoo.

  • Well the buttons work yeah but the screen doesn't dime or gets brighter... also no dmesg output. Need help here

<
> The Tablet Pen (this comes from the previous mentioned wiki) Tablet Pen Serial Port Configuration You first need to install the setserial utility which allows us to configure serial ports:

 apt-get install setserial
Now we need to enter the /dev/ttyS0 (COM0) settings in /etc/serial.conf. Add this to the file:
/dev/ttyS0 port 0x220 irq 4 autoconfig

To apply the settings immediately, execute this command:

 
sudo /etc/init.d/setserial reload 

( here it difference from the wiki)

    • (Under Jaunty, things no longer seem to be configured in xorg.conf. These lines kill X under Jaunty. The tablet should work without them, as it is now configured in an fdi file.)

In the /etc/X11/Xorg.conf you find at the end of the file # marked lines. Unmark them. Then there are three wacom entrys in de xorg.conf The pen, eraser and the cursor.

 change this line
Option          "Device"        "/dev/wacom"
to
Option          "Device"        "/dev/ttyS0"

This is the serial port you setup up. (it can be another port if you use another model) Restart the xserver by pressin crtl-alt-backspace Voila a working pen. To get screen rotation move on <
> Four Way Rotation Screen rotation can be made possible by either getting the Fujitsu buttons to work (using the fsc_btns module and fscd program -- see below) or my rotate scripts. Con for the buttons is that you can only have two rotations

  • Rotation is handled differently in Jaunty.
    • My current solution is further below, although needs work.

Beware : because of a driver problem in the intel xserver package you have to disable 3d acceleration in xserver. otherwise you get artifacts.

Tried to build from the source but didn't really work. No big artifacts but small ones. So it's a step in the right direction. For more information visit http://ubuntuforums.org/showthread.php?t=604896 where rotation is explained. Here is the tutorial until step 3 From the forum : This is a short guide to getting automatic screen rotation working on a Thinkpad X61 tablet, in the hopes of saving others some time. Most of the information is generic and could conceivably apply to other machines, and I'll try to indicate how to get that set up. I'm going to assume that you mostly have your tablet set up, have the pen working, have hdparm -B 254 set, etc etc. I owe a lot of this to others, particularly http://luke.no-ip.org/x60tablet/ for the basic setup and the person who wrote bug report 147783, which lists the DRI fix. Step 1: Remove conflicts. Below is a step to turn off 3d in the Xorg.conf. Just disabling the 3d theme of ubuntu wil also fix this in Hardy . didn't tried it in Gutsy. So enjoy 3d graphics and when you want to turn turn them off and just rotate with the script mentioned below. Edit the file /etc/X11/xorg.conf and add the following line to the "Device" section:

Option		"DRI"		"false"

This disables 3D acceleration. If you have an Intel 965 graphics controller and don't set this option, your screen will probably not redraw properly after rotation. Due to poor rotation support on most video cards, this bug is apparently not a priority at current, which is annoying if you want to use a tablet. If you have the package xserver-xgl installed, uninstall it. Now restart X by logging out and back in, or typing sudo /etc/init.d/gdm restart. Step 2: Add a rotation script. First we'll install a script that does the screen rotation for us. The following script is taken almost directly from http://luke.no-ip.org/x60tablet/ - the only alteration is that I changed to to always apply to the LVDS device. Add the following lines to /etc/rc.local before the "exit 0" line:

setkeycodes 6f 108 
setkeycodes 71 103 
setkeycodes 6e 105 
setkeycodes 6d 106

Create a file /usr/local/bin/rotate with the following content:

 #!/usr/bin/python

import os, sys, re

  # All allowed rotations
rotations = ['normal', 'right', 'inverted', 'left']

  # Keyboard scan codes for arrow keys
scanCodes = {'up': 0x71, 'dn': 0x6f, 'lt': 0x6e, 'rt': 0x6d}

  # Keycodes to use for each rotation
  # 104 = pgup, 109 = pgdn, 105 = left, 106 = right, 103 = up, 108 = down
keyCodes = {
            'normal':   {'up': 103, 'dn': 108, 'lt': 105, 'rt': 106},
            'right':    {'up': 105, 'dn': 106, 'lt': 108, 'rt': 103},
            'inverted': {'up': 108, 'dn': 103, 'lt': 106, 'rt': 105},
            'left':     {'up': 106, 'dn': 105, 'lt': 103, 'rt': 108}
          }

  # Rotations to pick from when no specific rotation is given
preferredRotations = rotations

  # Rotation to use when switched to tablet mode
tabletMode = "right"
  
  # Tells the program to stay open when in tablet mode and 
  # rotate using the orientation sensor
tabletAutoRotate = True
  
  # Rotation to use when switched to normal laptop mode
laptopMode = "normal"


if os.path.isfile('/usr/local/bin/xsetwacom'):
  xsetwacom = '/usr/local/bin/xsetwacom'
elif os.path.isfile('/usr/bin/xsetwacom'):
  xsetwacom = '/usr/bin/xsetwacom'
else:
  ## If it's not one of those two, just hope it's in the path somewhere.
  xsetwacom = 'xsetwacom'

xrandr = '/usr/bin/xrandr'



def main():
  setEnv()
  
    # list of wacom devices to be rotated
  devices = listDevices()
  
  if len(sys.argv) < 2:     # No rotation specified, just go to the next one in the preferred list
    cr = getCurrentRotation()
    if cr in preferredRotations:
      nextIndex = (preferredRotations.index(cr) + 1) % len(preferredRotations)
    else:
      nextIndex = 0
    next = preferredRotations[nextIndex]
  else:
    next = sys.argv[1]
    if not next in rotations:
      if next == "tablet":
        next = tabletMode
      elif next == "laptop":
        next = laptopMode
      else:
        sys.stderr.write("Rotation \"%s\" not allowed (pick from %s, tablet, laptop)\n" % (next, ', '.join(rotations)))
        sys.exit(-1)
  setRotation(next, devices)



def runCmd(cmd):
  f = os.popen(cmd)
  l = f.readlines()
  f.close()
  return l

def getCurrentRotation():
  #setEnv()
  try:
    rrv = randrVersion()
    if rrv < '1.2':
      l = [s for s in runCmd(xrandr) if 'Current rotation' in s]
      r = l[0].replace('Current rotation - ', '')
      return r.strip()
    elif rrv >= '1.2':
      l = runCmd(xrandr) #"%s | grep 'LVDS connected' | gawk '{print $4}' | sed -e 's/(//'" % xrandr)
      l = [x for x in l if re.search(r'(LVDS|default) connected', x)][0]
      l = l.split(' ')[3]
      l = l.replace('(', '')
      
      return l.strip()
  except:
    sys.stderr.write("Can not determine current rotation, bailing out :(")
    sys.exit(-1)

def setRotation(o, devices):
  #setEnv()
  runCmd("%s --output LVDS --rotate %s" % (xrandr, o))
  wacomRots = {'normal': '0', 'left': '2', 'right': '1', 'inverted': '3'}
  for d in devices:
    runCmd("%s set %s Rotate %s" % (xsetwacom, d, wacomRots[o]))
  setKeymap(o)

def setEnv():
  if 'DISPLAY' in os.environ:
    return  # DISPLAY is already set, don't mess with it.
  
  if os.system('pidof kdm > /dev/null') == 0:
    kdmsts = '/var/lib/kdm/kdmsts'
    if os.access(kdmsts, os.R_OK):
      kdmdata = open(kdmsts).readlines()
      userline = [s for s in kdmdata if ':0=' in s][0]
      user = userline.replace(':0=', '').strip()
      os.environ['DISPLAY'] = ':0.0'
      os.environ['XAUTHORITY'] = '/home/%s/.Xauthority' % user
  elif os.system('pidof gdm > /dev/null') == 0:
    os.environ['DISPLAY'] = ':0.0'
    os.environ['XAUTHORITY'] = '/var/lib/gdm/:0.Xauth'
  
def setKeymap(o):
  for sc in scanCodes.keys():
    os.system('sudo setkeycodes %x %d' % (scanCodes[sc], keyCodes[o][sc]))


def randrVersion():
  #setEnv()
  xrv = runCmd('%s -v' % xrandr)[0]
  xrv = re.sub(r'.*version ', '', xrv)
  return xrv.strip()

def listDevices():
  #setEnv()
  dev = runCmd("%s list dev | awk {'print $1'}" % xsetwacom)
  dev = map(str.strip, dev)
  return dev
   
main()

Then set permissions on this file to 755. Run visudo and add the following line to the bottom:

 
%admin ALL=NOPASSWD: /usr/bin/setkeycodes 

This allows the setkeycodes command to be run from within the script. You should now be able to type "rotate tablet" and "rotate laptop" from a command prompt to turn the screen at will. This script also adjust the arrow keypad on the side of the tablet so that the directions correspond to screen directions and sets the tablet pen to move correctly. NOTE Don't forget to install wacom-tools . Otherwise the pen doesn't rotate with you

  • Jaunty solution

Under Jaunty, the above script is broken, but xrandr can still be used for rotating the display, and xsetwacom for the tablet pen. For rotating to tablet mode right-handed orientation:

xrandr -o right
xsetwacom set "PnP Device (FUJ02e5)" rotate cw

For rotating to tablet mode left-handed orientation:

xrandr -o left
xsetwacom set "PnP Device (FUJ02e5)" rotate ccw

For rotating to laptop mode:

xrandr -o normal
xsetwacom set "PnP Device (FUJ02e5)" rotate

You can probably re-write the rotate script to work with these xsetwacom lines. (If someone does this, could they post it here please.) <
> The Tablet Buttons This only work for the 32bit gutsy. With 64bit you need to compile at your own. I tried the installer but it asks for the linux-wacom develpoment package which isn't in the reps. there are gusty packages instead of compiling on your own visit here and follow the instructions http://fjbtndrv.wiki.sourceforge.net/packages You can also compile yourself or download there own installer When installed do this in terminal

sudo nano /etc/modules

then add this:

fujitsu_laptop

Either reboot or do:

 modprobe fujitsu_laptop
 sudo fscd

You see fsc_buttons in green letters and the buttons are working. If you install the binaries from the ubuntu repository, everything should be set up to have fscd start at login. The problem is that the file /etc/udev/rules/65-fsc_btns.rules sets the /dev/event[0-9] devices to be owned by the group 'users', but (at least for me) you aren't a member of the 'users' group by default. After adding yourself to the 'users' group, fscd should start when you log into Gnome. <
> Sierra Wireless MC8780 builtin 3G modem For the models with the built-in umts module it get a bit tricky. There is a bug where it can't recognize the modem. I got a e-mail from Kevin Lloyd the builder of the driver and there is a 1.2.6 which isn't in the 2.6.22 kernel (in the 2.6.24 kernel there is version 1.2.5b still not enough. Click on the link below for the latest version 1.2.10b . P.S for a company with unsupported drivers their pretty good supported) follow this :

http://www.sierrawireless.com/faq/ShowFAQ.aspx?ID=608

Now the Mini-PCI gets recognize.

  • as of Hardy the driver is included in the kernel so just put in the sim card to activate it.

Be ware you sim card has to be in the reader to activate the modem Reboot and then in terminal do

 dmesg | grep sierra

you should get something like this [ 25.928000] sierra 4-1:1.0: Sierra USB modem (3 port) converter detected [ 25.928000] usbcore: registered new interface driver sierra You can find a lot on forums message stating that you need to connect to /dev/ttyUSB0 with minicom for example or gcom (comgt). Only thing is it will not work. You need to connect to /dev/ttyUSB2. Do gcom -d /dev/ttyUSB2 info and get the information from your card like imei number. Where going to use wvdial to get or connection up and running. Make sure other network devices are off. This includes wireless. Having the same wvdial config file from this page

http://ubuntuforums.org/showthread.php?t=49056

Enter this in you /etc/wvdial.conf

[Dialer Defaults]

Phone = *99#
Username = username
Password = password
Stupid Mode = 1
Dial Command = ATDT

[Dialer pin]

Init1 = AT+CPIN="1234"

[Dialer option]

Modem = /dev/ttyUSB2
Baud = 460800
Init2 = ATZ
Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ISDN = 0
Modem Type = Analog Modem

[Dialer 2gonly]

Init4 = AT+COPS=0,0,"Vodacom-SA",0

[Dialer 3gonly]

Init4 = AT+COPS=0,0,"Vodacom-SA",2

[Dialer internet]

Init5 = AT+CGDCONT=1,"IP","internet";

[Dialer internetvpn]

Init5 = AT+CGDCONT=1,"IP","internetvpn";

[Dialer myapn]

Init5 = AT+CGDCONT=1,"IP","myapn"

[Dialer 384k]

Init6 = AT+CGEQMIN=1,4,64,384,64,384
Init7 = AT+CGEQREQ=1,4,64,384,64,384

[Dialer 144k]

Init6 = AT+CGEQMIN=1,4,64,144,64,144
Init7 = AT+CGEQREQ=1,4,64,144,64,144

[Dialer 64k]

Init6 = AT+CGEQMIN=1,4,64,64,64,64
Init7 = AT+CGEQREQ=1,4,64,64,64,64

Also put this in your /etc/ppp/peers/wvdial

plugin passwordfd.so
noauth
name wvdial
replacedefaultroute
noipdefault
nomagic
usepeerdns
ipcp-accept-local
ipcp-accept-remote
nomp
noccp
nopredictor1
novj
novjccomp
nobsdcomp

Everthing is setup now. Then do the two commands below

  • Internet is the APN I'm using , change it to your liking ask for provider
wvdial pin option internet 
(press ^C after the PIN has been passed to the modem, wait until green LED stops flashing)
wvdial option internet 

Keep the terminal open to leave the connection open. At the end of the output is should say

WvDial<*1>: Carrier detected.  Starting PPP immediately.
WvDial<Notice>: Starting pppd at Fri Dec 28 21https://help.ubuntu.com/community/T4220?action=edit:07:47 2007
WvDial<Notice>: Pid of pppd: 7192
WvDial<*1>: Using interface ppp0
WvDial<*1>: local  IP address 10.64.3.60
WvDial<*1>: remote IP address 10.64.64.64
WvDial<*1>: primary   DNS address 10.11.12.13
WvDial<*1>: secondary DNS address 10.11.12.14

Enter the command route and see if you're route table get's populated. This takes 30 second aprox. If you see a filled route table check with a browser and if you get a page your done. <
> DSDT CPU Scaling In response to the comment above about cpu scaling, a small how to. Download the file provided by the link http://ginkel2.boerde.de/Lifebook_4220/lt4220.tgz As far I can tell, you don't need iasl (intel compiler) The files provided are already enough This wiki helped me: https://help.ubuntu.com/community/ACPIBattery

Some backups

As we don't want to mess with your working system we'll work on a duplicate and add that duplicate to your bootloader. First, navigate to /boot using nautilus. Copy the file with name "initrd.img-(version string here)", and paste in your terminal such that,

sudo -s -H   # followed by user password
cp /boot/initrd.img-(version string here) /boot/initrd.img-(version string here)-acpi
cp /boot/vmlinuz-(version string here) /boot/vmlinuz-(version string here)-acpi #same procedure for vmlinuz
exit

To be able to boot from this kernel-copy we need to add a section for it to the grub bootloader. Open up the menu file for modifying:

gksudo gedit /boot/grub/menu.lst&

Add a section for the duplicated kernel. Basically, you duplicate your default entry, and append "-acpi" behind the "kernel" and "initrd" lines, so that it looks something like the example installation below:

title           Ubuntu, kernel 2.6.22-14-generic Battery
root            (hd0,3)
kernel          /boot/vmlinuz-2.6.22-14-generic-acpi root=/dev/hda4 ro quiet splash
initrd          /boot/initrd.img-2.6.22-14-generic-acpi
savedefault

Then type the following into terminal to refresh the GRUB menu,

sudo update-grub

Putting your DSDT into initrd

As far the ACPI battery wiki goes you have to do some cat >> . But i get a permisson denied all the time. However i found a fix for this. Download this script that patches the kernel, http://gaugusch.at/acpi-dsdt-initrd-patches/initrd-add-dsdt, as well as the modified DSDT previously mentioned, if you haven't done so, i.e. http://ginkel2.boerde.de/Lifebook_4220/lt4220.tgz Run the script (after you have permission of both script and kernel, or you'll get "command not found"):

(where you saved "initrd-add-dsdt")/initrd-add-dsdt /boot/initrd.img-(version number)-acpi /(where you saved your file)/DSDT.aml

If you reboot and see that you cpu scale work you can also apply this to other initrd image. There are other options but there is a risk for kernel panic then. And I already got 3 today so that is enough. So we got CPU scaling working now. Useful links http://gaugusch.at/kernel.shtml http://forums.gentoo.org/viewtopic.php?t=122145 http://www.l4l.be/index.php?option=com_content&task=view&id=135&Itemid=37