Backup Night

I spent most of last night (bit sad innit?!) backing up my computers – well it started off as I thought I should clone my Mac Mini (in case I decide to buy OSX Lion) which I’ve never done before.

Booted Ubuntu 11.04 from a LiveCD, and dd’ed an 80Gb disk image to the 1Tb NTFS drive over USB. Ubuntu 11.04/Unity is a bit better than Fedora 15/Gnome Shell.

img

Blog Makeover

I’ve given the blog a bit of a makeover as I’m fed up of trying to fudge Google +1 and Facebook Like buttons onto the old CognoBlue theme and G+ was posting the tag cloud content instead of the post itself!

I’ve made a fork of the TwentyEleven theme with some modifications to header.php, footer.php and style.css to make the content wider and get rid of some wasted space. There’s some problems with WP-Syntax too – like the line number background colour is overridden by the main stylesheet, so I’ve put a custom wp-syntax.css in my theme too.

Building An Android Kernel

As I’ve been compiling Cyanogenmod for the ZTE Blade, I thought I’d have a look at compiling the kernel instead of applying binary patches. I found this tutorial which kind of helped, here’s my simplified summary:

  1. Pull kernel source from Github (currently weighs in at 1.7Gb):
git clone git://github.com/TomGiordano/kernel_zte_blade.git
  1. Get the .config file – most tutorials say to get this from your phone which is running the kernel that you want to compile, but actually its already stored in git:
cp ~/kernel_zte_blade/arch/arm/configs/cyanogen_blade_defconfig ~/kernel_zte_blade/.config
  1. Build the kernel:
make ARCH=arm CROSS_COMPILE=~/cyanogenmod/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
  1. Build CM7 as usual, and to make things easier we’re going to copy a few files all into the same directory, including the split_bootimg.pl we downloaded:
mkdir ~/custom_kernel
cd ~/custom_kernel/

cp ~/split_bootimg.pl .
cp ~/kernel_zte_blade/arch/arm/boot/zImage .
cp ~/cyanogenmod/out/host/linux-x86/bin/mkbootimg .
cp ~/cyanogenmod/out/target/product/blade/update-cm-7.1.0-RC1-Blade-KANG-signed.zip .
cp ~/cyanogenmod/out/host/linux-x86/framework/signapk.jar .
cp ~/cyanogenmod/build/target/product/security/testkey.* .

unzip update-cm-7.1.0-RC1-Blade-KANG-signed.zip
  1. Unzipping the KANG has given us the META-INF and system directories and boot.img file, which we must now unpack:
./split_bootimg.pl boot.img

6a. Optionally copy across the .ko files mentioned in modules.order to system/lib/modules/2.6.32.9-perf/ the highlighted ones are probably not neccessary:

Bluetooth

As part of my frustration with PulseAudio and my Skype headset, I thought I’d try using my little USB Bluetooth dongle and my headset. Well after a couple of hours I managed to get mplayer to play out of my headset but upon reboot I can’t get it to work, and PA didn’t detect it anyway, so no good for Skype – which annoyingly these days only uses PA and not direct ALSA devices.

Edify Scripting And Git Patches

I’ve been working on Edify scripting to create a flashable zip that allows me to patch a regular CM7 nightly build with a reverted libaudio.so and updated libcamera.so

There’s literally no documentation anywhere! There’s some very old posts about Amend scripts (update-script) on XDA but nothing about the newer Edify scripts (updater-script and update-binary) that CM7 uses.

My script is based on the script from gapps:

ui_print("Mounting /system");
run_program("/sbin/busybox", "mount", "/system");

ui_print("Extracting libraries");
show_progress(0.100000, 0);
package_extract_file("libcamera.so", "/system/lib/libcamera.so");
package_extract_file("libaudio.so", "/system/lib/libaudio.so");
show_progress(0.100000, 10);

ui_print("Setting permissions");
show_progress(0.200000, 0);
set_perm(0, 0, 0644, "/system/lib/libcamera.so");
set_perm(0, 0, 0644, "/system/lib/libaudio.so");
show_progress(0.200000, 10);

run_program("/sbin/busybox", "umount", "/system");
ui_print("Installation complete!");

There’s not a huge amount of documentation about the folder structure of a zip or apk, but essentially its this: