I still remembered the day I got the new Dell 700m, after I made sure that all parts worked properly on MS Windows , I formated the hd and started t" name="description" />

MY GENTOO NOTEBOOK

发表于:2007-07-04来源:作者:点击数: 标签:
MY GENTOO NOTEBOOK CONFIG uml ine" cellspacing="1" cellpadding="3" width="100%" border="0"> I still remembered the day I got the new Dell 700m, after I made sure that all parts worked properly on MS Windows , I formated the hd and started t
MY GENTOO NOTEBOOK CONFIG

umline" cellspacing="1" cellpadding="3" width="100%" border="0">
I still remembered the day I got the new Dell 700m, after I made sure that all parts worked properly on MS Windows, I formated the hd and started the journey of Gentoo without any hesitation.

This HOWTO is highly inspired by HARDWARE Gentoo Acer Travelmate 803LCi Manual


ATTENTION: PLEASE BE AWARE I AM NOT RESPORNSIBLE FOR ANY DAMAGE TO YOUR SYSTEM, YOU TRY THIS AT YOUR OWN RISK !



Introduction

Technical specification of Dell 700m:

    Processors
    Intel PentiumTM M processors 725 (1.60GHz, 2MB Cache, 400MHz FSB)
    Intel 855GME chipset

    Memory
    256 MB shared3 DDR SDRAM standard, upgradable to 2 GB maximum
    SDRAM Configuration: 2 SoDIMM slots (one user-accessible)

    Displays
    12.1-inch Wide Screen crystal clear TFT XGA active-matrix display (1280 x 800 resolution)

    Graphics Cards
    Intel Extreme Graphics up to 64 MB shared memory

    Hard Drives
    30 GB3 Ultra ATA hard drive

    Optical Drives
    Combo Drive: 24x/10x/24x CD-RW and 8x DVD

    Sound Cards
    Integrated stereo sound

    Modems
    Internal 56K3 capable v.92 Fax modem

    Network Interface
    Integrated 10/100 Ethernet

    Wireless Networking
    Dell 1350 internal wireless solution (802.11b/g, 54 Mbps4)

    I/O Ports
    1394: Integrated IEEE 1394
    2-USB 2.0 (Universal Serial Bus) compliant 4-pin connectors
    Audio jacks: Line-out (external speakers/headphone) and external microphone
    Video: 15-pin monitor connector
    10/100 Ethernet LAN: RJ-45 connector
    S-Video/TV Out: 7-pin mini-DIN connector
    Memory: Secure Digital memory slot
    Modem: RJ-11 connector

    Slots
    Connectors: Supports (1) Type I or Type II card
    3.3 and 5 V cards supported


Here is the output of `lspci | cut -b 13-`
Code:

 Host bridge: Intel Corp. 82852/82855 GM/GME/PM/GMV Processor to I/O Controller (rev 02)
 System peripheral: Intel Corp. 82852/82855 GM/GME/PM/GMV Processor to I/O Controller (rev 02)
 System peripheral: Intel Corp. 82852/82855 GM/GME/PM/GMV Processor to I/O Controller (rev 02)
 VGA compatible controller: Intel Corp. 82852/855GM Integrated Graphics Device (rev 02)
 Display controller: Intel Corp. 82852/855GM Integrated Graphics Device (rev 02)
 USB Controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 03)
 USB Controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 03)
 USB Controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 (rev 03)
 USB Controller: Intel Corp. 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller (rev 03)
 PCI bridge: Intel Corp. 82801 Mobile PCI Bridge (rev 83)
 ISA bridge: Intel Corp. 82801DBM (ICH4-M) LPC Interface Bridge (rev 03)
 IDE interface: Intel Corp. 82801DBM (ICH4-M) IDE Controller (rev 03)
 SMBus: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus Controller (rev 03)
 Multimedia audio controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 03)
 Modem: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Modem Controller (rev 03)
 Network controller: Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller (rev 03)
 CardBus bridge: Texas Instruments PCI7420 CardBus Controller
 CardBus bridge: Texas Instruments PCI7420 CardBus Controller
 FireWire (IEEE 1394): Texas Instruments PCI7x20 1394a-2000 OHCI Two-Port PHY/Link-Layer Controller
 Unknown mass storage controller: Texas Instruments PCI7420/PCI7620 Dual Socket CardBus and Smart Card Cont. w/1394a-2000 OHCI Two-Port  PHY/Link-Layer Cont. an
 Ethernet controller: Broadcom Corporation BCM4401-B0 100Base-TX (rev 02)



