Fedora 7 on a Dell D800 requires a little work to get suspend/resume working. The default configuration causes it to freeze during the resume, with the shift and scroll lock LEDs blinking.

The following has been tested with kernel-2.6.22.9-91.fc7 and NVIDIA-Linux-x86-100.14.19 on a Dell Latitude D800 with GeForce FX Go5200 graphics.

  1. If you use the binary-only nvidia driver, append "agp=off" to the kernel line in /etc/grub.conf. This disables the built-in AGP driver and allows nvidia to load its own.

    kernel /vmlinuz-2.6.22.9-91.fc7 ro root=/dev/vg1/root quiet agp=off
    
  2. Edit /etc/X11/xorg.conf and set the NvAGP option:

    Section "Device"
        ...
        Driver         "nvidia"
        Option         "NvAGP" "1"
    EndSection
    
  3. Reboot, log in and check if the nvidia AGP driver is used:

    # cat /proc/driver/nvidia/agp/status
    Status:          Enabled
    Driver:          NVIDIA
    
  4. Create /etc/pm/config.d/unload_modules with the following content:

    SUSPEND_MODULES="uhci_hcd"
    

    Create /etc/pm/config.d/nvidia with the following content:

    DISPLAY_QUIRK_VBE_POST=false
    

    Make the files executable with

    chmod +x /etc/pm/config.d/unload_modules /etc/pm/config.d/nvidia
    

Suspend and resume should work now.

14:27, 15 Jun 2007 by Carsten Clasohm Permalink | Comments (0)

Vodafone UMTS with Fedora 7

Vodafone UMTS After upgrading to Fedora 7, my Vodafone 3G Datacard (the old UMTS PCMCIA adapter) stopped working. Here's what I had to do to make it work again.


Create /etc/udev/rules.d/48-UMTS.rules with the following content:

BUS=="usb", KERNEL=="ttyUSB0", SYSFS{interface}=="Data Interface", SYMLINK+="umts", \
  RUN+="/usr/bin/wvdial --config /etc/wvdial-pin.conf"
BUS=="usb", KERNEL=="ttyUSB2", SYSFS{interface}=="Data Interface", SYMLINK+="gsm"

The wvdial configuration for setting the PIN is stored in /etc/wvdial-pin.conf. Replace "1234" with your own PIN.

Modem = /dev/umts
Baud = 460800
SetVolume = 0
Dial Command = ATDT
FlowControl = NOFLOW
Init1 = ATZ
Init2 = AT+CPIN="1234"

/etc/wvdial.conf contains the settings for establishing an UMTS connection:

[ModemUMTS]
Modem = /dev/umts
Baud = 460800
SetVolume = 0
Dial Command = ATDT
Init1 = ATZ
Init2 = ATM0
Init3 = ATM0
FlowControl = NOFLOW
[Dialer umts]
Username = VFD2
Password = WAP
Phone = *99***1#
Stupid Mode = 1
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP","web.vodafone.de"
Inherits = ModemUMTS

Next, we need to configure a network interface. Put this into /etc/sysconfig/network-scripts/ifcfg-umts:

IPV6INIT=no
ONBOOT=no
USERCTL=yes
PEERDNS=yes
TYPE=Modem
DEVICE=ppp0
BOOTPROTO=dialup
LINESPEED=460800
MODEMPORT=/dev/umts
IDLETIMEOUT=300
PROVIDER=umts
DEFROUTE=yes
PERSIST=no
WVDIALSECT=umts
MODEMNAME=ModemUMTS
DEMAND=no
PAPNAME=VFD2
AC=off
BSDCOMP=off
VJCCOMP=off
CCP=off
PC=off
VJ=off

This configuration has to be made available at two other locations:

ln /etc/sysconfig/network-scripts/ifcfg-umts \
  /etc/sysconfig/networking/devices/ifcfg-umts
ln /etc/sysconfig/network-scripts/ifcfg-umts \
  /etc/sysconfig/networking/profiles/default/ifcfg-umts

Now, tell PPP about the connection in /etc/ppp/peers/umts:

connect "/usr/bin/wvdial --remotename umts --chat 'umts'"

In /etc/ppp/peers/chap-secrets and pap-secrets, append this line at the end:

"VFD2"  *       "WAP"

SELinux prevents udev from running wvdial, and initialization of the PIN fails. To get around this, create /tmp/udevwvdial.te:

module udevwvdial 1.0;

require {
        type var_lock_t;
        type udev_t;
        class dir { write remove_name add_name };
        class file { write read create unlink };
}

allow udev_t var_lock_t:dir { write remove_name add_name };
allow udev_t var_lock_t:file { write read create unlink };

Compile and load the SELinux module.

checkmodule -M -m -o udevwvdial.mod udevwvdial.te
semodule_package -o udevwvdial.pp -m udevwvdial.mod
semodule -i udevwvdial.pp

The semodule command stores the module in /etc/selinux, so it will stay active when you reboot.

You should now be able to establish a connection with ifup umts and terminate it with ifdown umts. When the card switches between UMTS and GPS, the connection attempt may time out, so retry before checking the configuration files.

18:23, 14 Jun 2007 by Carsten Clasohm Permalink | Comments (4)

