Exactly how one goes about building .so files* isn’t widely understood, and the documentation on it is overcomplicated IMHO. So, I figure the web needs a tutorial demonstrating how to build an extremely simple .so file. Et voilà, here’s a step by step guide for building a .so file on Linux or a similarly flavored Unix using a GNU-compatible toolchain.
The contents of that file?
I don’t have unattended upgrades enabled on my Ubuntu laptop. Nevertheless, there’s something which goes around and replaces files in /var/lib/apt with whatever junk it gets from whatever network it happens to be connected to at random times. Can I be the only person who thinks this is a Really Bad Idea?
One of the common use cases for laptops is to plug into an external display at a docking station or with a projector, and unplug and use the internal display, then plug into another external display, then later back to the internal display, and keep on cycling like this. Unfortunately, Linux distributions haven’t supported switching displays very easily.
Enter disper to save the day. This is a command-line (and so easily scriptable) tool to switch the display in use. For example, to make only the internal display active, run disper -s. For only the external display, disper -S. And to toggle between them, disper --cycle-stages='-s:-S' -C. So when I want to bind one of the special laptop function keys to alternate between external-display-active-only and internal-display-active-only in Gnome, I run gnome-keybinding-properties, add a custom shortcut to run disper --cycle-stages=-s:-S -C, and bind that to XF86LaunchA. Voilà, with one keypress I can switch between the laptop’s screen and the projector. Other flags to disper let you activate both displays, etc.
I switched to OpenSuSE tonight.
PCLinuxOS had been grating on me for the last few months, since they decided to drop most of their man pages in favor of entering “man foo” into Google. But after an ordinary update, tonight I discovered that the new kernel hung on boot. To my distress, GRUB didn’t list any previous kernels when I intercepted its autoboot. After trying and failing to get grub to show me any files on the filesystem so I could select another kernel from /boot to boot from (why is this so hard?), I booted from a rescue disk… and discovered that there was only one kernel version in /boot, PCLinuxOS had been deleting the previous versions. This bad practice dismayed me, it’s standard for distributions to keep the previous one or two kernels around, in case of a case like this, where a kernel that doesn’t boot on someone’s hardware get pushed.
I’d been meaning to try out SuSE again for a while, and this pushed me over. I backed up my disk and did a clean install.
We’ll see how the new distribution goes.
So, I just upgraded Easy Peasy on my Eee. And surprise, surprise, it broke WiFi again.
Fortunately, there’s a user-contributed fix available, like the other times this has happened!
Unfortunately, the maintainers aren’t adopting it, also just like the other times!
This is a distribution targeting one specific line of netbooks, and in every version of it, WiFi doesn’t work. Scrapheap time for Easy Peasy.
Play around with apt-get, to see if I can get an older version from apt — uh oh, apt-get says floating point exception when invoked. Grab a Mandriva RPM from the net, give it to rpm — rpm dies with floating point exception. No problem, I’ll install the files by hand, just extract them with rpm2cpio — which hits a floating point exception.
Finally, I wise up, scp libgcc1_s.so.1 from a Debian system.
And everything is working again, at least enough to tide me over until PCLinuxOS fixes the libgcc1 package. If anyone else is stuck by this, the libgcc I used is here.
So, I’ve done a bunch of upgrades to my systems lately. After Ubuntu broke my X again somehow going from Intrepid to Jaunty (this time not recognizing my input devices), I switched over to PCLinuxOS (2009.2). I’m still getting used to it. The apt-rpm stuff seems to work well, and stuff I had to fight to get going in Ubuntu, like flashplayer and xmms, just work. Java actually runs, and there’s a desktop link to the magic for getting OpenOffice working. On the other hand, the package repository feels a lot smaller, not having programs I’ve long used like calc, ccrypt, dict, and procmeter.
WordPress had a series of security vulnerabilities, so I’ve updated to the latest version. As a plus, it finally knows about the system’s timezone database, so is no longer the only program you have to adjust an hour whenever daylight savings starts or stops. The WordPress upgrade process is getting easier, manual editing of the mysql db no longer needed. Hopefully one of these days they’ll simplify it down to “apt-get upgrade”-level, and it can keep itself up to date the same way everything else does.
I also upgraded the Easy Peasy (formerly known as Ubuntu Eee) install on my EeePC. I can’t speak about the install problems I noted in my last post on Easy Peasy, but most of the runtime problems seem to have been fixed — except the inability to turn the WiFi on! Another user put together a fix in February, but unincorporated by the maintainers. I find this bug just as staggering to find today as I did last December. How can this still not work out of the box after all this time?
I just upgraded my Ubuntu install from Hardy to Intrepid. (Jaunty was recently released, so I expected Intrepid to be very smooth by now.) Instead, I got the worst upgrade experience I’ve ever had with Ubuntu, by far.
First, X didn’t come up, leaving me staring at the console login after reboot. Checking Xorg.0.log, it said something about RgbPath being an illegal directive. Looking at the changes the updater had made to the xorg.conf file, it hadn’t done anything about that line. I tried replacing the updater-edited version with the one from Hardy, still choked on RgbPath. I removed the RgbPath directive, and now it aborted on ‘Module "type1"’. At this point I remember an LWN article about how recent X servers tried to autodetect everything and do the right thing if there were no xorg.conf file, so I moved it out of the way, started X, and huzzah, it worked.
Next, trying to do anything with the package manager errored out and I had a bunch of unconfigured packages. This turned out to be due to the preinstall script for openjdk-6-jre-headless consistently crashing (incidentally producing a multi-page error message containing an unsymbolized stack trace and a memory mapping dump, guaranteed to scare away non-developers), and a bunch of packages depending on openjdk-6-jre-headless, particularly OpenOffice. Uninstalling openjdk-6-jre-headless (and scrapping OpenOffice in the process) got my system back to a state where the package manager was happy.
I consider these two problems each a major lose. Intrepid’s Xorg doesn’t work with Hardy’s xorg.conf, and the update manager doesn’t fix it up. To fix it you have to either edit xorg.conf or know a not-well-publicized feature of Xorg. To even start diagnosing you have to know about Xorg.0.log and how to start the X server. Ubuntu is supposed to be targeting people who aren’t comfortable with a command line, and here it is dumping them at one after the upgrade without a map! And due to the second problem, I now don’t have OpenOffice on my system (though I do prefer AbiWord and Gnumeric, so that’s not as great a loss for me as for some).