Installing Gentoo: Stage 1 NPTL on a Stage 3 Tarball is a good handbook for fresh Gentoo installation.


CFLAGS and USE

Gcc 3.3.4 does NOT support Pentium-M architecture, some users argue that Pentium-M is more or less like Pentium 4. As far as I know, Pentium-M is a brand new architecture designed specifically for laptop inspired by PIII-M. So I choose this CFLAGS for gcc 3.3.4:
Code:

CFLAGS="-march=pentium3 -O2 -fomit-frame-pointer -pipe"


For gcc 3.4.3
Code:

CFLAGS="-march=pentium-m -mtune=pentium-m -O2 -pipe -mmmx -msse -msse2 -mfpmath=sse -fomit-frame-pointer -fno-delayed-branch -fcaller-saves -freorder-blocks -freorder-functions -falign-jumps -finline-functions -frename-registers -fweb -fno-trapping-math -falign-functions=64"


LD_FLAGS is disabled since I've met several compilation fail if it is enabled.


Kernel

Everybody has his/her own flavor of kernel, I prefer nitro-sources, 2.6.10-nitro4: The Kernel Formerly Known As Hercules.

ACPI
Code:

Power management options (ACPI, APM)  --->
    ACPI (Advanced Configuration and Power Interface) Support  --->
       [*] ACPI Support
       [*]   Sleep States (EXPERIMENTAL)
       <M>   AC Adapter
       <M>   Battery
       <M>   Button
       <M>   Fan
       <M>   Processor
       <M>     Thermal Zone


If you would like as small a kernel as possbile, just like me, you need to add the following modules to /etc/modules.autoload/kernel-2.6:
Code:

# acpi
button
ac
battery
fan
processor
thermal


Speedstep
Kernelwise:
Code:

    CPU Frequency scaling  --->
       [*] CPU Frequency scaling
       <M>   'powersave' governor                               
       <M>   'userspace' governor for userspace frequency scaling
       [*]     /proc/sys/cpu/ interface (2.4. / OLD)             
       <M>   'ondemand' cpufreq policy governor                 
       <*>   CPU frequency table helpers                         
       ---   CPUFreq processor drivers                           
       <M> Intel Enhanced SpeedStep                             
       [*]   Use ACPI tables to decode valid frequency/voltage pairs         

Add the following modules to /etc/modules.autoload/kernel-2.6:
Code:

# speedstep
speedstep-centrino
cpufreq_userspace
cpufreq_ondemand


Userspace daemon is speedfreq:
Code:

# emerge speedfreq
# rc-update add speedfreq boot
% cat /etc/conf.d/speedfreq
       SPEEDFREQ_SPEED="dynamic"
       SPEEDFREQ_USERS="yes"


Software Suspend 2
Kernelwise configuration:
Code:

    Software Suspend 2 --->
       <*>    Swap Writer                     
       --- Page Transformers                   
       <*>    LZF image compression (Preferred)
       --- User Interface Options             
       <*>   Text mode console support         
       --- General Options                     
       (/dev/hda2)    Default resume device name
  [ ]    Allow Keep Image Mode           


Code:
emerge hibernate-script


It takes quite a long time for me to hack the software suspend, then I found here is a little patch for the latest swsusp2:
http://lists.berlios.de/pipermail/softwaresuspend-devel/2005-January/001458.html

You need to apply this patch to the kernel, then format the swap partition for the sake of sanity, in my case, /dev/hda2 is the swap:
Code:
 mkswap /dev/hda2


We also need to edit the /etc/hibernate/hibernate.conf to meet your own need, Here is the mine:
Code:

$ cat /etc/hibernate/hibernate.conf  | grep ^[^#]
 UseSwsusp2 yes
 Reboot no
 EnableEscape yes
 DefaultConsoleLevel 1
 SuspendDevice swap:/dev/hda2
 PowerdownMethod 4
 Verbosity 0
 LogFile /var/log/hibernate.log
 LogVerbosity 1
 Bootsplash on
 SaveClock yes
 UnloadModules snd_intel8x0
 GentooModulesAutoload yes
 RestartServices alsasound local
 SwitchToTextMode yes


Since snd_intel8x0 is incompatible with swsusp, YMMV, I need to stop alsasound and unload this module before do_swsusp2.

SaveClock is another issue to address, you might run ntp-client service after the swsusp2, if your box are online all the time.


Last edited by bookstack on Sun Jan 16, 2005 9:02 pm; edited 16 times in total
Back to top
javascript:window.open(this.src);" style="CURSOR: pointer" onload="return imgzoom(this,550)">
bookstack
Tux's lil' helper



Joined: 27 Feb 2004
Posts: 129

Posted: Fri Jan 14, 2005 12:30 am    Post subject:

FnKey

Dell 700m supports FnKeys for users' convinience, most of them work out of box, except:
Fn + Esc: Standby
Fn + F5: Mute
Fn + F6: VolumnDown
Fn + F7: VolumnUp
Fn + F11: PrintScrn/ SysRq

Here is a small program, ESE Key Daemon, that supports multi-media keyboard, I just hacked a small patch to make it run more "gentoo-like":

Here is the patch :
>>>>>>>>>>>> CUT FROM HERE >>>>>>>>>>>>>>>>>
Code:

*** esekeyd-1.2.1/src/esekeyd.c 2004-05-15 05:43:34.000000000 -0400
--- esekeyd-1.2.1-gentoo/src/esekeyd.c 2005-01-16 19:18:23.598101776 -0500
***************
*** 12,19 ****
--- 12,28 ----
   * Released under the GNU Public License.
   */
 
  #include "esekey.h"
+ #include<signal.h>
+
+ FILE *funkey = NULL;
+ const char PID_FILE[] = "/var/run/esekeyd.pid";
+
+ void cleanup();
+ void HandleSignals();
+ void CatchSignal(int x);
+
 
  int
  main (int argc, char *argv[])
  {
***************
*** 21,33 ****
    char device_name[strlen (EVENT_DEVICE)] = { 0 };
    unsigned int keycount = 0;
    struct esekey *keys = NULL;
    unsigned int i = 0;
!   FILE *funkey = NULL;
    char *key = NULL;
    struct input_event ev;
 
!   printf ("%s\n", PACKAGE_STRING);
 
    if (argc < 2)
      {
        printf ("\nUsage:\n");
--- 30,64 ----
    char device_name[strlen (EVENT_DEVICE)] = { 0 };
    unsigned int keycount = 0;
    struct esekey *keys = NULL;
    unsigned int i = 0;
!
    char *key = NULL;
    struct input_event ev;
 
!   FILE* str;
!   pid_t pid;
!
!
!   /* check to see if a copy of ESE Key Daemon is already running */
!   
!   if (!access(PID_FILE, R_OK))
!   {
!     if ((str = fopen(PID_FILE, "r" )))
!     {
!       fscanf(str, "%d", &pid);
!       fclose(str);
!
!       if (kill(pid, SIGUSR1)==0)
!       {
!         fprintf(stderr, "esekeyd: alread running as process %d.\n", pid);
!  exit(1);
!       }
!
!       unlink(PID_FILE);
!     }
!   }
!
 
    if (argc < 2)
      {
        printf ("\nUsage:\n");
***************
*** 136,144 ****
    fclose (stderr);
  #endif
 
  #ifndef DEBUGGER
!   switch (fork ())
      {
      case -1:
        printf ("%s: fork() error", argv[0]);
        exit (-3);
--- 167,175 ----
    fclose (stderr);
  #endif
 
  #ifndef DEBUGGER
!   switch (pid = fork ())
      {
      case -1:
        printf ("%s: fork() error", argv[0]);
        exit (-3);
***************
*** 141,155 ****
--- 172,200 ----
      {
      case -1:
        printf ("%s: fork() error", argv[0]);
        exit (-3);
+     
      case 0:
        break;
+     
      default:
+
+  /* create the pid file */
+  if ((str = fopen(PID_FILE, "w")))
+  {
+   fprintf(str, "%d\n", pid);
+   fclose(str);
+  }
+  else
+   fprintf(stderr, "Fail to create %s", PID_FILE);

        exit (0);
      }
  #endif
 
+   HandleSignals();
+
    openlog ("esekeyd", LOG_PID, LOG_DAEMON);
    syslog (LOG_NOTICE, "started key daemon for %s", device_name);
 
    while (fread (&ev, sizeof (struct input_event), 1, funkey))
***************
*** 173,183 ****
   }
 
      }
 
    closelog ();
 
!   fclose (funkey);
 
!   return 0;
 
  }
--- 218,259 ----
   }
 
      }
 
+   cleanup();
+
+   return 0;
+
+ }
+
+ void cleanup()
+ {
   closelog ();
+  fclose(funkey);
+  unlink(PID_FILE);
+ }
 
