I’ve just wasted something like 36 hours of my life updating my Gentoo Linux box. It’s not been fun. This is the tale of me, Xorg 1.5.3, Gentoo, a Matrox G550 and Xinerama.
Meta’s Better
If you don’t know Gentoo it’s a Meta-Distribution of Linux. It’s not for the faint hearted as all the software on your machine is actually compiled there. So the speed of an install or upgrade depends wholly on your machine’s processing power (or network’s via distcc). The faster the processor and environment, the quicker things get installed/updated.
In order to keep updated you need to run a utility called emerge to synchronise your locally kept package database with the network of portage servers. If you get slack, you can get a shock sometimes if large things like KDE or GNOME get updated.
So I got that shock yesterday. I’m usually quite diligent and try and emerge sync two or three times a week but I’ve been that busy lately that I got both barrels of slackness yesterday and had over 250 packages to update. Ouch! So long CPUs for a while.
We’re Off
I set the emerge update running sometime on Tuesday Evening expecting the thing to be complete by the following morning. Unfortunately I’m such a numptie that I logged out of KDE prior to going to bed and that killed off the update. Note to self, run emerges in Screen. I got out of bed on Wednesday and bollocks, only 50 odd had compiled. I started the emerge again and had to put up with a sluggish machine all Wednesday. I upped the niceness level to 15 so that took the edge off a bit.
Nearly there…
Around 4pm on Wednesday the emerge finished. I always run a tool called revdep-rebuild that checks for missing dependencies after an emerge. Sure enough there were 6 packages needing re-emerging so the second run started and didn’t complete until around 8pm, thanks to KOffice Suite. Anyway, all looking good, let’s reboot since some major system libraries got updated, let’s start afresh. Hit reboot and wait.
Uh Oh!
The machine booted fine but X wouldn’t start. Shit. No worries, bit of xorg.conf editing perhaps, check this, check that. Hmmmmm. I then remembered that I’d seen a Gentoo advisory message the other day saying the xorg was due for a major update. Oh dear. The trouble is I run a two screen display, well one screen spread over 2 monitors. When I eventually got X to start I ended up with the same display on each monitor.
Much Googling followed and it turns out that some major changes had been implemented in xorg. The culprits were the relationship between libpciaccess, the mga driver and Xinerama. Between them they should have been detecting the one card two head setup on my Matrox G550 but it wasn’t working. I tried and tried all evening to find a fix, but tiredness took over and I was resigning myself to either downgrading xorg (not fun) or even overwriting Gentoo with a distro running an older version of xorg. Pffft!
New Day, New Head
After a quick visit to the Doctor’s on Thursday morning (M.O.T. check) I sat down and decided to have another go at fixing the bugger. Overwriting was to be the last resort. I fiddled, re-wrote my xorg.conf loads of times, Googled, read as much as I could on the xorg site, tried out a different approach with MergeFB but all to no avail. I had to bite the bullet and kill off Gentoo. Boo-hoo. I even popped to the local Maplins to get some CD-Rs to do the deed.
One last gasp Google at around 3pm led me to this post on the Gentoo Forums. It concerns a patch for the mga driver which can be found here: xorg mga patch.
I unpacked xf86-video-mga-1.4.9.tar.bz2, cd’d to the dir and applied the patch:
tar -jxvf xf86-video-mga-1.4.9.tar.bz2
cd xf86-video-mga-1.4.9
patch < /home/knocker/Desktop/mga-driver-3.patch
./configure
make
make install
The mga_drv.so and .la got installed to /usr/local/lib... rather than /usr/lib/xorg/modules/drivers/ so I just copied them to the right place. Restart X, still no joy. Arrrggghhh.
Hurrah
The Gentoo Forum link above also directs you to a bug report so I copied an xorg.conf from there, customising it for myself.
I installed it, restarted X and..... BLAMM! Success! One screen over 2 monitors.
How happy was I. A lot. Which is a bit nerdy but what the heck! I'm typing this out on my restored Xinerama enable KDE screen on xorg 1.5.3 and life's split screen happiness once again.
I've copied my stripped back xorg.conf file and patch file to my file server in case things go missing on other sites. They are here together with the links from above:
- Original Gentoo Post
- Bug Report at LaunchPad with xorg.conf
- Mga driver patch
- Same patch on my site
- My working xorg.conf
I suppose things will go tits up again on the next upgrade but at least I'm ready for it next time. I may have to mask further updates of xorg for the time being.
No matter what, I hope this entry saves someone else a bit of time.
Creds to the following:
Oh what a bugger. I've seen applications regress but not usually drivers. iwouldn't have thought to look their too. The thing I do like about Gentoo is once you got a good system going, it stays that way.
I know, Gentoo has been my distro of choice for a long time now. I have dallied with Fedora and Ubuntu but I always come back to Gentoo.
The good news is that 3 days after writing this post, X is still running happily. Phew!
[...] my debacle with xorg the other day you’d think I’d leave fiddling with stuff alone for a while. Oh no, not [...]