# HOWTO: Fix svgalib on x86 with vanilla-sources > 2.6.23

## radio_flyer

This is a quick HOWTO I'm writing for the sake of the handful of us who still seem to be running stable x86 systems.

When kernel 2.6.23.9 went stable on x86, the svgalib library broke. You may have noticed this when 'module-rebuild' failed after you installed the new kernel. There is a bug report filed for this problem:

[url]

https://bugs.gentoo.org/show_bug.cgi?id=195632

[/url]

and a working patch has been posted, but there's been no action to move this into the portage tree for over a month. Given the silence, I can only presume it impacts just the handful of users running x86. In any case, the bug report describes how to make svgalib compile, but not in any detail. Here's the details:

Make sure you have portage overlays enabled in /etc/make.conf.

In your overlay directory (usually /usr/local/portage) mkdir media-libs to make a media-libs directory if it doesn't already exist.

In /usr/local/portage/media-libs, do 'cp -R /usr/portage/media-libs/svgalib/ .' to copy the svgalib ebuild to the overlay directory.

Copy the unified patch available from the bug report to a file in the svgalib/files directory, something like 'svgalib-1.9.25-kernel2.6.23.patch'.

Edit the patch file and remove the './work/' part from the diff lines (--- and +++).

Now edit svgalib-1.9.25.ebuild and add the following lines in the src_unpack() function:

```

    # Fix API change  with >= 2.6.23 kernel

    epatch "${FILESDIR}"/${PN}-1.9.25-kernel2.6.23.patch

```

Run 'ebuild svgalib-1.9.25.ebuild digest' to create a good manifest.

You should now be able to run 'module-rebuild rebuild'' and svgalib will build correctly.

Unfortunately, I'm not aware of any way for portage to let you know if and when the bug is fixed and the patch makes it to the mirrors, so this overlay will remain in effect until the version/revision of svgalib bumps beyond it.

----------

## rbergen

Thanks for this! It's clear and works like a charm!

And you're right, what am I doing using an x86? I guess I always knew I should have bought that hppa...

----------

## rickj

Works perfectly for me using kernel 2.6.23-gentoo-r3.

Thanks.

----------

## jcat

+1 for 2.6.23-gentoo-r3    :Cool: 

Cheers,

jcat

----------

