Thread: PRS-T1 Enormous battery drain
View Single Post
Old 08-11-2012, 05:05 PM   #10
altruizine
Senior Altruist
altruizine ought to be getting tired of karma fortunes by now.altruizine ought to be getting tired of karma fortunes by now.altruizine ought to be getting tired of karma fortunes by now.altruizine ought to be getting tired of karma fortunes by now.altruizine ought to be getting tired of karma fortunes by now.altruizine ought to be getting tired of karma fortunes by now.altruizine ought to be getting tired of karma fortunes by now.altruizine ought to be getting tired of karma fortunes by now.altruizine ought to be getting tired of karma fortunes by now.altruizine ought to be getting tired of karma fortunes by now.altruizine ought to be getting tired of karma fortunes by now.
 
Posts: 82
Karma: 600554
Join Date: Jun 2012
Device: Onyx Boox C67ML, Onyx Boox Note Pro
The fix

OK, apparently I managed to fix this.

My guess was right, the pastlog (whatever it is; perhaps a copy of the logcat output made persistent across boots?) is saved to a hidden area on the internal flash storage. I was able to find the internal partition table (“raw data table”) on the flash device by looking for its magic value (taken from the kernel source code distributed by Sony), and to find the pastlog area in this table by looking for the “LOG” label (also found in the source code). The referenced pastlog area did indeed contain the pastlog header (replicated two times) with the right magic values.

I fixed the problem by resetting the pastlog headers on disk with all zeros and then rebooting:
Code:
cd /dev/block/ 
dd if=mmcblk2 bs=1 skip=19922944 count=8192 | od -t x4 -t c
Before proceeding, please make sure you are looking at the pastlog header: The magic value 0x4c4b5045 (ASCII “EPKL”) should appear twice in the output.

Now let's clean out the headers and reboot:
Code:
dd if=/dev/zero of=mmcblk2 bs=1 seek=19922944 count=8192 
reboot
(One symptom of the pastlog problem is that reboots often hang. I had to unplug the USB cable and hit the power button once for it to work.)
altruizine is offline   Reply With Quote