[maemo-developers] Turning on Automatically when connected to power

From: Faheem Pervez trippin1 at gmail.com
Date: Wed Oct 21 09:44:30 EEST 2009

I have my N810 booting straight into a desktop when I boot with the
charger in. Changing the runlevel number seemed like the way to go but
didn't work for one reason: mce checked to see if it was booted with
the charger in; if so, then display the charger screen. This meant
that it booted into the desktop, sure, but I would have to hold the
power key first before the touchscreen and wifi were activated (and if
you had a lock code,  entering that then) so a straight change didn't
work for me.

So, thanks to fanoush, I changed the bootreason driver in the kernel
to let me write whatever I wished to in it. (Patch is on the internet,
but it's dodgy code unless you wish to clean it up...) So I added this
to /mnt/initfs/linuxrc, before DSME starts:

        bootreason=`cat /proc/bootreason`
        if [ x"$bootreason" = x"charger" ]; then
                echo pwr_key > /proc/bootreason

This way, DSME tells MCE that it has been started by "holding" the
power key, and the linuxrc script thinks likewise so it boots from
runlevel 2.

Best Regards,
On 10/21/09, Jey Han Lau <jeyhan.lau at transtech.net.au> wrote:
> Hi all,
> This is for the N810. Is it possible to configure the device such that
> it will turn on automatically when it is connected to a power supply? I
> am thinking that since it knows that it is in the charging state when
> connected to power I am wondering if it is possible to tell itself to
> turn on automatically.
> Thanks,
> Jey Han
> _______________________________________________
> maemo-developers mailing list
> maemo-developers at maemo.org
> https://lists.maemo.org/mailman/listinfo/maemo-developers
More information about the maemo-developers mailing list