Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 12-23-2017, 02:47 PM   #1
j.p.s
Grand Sorcerer
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 5,278
Karma: 98804578
Join Date: Apr 2011
Device: pb360
Prototype power off script

I've been looking at the script /usr/sbin/shipping_mode which is invoked by the ;shpm search bar command and the files that it sources and calls. I think that it is possible to put together a script powers a Kindle off without wiping documents, settings, etc.

Does anyone think it will work, or see any problems with it?

Has anyone tried something similar?

This is a prototype script and will likely display the critical battery screen, but something more suitable could be developed.

Proposed power_off.sh

Code:
#!/bin/sh

source /etc/upstart/functions
source /etc/upstart/shutdown_modes

# flash the screen multiple times to fully clear to white
eips -c -w gc16 -f
usleep 1250000
eips -c -w gc16 -f
usleep 1250000

start shutdown SHUTDOWN_MODE=$SHUTDOWN_MODE_CRITBATT
j.p.s is offline   Reply With Quote
Old 12-24-2017, 09:27 AM   #2
fllc
has been
fllc ought to be getting tired of karma fortunes by now.fllc ought to be getting tired of karma fortunes by now.fllc ought to be getting tired of karma fortunes by now.fllc ought to be getting tired of karma fortunes by now.fllc ought to be getting tired of karma fortunes by now.fllc ought to be getting tired of karma fortunes by now.fllc ought to be getting tired of karma fortunes by now.fllc ought to be getting tired of karma fortunes by now.fllc ought to be getting tired of karma fortunes by now.fllc ought to be getting tired of karma fortunes by now.fllc ought to be getting tired of karma fortunes by now.
 
Posts: 55
Karma: 765322
Join Date: Feb 2015
Device: k2, k4nt, touch, PW2, koa2, pw4, Nook GLP 7.8
I thought there is already an extension "HALT" that shuts down kindle without wiping anything. I use it regularly. I am not sure where is the link to it...
fllc is offline   Reply With Quote
Old 12-24-2017, 12:24 PM   #3
theol0403
Enthusiast
theol0403 is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!theol0403 is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!theol0403 is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!theol0403 is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!theol0403 is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!theol0403 is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!theol0403 is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!theol0403 is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!theol0403 is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!theol0403 is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!theol0403 is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!
 
Posts: 37
Karma: 50278
Join Date: Feb 2017
Device: Kindle PW3
The HALT extension

I also remember this extension. It I think it was from someone who also posted different theme packs and modded menu bar icons. However, search is down, so I couldn't find the link. I still have it though on my kindle, and here is its code:

Code:
#!/bin/sh
halt
So I guess the "halt" command is good enough. Have you also tried "poweroff"?

Since I have android on my kindle, the android system adds another step to the bootloader. When I turn on the kindle I can choose the operating systems. Because the android system has taken over the boot process, and android is default, when I press restart in the kindle system it just shuts down to a blank screen. Then I have to press the power button to turn the kindle back on, and then select an operating system. If I select nothing, it continues booting android, if I select kindle, it restarts and loads the tree.
theol0403 is offline   Reply With Quote
Old 12-24-2017, 01:00 PM   #4
j.p.s
Grand Sorcerer
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 5,278
Karma: 98804578
Join Date: Apr 2011
Device: pb360
Quote:
Originally Posted by fllc View Post
I thought there is already an extension "HALT" that shuts down kindle without wiping anything. I use it regularly. I am not sure where is the link to it...
Thanks, I managed to find it here:

https://www.mobileread.com/forums/sh...d.php?t=211677

What does the screen show after the Kindle is off?

Quote:
Originally Posted by theol0403 View Post
I also remember this extension.

Code:
#!/bin/sh
halt
So I guess the "halt" command is good enough. Have you also tried "poweroff"?
That's a little too minimalist for me. In particular, it does not do a sync.

I will look into the poweroff command.

At the moment, I'm inclined to try my proposed script without the screen clears since that might help distinguish between power off and true low battery condition. But I still don't know whether there are any potential adverse side effects to my approach and may go with a sync followed by a halt. The advantage of shutdown is that all running processes will be cleanly stopped,

What does your screen show after power down?
j.p.s is offline   Reply With Quote
Old 12-24-2017, 01:05 PM   #5
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Of more interest, what does the system log show during shutdown and during startup??
knc1 is offline   Reply With Quote
Old 12-24-2017, 01:24 PM   #6
j.p.s
Grand Sorcerer
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 5,278
Karma: 98804578
Join Date: Apr 2011
Device: pb360
Quote:
Originally Posted by knc1 View Post
Of more interest, what does the system log show during shutdown and during startup??
My interest in what the screen shows is whether I can tell if a Kindle I have not done anything with for some extended time is asleep, powered down by me, or powered down because the battery is actually critically low.
j.p.s is offline   Reply With Quote
Old 12-24-2017, 03:55 PM   #7
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by j.p.s View Post
My interest in what the screen shows is whether I can tell if a Kindle I have not done anything with for some extended time is asleep, powered down by me, or powered down because the battery is actually critically low.
If the battery is critically low, you will have a special screen for that announcement.
If it was powered down, for any reason, you can't wake it up with a script.
knc1 is offline   Reply With Quote
Old 12-24-2017, 04:06 PM   #8
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,966
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Does the use of this script require the Kindle to be jailbroken?
JSWolf is online now   Reply With Quote
Old 12-24-2017, 04:10 PM   #9
j.p.s
Grand Sorcerer
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 5,278
Karma: 98804578
Join Date: Apr 2011
Device: pb360
Quote:
Originally Posted by JSWolf View Post
Does the use of this script require the Kindle to be jailbroken?
Yes.

I am ready to start making a KUAL extension that will do what I want.
j.p.s is offline   Reply With Quote
Old 12-24-2017, 08:01 PM   #10
j.p.s
Grand Sorcerer
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 5,278
Karma: 98804578
Join Date: Apr 2011
Device: pb360
OK, I tried my script. It worked and displayed the critical battery screen as expected. Pressing the power button or plugging the USB into a power source (wall or computer) boots it with settings and documents intact.

I also tried a script with sync then halt and that worked similarly with differences below.
Code:
#!/bin/sh
sync
halt
results in a boy under the tree screen with the caption:
"Please wait a moment while
your Kindle starts up."

In fact, it sits there powered down, the desired result.

As to my script, because there is a symbolic link from writable

/var/local/eink/images/critbatt.png
to
/opt/amazon/low_level_screens/critbatt.png

I thought that I could replace /var/local/eink/images/critbatt.png with a custom image, which I could, but it was not used. I am guessing that /opt/amazon/low_level_screens/critbatt.bmp.gz is waht is actually used.

As might be expected, halt and poweroff are symbolic links to reboot, but POSIX executable know how they are called. In theory, halt stops the CPU, which continues to drar power, while poweroff actually powers the system off. On the Voyage, I can not tell the difference or see any meaningfull difference in dmesg output.

sync followed by poweroff has no path dependencies and seems the most portable across all systems. My original proposed script is at the mercy of Amazon not rearranging things.
j.p.s is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The Power of Exercise and The Power of Healthy Eating kimessex Self-Promotions by Authors and Publishers 0 08-28-2014 08:21 AM
Astak prototype with Android Javed Astak EZReader 44 04-23-2010 03:55 PM
XPal Power to Go - extra battery power cheyennedonna enTourage Archive 3 04-13-2010 11:22 PM
Fujitsu prototype Maquevil News 4 10-06-2006 09:20 PM


All times are GMT -4. The time now is 09:18 AM.


MobileRead.com is a privately owned, operated and funded community.