Linux Laptops Home        

Installing Ubuntu 7.10 (Gutsy) 32 bits on ACER ASPIRE 7520G

Last updated: 02/29/2008

General Hardware Specifications of ACER ASPIRE 7520G:

Hardware Components
Status under Linux
Notes
AMD Turion 64 X2 TL-60 2 GHz Works No special procedure required during installation.
17 WXGA Display Works No special procedure required during installation.
NVidia GeForce 8600M GS Works chosen non free driver but works out of the box
2048MB, DDR2, 2 SO-DIMMs Works No special procedure required during installation.
320 GB SATA Hard Drive (2x160GB) Works No special procedure required during installation.
Integrated Network Card Works MAC Address/udev problem, fixed with a custom udev rule, see further
Internal 56k Modem Not detected
ExpressCard extension slot Not tested
DVD double layer Drive Works Burning not tested yet
WiFi 802.11 b/g Works Need the installation of ndiswrapper, see further
Lithium-Ion Battery Works No special procedure required during installation
Memory Card reader 5 in 1 Works No special procedure required during installation
Sound card nVidia MCP67 HDA/Realtek ALC268 Works Realtek for ALSA Sound drivers required
Function keys Work No special procedure required during installation

This laptop is operating under Kernel version ubuntu 2.6.22-14-generic

Basic Installation of Ubuntu 7.10:

Why to use Ubuntu

Ubuntu seems the right distribution to install on a laptop, quickly and painlessly. Actually it's not that straightforward as we can see in the following. Current Version can be downloaded from http://www.ubuntu.com/

Installing

During the initial installation the only real important choice to make was the drive partitionning. Out of the box the laptop has 3 partitions on the first drive, 1 on the second. First drive : I decided to install linux on the 3rd partition from the first disk, keeping Vista and recovery partitions intact. I used 70GB for the root mountpoint, and 4GB for swap. Second disk is mounted as /home. I'm not particularly happy with this partitioning as system will never use 70GB, but I'll deal with that later. The system installs flawlessly, boots right as we expect... We could almost think that everything's fine. But we quickly find out that the wifi is not actually working, that no sound will come out from speakers, that the boot process sometimes hangs after a few seconds, and that the internal ethernet card has a weird behaviour. Alright, some work has to be done.

Getting the Wifi to work

I found plenty of help on the ubuntu forums, particularly here The autor of this post recommends using the wicd program for WiFi connectivity, which I do now. It seems indeed a good solution. Basically the problem is that the WIFI card is detected as an Atheros AR5006EG when it is actually a AR5007EG model, not using the same driver (we can verify with Windows that the card is actually a AR5507EG). lspci gives:
lspci|grep Wireless
05:00.0 Ethernet controller: Atheros Communications, Inc. AR5006EG 802.11 b/g Wireless PCI Express Adapter (rev 01)
So we need to use another driver, using ndiswrapper. I will just copy the procedure from the previously mentionned ubuntu forum post, just to avoid dead link problems. To get ndiswrapper and ar5007 driver type
wget http://wifix.sourceforge.net/software.php?title=ndiswrapper
wget http://blakecmartin.googlepages.com/ar5007eg-32-0.2.tar.gz
Beware: this is the 32 bits version of the driver, use the one suitable for your distribution. Extract the archives
tar xzf ar5007eg-*.tar.gz
tar xzf ndiswrapper-1.51.tar.gz
Make sure that you have the kernel headers and the build essential package.
sudo aptitude update && sudo aptitude install linux-headers-$(uname -r) build-essential
Blacklist the ath_pci kernel module (it doesn't support our chipset).
sudo echo "blacklist ath_pci" >> /etc/modprobe.d/blacklist
Compile
pushd ndiswrapper-*/
sudo make uninstall
make
sudo make install
popd
Install the windows driver using ndiswrapper
pushd */ar5007eg/
sudo ndiswrapper -i net5211.inf
popd
Add ndiswrapper to the autoloading list
sudo modprobe ndiswrapper
sudo echo "ndiswrapper" >> /etc/modules

Here is a last quote of the forum post: Q: I can see wireless networks. Why can't connect to any of them? A: There are a couple options to try here. If you're using WICD to connect and WPA encryption, under preferences, make sure that for WPA Supplicant Driver, you're using WEXT (make sure you've installed WPA_Supplicant). If you're using WEP, try putting your key in "double quotes". If you can't connect to an encrypted network, try removing the key to see if that's the problem. If you're not using WICD, try it out; many people have been successful simply after switching the wireless connection manager program to WICD.

Right now, using WICD correctly configured with WPA_SUPPLICANT=WEXT, I can connect to WIFI. :o)

Getting the sound card to work

As for WIFI what follows has been found on ubuntu forums. Like here (in french) or here. As I followed multiple solutions I'm not sure what was decisive in making the sound work with my configuration (hem, I don't feel like installing from scratch again just to make sure). But I installed the modules-backport and the realtek drivers. Alsa sees the card as a Realtek ALC268. I downloaded the Realtek patch for Alsa here and installed it (got version 4.07b). Ensure you have all you need for compiling
sudo apt-get install libncurses5 libncurses5-dev gettext
Untar the driver and compile it using the install script
tar xjf realtek-linux-audiopack-4.07b.tar.bz2
cd realtek-linux-audiopack-4.07b
sudo ./install
I also added to the file /etc/modprobe.d/alsa-base the line
options snd-hda-intel model=acer
You can do it by typing:
sudo echo options snd-hda-intel model=acer >> /etc/modprobe.d/alsa-base
The sound worked only after reboot and only after having installed backports (add "deb http://archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse" to /etc/apt/sources.list and run sudo apt-get update). I must admit I was quite surprised as I had done these changes long before rebooting ;) The sound is good, the speaker are muted when headphones are plugged, everything seems fine.

Getting rid of proliferating eth devices

Here is a strange thing: at startup, linux will detect that the MAC Address of the internal network card is invalid, and chose another one randomly. If you look into the logs with the command dmesg you find something like:
dmesg
...
[    6.576000] 0000:00:0a.0: Invalid Mac address detected: c5:55:5b:88:1b:00
[    6.576000] Please complain to your hardware vendor. Switching to a random MAC.
...

This has the undesired side effect of creating a "new" eth interface at each boot, which can prevent your computer from connecting to the network. In fact, udev will identify a network card by, among other things, its hardware address. As this address change it considers the card a new device every time. The result is that after 5 reboots you have only one wired network device: eth5. It can be a problem with a program that handles the interface, like wicd, or if, as in my office the DHCP admission require a known Hardware Address.

To address that problem we will need to modify the rule udev uses to define the device. Sorry but here you can't just copy/paste procedures, so I give a very little (and not very accurate) explanation about how udev works in this case.

Basically udev is a system that allows you or other programs to handle your devices by giving them filenames. At startup udev scans your system, seeking any device for which to create a special file in /dev directory (or /sys). It will keep in mind some caracteristics of your devices to keep a consistant view of your computer even if you unplug then plug again a device. Udev uses rules to recognise devices, and when it finds a new one, it write a rule applying to this device and saying : "that particular device is and should be from now on called /dev/something". These rules are stored inside files, under the /etc/udev/rules.d/ directory.

Now our problem is that the rule it takes to recognise the onboard LAN device relies on the hardware address, the one that is changing from one boot to another, so it sees the card as a "new one" ans adds a new device every time. We need to indicate udev that it shouldn't rely on this attribute, and find another one that is more relevant in our case.

First, look for information about your device. I use eth* to ask for "any device that begins with eth", because as far as I know I can be at eth42.
udevinfo -a -p /sys/class/net/eth*

  looking at device '/class/net/eth0':
    KERNEL=="eth0"
    SUBSYSTEM=="net"
    DRIVER==""
    ATTR{weight}=="64"
    ATTR{tx_queue_len}=="1000"
    ATTR{flags}=="0x1002"
    ATTR{mtu}=="1500"
    ATTR{operstate}=="down"
    ATTR{broadcast}=="ff:ff:ff:ff:ff:ff"
    ATTR{address}=="00:00:6c:fc:f8:b6"
    ATTR{link_mode}=="0"
    ATTR{type}=="1"
    ATTR{features}=="0x20"
    ATTR{ifindex}=="2"
    ATTR{iflink}=="2"
    ATTR{addr_len}=="6"

  looking at parent device '/devices/pci0000:00/0000:00:0a.0':
    KERNELS=="0000:00:0a.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="forcedeth"
    ATTRS{msi_bus}==""
    ATTRS{broken_parity_status}=="0"
    ATTRS{modalias}=="pci:v000010DEd0000054Csv00001025sd00000126bc02sc00i00"
    ATTRS{local_cpus}=="ff"
    ATTRS{irq}=="19"
    ATTRS{class}=="0x020000"
    ATTRS{subsystem_device}=="0x0126"
    ATTRS{subsystem_vendor}=="0x1025"
    ATTRS{device}=="0x054c"
    ATTRS{vendor}=="0x10de"

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""
    ATTRS{uevent}==""

