Installing Ubuntu 7.04 on a HP 510 laptop computer

I’ve just finished installing Ubuntu on the HP 510 laptop. It’s a very cheap machine – I got it for 4000 NOK (I believe it’s priced around 400$ in the US).

Installing off the Live CD, I was a bit annoyed that Ubuntu couldn’t resize the existing XP partitions, but considering that they are NTFS I shouldn’t be surprised, I guess. Being able to dualboot isn’t that important for this machine, so I used the entire disk for Ubuntu.

The out of the box-install has a few problems, namely:

– The display runs at 1024×768 and not 1280×800
– The trackpad doesn’t work
– The WiFi apparently doesn’t work

FIXING THE SCREEN RESOLUTION
I found this solution at this website: Alik’s site on how to fix the issue with Ubuntu 6.10 and a HP 500 laptop. I found that I could skip a step from his howto, so that I only needed to do the following on the command line:

Update the software:

sudo aptitude update

Install 915resolution utility:

sudo aptitude install 915resolution

after installation is finished, you need to set 915resolution tool:

sudo gedit /etc/default/915resolution

Change the following values in the file:

MODE=auto
XRESO=1280
YRESO=800
BIT=

Save the file, close the program and reboot the computer. The resolution should be the correct one.

FIXING THE TRACKPAD
These instructions are also from Alik’s site on how to fix the issue with Ubuntu 6.10 and a HP 500 laptop (well done, mate!).
To fix this, we have to download the latest kernel source code, make a tiny change in it, and compile a new kernel. (This sounds scary, but is actually easy, although more time-consuming than I would have thought.)

First, get the kernel source:
sudo aptitude install linux-source-[you get latest source code using TAB key]

The version I got was 2.6.20.
Now, we want to unzip (untar) it.

cd /usr/src/
sudo tar -xvjf linux-source-[your kernel version]

After this command you will have source codes in /usr/src/linux-source-[your kernel version] directory. We will now make a small change in the source code of the keyboard/mouse driver.

sudo gedit linux-source-2.6.17/drivers/input/serio/i8042.c

In the 2.6.20 source, the line you will add is at line 576. If you get a newer kernel, the function we are changing might have moved/changed slightly. Search the file for i8042_check_aux(void) if you can’t see it. Make an empty line and write

return 0;

See the screenshot if you are uncertain:

Screenshot of the kernel function

Now we have to get all the software we need to compile a kernel. Run the following commands:

sudo aptitude install build-essential
sudo aptitude install bin86
sudo aptitude install kernel-package
sudo aptitude install gcc
sudo aptitude install gcc-3.4
sudo aptitude install libncurses5
sudo aptitude install libncurses5-dev
sudo aptitude install libqt3-headers
sudo aptitude install libqt3-mt-dev

Now, we want to move into the directory where the kernel is untar/unzipped to, and start making it.

cd linux-source-[your kernel version]

sudo make xconfig

Alik has some suggestions to changes you can make in the QCONF graphical tool. These can be found in the Processor type and features section, and are:

disable Symmetric multi-processor support
select Pentium M processor family
disable Generic x86 support
enable Local APIC support on uniprocessors
enable IO-APIC suport on uniprocessor
disable Toshiba + Dell laptop support
disable Enable X86 board specific fixups for reboot
disable /dev/cpu/microcode – Intel IA32 CPU
Hight memory support – set to OFF
set Timer frequency to 1000Hz
disable kexec system call

Select Save from the File menu and quit QCONF.
Now we can make the kernel:

sudo make-kpkg clean
sudo make-kpkg --initrd --stem linux --revision=hp510.1.0 kernel_image

This will take quite a while. I didn’t pay too much attention while it compiled, but I think it took at least 10 -15 minutes.
Then, we have to decompress the kernel, so that it will be found at boot (the linux-image name below will vary depending on the kernel version you are using):

cd ..
sudo dpkg -i linux-image-2.6.20.3-ubuntu1_hp510.1.0_i386.deb
sudo reboot

When rebooting and entering the GRUB boot menu, you will notice that you have a new choice, ending with -ubuntu1. This was automatically selected for me. The trackpad should now work.

Note: Fixing this by modifying the kernel obviously means that a new kernel might re-introduce the problem. Unless the new kernel fixes the underlying issue (which we are merely avoiding by exiting this function), we will have to modify the kernel again. Thus, this is not an ideal solution. Béranger pointed this out and suggested to pass the i8042.noaux parameter to the kernel instead; unfortunately, I wasn’t able to make this work.