If you carry around business information on your laptop, it's a good idea to encrypt /tmp and the swap volume, and not only your home directory. You could already do this with a little scripting on Fedora Core 6. With Fedora 7, it got a little easier. First, create /etc/crypttab with the following content:

swap    /dev/vg1/swap   /dev/urandom    swap,cipher=aes-cbc-essiv:sha256
tmp     /dev/vg1/tmp    /dev/urandom    tmp,cipher=aes-cbc-essiv:sha256

In /etc/fstab you only list the swap volume:

/dev/mapper/swap        none            swap    defaults        0 0

Because the encrypted volumes are created after /etc/fstab is processed, the following script has to take care of mounting /tmp:

#!/bin/bash
#
# cryptotmp setup crypted tmp partition
#
# chkconfig: 2345 01 90
# description: adds crypted tmp partition.

. /etc/init.d/functions

# See how we were called.
case "$1" in
    start)
        mount /dev/mapper/tmp /tmp
        restorecon /tmp

        action "Adding encrypted tmp"

        touch /var/lock/subsys/cryptotmp
        ;;
    stop)
        rm -f /var/lock/subsys/cryptotmp
        ;;
    *)
        echo $"Usage: $0 {start|stop}"
        exit 1
esac

exit 0

Save it as /etc/init.d/cryptotmp and run

chmod +x /etc/init.d/cryptotmp
chkconfig --add cryptotmp

When the system boots, it overwrites the contents of /dev/vg1/swap and /dev/vg1/tmp, using a random key for encryption. Once the system shuts down, the content will no longer be accessible, as the encryption key is not stored anywhere.

Warning: The above configuration erases /dev/vg1/swap and /dev/vg1/tmp when the system boots. Files stored in /tmp are lost when the system is shut down. Also, suspend to disk does not work with an encrypted swap volume.

14:30, 12 Jun 2007 by Carsten Clasohm Permalink | Comments (2)

Presenting: Dell D800 TwinView [www.clasohm.com]

Some time ago I described how to put presentations on a projector with a Linux notebook with two X displays. In the meantime, I have switched to a Dell D800 with NVIDIA TwinView. I still do presentations where I want the image from the projector in a window on the LCD, without showing my whole desktop. Here's how to do it.

After setting the TwinView parameters in xorg.conf, configure VNC's ~/.vnc/xstartup to start the Metacity window manager and a gnome-terminal.

All you need then is the present script to start the VNC server and clients. Drag the view-only VNC window to the right, adjust its position so the title bar is not visible (Alt + left mouse button), and you can start your presentation in the second VNC window. To use Firefox, you either need to quit it on your primary display, or start it as a different user.

When you are done, stop the VNC server with the present-kill script.

22:20, 05 May 2007 by Carsten Clasohm Permalink | Comments (0)

A week ago, I returned from a trekking trip in the Solukhumbu region of Nepal. The pictures can be found in the following photo sets:


And with a little delay, I finished a page about the hikes I did in Austria's Dachstein region in 2004: Dachstein


19:29, 16 Mar 2007 by Carsten Clasohm Permalink | Comments (0)

UMTS Image Compression

If you use Vodafone's UMTS service in Germany, you have probably noticed that JPEG images are compressed in low-quality mode. This is done by a transparent HTTP proxy, and there is no obvious way around it. Apart from very poor image quality, you might see messages about IP address 1.2.3.4 in your browser's status bar, and pop-ups advising you to press Ctrl+F5 to improve image quality.


2x magnified original and re-compressed JPEG image

The software that does this is provided by Bytemobile, and is used by other phone companies.

For MS Windows, the Vodafone HighPerformance Client apparently allows you to change the compression settings, but if you use Linux, you are on your own.

Fortunately, it is pretty easy to convince the Bytemobile proxy to stop messing around with your images. All that is needed is contained in a small Perl script, which sends a magic byte sequence to the proxy. As long as the script is running, compression is turned off.

The magic bytes should be the same as the ones sent by the HighPerformance Client, but use the script at your own risk.

17:39, 05 Jan 2007 by Carsten Clasohm Permalink | Comments (6)

RSS

Archive

January 2007
S M T W T F S
  5 
10  11  12  13 
14  15  16  17  18  19  20 
21  22  23  24  25  26  27 
28  29  30  31       
September 2008
July 2008
June 2007
May 2007
March 2007
January 2007
December 2006
September 2006
June 2006
April 2006
March 2006
February 2006
January 2006
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
January 2005
December 2004
November 2004
October 2004

Blog Categories

Hiking (5)
Desktop Linux (28)
Server Linux (5)
Palm (3)
Photography (5)
Politics (2)
Web Applications (15)

Notifications

Request notifications

Syndication Feed

RSS

Recent Comments

  1. Anonymous Visitor: Thanks
  2. Anonymous Visitor: AT&T U.S.
  3. Anonymous Visitor: All went well under CentOS 5.0 in Croatia (VIP network)
  4. Anonymous Visitor: tmp crypt not necessary
  5. Anonymous Visitor: Great article
  6. Anonymous Visitor: So it's not a Virus...
  7. Anonymous Visitor: Thanks! Helps also on Windows!
  8. Anonymous Visitor: Thank you
  9. Anonymous Visitor: Economic Incentives
  10. Anonymous Visitor: thank you