|
|
#1 |
|
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Jan 2023
Device: pw1
|
PW5 Proper Poweroff / Shutdown
I'm using Online Screensaver extension.
I made some quick modifications that if the power is bellow 10% it shows a LOW BATTERY image and I wanted it to shutdown. Just trying to avoid wearing the battery too much so I plug to charge at 10%. I've tried: poweroff, halt, shutdown -h now. They appear that they do shutdown as it's a pain to turn the device back on however I get the boy under tree image with a "Please wait a moment while your Kindle starts up..." on the screen and my image does not persist. I wanted to shutdown but keep the LOW BATTERY image on the screen. Any recommendation ? |
|
|
|
|
|
#2 |
|
rm -rf /
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 219
Karma: 3333683
Join Date: Nov 2019
Location: United Kingdom
Device: K5, KT, KT2, KT3, KT4, KV, PW2, PW3, PW4, PW5
|
This script is probably a good starting point, I use it to cleanly shutdown devices if I need to store them - it's ripped off/adapted from the script used to put a device into shipping mode:
Code:
#!/bin/sh
# shutdown.sh
# Simple shutdown script based on /etc/upstart/shutdown_special
source /etc/upstart/functions
source /etc/upstart/upstart_functions
set_background() {
fbink -c -f
if [ -f /tmp/bg_shipping.png ]; then
bg_img=/tmp/bg_shipping.png
else
bg_img=/usr/share/blanket/shutdown/bg_shipping.png
fi
fbink -g file=$bg_img
}
shutdown_device() {
echo "shutdown" > /tmp/shutdown_in_progress
f_log I shutdown "closing password dialog"
killall -q -s KILL passwdlg || true
f_upstart_job_stop_timeout 60 "x wifid wifis lab126 framework sshd usbnetd testd" || \
f_log W shutdown "stop_failed" "type=services" "continuing"
# Shutdown the filesystems
f_upstart_job_stop_timeout 30 "filesystems" || f_log W shutdown "stop_failed" "type=filesystems" "continuing"
#
# Logging went down with filesystems, the following only prints to console
#
# Make sure rootfs is readonly (it should be already)
f_log I shutdown "mounting root filesystem read-only"
sync || true
mntroot ro || true
# Sync the filesystems
f_log I shutdown "syncing disks"
sync || true
echo 3 > /proc/sys/vm/drop_caches || true
f_log I shutdown "wait for additional 5 seconds to ensure all files have been written to disks"
sleep 5
poweroff -f
}
main() {
set_background
shutdown_device
}
main
|
|
|
|
| Advert | |
|
|
![]() |
| Tags |
| shutdown, shutdown image |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Set system poweroff screensaver on PocketBook ereaders | datanoise | KOReader | 5 | 01-14-2024 09:52 AM |
| KOReader doesn't show poweroff cover on Libra 2 | AnimalOfArt | KOReader | 16 | 05-18-2022 06:41 PM |
| Is it possible to specify poweroff image folder in KOReader? | sockscap | KOReader | 4 | 03-10-2019 08:49 AM |
| Aura How to show random images on poweroff? | babloyi | Kobo Developer's Corner | 1 | 09-10-2018 02:37 PM |
| Poweroff screens | valris | Kobo Developer's Corner | 11 | 01-17-2015 08:20 AM |