FIXING THE WIFI
There are two different issues causing WiFi problems. First, the DHCP appears to be not working, so the IP address must be set manually. This can be done in the System -> Administration -> Network window. Double-click on the WiFi connection, enter the password and add an appropriate IP address (ie, if the IP address of your router is 192.168.0.1, you could use 192.168.0.123 and set 192.168.0.1 as the gateway address).

The second is that after creating a new kernel (above), the new kernel cannot find the firmware required by the WiFi card. The kernel goes looking for it in /lib/firmware/[kernel-name]. Thus, we create a symlink from the new kernel name to the firmware we already have (in the old kernel’s FW directory).


cd /lib/firmware
ln -s 2.6.20-8-generic 2.6.20-ubuntu1hp510

The second part of the last command must correspond to your kernel name and version. If you have kernel 2.6.21, that should be reflected.

FINALLY…
A big, big, big thank you to Alki and his website on the HP 500 and Ubuntu 6.10 as well as the people on this thread on the trackpad, wifi and resolution issues over at the Ubuntu forums. Also, thanks to Hexen for the extra googleability. It is a pity that we still do not have complete out of the box functionality, but thanks to the community, it is possible to get pretty close to 100% when you put in some work :)

PS: Here is a short review of the HP 510.

14 Responses to “Installing Ubuntu 7.04 on a HP 510 laptop computer”

  1. gashaw Says:

    It is perfect!!!

    After I follow these steps of yours, I found my touchpad working.

    That is great. Thank you

  2. A brief review of the HP 510 laptop « Are about everything Says:

    […] Are about everything Discussing topics I’m passionate about « Installing Ubuntu 7.04 on a HP 510 laptop computer […]

  3. Cornish Says:

    Don’t beat yourself up over the trackpad not working. The trackpad on my sister-in-law’s HP 510 stopped working after she plugged in an USB mouse – and that’s with pre-installed Windows! Not working means it’s dead, even without the USB mouse connected-

  4. winnie pooh Says:

    does it works for kubuntu 7.04 too?

  5. liam Says:

    any chance of an update for ubuntu 7.10 ? screen res is correct automatically, trackpad works, wifi will only connect to my wireless router, but not internet?, screen flickers a bit too much when starting up, mine is running 7.04 again, flawlessley, with beryl, so i think ill leave it be for the moment :)

  6. Mark Says:

    I installed Gutsy just fine on my 510. Wireless works just fine.
    The only issue I have is with Desktop Effects turned on, some of the title bars on newly opened windows are placed under to top gnome panel.
    Using ALT+right mouse click the window can be dragged out from under the gnome panel, but it’s blooming annoying….

  7. Mark Says:

    Just found another issue. HP 510 goes into suspend OK, but when it comes out of suspend, there is a bubble in the lower right corner of the screen, saying that the machine failed to go into into/come out of suspend and then the whole machine locks up… It all worked fine under Feisty…

  8. Vlatko Says:

    Man this was totally great!!! It helped me with all of the issues and all of them worked fantastic on Fiesty. Thanks a lot!!!

  9. Are Wold Says:

    Thanks very much for commenting!

    The HP 510 is no longer in my possession, so unfortunately I don’t have any experience with more recent versions of Ubuntu.

  10. Militaria Says:

    Fajna stronka, dodalem ja sobie do ulubionych, bede tu zagladal czesciej, pozdrawiam

  11. Runescape Hacks Says:

    I was almostcouldnt speak English before, but thanks to posts like yours get a B! (Which is very awesome for me :), and yes I live in Sweden -rolleyes-) And btw, if you want to check my english writings could you please come to my webpage Runescape Hacks

  12. Runescape Hacks Says:

    The resolution was killing me. Thanks for the guide and thanks to Alik.

  13. Thermal Imaging Says:

    wireless routers are very necessary nowadays because we do not want so many wires running around the home ;-~

  14. HP510 Says:

    I’ve tried a few linux distros on the HP510 including the latest Ubuntu 10.04.1 and they all seem to have the same issue: headphone jack sense does not work and all the crude workarounds don’t appear to work either, the only way is to go into settings and manually lower the sound every time you want to use the headphones.

    So if anyone knows of a definitive tested solution feel free to post it as a reply here.

Leave a comment