01-29-2017, 04:07 AM | #31 |
Guru
Posts: 779
Karma: 625816
Join Date: Sep 2013
Device: EnergySistemEreaderPro, Nook STG, Pocketbook 622, Bookeen Cybooks ...
|
If you make an image of the SD you will find the serial number of the device at hex:5B00000
Changing that will result in constant bootloop. My guess is, that serial number, SD-CID (and probably the SD size too) are somewhere encrypted together. Changing one of this resulting in constant bootloop. Further guesses suggest, that the file monitor.app is checking the correct CID and serial number. Since it is the first app, that is called after start. One could either have a closer look at this app or find the encrypted section where CID and serial number are stored and reverse this somehow. Neither approach seems to me worth the effort, since Pocketbook is helping when the internal memory gets corrupted. Did you try fsck -r /dev/sd?? with your card? You can check the state of the internal card by making a backup of it (I described the howto somewhere in this thread) and formating the card. If the card is usable on another device (computer/tablet) after formating, you are lucky and have only an error in the filesystem. That is solveable (see abaove). The image can be rewritten on the same SD without problems. I use USB Image Tool 1.72 from Alexander Beug for creating and rewriting the Image. Last edited by nhedgehog; 01-29-2017 at 04:24 AM. |
12-24-2017, 08:29 AM | #32 |
Junior Member
Posts: 6
Karma: 10
Join Date: Jun 2015
Device: Pocketbook 626
|
internal SD card & partitions
I also had problems with the internal SD card. It was impossible to write to the card and the reader would not update the firmware anymore.
I opened the device and removed the SD card (very easy, as it is removable). I tried to read the card with gparted. The programm aborts with overlapping partitions and another mistake with crashes gparted. Nevertheless some mounts are done and on syslog you can see a complex partition (up to sdd10, see below). I was unable to fsck /dev/sdd on the whole. Fsck only worked on some single partitions while the mounts are active. I have another pocketbook with a broken screen. Using this SDcard I observed the same behaviour (gparted erorr, no fsck). I saved an image of the SD card using dd. But could not copy it to the other card (hardware error). Mounting the image is not possible: unknown partition table. However the SDcard from the PB626 (Lux2) was functionally in the PB626 (Lux3). At least after an update with firmware provided by the external SDcard. The serial number is now the one of the old model. My conclusions are: PB uses a unconventional partition table to prevent experts to play around. This is especially sad since this leaves a broken SD card unrepairable to the user. So the only way is to fiddle around with the CID as described above in the thread. Please use tags - MODERATOR Spoiler:
Last edited by Dr. Drib; 01-01-2018 at 02:30 PM. |
Advert | |
|
07-13-2018, 07:58 PM | #33 |
Enthusiast
Posts: 49
Karma: 107174
Join Date: Mar 2012
Device: PB631, PB741, PB840
|
One can patch monitor.app to read SD serial from an arbitrary file instead of data from block device.
I have no idea if the protection scheme is complicated or not, I simply patched monitor.app to use an arbitrary file instead of "/sys/block/mmcblk%c/device/serial" (modified the string with an hex editor, put the file accordingly, and in ebrmain filesystem, updated the "pocketbook" link to monitor.app to use the patched version). Worked on my TL2/626, guess it will work on TL3/626 and certainly other systems. |
07-13-2018, 09:09 PM | #34 |
Wizard
Posts: 3,029
Karma: 18765431
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
|
Did you need to become root to modify the files in /ebrmain? Or did you pull the internal SD card from the device and patch it on another machine?
Edit: Oops. I guess since this thread is about copying the internal SD card image to a different card, the patching was done on another machine. Last edited by rkomar; 07-13-2018 at 09:21 PM. |
07-14-2018, 07:38 AM | #35 |
Enthusiast
Posts: 49
Karma: 107174
Join Date: Mar 2012
Device: PB631, PB741, PB840
|
Yes I did everything on another machine.
Note monitor.app is not in ebrmain, but in cramfs.img (I used cramfsck for extraction). I guess it could be copied without specific privileges from a running system. Then you would need root to remount rw /ebrmain and replace the link, or modify /etc/init.d/rcS to use the patched app. |
Advert | |
|
07-14-2018, 07:56 AM | #36 | |
Guru
Posts: 779
Karma: 625816
Join Date: Sep 2013
Device: EnergySistemEreaderPro, Nook STG, Pocketbook 622, Bookeen Cybooks ...
|
Quote:
Can you please be more specific with an exact example. I suspected the monitor.app to be responsible but did not find the string you quoted. Your steps 0) Create an image of the old card and burn it on the new card. 1) Changed in monitor.app the string: "/sys/block/mmcblk%c/device/serial" to "please quote it exactly" and 2) created a textfile (which formating) with only the CID of the new card and put it where exactly? 3) Last you symlinked the patched app from where to where. 4) Replace the old card with the new one. Last Question: From my tests the size of the image can't be changed. Same for you? |
|
07-14-2018, 09:43 AM | #37 |
Enthusiast
Posts: 49
Karma: 107174
Join Date: Mar 2012
Device: PB631, PB741, PB840
|
I will try to answer all your questions.
0/ Yes I "dd"-ed the original SD card and "dd"-ed the image on the new one. 1/ Yes. (check full res here: https://imgur.com/a/p8Rg8PZ ) This is the monitor.app file from 5.14_1225 firmware for TL2/626. So modified "/sys/block/mmcblk%c/device/serial" to "/mnt/secure/.sd_original_serial" (check screenshot, padded with a null byte). 2&3/ The ".sd_original_serial" was creating with the following command: echo 0xaabbccdd > .sd_original_serial When I have the SD in my computer, it is like that: Code:
Disk /dev/sdd: 14.7 GiB, 15720251392 bytes, 30703616 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x0a706388 Device Boot Start End Sectors Size Id Type /dev/sdd1 1009664 28606462 27596799 13.2G b W95 FAT32 /dev/sdd2 * 73728 139263 65536 32M 6 FAT16 /dev/sdd3 1 1009664 1009664 493M 85 Linux extended /dev/sdd4 28606464 30703615 2097152 1G 83 Linux /dev/sdd5 139264 172031 32768 16M 83 Linux /dev/sdd6 172032 204799 32768 16M 83 Linux /dev/sdd7 204800 275455 70656 34.5M 83 Linux /dev/sdd8 275456 776191 500736 244.5M 83 Linux /dev/sdd9 776192 976895 200704 98M 83 Linux /dev/sdd10 976896 1009663 32768 16M 83 Linux /dev/sdd2 is the boot partition (with what I guess is the kernel etc.) /dev/sdd7 is the root partition (with /etc, linux userland) /dev/sdd8 is ebrmain (it contains cramfs.img which in turn contains actual pocketbook programs like monitor.app, can be extracted with cramfsck). /dev/sdd9 is the "secure" partition, mounted as /mnt/secure on pocketbook. This is where I put the .sd_original_serial file. Code:
root@kali:/media/root/90ea7483-25c1-48ae-937c-b39d3b60b4e3# df -k . Filesystem 1K-blocks Used Available Use% Mounted on /dev/sdd9 97167 19473 72677 22% /media/root/90ea7483-25c1-48ae-937c-b39d3b60b4e3 root@kali:/media/root/90ea7483-25c1-48ae-937c-b39d3b60b4e3# ls -lA total 1314 -rw-r--r-- 1 root root 779270 Jul 11 2014 bootlogo.bmp -rw-rw-rw- 1 systemd-resolve systemd-timesync 0 Jul 8 11:01 device.cfg -rw-rw-rw- 1 root root 32 Jul 11 2014 deviceid drwxrwx--- 2 systemd-resolve systemd-timesync 1024 Jul 5 16:08 dictionaries -rw-r--r-- 1 root root 524288 Jul 11 2014 explorer-2.tar -r-------- 1 root root 4 Jan 1 2000 .freezestatus -rwxr-xr-x 1 root root 196 Jul 11 2014 fwinfo.txt -rw-rw---- 1 systemd-resolve systemd-timesync 51 Jul 5 16:10 global.cfg -rw-rw-rw- 1 systemd-resolve systemd-timesync 16 Jul 11 2014 .hashsum_1 -rw-r--r-- 1 root root 16 Jul 3 12:25 last_update drwxrwxrwx 2 systemd-resolve systemd-timesync 1024 Jul 8 11:01 Legimi drwxr-xr-x 2 root root 1024 Jul 5 16:10 logo drwxr-xr-x 2 root root 12288 Jan 1 2000 lost+found -rw-r--r-- 1 root root 343 Jul 10 2016 man2wall.txt -rw-rw-rw- 1 root root 139 Jul 14 08:01 monitorinfo -rw-r--r-- 1 root root 25 Jul 14 08:01 netdevcache -rw-r--r-- 1 root root 195 Jul 8 11:02 network.conf drwxrwx--- 2 systemd-resolve systemd-timesync 1024 Oct 23 2013 pbpk drwxrwxrwx 5 root root 1024 Jul 5 18:20 pb_sshd5 drwxr-xr-x 2 1000 1000 1024 Jan 1 2000 ppbk -rw-rw-rw- 1 root root 8 Oct 3 2015 reg.status drwxrwxrwx 2 systemd-resolve systemd-timesync 1024 Jul 8 10:56 runonce -rw-r--r-- 1 root root 11 Jul 8 10:08 .sd_original_serial -rw-rw-rw- 1 systemd-resolve systemd-timesync 0 Jul 8 11:01 settings_pass.txt -rwxrwx--- 1 systemd-resolve systemd-timesync 40 Jul 5 16:10 swupdate.db For replacing the pocketbook link to monitor app, I went into /dev/sdd8, copied the patched version of monitor.app, moved the old link, and made a new one. I have this: Code:
root@kali:/media/root/disk1# df -k . Filesystem 1K-blocks Used Available Use% Mounted on /dev/sdd8 249983 200078 37388 85% /media/root/disk1 root@kali:/media/root/disk1# ls -l total 127246 drwxr-xr-x 2 1028 users 2048 Jul 17 2017 adobefonts drwxr-xr-x 2 1028 users 1024 Jul 17 2017 applications drwxr-xr-x 2 1028 users 3072 Jul 17 2017 bin drwxr-xr-x 4 1028 users 1024 Jul 17 2017 config drwxr-xr-x 2 1028 users 1024 Jul 17 2017 cramfs -rw-r--r-- 1 1028 users 116277248 Jul 17 2017 cramfs.img drwxr-xr-x 10 root root 1024 Jul 5 16:08 demo drwxr-xr-x 3 1028 users 2048 Jul 17 2017 fonts -rw-r--r-- 1 1028 users 2623 Jul 17 2017 fsimage.md5 -rw-r--r-- 1 1028 users 287713 Jul 17 2017 fsimage.tar.gz drwxr-xr-x 4 1028 users 2048 Jul 17 2017 language drwxr-xr-x 6 1028 users 8192 Jul 17 2017 lib drwxr-xr-x 2 1028 users 1024 Jul 17 2017 libexec drwxr-xr-x 2 1028 users 1024 Jul 17 2017 license drwxr-xr-x 2 1028 users 1024 Jul 17 2017 logo drwxr-xr-x 2 1028 users 1024 Jul 17 2017 logo2 drwx------ 2 root root 12800000 Jul 17 2017 lost+found -rwxr--r-- 1 root root 387543 Jul 8 10:06 monitor.1225patched.app lrwxrwxrwx 1 root root 23 Jul 8 10:06 pocketbook -> monitor.1225patched.app lrwxrwxrwx 1 1028 users 15 Jul 17 2017 pocketbook.ORG -> bin/monitor.app drwxr-xr-x 2 1028 users 1024 Jul 17 2017 sbin drwxr-xr-x 17 1028 users 1024 Jul 17 2017 share drwxr-xr-x 2 1028 users 1024 Jul 17 2017 themes To answer your final question, the original SD was 4 Gb, the new one is 16. My user partition is 13+ Gb, and I have added a /dev/sdd4 ext2 partition to have native linux file system to play with (see fdisk -l output above). I can't really explain the steps to make /dev/sdd1 bigger, I did not take notes for those steps. I remember using fdisk to delete the old FAT32 partition and create the bigger one. Because of the strange partition layout I was not able to create it at the exact offset than the original. I am not sure if not respecting the value is important or not, but after creating it, I used a disk editor to patch the offset and restore the deleted partition start offset. I also used fdisk to create the 1 Gb partition #4 which does not exist in original SD card layout. I had no fear playing around like that since I have the SD card image to start over in case something wen wrong. While the SD card was in my PC, I modified /etc/sudoers to allow everything, created a mnt/alt directory and modified /etc/fstab to automatically mount my etx2 partition inside it at system startup. Code:
root@kali:/media/root/disk# cat etc/fstab none /proc proc defaults 0 0 none /dev/pts devpts mode=0622 0 0 tmpfs /dev/shm tmpfs defaults 0 0 /dev/mmcblk0p4 /mnt/alt auto defaults 0 0 /dev/mmcblk0p8 /ebrmain auto ro 0 0 /dev/mmcblk0p9 /mnt/secure auto defaults 0 0 /ebrmain/cramfs.img /ebrmain/cramfs auto defaults,loop 0 0 Edit: I could have put the .sd_original_serial file elsewhere, same with patched monitor.app, but this was done in a long process and made things like I felt. One thing you cannot avoid is modifying /dev/sdd8 to replace the link, or create a new cramfs.img and replace it (overkill in my opinion). Now it is done, but if I had to start over again, I would place those two files in the new #4 partition. This will not survive a firmware upgrade, but the device is "old" and I do not care. I hope I have been clear enough and you will be able to extend your partition, I regret not having taken notes of this step. Last edited by m4mmon; 07-14-2018 at 09:57 AM. Reason: remarks |
07-14-2018, 03:25 PM | #38 | |
Guru
Posts: 779
Karma: 625816
Join Date: Sep 2013
Device: EnergySistemEreaderPro, Nook STG, Pocketbook 622, Bookeen Cybooks ...
|
Very good tutorial, it was easy to follow and covered all I wanted to know. Thanks.
Edit: I'll try to do this after my holidays with one of my devices. I have previously allready extracted the monitor.app. Which is still unclear is this: Quote:
Last edited by nhedgehog; 07-14-2018 at 03:39 PM. |
|
07-14-2018, 05:39 PM | #39 |
Enthusiast
Posts: 49
Karma: 107174
Join Date: Mar 2012
Device: PB631, PB741, PB840
|
I decided to start all over again with another SD card in order to give clear explanations. I used a 32 Gb.
After preparing the card for the patched monitor.app as explained above, I copied all /dev/sdd1 contents to easy restore after partitioning, then launched fdisk on the card: Code:
root@kali:~/Desktop# fdisk /dev/sdd Welcome to fdisk (util-linux 2.29.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Command (m for help): p Disk /dev/sdd: 29.8 GiB, 32010928128 bytes, 62521344 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x0a706388 Device Boot Start End Sectors Size Id Type /dev/sdd1 1009664 7763967 6754304 3.2G b W95 FAT32 /dev/sdd2 * 73728 139263 65536 32M 6 FAT16 /dev/sdd3 1 1009664 1009664 493M 85 Linux extended /dev/sdd5 139264 172031 32768 16M 83 Linux /dev/sdd6 172032 204799 32768 16M 83 Linux /dev/sdd7 204800 275455 70656 34.5M 83 Linux /dev/sdd8 275456 776191 500736 244.5M 83 Linux /dev/sdd9 776192 976895 200704 98M 83 Linux /dev/sdd10 976896 1009663 32768 16M 83 Linux Partition table entries are not in disk order. Command (m for help): d Partition number (1-3,5-10, default 10): 1 Partition 1 has been deleted. Command (m for help): n Partition type p primary (1 primary, 1 extended, 2 free) l logical (numbered from 5) Select (default p): p Partition number (1,4, default 1): 1 First sector (1009665-62521343, default 1011712): 1009665 Last sector, +sectors or +size{K,M,G,T,P} (1009665-62521343, default 62521343): 60424191 Created a new partition 1 of type 'Linux' and of size 28.3 GiB. Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. I also kept space at the end of the card for my future #4 partition. Since I wanted to know if it was useful or not to have the partition starting at the 1009664 sector, I kept it like that and formatted it: Code:
root@kali:~# mkdosfs -F 32 -I /dev/sdd1 mkfs.fat 4.1 (2017-01-24) Just for explaining how I modified the card with disk editor in my previous post (which is useless!), I used Active Disk Editor on windows, the first software I tried and it did the job. I edited the "First sector value" (this is what fdisk reads and shows). https://imgur.com/a/0Vm39ns |
07-15-2018, 11:34 AM | #40 |
Guru
Posts: 779
Karma: 625816
Join Date: Sep 2013
Device: EnergySistemEreaderPro, Nook STG, Pocketbook 622, Bookeen Cybooks ...
|
Again, great tutorial! I just checked it and got it running!
Some remarks: 1) To create the symbolik link to monitor.patched.app I used at first absolute paths (/media/sdb8/monitor.patched.app), which resulted in bootloop [I know this was a stupid mistake]. Later I used this command: cd /media/sdb8 ln -s monitor.patched.app pocketbook and everything worked well, even the resizing. 2) Extracting the monitor.app can be done via mounting and copying it to the fat32 partition: mkdir /tmp/image mount -t cramfs -o loop /media/sdb8/cramfs.img /tmp/image cp /tmp/image/bin/monitor.app /media/sdb1/ umount /tmp/image 3) I found dd for copying the content of the SD really slow, doing this under Windows with USB Image Tool from Alexander Beug was much quicker. Last edited by nhedgehog; 07-15-2018 at 11:51 AM. |
07-15-2018, 02:15 PM | #41 |
Enthusiast
Posts: 49
Karma: 107174
Join Date: Mar 2012
Device: PB631, PB741, PB840
|
Good to know you succeeded!
|
08-21-2018, 05:45 AM | #42 |
Member
Posts: 16
Karma: 10
Join Date: Feb 2015
Device: Pocketbook 626 TL2
|
Great thanks to all of you. It works like a charm!
|
09-11-2018, 05:47 PM | #43 |
Junior Member
Posts: 1
Karma: 10
Join Date: Sep 2018
Device: Tl3
|
Hello guys i have same problem with tl3 internal card i have new cloned card And i manage to edit monitor.app but i have Windows 10 and no experience with Linux can some one help me with this on Windows or if Its not posible on Windows then some one make Linux total noob tutorial (im mega Linux noob i dont know much about terminal ) thanks
|
09-14-2018, 07:59 AM | #44 |
Member
Posts: 16
Karma: 10
Join Date: Feb 2015
Device: Pocketbook 626 TL2
|
You can download File Compare for Windows and make changes in the file monitor.app in Windows.
|
09-14-2018, 09:28 AM | #45 |
Guru
Posts: 779
Karma: 625816
Join Date: Sep 2013
Device: EnergySistemEreaderPro, Nook STG, Pocketbook 622, Bookeen Cybooks ...
|
It is not working without Linux and some rudimentary knowledge of it.
|
Tags |
pb626, pocketbook |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
No write access to Kobo internal memory (seemingly) | simonk | Kobo Reader | 3 | 11-22-2015 01:35 PM |
Touch Is it better to us SD than internal memory? | CatherineStewart | Kobo Reader | 5 | 09-12-2012 12:46 PM |
Books on internal memory show as on Memory Stick | doreenjoy | Sony Reader | 6 | 06-05-2009 03:08 AM |
Internal Memory | jlbfoot | Sony Reader | 3 | 12-16-2008 05:34 PM |
Memory cards and internal memory | Valloric | Sony Reader | 30 | 02-15-2008 06:46 AM |