maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   Completely Power Off Your Device After a Few Reboots! (https://talk.maemo.org/showthread.php?t=37431)

Rushmore 2009-12-16 18:08

Re: Completely Power Off Your Device After a Few Reboots!
 
"0" here too. How can you not power off and just reboot? I see no reboot option, just "Switch off!".

Oh... terminal command. Got it;)

TA-t3 2009-12-16 18:10

Re: Completely Power Off Your Device After a Few Reboots!
 
@Rushmore: I'm guessing this will mainly be in connection with the 'automatic reboot' problems some people are experiencing.

Pedrolot 2009-12-16 18:16

Re: Completely Power Off Your Device After a Few Reboots!
 
erm..Where do i put his code?

jebba 2009-12-16 18:19

Re: Completely Power Off Your Device After a Few Reboots!
 
Quote:

Originally Posted by Laughingstok (Post 430729)
Mine says 0. What happens if I hard code a 50 in there? It will not boot? What reason?

If you put a 50 in there (or maybe 51) and reboot, your system will hang like:

* (*) * * *

(picture those bootup dots or "balloons")

From the bug report:
Quote:

The root cause appears to be that when we during Fremantle development switched to Upstart, it didn't anymore provide shutdown runlevel (runlevel is now a dummy script) so that the device would have been correctly powered off when max reboot count is reached (as it did earlier).
Also from report:
Quote:

The updated version of getbootstate package & binary will have also some other improvements (in testing currently)
AFAICT "testing" in this case is internal Nokia testing, not Maemo's extras-testing.

Also, the bug report provides a temporary workaround:

Quote:

To prevent that issue, power users could probably quickfix /sbin/preinit scriptwith something like this:

Code:

echo_g "Houston, we have a problem, powering off..."
+sleep 10
+poweroff
def_runlevel=0


-Jeff

smolomiami 2009-12-16 18:46

Re: Completely Power Off Your Device After a Few Reboots!
 
Quote:

Originally Posted by TA-t3 (Post 430726)
Mine is currently zero, so I'm in the clear for a while. I'll make a note of the info though, it could come in useful.

where can i check that ? thanx

kwotski 2009-12-16 18:51

Re: Completely Power Off Your Device After a Few Reboots!
 
Mine is at 0, and the file date reflects the time I last did a switch off via the power switch menu (no power cable connected). I guess that must be enough to reset it, then.


Why couldn't you just put

Code:

      echo 0 > /var/lib/dsme/boot_count
      ;;

in the currently empty stop) case in the /etc/init.d/zzinitdone file?

Looking at the getbootstate binary, there's the line:

Quote:

Unexpected reset count %d exceeds maximum (%d)
which suggests that any reboot which doesn't set the boot_count to 0 is an "unexpected reset".

So maybe this is to avoid endless reboot cycles when something is seriously broken.

In that case, just making one of the normal init.d shutdown scripts set the count to 0 might be the right fix?

Edit: Or, maybe I've got the wrong end of the stick here.. does rebooting "normally" actually increment the count in this file at the next boot, or is it just kernel crashes that do this? If the latter, maybe something resetting the count in the zzinitdone start) case might be better, on the assumption that getting that far is far enough to count as a normal startup? Maybe I should leave this to actual Nokia devs ;) Can't help being curious though!

Further edit: Ok, so if there's no shutdown runlevel, I guess the K00zzinitdone script in /etc/rc2.d/ isn't going to get invoked at shutdown. In which case pretty much all of the above can be ignored. :o

kwotski 2009-12-16 18:53

Re: Completely Power Off Your Device After a Few Reboots!
 
Quote:

Originally Posted by smolomiami (Post 430780)
where can i check that ? thanx

In X-Terminal, do:

cat /var/lib/dsme/boot_count

bltcool 2009-12-16 18:55

Re: Completely Power Off Your Device After a Few Reboots!
 
aff my at 3, btw can someone give me the command for fully poweroff the device

sjgadsby 2009-12-16 19:01

Re: Completely Power Off Your Device After a Few Reboots!
 
Quote:

Originally Posted by bltcool (Post 430797)
...can someone give me the command for fully poweroff the device

  1. If your N900 is connected to a USB cable, disconnect that cable.
  2. Press the power button on your N900.
  3. Tap "Switch off!"

bltcool 2009-12-16 19:06

Re: Completely Power Off Your Device After a Few Reboots!
 
Quote:

Originally Posted by sjgadsby (Post 430803)
  1. If your N900 is connected to a USB cable, disconnect that cable.
  2. Press the power button on your N900.
  3. Tap "Switch off!"

thanks , lol forgot that each boot add 3 count , got me worrie for a sec


All times are GMT. The time now is 20:52.

vBulletin® Version 3.8.8