mac-mini power button
Brought to you by:
matthiasgrimm
|
From: pix <pi...@te...> - 2005-09-15 07:59:50
|
hi, i was trying to get pbbuttons to detect the mac-mini power button. by running: od -t x1 -w1 /dev/pmu i could see that on pressing the power button, the bytes [0x40 0x0c] are generated. when you release the button, [0x40 0x04] is generated. i tried adding this to the module_pmac.c file, but then i noticed a bigger problem. it appears that when running on the mac mini, pbbuttonsd doesn't even listen to /dev/pmu. to check, i turned on PMUINTR in debug.h and compiled with -DDEBUG. i get a lot more debug info, but i don't get the expected line printing out the bytes that i know are being generated at /dev/pmu... so i assume somewhere during startup, pbbutons makes some decision not to monitor /dev/pmu.. possibly because it doesn't support many laptop-like functions, such as sleeping (this is also why pmud doesn't want to start on the mac-mini). anyhow, i have resorted to writing a small program which does nothing but monitor /dev/pmu, and hand off any read bytes to a script, which then halts the machine is the power button is pressed. it is available here... http://f0.am/darcs/lyta/system/pmumon/ the install rule is very debian-centric, sorry. also, the rcd script included sets server_mode in /proc/pmu/options, which is something very peculiar to our setup here, and possibly isn't what you want. it would probably be better for this *cough* feature to be incorporated into pbbuttonsd, but it seems a few people are trying to get their mac-mini power buttons to work like this, so i've made this available. i hope this is useful for the developers, unless there is some policy about not supporting desktop machines... pix. |