Friday, May 21, 2010

playing with udev, dbus and hal for puppy and kde users

(updated)Hello normal people!

I have been playing around with HAL on frankenpup2 for a while and i am having some good results to share xD

after some very little mods to the rc.shutdown and the rc.local i was able to get some basic hardware detection for kde4, what does that means? that means kde4 is now aware of my sound card, video card and some usb devices (mp3 players, usb drives, etc)

ok now the modifications i made:

first you need to install dbus, HAL and udev (i got them from slackware-13.0 repos)

then, when everything is installed and ready to go follow the next steps:

1.- type: dbus-uuidgen --ensure=/var/lib/dbus/machine-id


after that make sure dbus monitor is running by typing: dbus-monitor
if you get something like this:



everything is ok and go to the next step


2.- now add the groups: video, lp, disk, floppy, cdrom, tape, plugdev and power

type: addgroup video (and then replace video with lp and you know what's next xD)

3.- ok let's make the socket we need for HAL

type: rm -rf /var/run/dbus/*
then: dbus-daemon --system
and check the /var/run/dbus for dbus.pid and system_bus_socket
now go to the next step



4.- ok so you have the groups and the socket now let's test HAL

type hald on the terminal and if it just makes a little stop and dropsyou to # it's actually running =)


5.- ok now test if hal is detecting the hardware by typing hal-device on the terminal.
if you get something like this:





YOU ARE DONE! XD




well that's the software and config part now we need hal to load on the system boot so weare gonna mod some files on /etc/rc.d/

1.- ok first open /etc/rc.d/rc.shutdown to make a dbus-daemon hand-made cleaner xD

ok goto line 880

it should look like this

rm -rf /root/.thumbnails/* 2> /dev/null
sync

now add rm -rf /var/run/dbus/*

and it should look like...

rm -rf /root/.thumbnails/* 2> /dev/null
rm -rf /var/run/dbus/*
sync

save and close.


2.- good, now we need to start dbus and hal on the system init
now open /etc/rc.d/rc.local


it should say

#this file called from rc.sysinit
#you can edit this file
#When firewall is installed, will append lines to this file...

now add this to it


######################LOAD DBUS####################

echo -n "starting dbus-daemon" >/dev/console

dbus-daemon --system

status_func 0

######################LOAD HAL#####################

echo -n "starting HAL" >/dev/console

hald

status_func 0


save and close.


ok now reboot your system and let the magic flow!! xD

[uploading video]

pretty good now HAL must be able to see all your hardware, make sure of that typing hal-device ona terminal, and if you see (again) this




everything is ok, now try looking on the kde panel for some hardware detection and check if it shows something, i'm using kde4.2.4 and i got this:

[uploading screenshot xD]

or try plugging a usb drive..


[uploading video xD]


well, hope this help someone.

i'm now looking for a config somewhere to make autoruns for the usb and cd/dvd drives (or will make a daemon for that) to avoid pmount (as i am using kde and not rox the drive icons are not showed on the bottom of the screen) hope i can come out with something to share with the puppylinux community.

Will keep you informed

samedog out.

No comments:

Post a Comment