View Single Post
Old 11-03-2013, 02:44 PM   #41
tshering
Wizard
tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.
 
Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
I think, I have something.

In libnickel.so.1.0.0, replace
Code:
echo %1 > /sys/power/state-extended
by
Code:
sh /mnt/onboard/susptest/susp.sh %1
and the line
Code:
echo mem > /sys/power/state
by
Code:
echo "abc"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
Here each \x00 stands for a byte with the value 0. This call itself is meaningless. But since nickel does a system call, I think we have to fill in something here.

In the root of the reader, create a folder "susptest". Put in this folder a script susp.sh with the content

Code:
#!/bin/sh
# replace /usr/local/Kobo/slideshow/1.gz with the path to your picture
sleepPicture=/usr/local/Kobo/slideshow/1.gz

if [ $1 == 1 ] && [ -e $sleepPicture ]; then
 zcat $sleepPicture | /usr/local/Kobo/pickel showpic
fi
echo $1 > /sys/power/state-extended
echo mem > /sys/power/state
The line in the if ... fi block is just an example of writing something to the screen. I suppose that "/usr/local/Kobo/slideshow/1.gz" is on all kobo readers. If this is wrong, then that is a problem.

It is interesting to see, how long it takes for the original kobo screen image to be replaced by the custom image. This seems to indicate how much nickel has to take care of before calling it a day.

If you try this, DO IT AT YOUR OWN RISK!

I would recommend, using the patcher for modifying libnickel, because there is at least a control, that the patch goes to the correct address and has the correct length.

Last edited by tshering; 11-04-2013 at 03:54 AM.
tshering is offline   Reply With Quote