Fixing your HAL application for Ubuntu 10.04

Ubuntu Lucid Lynx sports full removal of HAL from the boot process, making Ubuntu faster to boot and faster to resume from suspend.

From a developer stance, all what has changed is that Ubuntu has switched over to D-BUS activation. So if a program tries to talk to HAL, but HAL is not running, it triggers it’s startup.

If this isn’t the case when you try to start your application, then the most likely reason is that it is too cautious and checks if HAL is running before trying to connect to it. This is true in the case of lshal, where you probably wouldn’t want HAL starting if it wasn’t already running.

Such an example of this check would be as seen below (taken from pcmanfm).

/* try to initialize the HAL context */
if (!libhal_ctx_init (hal_context, &error)
    goto failed;

What we do differently is simply dropping the check, letting the application connect to hal straight away, checking of course if that failed instead before returning true.

/* try to initialize the HAL context */
libhal_ctx_init (hal_context, &error);

Happy debugging!

Regards

Advertisements

About ibuclaw
An avant developer and support analyst.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: