OESF Portables Forum

Everything Else => Zaurus Distro Support and Discussion => Distros, Development, and Model Specific Forums => Archived Forums => Debian => Topic started by: Chero on October 06, 2007, 11:12:35 am

Title: What Does The On/off Button Do
Post by: Chero on October 06, 2007, 11:12:35 am
As the title says,

Can I do the same from command line as if I'd press the power button ?

I have a C1000 with a power button that lets me down every now and then, causing the Z to freeze. It's not debian related, it happens in pdaXrom, Angstrom, debian eabi and titchy. I haven't tried the sharp-rom, but I suppose it would be the same.

I see the screen dropping to a "console" on my C3100, then I see it "stopping tasks" before power turns off. When I use apm --suspend it doesn't do that.
Does anybody know what command/script I have to look for ?

Thanks,
Chero.
Title: What Does The On/off Button Do
Post by: jfv on October 06, 2007, 11:52:19 am
What works on desktops is:
shutdown -h now
You can try that and see what happens.
Title: What Does The On/off Button Do
Post by: Chero on October 06, 2007, 12:11:01 pm
Quote from: jfv
What works on desktops is:
shutdown -h now
You can try that and see what happens.

That also works on my zaurus, but I don't want to shutdown, I want to suspend.

Thanks for the effort anyway,
Chero.
Title: What Does The On/off Button Do
Post by: jpmatrix on October 06, 2007, 02:33:39 pm
apparently

apm --suspend

seems to do the job.

apparently there's apm --standby too, i haven't tried.
Title: What Does The On/off Button Do
Post by: ZDevil on October 06, 2007, 05:23:47 pm
So do you mean it is a hardware failure?

It's very straightforward to map the suspend command to a shortcut key to make up for the misbahaving power key. Perhaps modifying the kernel keymap and xmodmap will fix it once and for all?
Title: What Does The On/off Button Do
Post by: dlj0 on October 06, 2007, 10:11:40 pm
Quote from: jpmatrix
apparently

apm --suspend

seems to do the job.

apparently there's apm --standby too, i haven't tried.

apm --suspend works as advertised.  -- standby gives me "invalid argument".  apm --help lists it as an option, though.
Title: What Does The On/off Button Do
Post by: Chero on October 07, 2007, 03:40:44 am
Quote from: ZDevil
So do you mean it is a hardware failure?

It's very straightforward to map the suspend command to a shortcut key to make up for the misbahaving power key. Perhaps modifying the kernel keymap and xmodmap will fix it once and for all?

Ok, but first I have to know what the suspend command is.

Check this :
Use the on/off button to suspend, then resume using it again or using the home button. Check dmesg :
stopping tasks...done
restarting tasks...done

Then use apm -s to suspend and resume using the on/off or the home button. Check dmesg :
restarting tasks ... done.

But there is no stopping tasks.
This brings me to my initial question : what does the on/off button do and how can I do it from command line ?

Chero.
Title: What Does The On/off Button Do
Post by: ZDevil on October 07, 2007, 04:18:53 am
Just a wild guess: What does the /etc/sysconfig/keyboard/kernel.map in your pdaXii setup say about the Power AND the Home buttons?
Title: What Does The On/off Button Do
Post by: Chero on October 08, 2007, 02:18:20 am
I've done a few tests and it seems that apm --suspend does add "stopping tasks ... done" to dmesg, so I guess I'll have to do some more testing and see where it leads me ... .

Thanks for all the answers.
Chero.
Title: What Does The On/off Button Do
Post by: ZDevil on October 08, 2007, 02:52:15 am
Quote from: Chero
Quote from: ZDevil
So do you mean it is a hardware failure?

It's very straightforward to map the suspend command to a shortcut key to make up for the misbahaving power key. Perhaps modifying the kernel keymap and xmodmap will fix it once and for all?

Ok, but first I have to know what the suspend command is.
...
Chero.
I just wonder if it is possible to remap the Power/Home key to something else, without even knowing the exact command, so as to make the new key function in the same way as Power/Home key.
Title: What Does The On/off Button Do
Post by: jpmatrix on October 12, 2007, 11:04:23 am
i don't know if it is related to this thread, but i notice some battery draining while the zaurus is suspended.
am i the only one ? perhaps my zaurus battery is beginning to be a little old, i've never changed it since i've bought my C3000
Title: What Does The On/off Button Do
Post by: ZDevil on October 12, 2007, 05:40:27 pm
Can't tell yet.
The day before yesterday my 3200 was busy compiling things busily without any external power source. I checked after three hours of compilation and the bettery went down from 9x% to 50%.