Compiling 2.6.18 kernel for Ubuntu on a MacBook Pro

First, let me say that this isn’t completely necessary. Almost everything works right out of the box with Ubuntu/Edgy and the 2.6.17 kernel. The only semi-annoying thing was lackluster response from the touchpad using the appletouch driver. This response was fixed with 2.6.18, especially with the mactel patches applied. Therefore, I compiled my own. If you don’t want to bother with all the steps below, just download my already compiled packages and skip down to Install Packages.

Install pre-reqs

sudo apt-get install ncurses-dev kernel-package build-essential 

Download Kernel Source and configure

cd /usr/src
sudo -s wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.18.8.tar.bz2
tar jxvf linux-2.6.18.8.tar.bz2
rm linux
ln -s linux-2.6.18.8 linux
cd linux
cp /boot/config-2.6.17-11-generic ./.config
make oldconfig

If oldconfig prompts you for questions, generally just accept the default by pressing enter.

Apply mactel patches

cd ~
svn checkout https://mactel-linux.sourceforge.net/mactel-linux
cd mactel-linux/kernel/mactel-patches-2.6.18
rm acpi-blacklist-fix.patch
sudo ./apply /usr/src/linux 

Note: we’re removing the blacklist-fix because it breaks compilation (at the time of this writing)… It is unneeded for the MBP anyway.

Compile kernel packages

cd /usr/src/linux make-kpkg
clean
make-kpkg --initrd kernel_image kernel_headers 

Install packages

cd /usr/src
dpkg -i linux-image-2.6.18.8_2.6.18.8-10.00.Custom_i386.deb
dpkg -i linux-headers-2.6.18.8_2.6.18.8-10.00.Custom_i386.deb 

Reboot and install additional modules

The MBP requrires madwifi for its wireless card and optionally fglrx for the video card.

custom mactel kernel in ubuntu

Almost everything on the MacBook Pro works out of the box on Ubuntu. However, there are some minor annoyances that are solved by the mactel patches and the 2.6.18 kernel. I’ve put up some instructions on how to compile your own kernel for Ubuntu, specifically geared towards the MBP.

For those of you uncomfortable with compiling your own kernels, download my debian packages and follow the instructions on how to install.

Ubuntu MPlayer not detecting end of stream

There is a bug in the Ubuntu multiverse version of MPlayer that bit me when trying to write the All Songs Considered script for Linux. At the end of the Real Audio stream, MPlayer continues to dump empty frames into the output file instead of exiting. This does not happen if you compile mplayer yourself with version 1.0RC1.

I recommend compiling from source if you’re attempting to record streaming audio.

A Better All Songs Considered Podcast

Download

Python script (Mac OS X) -or- Python script (Linux)

Requirements

Description

 

National Public Radio‘s music program All Songs Considered is a great weekly program that features new (mostly) adult alternative music. NPR has started publishing a podcast of the show but it leaves a bit to be desired. The ASC website is much more useful. You can get a blurb about the band and song along with the ability to stream each song individually to see if it is in your tastes. How can we make the podcast more useful like the website? To start, we can split it into tracks, with the artist and song title encoded in each. Album art for each track would be a nice bonus.

The Mac script creates an “enhanced” podcast which is a single m4a file with chapters and meta info. Unfortunately, Apple decided to release their chapter tool OS X only so this doesn’t work for the majority of people. Still, it is pretty good and it probably what ASC should move to

The Linux script is currently what I use. It creates an mp3 file for each track and encodes it. I then put that in a playlist on my iPod every week. Not exactly a “podcast” because it is many files, but has some benefits over the OS X version because you can change all the meta-data for each song.

Building a better All Songs Considered podcast

National Public Radio’s music program All Songs Considered is a great weekly program that features new (mostly) adult alternative music. NPR has started publishing a podcast of the show but it leaves a bit to be desired.

I’ve uploaded to the documents section a script that creates a better ASC podcast. It is OS X only at the moment because of an Apple tool it uses, but I’ll be uploading a more useful Linux script soon.