! void HandleSignals(void)
! {
!  signal(SIGHUP, CatchSignal);
!  signal(SIGINT, CatchSignal);
!  signal(SIGQUIT, CatchSignal);
!  signal(SIGILL, CatchSignal);
!  signal(SIGTRAP, CatchSignal);
!  signal(SIGABRT, CatchSignal);
!  signal(SIGIOT, CatchSignal);
!  signal(SIGFPE, CatchSignal);
!  signal(SIGKILL, CatchSignal);
!  signal(SIGSEGV, CatchSignal);
!  signal(SIGPIPE, CatchSignal);
!  signal(SIGTERM, CatchSignal);
!  signal(SIGSTOP, CatchSignal);
!  signal(SIGUSR1, SIG_IGN);
 
!  return;
! }
 
+ void CatchSignal(int x)
+ {
+  fprintf(stderr, "dispswitch: caught signal %d, cleaning up...\n", x);
+  cleanup();
  }

<<<<<<<<<<<< CUT ENDS HERE <<<<<<<<<<<<<<<<<
To apply this patch:
Code:

% cd esekeyd-1.2.1/src
% patch esekeyd.c  path/to/the/patch

% config --prefix=/usr/local
% make
% su
% make install


Then we need to create /etc/init.d/esekeyd and /etc/esekeyd.conf:
Code:

bookstack@getnoo esekeyd-1.2.1 $ cat /etc/init.d/esekeyd
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

depend() {
       need keymaps
}


start() {

        ebegin "Starting esekeyd"
        /usr/local/sbin/esekeyd /etc/esekeyd.conf /dev/input/event0
        eend $?
}

stop() {
        ebegin "Stopping esekeyd"
        if [ -e /var/run/esekeyd.pid ] ; then
                local pid="$(</var/run/esekeyd.pid)"
                kill $ >& /dev/null
                eend $? "Could not kill pid '$'"
        else
                eend 1 "Lost pid file :("
        fi
}




Code:

bookstack@getnoo / $ cat /etc/esekeyd.conf
#
# ESE Key Deamon 1.2.1 config file
#
#
# example: to run mutt in xterm we must set DISPLAY
#          so the command line will be as follows:
#MAIL:/bin/sh -c "DISPLAY=:0 xterm -e mutt"
#

SLEEP: /usr/sbin/hibernate
MUTE: amixer set PCM toggle
VOLUMEDOWN: amixer set PCM 10%-
VOLUMEUP: amixer set PCM 10%+


Now, you can lauch this daemon like this:
Code:
 # /etc/init.d/esekeyd start

you can also add it to default run-level:
Code:
 # rc-update add esekeyd default


If Fn+Fx are pressed in the console mode, an annoying symbol '~' wil appear, for the sake of sanity, we need to add the following keymap to the system:
Code:

bookstack@getnoo bookstack $ zcat /usr/share/keymaps/i386/include/fnkey.map.gz
keycode 113 = nul
keycode 114 = nul
keycode 115 = nul
keycode 223 = nul


And add the following lines to /etc/rc.conf:
Code:
EXTENDED_KEYMAPS=fnkey


The above Fn keys work well in both console and X, Fn+F11 needs more tricks, I will take care of that later.


Last edited by bookstack on Sun Jan 16, 2005 9:00 pm; edited 7 times in total
Back to top
bookstack
Tux's lil' helper



Joined: 27 Feb 2004
Posts: 129

Posted: Fri Jan 14, 2005 12:30 am    Post subject:

Video

[TODO]
In Dell 700m specification, this machince can be configured as 64 MB shared video memory. Anybody knows HOW?

Framebuffer and Gensplash
Please refer to this post:
For Dell 700m users, we can use vesafb, vesafb-tng, intelfb or i810fb as well,
Code:

<M> Intel 810/815 support (EXPERIMENTAL)
<M> Intel 830M/845G/852GM/855GM/865G support (EXPERIMENTAL)   


And enable them when booting:
Code:

# cat /boot/grub/grub.conf
root@getnoo bookstack # cat /boot/grub/grub.conf
splashimage=(hd0,0)/grub/gentoo.xpm.gz

# Default kernel
title Gentoo 2.6.10-nitro4-unicon
root (hd0,0)
kernel /kernel-2.6.10-nitro4-unicon root=/dev/hda3  resume2=swap:/dev/hda2 video=intelfb:ywrap,mtrr,1024x768-24@75 vga=0x317 splash=verbose,theme:emergence
initrd (hd0,0)/boot/fbsplash-emergence-1024x768


If MPlayer is emerged with USE="directfb", we can play video in console mode:
Code:
mplayer -vo fbdev (or fbdev2 or directfb) foo.avi

