HARDWARE Dell Latitude D410

From Gentoo Linux Wiki

Jump to: navigation, search
This article is part of the Hardware series.
Laptops TV Tuner Cards Wireless Servers Storage Other Hardware Motherboards Related

The Dell Latitude D410 is a wonderfully compact laptop. However, Gentoo does not install easily from CD (liveCD or otherwise), because the CD-ROM is USB, not IDE or ATAPI/SCSI. I spent hours (over several days) trying to come up with the right combination of search terms (in the forums, bugzilla, etc) to figure this out...hopefully this will save you some time.

Contents

[edit] Installation

This was especially frustrating given that Ubuntu installed in less than 15 minutes. You won't be able to install from the 2005.1 minimum install disk. Though the computer will start from the CD, the installer will complain that it can't find its files.

A workaround is to install from another distro that you may already have installed on your laptop. KNOPPIX 4.0.2 works well for this purpose (as does Ubuntu LTS 6.0+). Or you can try installing from a USB flash drive.


[edit] LiveCD Background

Background: http://bugs.gentoo.org/show_bug.cgi?id=83276. This issue is supposedly closed, at least for the 2005.1 minimal CD, but still fails with a 2006.0 LiveCD

The liveCD solution appears to be http://forums.gentoo.org/viewtopic-t-369937-highlight-doscsi+scandelay+debug.html. What I did, after a LOT of testing, is simply boot the LiveCD with "gentoo doscsi debug". Once the debug stopped, I typed "udevstart", then ^D (or exit), and /dev/sr0 was found and loaded the LiveCD. I would advise booting the LiveCD with "gentoo doscsi scandelay debug" for good measure...even if the scandelay is overkill. At least with the 2006.0 LiveCD, the steps below regarding hotplug and pulling/replugging the drive were NOT necessary. Udevstart did not work UNLESS debug mode was requested at boot.

What follows below is from the original entry


You can boot the minimum by issuing gentoo dobladecenter

Which adds extra sleeptime for the USB cd-rom to initialize. Otherwise i dont like the onboard Dell Wireless and I915 non-working fine other than vesa, or Xorg 6.9+


Booting with doscsi and debug will drop you to a shell. Typing echo /bin/udev >> /proc/sys/kernel/hotplug and plugging out and then back in the drive solves this. This is a known problem with these boot discs. It is on the bugzilla but I haven't time to search for it. It is still present on 2006.0 CD's too unfortunately.

[edit] Getting the video to work properly after closing and opening the lid

After closing and opening the lid of your Latitude D410, the screen will be black. This will happen even if you have not turned the power off or suspended: the screen turns off when you close the lid, and opening the lid does not cause the screen to turn back on.

[edit] A script to restore the video

To get the video work properly after opening the lid, you'll need vbetool. It hasn't been marked stable so stable users will need to unmask it:

 # echo "sys-apps/vbetool ~x86" >> /etc/portage/package.keywords
 # emerge sys-apps/vbetool

As root, run the following script ONCE:

#!/bin/bash
statedir=/root/s3/state
mkdir -p $statedir
chvt 2
sleep 1
vbetool vbestate save >$statedir/vbe

Now create the following file:

File: /root/restoreVideo.sh
#!/bin/bash
statedir=/root/s3/state
curcons=`fgconsole`
fuser /dev/tty$curcons 2>/dev/null|xargs ps -o comm= -p|grep -q X && chvt 2
vbetool post
vbetool vbestate restore <$statedir/vbe
chvt $[curcons%6+1]
chvt $curcons

The above two scripts are floating around on the Internet but it seems they are slightly modified versions of a tip found in /usr/src/linux/Documentation/power/video.txt. The above script, /root/restoreVideo.sh, will reset your video so it works correctly.

Make the script executable:

# chmod 744 /root/restoreVideo.sh

[edit] Running the script to restore video automatically

Now, to make life easier, you can have this script run automatically whenever you open the lid. If you haven't already, install acpid, which monitors your system for events like opening and closing lids, and add it to the default runlevel:

# emerge sys-power/acpid
# rc-update add acpid default

Create the following two files:

File: /etc/acpi/events/lid
event=button[ /]lid
action=/etc/acpi/actions/lid
File: /etc/acpi/actions/lid
#!/bin/bash

lid_state=/proc/acpi/button/lid/LID/state
test -e $lid_state || exit 0

if cat $lid_state | grep open > /dev/null
    then echo "lid open -> reinitializing video"
    /root/restoreVideo.sh