What we have here is a serie of attributes (ATTRS) with their name under brackets and their value after the == sign. Let's see how rules are made...
more /etc/udev/rules.d/70-persistent-net.rules 
Look for the (maybe numerous) lines:
# PCI device 0x10de:0x054c (forcedeth)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:00:6c:fc:f8:b6", NAME="eth0"

You may have many lines like this one (one per eth device before the current one in fact). Keep in mind that these rules are not mandatory for the PC to work, if you empty the file udev will detect your network card as eth0 at next startup. Notice how the lines are only different by the ATTRS{address} value (and, of course, the number after "eth" in the name, because that's the name udev actually gives the device). The same detection mechanism exists for the wifi card so you can safely delete the only entry corresponding to it. Let's do some cleaning.

Clean the file
sudo echo "" > /etc/udev/rules.d/70-persistent-net.rules
Restart udev for it to fill the file
sudo /etc/init.d/udev restart
Now you can open the file with a text editor
sudo gedit /etc/udev/rules.d/70-persistent-net.rules
Normally udev tries to find a rule in this file that applies to the card, if it doesn't it creates a new device and adds a rule in this file. Here the attribute it looks for is the ATTRS{address}, so we're going to change this criterion. Notice that the comment "#PCI device 0x10de:0x054c (forcedeth)" indicates the vendor an device attributes (ATTRS{vendor}=="0x10de" and ATTRS{device}=="0x054c") followed by the driver name. These attributes are a unique identifier for this device model. Make the line looks like the following (normally the vendor and device values should be the same on the same laptop model, but still, check that you repport the values given by the udevinfo command).
# PCI device 0x10de:0x054c (forcedeth)
SUBSYSTEM=="net", DRIVERS=="?*",  ATTRS{device}=="0x054c",  ATTRS{vendor}=="0x10de", NAME="eth0"
Save the file and close gedit. You can reboot to check if the change works (which is to say, the network card given by ifconfig -a is still eth0). You can even suspend to RAM, then wake up, it also works.

If you need a imutable Ethernet Address

You can even add a command to the udev rule to force the address if you need to.
# PCI device 0x10de:0x054c (forcedeth)
SUBSYSTEM=="net", DRIVERS=="?*",  ATTRS{device}=="0x054c",  ATTRS{vendor}=="0x10de", NAME="eth0", RUN+="/sbin/ifconfig eth0 hw ether 00:00:6c:fc:f8:b6"
Replace the value with the desired hardware address of course. The RUN word indicates that upon detection udev should run the given command. I took the address given by udevinfo in the first place (it was random anyway). Another way of doing it is to add the same command to /etc/rc.local
sudo echo "/sbin/ifconfig eth0 hw ether 00:00:6c:fc:f8:b6" >> /etc/rc.local
Don't do both, once should be enough ;)

Unresolved issues

Well... I can say I don't care ;)

Final notes

I mentioned at the begining of this article a freeze problem at startup. In fact, a freeze sometimes happen after about seven seconds, during HD/CDROM detection, it seems. When it happens, I have to reboot until the startup really begin (which can take 3 to 10 reboots, that's really annoying).

Update: I just installed the BIOS update v1.30 (downloaded from Acer website). It seems that the freeze problem at startup is over, but of course it's a little early to be sure about this. The MAC Address problem is still here, though.

If you found this guide useful and/or have any comment I'd be happy to ear it, you can email me.