Feb
17
I just updated my server to Debian Lenny, which was released on February 14th.
So far, the only issue seems to have been my WordPress installation. I was getting errors in the Apache error log that the wordpress.wp_terms table didn’t exist in the database. I had to manually browse to /wp-admin/upgrade.php to do a database upgrade. After this, everything worked as normal.
So, if you come across a WordPress blog with no posts, no categories, and saying “Nothing to display for this category”, be kind and go /wp-admin/upgrade.php for them and run the database upgrade.
Thanks to this post on Erik Osterman’s blog for pointing out the issue.
Feb
12
Having played with various mencoder options at different times, and with no success, I had a look at converting a standard avi file into an iPod recognisable mp4 again today.
Luckily this time I came across a post to one of the Mplayer mailing lists from someone having similar issues, and a link to “HOWTO batch encode video for iPod under Linux”.
He’s written a tool called podencoder which will encode DVDs and files into iPod mp4 format. After downloading that shell script to a directory in my $PATH, renaming it to podencoder and setting it executable, running
podencoder file.avi
produced file.avi.mp4 which iTunes recognised and was synced with the iPod.
On a related note, why can’t iTunes report back to you when it can’t import a certain file? Even if it gave no reason, just saying “I’m not importing that, now piss off” would be better than nothing.
Anyway, having searched for this type of thing before and coming up blank, maybe another post and link to that site will push it further up the search ratings.
Nov
9
I’ve done 3 upgrades to Debian lenny over the last week or so. I started off with my work desktop, a Dell Optiplex 745, followed by my home desktop AMD64, and finally my MacBook. Apart from some very minor problems, the upgrade went very smoothly, and everything works fine afterwards.
I had no issues upgrading the Optiplex – everything just worked.
On the AMD64, the biggest problem was with the installer for the NVidia binary drivers. It installs the X11 drivers in /usr/X11R6/lib/modules/. For the Xorg version in lenny, these need to reside in /usr/lib/xorg/modules/. The problem was easily found (the Xorg.0.log file pointed to a missing nvidia driver), and easily fixed (dpkg -L xserver-xorg-video-intel showed where the driver files should now reside).
cp /usr/X11R6/lib/modules/drivers/nvidia_drv.so /usr/lib/xorg/modules/drivers/
cp /usr/X11R6/lib/modules/extensions/libglx* /usr/lib/xorg/modules/extensions/
The MacBook upgrade went smoothly aswell, with the usual caveats. My kernel isn’t managed by apt because I apply the mactel patches to it. So, after the dist-upgrade, I got the new kernel sources, applied the latest mactel patches, built the package and installed it. I also built the headers package, and installed that to build and install the madwifi drivers for the atheros wireless card.
apt-get source linux-image-2.6.22-2-686
cd mactel/kernel/mactel-patches-2.6.22
./apply ../../../linux-2.6-2.6.22
cd ../../../linux-2.6-2.6.22
make oldconfig
make-kpkg –initrd linux-image
make-kpkg linux-headers
dpkg -i ../linux-image-*.deb ../linux-headers-*.deb
I rebooted before building and installing the madwifi drivers.
cd /usr/src/modules/madwifi
make -C /lib/modules/2.6.22*/build SUBDIRS=`pwd` modules
make -C /lib/modules/2.6.22*/build SUBDIRS=`pwd` modules_install
modprobe ath_pci
And that’s it. All three machines are running lenny now with no problems.
Aug
20
The latest apt-get update && apt-get upgrade had a kernel update to 2.6.18-5. This kernel is still missing some of the Macbook patches, so I had to get the source, patch and build a package. This took longer than I thought, because a few things had changed. So, here are the bits and pieces that I had to do to get my Macbook back to working the way it had been.
Firstly get the source for this new kernel with apt-get source linux-image-2.6.18-5-686. This downloads the kernel source to a linux-2.6-2.6.21 directory.
If you haven’t already, get the Mactel patches from the Subversion repository at https://mactel-linux.svn.sourceforge.net/svnroot/mactel-linux/trunk; cd into the kernel/mactel-patches-2.6.21/ directory and run ./apply /path/to/linux/source.
At this point, you should configure the kernel. To do this, I used make oldconfig. You can go with the default on most of the new options you’re prompted on I think. The only ones I changed were some of the Apple specific ones. Watch out for them, and decide yourself if you want to include them. I can’t remember off-hand right now what they were.
After building, installing and booting this new kernel, it looked like the harddrive was renamed from sda to hda. However, using hda only got the system to boot a small bit further (this was using a root=/dev/hda3 kernel boot parameter, and changing sda to hda in /etc/fstab). To fix this, in the kernel configuration (I used make menuconfig), do the following
- Under Device drivers, turn off ATA/ATAPI/MFM/RLL Support
- Under Serial ATA (prod) and Parallel ATA (experimental) drivers, set both ATA device support and Intel ESB, ICH, PIIX3, PIIX4, PATA/SATA support to ‘m’ (to build kernel modules instead of compiling support into the kernel)
While you’re configuring the kernel, do the following also, if, like me, you change the order of the F keys and the FN keys.
- Under HID Devices, set Generic HID support to ‘m’ instead of ‘y’
I like the F keys first, so in previous kernels I set pb_fnmode=2 for the usbhid module. However, this option moved to the hid module at some point, but in the default debian kernel build, hid is built into the kernel. I rebuilt it as a module and put
options hid pb_fnmode=2
into /etc/modprobe.d/options. If you have a similar line for usbhid in there already, comment it out.
At this point, you should compile and install your new kernel. The commands below also create a kernel headers package, as well as the kernel image package, which you can skip if you don’t require it.
make-kpkg clean
make-kpkg –initrd kernel-image
make-kpkg kernel-headers
dpkg -i ../linux-image-2.6.21-mactel*
dpkg -i ../linux-headers-2.6.21-mactel*
lilo
I’m using lilo as the bootloader. If you’re using grub, replace the lilo command above with grub-install to update the MBR with the new kernel image.
You can now reboot to the new kernel.
The last thing I can think of is to install the madwifi drivers for the wireless card.
apt-get install madwifi-source
cd /usr/src
tar xjvf madwifi.tar.bz2
cd modules/madwifi
make
make install
This depends on the kernel headers package being installed. If you didn’t create one, or didn’t install it, you can build the modules with
make -C /path/to/linux/source SUBDIRS=`pwd` modules
make -C /path/to/linux/source SUBDIRS=`pwd` modules_install
I think that covers most of what I had to do to get 2.6.21 running.
Jul
24
So, I had a problem with my MacBook – the harddrive failed twice (or, at least, that’s what all the symptoms pointed to). After it failed the second time and I brought it back, the nice Apple tech support guy messed around with it a bit more, and replaced both the drive and the logic board (as he called it). It’s been working fine since, so kudos to them.
Of course, this meant that I had to install Linux on it again. This time, I decided I’d go with Debian, instead of Ubuntu. You’d think there wouldn’t be much difference, but there is.

Last time, I installed Ubuntu from a Dapper CD I had lying around, and upgraded to Feisty in one fell apt-get dist-upgrade. And, of course, this horribly messed up lots. Simple things like icons for certain things went missing, and never came back. Sometimes, when I logged into Gnome, it wouldn’t run my .xmodmaprc and I’d have to do it manually. I swap the ` and \ keys, as they are by default on the MacBook, so that they’re in the usual position. Another minor annoyance, but it’s those types of things that grate on me. The last one which really annoyed me was the Fn key functionality. Basically, I like to have F-keys first and require pressing Fn to get that functionality. So, I passed the necessary option to the necessary kernel module to get this. This enabled Home, End, Pgup and Pgdn on the arrow keys aswell, using the Fn key. But, if I held Fn, Alt and Left Arrow (Home) in Firefox, it didn’t recognise the key as Home, and instead went back a page instead of to the home page.
So, I decided to try Debian on it and see if it fared any better. And it did. I installed from an Etch CD, and nearly everything worked out of the box. The few things that I needed to do were :
- Get the kernel source and apply the mactel kernel patches, build it and install it
- Make sure the appletouch kernel module is loaded before usbhid for the touchpad
- Install madwifi-source and madwifi-tools, and build and install the modules to support the wireless card
- Set up the touchpad for 2-tap right click, and 3-tap middle click, instead of the opposite (which is the default)
- Edit
/etc/default/acpi-support and set ACPI_SLEEP_MODE to standby. This works around an issue I had (have) where, when the power cable is plugged out and the lid is closed and reopened, the computer doesn’t return from its sleep
- Edit
/etc/acpi/events/powerbtn and comment out the action line, so that the script isn’t run. When I press the power button, the Gnome logout dialogue pops up, offering me the choice to logout, power down or reboot. The acpi script shuts the machine down immediately.
All this stuff is explained on the MacBook – Debian Wiki page, so I won’t go into the details of it here. I haven’t even tried getting the iSight camera working yet, because I don’t really have any need for it.
So, I’ve noticed from my web logs that people do end up here on quests for information about Linux, particularly Ubuntu, on MacBook. Well, here’s my advice if you’re here on one of those quests – install Debian Etch! It’s easier, quicker and works perfectly.
May
31
I came across usplash recently as a solution to setting up a custom bootsplash screen. It installed and worked fine, but there didn’t seem to be any way to customise the splash screen. There are plenty of HowTo’s for how to customise it in Ubuntu (like this one) but they didn’t work for Debian.
The reason is that the Debian build doesn’t use a shared library for the bootsplash screen. Instead, it’s compiled in and so will always use the testcard theme.
Changing it is pretty simple though. Firstly,
apt-get install usplash libbogl0 libbogl-dev libgd2-noxpm libgd2-noxpm-dev
apt-get source usplash
I’m presuming you already have ~/bs.png that you want to use for the bootsplash. This should have a 16 colour palette and be of the required resolution.
Next, cd into the usplash source directory and copy your bootsplash image into it.
cd usplash-0.3e
cp ~/bs.png usplash-artwork.png
For this example, I’m setting up a usplash-artwork theme.
Next, use pngtobogl to convert the png image to C code.
pngtobogl usplash-artwork.png >usplash-artwork.c
The easiest way to set up the theme is copy usplash-testcard-theme.c and edit it for your own theme. In this case, you’ll want to search for any occurances of testcard and change it to artwork. Do this with sed, awk or whatever editor you use (which, of course, should be ViM!!). The code you’ll want to change is pretty obvious in the file too. To change the colours, edit the hex values for the palette indexes. Your image should have 16 colours, and each hex value, 0×0 through 0xf, will represent one of those 16 colours. The rest are positions and sizes for the progress bar, text box and text.
Lastly, edit usplash.c and again search and replace testcard with artwork.
sed -e ‘s/testcard/artwork/g’ usplash-testcard-theme.c >usplash-artwork-theme.c
vim usplash-artwork-theme.c
** Edit the palette, progress bar, text box and text details **
vim usplash.c
** Search and replace testcard for artwork **
Now, you’re ready to compile usplash again. Just run make in the source directory. Shortly afterwards, the usplash binary is there. Next thing is to “install” it! As root do
cd /sbin
cp usplash usplash.bak
cp ~/usplash-0.3e/usplash .
update-initramfs -u
This backs up your previous usplash binary, copies in your newly compiled one and updates the kernel’s initrd to contain your newly created bootsplash image.
Lastly, reboot to see the bootsplash screen.
Tip: you can test the image without rebooting by just running your usplash binary as long as X isn’t running. It obviously won’t have any progress bar animation or text, but you’ll get a good idea of how it’ll look during boot.
Edit – 2007-08-13
Two minor updates to this. Firstly, if you run usplash just after compiling, and you get a bogl_init failed message, it’s probably because you’re not using framebuffer support. You’ll need to edit /boot/grub/menu.1st as follows :
# defoptions=quiet splash vga=791
Leave the ‘#’ in place. It’s picked up when you run update-grub and added to the kernel line for each configured kernel. So, update it now with update-grub.
The different options for vga= are :
- 785 – 640×480
- 788 – 800×600
- 791 – 1024×768
- 794 – 1280×1024
The second issue is that when you boot, the bootsplash screen is ended prematurely and a load of the usual boot-text is shown. To fix this, edit /etc/init.d/console-screen.sh and find the text unicode_stop 2> /dev/null|| true and comment it out, so it looks like
#unicode_stop 2> /dev/null|| true
Now your bootsplash screen should run right to the end of boot.
Apr
9
I decided to put some work into getting the advanced features of the touchpad on my MacBook working. These include double and triple tap for middle and right clicking and scrolling using the touchpad.

I started with the instructions on Simon van der Linden’s “MacBook: emulate a Synaptics touchpad with Ubuntu GNU/Linux” page. The patch on the Ubuntu forums is required to support the touchpad. However, even though this supports the touchpad, it’s fairly jittery and difficult to use.
So, next step was to apply another patch from Jason Parekh which helps fix that jitter and improves the multi-tap recognition.
Finally, I tweaked Jason’s patch a small bit, and I find it improved the jitter a bit more. Here’s the complete patch to appletouch.c that I’m using at the moment. With this, I load the appletouch.ko module with
modprobe appletouch tap_threshold=5 track_threshold=1
To do this automatically on boot, put the following into /etc/modprobe.d/options (you may have already put in a similar line from Simon van der Linden’s howto, so just edit it in that case)
install usbhid /sbin/modprobe appletouch tap_threshold=5 track_threshold=1 && sleep 2 && /sbin/modprobe –ignore-install usbhid $CMDLINE_OPTS
I have noticed some issues with slight jitters and when using the scrolling in Firefox. While using Firefox, I’ve noticed phantom clicks, which can get annoying when in the middle of a blog post and the browser’s back button gets mysteriously clicked! What I suspect is that I hit the touchpad and bring up the right-click menu, and I end up hitting the “Back” option there. Other than that, it works well, and I’m sure once I get used to it, I’ll wonder how I ever did without it!
Feb
28
So, the second major upgrade that needed to be done was to my AMD64 desktop. This served as my mail server, and a few other bits, for a while, but obviously had to give up that role when I moved into the new house (due to not having an internet connection there!).

Obviously, nothing is ever easy! When I plugged in the ADSL modem upstairs, I realised that our upstairs phone port doesn’t work! So, the ADSL modem had to sit downstairs. Of course, the desktop is upstairs in the office, with no wireless card!
So, first thing to do was to get a wireless adaptor for it. I took a quick look online, and spotted mention of a Belkin G USB wireless adaptor that I had seen in a local PC shop. So I bought this one. A bit of further investigation showed an update to the zd1211rw module in kernel 2.6.19 to support this device. The kernel in Etch is 2.6.18, so didn’t support the device. It’s an easy fix though – just grab the kernel source, and add the following to drivers/net/wireless/zd1211rw/zd_usb.c :
{ USB_DEVICE(0x050d, 0x705c), .driver_info = DEVICE_ZD1211B }
Then recompile this module and copy it into
/lib/modules/`uname -r`/kernel/drivers/net/wireless/zd1211rw
(don’t forget to backup the one that’s there already), and run
depmod -a
Loading this module should then pick up on the Belkin USB wireless adaptor.
Other than this minor problem, the upgrade went smoothly, and the AMD64 is now happily running Etch with no problems.
Feb
26
Since I recently (finally!) got broadband installed into our new house, I got started on the long-awaited upgrades to both my Macbook and my AMD64 desktop.

Starting with the Macbook, I installed Dapper on it about 9 months ago. Obviously, there were hacks needed to get some stuff working, and other bits just didn’t work at all!
I got started on the upgrade last week. This broke some things, well, not so much broke them, but changed them to work in a way I didn’t want! The most obvious one was the F keys. I like to use Alt + F(1-4) to switch virtual desktop. However, the Edgy kernel defaults the F keys to be the equivalent of Fn + F key. To undo this, put the following into a file in /etc/modprobe.d.
options usbhid pb_fnmode=2
If you’re using the Feisty kernel, the above option needs to be sent to hid instead of usbhid.
The wireless card seems to work much better under the later kernel in Edgy. Under Dapper’s kernel, the wireless connectivity was shaky to say the least. It’s a lot more stable under Edgy, I’m glad to see.
Also, under Dapper, whenever I closed the lid on the laptop and re-opened it, the screen remained dark. This seems to have been fixed under Edgy. So, suspend to RAM looks good to go!
The last remaining obstacle for me with the Macbook was the microphone. I wanted to be able to use Skype under Ubuntu, but without a working mic, this wasn’t possible. I found this page though, which explains how to fix the issue. Having followed these instructions, the mic now works perfectly.
I haven’t bothered touching on any of the stuff that already works like direct rendering, sound, touchpad, keyboard etc. The iSight camera apparently works, but I don’t know what I’d use it for, so I haven’t set it up.
I found this page to be an invaluable resource after the initial upgrade.