fi

Set this script as executable with:

# chmod 744 /etc/acpi/actions/lid

Now you're all set.

[edit] Suspend to RAM and suspend to disk

Suspend to RAM, also known as sleep, powers down almost everything on your laptop. Minimal power is supplied to the RAM. You can leave your laptop in suspend to RAM for days without any appreciable battery drain. If you disconnect the power and remove the battery while in suspend to RAM, all your data in RAM will be lost. The suspend to RAM process is fast--suspending and resuming takes only a few seconds.

Suspend to disk takes longer than suspend to RAM, both for suspend and resume. It writes the contents of your memory to disk and then powers everything down, so you can remove power and change your battery without losing anything.

[edit] Suspend to RAM

Suspend to RAM can be especially finicky to get working, primarily because getting the video to work correctly after a resume can be tricky. I once had this working perfectly, but after updating my system and upgrading several packages, it did not work anymore. Here is how I got it working again.

[edit] Needed packages

Start by ensuring you're using the following packages--emerge them if needed. (Of course you can try using different versions of the packages, but then, your results may vary.)

  • sys-kernel/suspend2-sources-2.6.16-r8 You don't need the suspend2-sources to use suspend to RAM; suspend2 is an improvement over the suspend to disk functionality that's in gentoo-sources. I recommend the suspend2-sources here because I've tested them and I know they work.
  • sys-apps/vbetool-0.7 needed to resume the video after suspend. As of December 9, 2006 this was not marked stable, so you might need to unmask it.
  • x11-base/xorg-x11-7.1 As of December 9, 2006, The latest stable xorg; known to work properly with suspend to RAM.
  • x11-drivers/xf86-video-i810-1.6.5 As of December 9, 2006, the latest stable i810 drivers; known to work properly with suspend to RAM.
  • sys-power/hibernate-script-1.93-r6 As of December 9, 2006, the latest stable hibernate script. This is from the suspend2 project; it works not only with suspend2 but also with suspend to RAM. It does many useful tasks to prepare your system for suspend and to resume it properly.

[edit] Kernel setup

First you'll need to enable sleep states in your kernel config. Under "Power Management Options (ACPI, APM):

Linux Kernel Configuration: ACPI (Advanced Power Configuration and Power Interface) Support
[*] ACPI Support
[*] Sleep States

[edit] Get vbetool working properly

You'll need vbetool working properly in order to restore your video upon resume. Follow the directions above under "A script to restore the video" in the "Getting the video to work properly after opening and closing the lid" section. You'll use this script to restore the video upon resume.

[edit] Edit hibernate scripts

Edit the scripts in /etc/hibernate so they look like this. You might want to back up the scripts that are already there--they have useful comments, but I have removed those to save space here. You can also learn more details about the options available in these files with "man hibernate.conf".

File: /etc/hibernate/common.conf
Verbosity 0
LogFile /var/log/hibernate.log
LogVerbosity 1
Distribution gentoo
SaveClock yes
UnloadBlacklistedModules yes
LoadModules auto

# Will take down both your wired and wireless interfaces before suspend
# this way you can unplug cables or move to a different hotspot during suspend
# without worries
DownInterfaces eth0 eth1
UpInterfaces eth0 eth1

# if you run sshd or ntpd, you'll need to restart them, because taking down your
# network interfaces on suspend will kill these services, but they will not
# restart automatically unless you include this line
RestartServices sshd ntpd

# Switches to text mode before suspending; if you suspended while in X, you'll
# automatically be put back in X on resume. It's not certain this is needed,
# but if it ain't broke...
SwitchToTextMode yes
File: /etc/hibernate/ram.conf
UseSysfsPowerState mem

# hibernate-script has a built-in vbetool capability. Do NOT use it; as it often causes
# problems! Instead, the line below will use the restoreVideo.sh script to restore the video
# (if you're wondering what that script is, read the directions further up on the gentoo-wiki.com
# page.)
OnResume 20 /root/restoreVideo.sh
Include common.conf

And you're all set. To suspend, type "hibernate-ram" as root. For suggestions on how you can use acpid to suspend automatically when closing the lid, or how to allow non-root users to suspend, see HOWTO Software Suspend v2, which contains tips on this.

[edit] Suspend to disk

Unlike with suspend to RAM, suspend to disk is not particularly tricky. The directions at HOWTO Software Suspend v2 work perfectly.

[edit] Links

Personal tools