Grub the hardware killer

The latest annoyance: if I stay in the GRUB boot menu for too long my notebook overheats and then shuts down to try to avoid damages.
It happens ONLY in GRUB and only if I go from GRUB to a textonly tool (eg. memtest86).

In every other case such as staying at the POST screen, entering BIOS, selecting the boot device, booting Linux or XP, whatever is malfunctioning at the GRUB boot menu gets initialised properly and the problem does not show up.

I love FOSS so much, you can also choose how to kill your hardware.

Posted in Living with Linux | Tagged , , , , | Leave a comment

When innovation breaks things.

Ubuntu 10.04, Fedora 13 and other Linux distros embraced the latest graphic related innovation: KMS (kernel mode setting).

KMS, with DRM and DRI/DRI2, should bring everyone a more pleasant desktop experience, allowing the kernel to switch resolution at boot, eliminating the artifacts typical of the resolution changes managed by X. As a bonus since the framebuffer gets managed as well you also get nice 132 columns wide TTYs and some additional perks when using OpenGL.

This of course is a blatant simplification. The overall idea anyway is that there are different software layers that need to play together to have everything working properly.

Unfortunately this is what happens to me when KMS is on:

ATI Radeon X1300 + Intel 3945abg + Kernel 2.6.32.24
Fatal disconnection (bug 564376)

ATI Radeon X1300 + Intel 3945abg + Kernel 2.6.33.6
Disconnections are handled gracefully reloading the WiFi card’s firmware, but the screen goes out of sync from time to time

ATI Radeon X1300 + Intel 3945abg + Kernel 2.6.34
disconnection happens, network manager handles automatic reconnection, but again the screen goes out of sync from time to time.

Some experience more severe corruptions (with several kernel versions), others just the display going out of sync.

Examples: here here here here here.

So for now it seems that you need to choose stable WiFi / screen image (KMS off) OR 3D graphics + multi-player games (KMS on).
Again without KMS you also kiss framebuffer goodbye and this could prevent your game from running. With KMS you have framebuffer back, but WiFi (or display refresh rate) could be broken for you so your games will not last for very long.

Will these annoyances be fixed without the risk that a change in any of the above-mentioned components screws things up by accident again?
Because reading the various bug reports, and seeing what happens with different distros/kernels, I have the feeling that things get fixed “by accident” without all the people involved knowing why.

Unfortunately this situation seems quite widespread: there are no video cards unaffected, there are no video cards with good bug-free non-binary drivers, the list of WiFi card with good drivers seems pretty slim as well (according to Dan Williams).

Posted in Living with Linux | Tagged , , , , , , , | Leave a comment

I just wanted some 3D acceleration within VMware…

I have just spent the past 5 hours fiddling with Ubuntu 10.04, ATI X1300 FOSS OpenGL drivers and VMware Player 3.1.0 build 261024.

All I wanted was to launch a Windows XP SP3 VM, run the damn dxdiag and smile like an idiot at the spinning cube test. It was not possible.

The errors “Required extension GL_EXT_framebuffer_object is missing” or “Required extension GL_EXT_texture_compression_s3tc is missing” in vmware.log clearly mean that in order to enable 3D acceleration VMware needs the following OpenGL extensions enabled:

GL_EXT_framebuffer_object
GL_EXT_texture_compression_s3tc

Ubuntu Lucid Lynx comes with Mesa3D (or libgl1-mesa-glx if you prefer) 7.7.1 that is supposed to expose both extensions, but I was not that lucky.

Asking Google I was able to enable the second extension: just install driconf (sudo apt-get install driconf), launch it from System/Preferences/3D Acceleration and force “S3TC Texture Compression …” under the “Image Quality” tab to “yes”.

In order to enable/expose GL_EXT_framebuffer_object, I tried to install libgl1-mesa-swx11 and I was happy to see the extension appearing in glxinfo’s output. Unfortunately I did not realise that this is a software rendered, therefore I was missing DRI and the ability to enable S3 Texture Compression.

So I have decided to try the new Gallium 3D drivers 0.4 R300g. After fiddling with PPAs, installing a ton of updates and rebooting (re-enabling modeset in grub) I had GL_EXT_framebuffer_object back, but I was not able to use driconf anymore (hell yeah).

According to Gallium’s support forum at the moment it is not possible to enable S3TC at will, maybe in the next months it will be possible (but there are some patent issues) but for now you just can’t.

Then it came to my mind the reason why I did disable kernel mode set in the first place…

The combination of Radeon X1300, Intel 3945abg and mode setting is bad, because it leads to frequent disconnections (probably because of an IRQ conflict, but it is not clear if it is confirmed or not).

