12-23-2017, 02:47 PM | #1 |
Grand Sorcerer
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 |
12-24-2017, 09:27 AM | #2 |
has been
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...
|
12-24-2017, 12:24 PM | #3 |
Enthusiast
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 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. |
12-24-2017, 01:00 PM | #4 | ||
Grand Sorcerer
Posts: 5,278
Karma: 98804578
Join Date: Apr 2011
Device: pb360
|
Quote:
https://www.mobileread.com/forums/sh...d.php?t=211677 What does the screen show after the Kindle is off? Quote:
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? |
||
12-24-2017, 01:05 PM | #5 |
Going Viral
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??
|
12-24-2017, 01:24 PM | #6 |
Grand Sorcerer
Posts: 5,278
Karma: 98804578
Join Date: Apr 2011
Device: pb360
|
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.
|
12-24-2017, 03:55 PM | #7 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
If it was powered down, for any reason, you can't wake it up with a script. |
|
12-24-2017, 04:06 PM | #8 |
Resident Curmudgeon
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?
|
12-24-2017, 04:10 PM | #9 |
Grand Sorcerer
Posts: 5,278
Karma: 98804578
Join Date: Apr 2011
Device: pb360
|
|
12-24-2017, 08:01 PM | #10 |
Grand Sorcerer
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 "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. |
|
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 |