Dents for 2010-09-28

  • @cassidyjames Sorry for late reply. Working on some code for custom backgrounds for a client’s app. Not using some paint program that is. #
  • @cassidyjames That said, there is some powerful image manipulation API in the SDK. So one could build a pretty decent Android paint app. #

Dents for 2010-09-16

  • Stayed up late last night to finish editing Negotiation. Submitted to #365Tomorrows and hoping it’ll be my first non-self-published piece. #
  • Getting my #scifi short Negotiation from 800 to below 600 words was painful. I prefer longer formats. #writing #365Tomorrows #
  • Sometimes the Have-Big-Sword-Will-Cut is the right technique to programming. #programming #rant #

Gliders, Italy and Androids

What an incredible summer and it is funny how it all started.  I found myself without a job at the end of April.  A week or two later I started a crazy schedule of fencing, archery and hiking amongst the usual day-to-days at home.  I even got to try out some serious tree climbing and zip-lining.  And I met new friends at a retreat and a number of parties too.  I even got to hang out with and host Anna and Behnaz, two friends from Montreal for over a week.

At the beginning of July, after months of preparation my brother, Martin went for the Air Cadet’s gliding summer camp.  After over 6 weeks of intensive work, training and practise, my brother can now legally fly a glider by himself.  I am incredibly proud of him and we now have a real pilot in the family.  Wow.

The past month and a half I had the honour and pleasure of hosting one of my very good friends from Italy, Laura.  Laura came to visit us, see Canada and learn English.  We did that and a whole lot of hiking, sightseeing and partying in Toronto, Niagara, Tobermory and Hamilton.  And her English became a lot better too.  I am so thankful that you came Laura and I hope you enjoyed being with us as much as we having you over.  Thanks!

After a full summer, I’ve come full circle.  About three weeks ago, I interviewed and got hired as a mobile developer for Web Impact.  I get to work on building Android mobile applications in a great environment with awesome coworkers.  I have always wanted to get into mobile programming.  But I never imagined that I would be doing what I get to work on.  Unfortunately I can not disclose the details of what I am working on and the technology behind it.  However I can say that the technology and the way we apply it is how I envision the future of mobile, web and desktop computing will look like.

This year has been an amazing ride so far.  And from what I can tell there is even more awesomeness in store.

Beautifying the Boot – GRUB2 & Plymouth Themes in Ubuntu 10.04

I like eyecandy especially when it comes to my Linux workstation.  I was pleasantly surprised when I first booted up my fresh install of Kubuntu 10.04.  However after installing the NVIDIA drivers (Sigh.  NVIDIA when will you learn?  Open sourcing your drivers is not going to kill you.), I lost the pretty Kubuntu splash screen.  After a lot of experimentation and searching the Web for a sane solution, I managed to not only bring back the splash screen but also add a pretty background for GRUB.  Here is how:

1. Install the v86d package

sudo aptitude install v86d

Why exactly a daemon is needed to execute x86 code is beyond me.  But without it GRUB2 and the initialization scripts refuse to show the proper splash screen.  Instead you get the fallback purple Ubuntu text theme.

2. Edit Your Grub Config (/etc/default/grub)

This is a big step.  You need to edit the GRUB2 configuration to add a few modsetting options.  Otherwise things will not work out.  You’ll need to edit the configuration first use your favourite text editor to edit the file.  I use Vi for this example.  If you prefer Kate or gedit to change the “sudo vi” parts to “kdesudo kate” or “gksudo gedit” throughout the manual.

sudo vi /etc/default/grub

You’ll need to change the following lines:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=" splash quiet vga=769"

To something like this:

#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
#GRUB_CMDLINE_LINUX=" splash quiet vga=769"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodset
  video=uvesafb:mode_option=1280x1024-24,mtrr=3,scroll=ywrap"

Commenting out those lines prevents the original configuration.  Note that the GRUB_CMDLINE_LINUX_DEFAULT should be one line, I put it on two lines for readability.. Instead we want to manually set the video mode of the framebuffer.  Namely we want to use the uvesafb driver and to run the resolution at 1280×1024 with 24-bits of colour.  If your screen uses a different resolution substitute it in the mode_option option.  [It always good to check what resolutions your graphics card supports, by using the vbeinfo command when running inside of grub.]

mode_option=1280x1024-24

In addition, to you’ll need to change the following line:

GRUB_GFXMODE=640x480

To something like this:

GRUB_GFXMODE=1280x1024
GRUB_GFXPAYLOAD_LINUX=1280x1024x24

The first line sets the correct mode for the graphical console.  The second one keeps the changes when switching over to Plymouth.  If the second line sounds magical, I can just vouch it worked for me.  Other users reported not needing this line or using the “keep” instead of an actual resolution.

3. Edit /etc/initramfs-tools/modules

Next up we need to update what options get included in our initramfs (initial ramdisk that gets loaded up first by Grub and that is used to initialize the entire system at boot).  On the very bottom of the /etc/initramfs-tools/modules file, just add the following new line.  This will make initramfs load up the right splash mode at boot.

uvesafb mode_option=1280x1024-24 mtrr=3 scroll=ywrap

4. Fixing the Splash Delay

This next step fixes the delay that normally happens when Plymouth runs at boot.  Open and edit the /etc/initramfs-tools/conf.d/splash file.  All you need is to add the following line on the bottom of the file:

FRAMEBUFFER=y

5. Updating GRUB2 and Initramfs

Before you can see the changes in actions, you need to update your initram and Grub installs.  First you need to rebuild the initramfs image with:

sudo update-initramfs -uv

Then you need to update your Grub installation with:

sudo update-grub2

And you are done!  Below I also mention how to modify which Plymouth theme gets used, and how to add a nice background image to Grub.

Changing the Plymouth Splash Theme

Before you can change the Plymouth theme, you will need to either install or build your own theme.  I did not bother with building my own but the second link below gives instructions on how to build your own.  Once you have some additional themes, you can switch between them by running:

sudo update-alternatives --config default.plymouth

Follow the on-screen instructions and rebuild your initramfs image as you did above.

Changing Grub’s Background

Just like with the Plymouth themes, you’ll need to install an extra package (e.g. grub2-splashimages) or create your own images.  Next you will need to edit the script that sets up your Grub2 image.  It seems a bit hackish, but at the moment there isn’t a better way to do this.  So open the /etc/grub.d/05_debian_theme file with your favourite text editor.  Look for the following line (should be line 10):

WALLPAPER="/usr/share/images/desktop-base/moreblue-orbit-grub.png"

All you need to do is to change the WALLPAPER value, to the full path of the image you want to use as your background.  The third link below contains some useful guidelines for picking a background image with the correct dimensions and colour value.  I would stick with an image that is 640×480 and 16 bit colours.  Once you finish editing that line, remember to update your Grub2 install just like we did above.

And there you have it – a much nicer looking booting experience.  I’d like to thank the following sources for letting me piece together this guide: