Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > PocketBook > PocketBook Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 02-10-2020, 12:03 PM   #1
sigizmund
Member
sigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheese
 
Posts: 21
Karma: 1088
Join Date: Dec 2009
Device: Pocketbook && Android
Booting Pocketbook in qemu

Hey folks,

I've been hacking my Touch Lux 4 lately - mainly trying to boot full system image in qemu.

Here's what I am doing:
  1. I made full image of the internal SD card
  2. Figured out that partition #7 is the root partition (with /sbin/init)

Now I am running:
Code:
qemu-system-arm -M vexpress-a9 -kernel vmlinuz-3.2.0-4-vexpress -initrd initrd.img-3.2.0-4-vexpress -sd ../full_disk.raw -append "ext2=1 root=/dev/mmcblk0p7"
Note, that I am not immediately certain that vexpress-a9 is the right machine type, but this page suggests this is a good option for Allwiner A10 (sun5i) CPU in my Pocketbook.

I figured that I have to pass ext2=1 to kernel command line because otherwise it fails to mount the partition (idk why ext2 is not enabled by default in initrd).

So right now the process goes all the way to running init which fails:
Code:
/init: line 327: can't open /root/dev/console: no such file
and panic ensues.

Any thoughts how can I make progress there?
sigizmund is offline   Reply With Quote
Old 02-15-2020, 05:16 AM   #2
WaseemAlkurdi
Zealot
WaseemAlkurdi began at the beginning.
 
Posts: 147
Karma: 12
Join Date: Jul 2019
Device: Kindle Touch (K5) Wi-Fi x 2, Kindle (7th Gen, KT2), Paperwhite 3rd Gen
You must add:
Code:
 ... console=ttyAMA0
to your QEMU commandline.
WaseemAlkurdi is offline   Reply With Quote
Old 02-17-2020, 07:18 AM   #3
sigizmund
Member
sigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheese
 
Posts: 21
Karma: 1088
Join Date: Dec 2009
Device: Pocketbook && Android
Quote:
Originally Posted by WaseemAlkurdi View Post
You must add:
Code:
 ... console=ttyAMA0
to your QEMU commandline.
Thanks! Now I am running:

Code:
qemu-system-arm -M vexpress-a9 -kernel vmlinuz-3.2.0-4-vexpress -initrd initrd.img-3.2.0-4-vexpress -sd ../full_disk.qcow2 -append "ext2=1 root=/dev/mmcblk0p7 console=ttyS0"
However, the qemu screen is now empty and no messages are printed in the console other than:

Code:
sgzmd@roman-dev:qemu/sunxi]$ qemu-system-arm -M vexpress-a9 -kernel vmlinuz-3.2.0-4-vexpress -initrd initrd.img-3.2.0-4-vexpress -sd ../full_disk.qcow2 -append "ext2=1 root=/dev/mmcblk0p7 console=ttyS0"                     
pulseaudio: set_sink_input_volume() failed
                                          pulseaudio: Reason: Invalid argument
                                                                              pulseaudio: set_sink_input_mute() failed
                                                                                                                      pulseaudio: Reason: Invalid argument
Since the qemu screen empty I can't really see what's the next problem. Using -curses option doesn't help - grey screen and nothing much else.

Also Ctrl-C' no longer works (expected?)
sigizmund is offline   Reply With Quote
Old 02-17-2020, 07:20 AM   #4
sigizmund
Member
sigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheese
 
Posts: 21
Karma: 1088
Join Date: Dec 2009
Device: Pocketbook && Android
Also, changing to console=ttyAMA0 produces identical result, that was just me playing. Not sure what's the difference to be completely honest.
sigizmund is offline   Reply With Quote
Old 02-27-2020, 08:44 AM   #5
ezdiy
Connoisseur
ezdiy inspires wonder wherever he or she goes.ezdiy inspires wonder wherever he or she goes.ezdiy inspires wonder wherever he or she goes.ezdiy inspires wonder wherever he or she goes.ezdiy inspires wonder wherever he or she goes.ezdiy inspires wonder wherever he or she goes.ezdiy inspires wonder wherever he or she goes.ezdiy inspires wonder wherever he or she goes.ezdiy inspires wonder wherever he or she goes.ezdiy inspires wonder wherever he or she goes.ezdiy inspires wonder wherever he or she goes.
 
Posts: 64
Karma: 151518
Join Date: Oct 2019
Device: KT, KPW4, PB740-2
The monitor app won't boot in qemu as it expects a lot of I/O specific to this board it assumes to be present. Moreoever, real system uses multiple partitions you need to expose as mmc layout correctly - best is to just give it full NAND dump and let qemu expose that as full emmc device. A good starting point is to look at what the running system actually does and try to replicate that.

And even after that, you'll have to then manually patch monitor.app to ignore all the missing ioctls. In summary, it's not usually worth it. Its usually far simpler AND more useful (able to trace actual kernel) on a running system directly, on the device. Like most allwinner boards, it's neigh impossible to truly brick your system, even if you do something exceptionally silly, like wipe out whole emmc. The brom is smart enough to fallback to secondary mmc.

Just make sure to do the important part: Have full dump of the stock emmc at hand, to have something you can restore. Official FW update files *cannot* really repair broken partitions on their own.
ezdiy is offline   Reply With Quote
Old 02-28-2020, 05:22 AM   #6
sigizmund
Member
sigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheese
 
Posts: 21
Karma: 1088
Join Date: Dec 2009
Device: Pocketbook && Android
Quote:
Originally Posted by ezdiy View Post
Its usually far simpler AND more useful (able to trace actual kernel) on a running system directly, on the device. Like most allwinner boards, it's neigh impossible to truly brick your system, even if you do something exceptionally silly, like wipe out whole emmc. The brom is smart enough to fallback to secondary mmc.

Just make sure to do the important part: Have full dump of the stock emmc at hand, to have something you can restore. Official FW update files *cannot* really repair broken partitions on their own.
Thanks a lot for the advice! I'll start digging that direction then!
sigizmund is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PW Booting to CELESTE_WFO autumnhasfallen Kindle Developer's Corner 1 09-28-2018 07:53 AM
Debian on modern kindles with pre-built qemu and debian image, scripts, desktop theol0403 Kindle Developer's Corner 25 08-25-2017 02:49 AM
H2O not booting boriar Kobo Developer's Corner 41 02-05-2015 08:11 AM
DR1000 Where can I start qemu in Anjuta? Gogolo iRex Developer's Corner 2 08-29-2011 04:44 PM
More memory for qemu image Mackx iRex Developer's Corner 2 06-27-2010 02:20 PM


All times are GMT -4. The time now is 11:27 PM.


MobileRead.com is a privately owned, operated and funded community.