Luckily enough there is a workaround: just set in grub’s configuration the kernel parameter “radeon.modeset=0” and the disconnections will be gone forever. Together with GL_EXT_framebuffer_object, yeah!!!

Anyway I did a rollback towards the original Mesa 7.7.1 drivers, keeping kernel mode setting enabled and using driconf to enable S3 Texture Compression.

After 5 hours I had everything VMware needed to run with 3D acceleration turned on.

I was happy for 5 or 6 minutes top, just the time to realise that dxdiag was crashing (even during the directdraw tests) with VMware Player just exiting in a POOF. I tried to limit the virtual SVGA memory and to disable its off-screen memory, without luck: the bastard still crashes.

Funny thing is that I can smile at the spinning cube test on my Mac thanks to its craptastic Intel GMA950.
Maybe I will be able to do it using Linux in a couple of years if and when Gallium3D/VMware player will show some improvements.

Edit:
Some more info about fixing DirectDraw.

If the full screen DirectDraw testing is failing on you (with or without 3D acceleration enabled) either with VMware crashing or DXdiag throwing the following:

DirectDraw test results: Failure at step 20 (Colorfill to back buffer): HRESULT = 0x887601c2 (error code)

Insert in the virtual machine .vmx definition file this string:

svga.noOffscreen = “TRUE”

It will slow things down, but your VM/application should not crash anymore when handling DirectDraw.

If you are wondering I am running:
– Ubuntu 10.04 with kernel 2.6.32-24-generic
– ATI Radeon X1300 with Mesa 3D 7.7.1 (libgl1-mesa-glx 7.7.1-1ubuntu3)
– X 2:1.7.6-2ubuntu7.3

About VMware crashing with Direct3D, it could be a bug related to DRI that should be fixed with kernel 2.6.34-something. I will post an update as soon the kernel gets pushed into the repository.

Edit 05/Aug/2010
No joy with Fedora 13 (Kernel 2.6.33.6-147.2.4.fc13.i686, X 1.8.2-3.fc13, Mesa 3D 7.8.1)
No joy with Ubuntu 10.10 alpha 3

Posted in Living with Linux | Tagged , , , , , , , | 2 Comments

Proftpd user login rewrite

Ok, this is the first post.

As I have already explained in the “About” page, I was dealing with systems running Webmin/Virtualmin.

The old system was configured to use a username@domain format “for usernames that include domain”, while the new system was using a username-domain format because of Postfix.

Note that while it is possible to use the username@domain format as well with Postfix, I do not recommend it as it is in my opinion messy. Also at a certain point Webmin 1.5.10 will destroy the mechanism put in place to make it work, so it is not worth it.

Anyway back to the main matter…

I am sure your end users are just like mine, so it is already a challenge for many of them to understand that to access the server they need to append “@something.else” to their names because there are too many Joes in the system.

Now imagine having to explain to these challenged and confused people, that from next week they will need to use a “dash” instead of an “at” after their names: it would be a lost cause.

So instead of wasting your time and energy, the easiest way to handle the situation is to use ProFTPd rewriting rules.

Basically you will ask ProFTPd: to take whatever the user put after the USER command and replace “@” (if any) with ““.

So joe@example.com will magically become joe-example.com. Since the former is not defined anywhere in /etc/passwd/ and /etc/shadow, but the latter is, the user will login even if the username was initially incorrect.

To make it happen, just open /etc/proftpd.conf and add the following:

RewriteEngine on
RewriteMap replace int:replaceall
RewriteLog /var/log/proftpd/rewrite.log
RewriteCondition %m USER
RewriteRule ^(.*) ${replace:/$1/@/-}

The RewriteLog line will turn on the logs for when you need to diagnose any problem that should arise.

Now just reload the configuration:

service proftpd reload

or restart ProFTPd altogether:

service proftpd restart

Now a couple of things to consider: mod_rewrite is a contrib module, it means that you must check if your ProFTPd was compiled with it or not.

To check if it is a built-in module,  just execute:

proftpd -l

To check if mod_rewrite is available as loadable module execute the following:

rpm -q --dump proftpd | grep .so

or just check what you have in /usr/libexec/proftpd/ that is the default location ProFTPd modules are installed under CentOS 5 .

If the module is not there, you are out of luck. Either package your own RPM or find an RPM containing the modules you need already compiled.

Installing something compiled from source would be a bad idea because sooner or later you would break your CentOS installation, anyway theoretically you could just compile ProFTPd and throw away everything but mod_rewrite.so instead of performing also the installation (since you are not going to perform the installation, will skip the part where I tell you how tedius it would be to specify the many, many configure directives you would need in a CentOS environment).

Posted in Migration Project | Tagged , , , , , , , | Leave a comment