[TODO]
However, I can not zoom the video to full screen. So it is with "links2 -g", any suggestion ?

X
We need run 855resolution before X server lauch.
Code:

# cp ./855resolution /usr/local/sbin
% cat /etc/conf.d/local.start
#Tweak the 855GM resolution
/usr/local/sbin/855resolution 4d 1280 800 1>&2 > /dev/null


Since the VBIOS tweak would take effect until power off, so we need to add "RestartServices alsasound local " to /etc/hibernate/hibernate.conf.

Here is the section of xorg.conf
Code:

Section "Device"
    Identifier  "ExtremeGraphics2"
    Driver      "i810"
    #VideoRam    16384
    # Insert Clocks lines here if appropriate
EndSection
Section "Screen"
    Identifier  "Screen 1"
    Device      "ExtremeGraphics2"
    Monitor     "LCD"
    DefaultDepth  24

    Subsection "Display"
        Depth       24
        Modes       "1280x800"
        ViewPort    0 0
    EndSubsection
EndSection

Section "Monitor"
     Identifier  "LCD"
      HorizSync   31.5 - 79.0
     VertRefresh 50-100
     Option  "DPMS"
     Modeline "1280x800" 101.92 1280 1312 1696 1728 800 816 825 841
 EndSection

Section "ServerLayout"
    Screen "Screen 1"
    InputDevice "Keyboard1" "CoreKeyboard"
    InputDevice "TouchPad"  "USBMouse"
    Option "OffTime"            "20"
    Option "StandbyTime"        "5"
    Option "SuspendTime"        "10"
EndSection

Section "DRI"
    Mode 0666
EndSection


[TODO]
How to enhance the performance of X server ?
The DRI is enabled, but score of glxgears is so poor:
Code:

3330 frames in 5.0 seconds = 666.000 FPS # small window
344 frames in 5.0 seconds = 68.800 FPS    # Full screen


Any suggestions ?


Last edited by bookstack on Wed Jan 19, 2005 12:50 pm; edited 7 times in total
Back to top
bookstack
Tux's lil' helper



Joined: 27 Feb 2004
Posts: 129

Posted: Fri Jan 14, 2005 12:31 am    Post subject:

Audio
Just follow this guide , and enable this option in kernel configuration:
Code:

   <M> Intel/SiS/nVidia/AMD/ALi AC97 Controller


and edit /etc/modules.d/alsa:
Code:
alias snd-card-0 snd-intel8x0


Network
Enable this option in kernel configuration:
Code:

 <M>   Broadcom 4400 ethernet support (EXPERIMENTAL)

And add b44 to /etc/modules.autoload/kernel-2.6

Wireless network
Enable this option in kernel configuration:
Code:

  [*] Wireless LAN drivers (non-hamradio) & Wireless Extensions 


Then we need to
Code:
emerge ndiswrapper wireless-tools
. Select the appropriate Windows driver here, then (I use TruMobile 1350):
Code:
 # ndiswrapper -i bcmwl5a.inf

And add ndiswrapper to /etc/modules.autoload/kernel-2.6.

For ipw2210, ipw2200 users, please check ipw2210.sf.net and ipw2200.sf.net for more details.


Last edited by bookstack on Mon Jan 17, 2005 7:52 pm; edited 6 times in total
Back to top
bookstack
Tux's lil' helper



Joined: 27 Feb 2004
Posts: 129

Posted: Fri Jan 14, 2005 12:31 am    Post subject:

CRT out

There are two programs here:
i810switch ( in portage already)
i855crt .

For Dell 700m user, I suggests i855crt, just as the i810swtich developer says:" i855 users who have flickering problems may want to try the i855crt project to see if that works better."

i855crt solves 3 problems that i810switch does not address:
1 i855crt could setup the resolution of CRT.
2 It eliminates flickering. Very interesting, the CRT works much better in higher resolution such as 1280x1024@75 than 640x480@60.
3 It partially gets rid of the white rectangle in the left top corner of CRT screen. Partially means the "swcursor" sometimes works, somtimes not. I'll try cvs version, and report it later.

We can video out in either X or console mode. In fact console mode looks very nice, since the screnn just squeeze from 1280x800 to 1024x768. However, in X mode, we have to make a decision between lost of contens or waster of screen.


TODO:
Anyone knows how to span the screen? For example, I could surf the web in LCD, and watch movie full screen in CRT? Does this video adapter support this feature ?

S-Video out
I could not test this feature right now. I can not afford the S-Video cable(!) and the television so far.

原文转自:http://www.ltesting.net