![]() |
#1 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12
Karma: 85746
Join Date: Jun 2012
Device: Kindle Touch
|
Chroot environment locks up?
So I created a Debian image file and am trying to set it up as a chroot system on the KT. I tried both creating my own image, and using someone elses image from somewhere on these forums.. can't remember exactly where.
The problem came up when I try to use apt. It seems to lock up the entire filesystem somehow. for instance, running apt-get update will freeze in the middle of stuff (not always at the same point mind you...). Anytime any process trys to access parts of the filesystem, they hang as well. for instance, after apt hangs, I can call "ls /" fine, but "ls /mnt/us" will freeze... If I try to access a book from the kindle UI, the UI freezes... only thing I can do is a hard reset to fix it. Seeing as how other people seem to have gotten this to work already, I'm kinda stuck as to why this is happening. Any advice here would be greatly appreciated! |
![]() |
![]() |
![]() |
#2 | |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Normally, it would not be possible to "see" parts of the file system outside of the chroot. So as an example of the missing information: Did you try the reported "ls" commands from inside of the chroot? If so, have you done some filesystem commands that make you think you should be able to see the file system outside of the chroot? What all have you done to start the chroot prior to entering it? Use this link for reference: http://www.gerv.net/hacking/how-to-ask-good-questions/ Last edited by knc1; 06-22-2012 at 10:49 PM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12
Karma: 85746
Join Date: Jun 2012
Device: Kindle Touch
|
oky then. heres what I've done:
- created a debian disk image using debootstrap, and completeing the --second-stage bit with qemu. - moved the image onto the /mnt/us partition - used the script from http://xkid.biz/wordpress/?p=4 - ssh into the kindle - execute the chroot script - in the chroot: --- add debian testing repo into sources.list --- apt-get update here the output from apt: Get:1 http://ftp.debian.org testing InRelease [190 kB] Get:2 http://ftp.debian.org testing/main armel Packages [5710 kB] Get:3 http://ftp.debian.org testing/main Translation-en [3886 kB] 100% [2 Packages bzip2 0 B] - in another ssh session with the kindle, outside the chroot (after apt hangs): --- ls / (works just fine) --- ls /mnt (hangs) also, other programs seem to get stuck. as mentioned, the framework locks up trying to access a book (the user guide in my case). from running ps outside the chroot, tinyrot also seems to gets stuck, for example. |
![]() |
![]() |
![]() |
#4 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
I discovered that loop mounts are MUCH more useful (more free RAM) while booted from diags, which does not load the framework (cvm and Xorg). If you can stop and unload the framework without making the K5 reboot itself, you may be successful booting from main too. If you just kill cvm or Xorg (commonly done on earlier kindles), the K5 just reboots itself. In some cases, K5 devices seem to have bricked themselves while trying to use a loop mount, but I think now that it was just a dead battery. Battery charging does not work well while booted from diags (at least on the original diags kernel), and a K5 can act bricked if it has an almost dead battery and an ENABLE_DIAGS file. You can read more about it in some older posts about optware and loop mounts. Last edited by geekmaster; 06-23-2012 at 03:15 AM. |
|
![]() |
![]() |
![]() |
#5 | |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
You do not need a lot, just enough to work around some VFS problems not solved until last week's kernel release. Half of your RAM (128mb) will do fine. There are network file systems that will let you put the swap on another machine accessed over whatever networking you have installed. For casual use, not worth the effort. Your choices are a swap partition or a swap file, in this case choose a swap file. Yes, you can run swap on the internal eMMC. Yes, this will generate eMMC wear that would not otherwise happen. Yes, this will reduce the amount of time before you have to replace it. Yes, it is difficult to replace and expensive to hire done. Cheaper to just toss the Kindle when the eMMC wears out. You will be taking a few years off the devices expected ten year useful life. Where you going to keep this Kindle longer than two or three years anyway? Got all that? Agreed? All right then: Use dd to make a 128Mb file of zeros (must be zeros for swap, not a sparse file, swap doesn't do sparse files); Use mkswap on the filename; Use swapon <filename> and swapoff <filename> as appropriate. Enjoy. Edit: As GM points out, keep the Kindle on the charger whenever your using it this way. The device type which MMC devices are built on does not do "write", only erase and re-program. The base device is an EEEProm, it generates its erase and programming voltages internally. The micro-controller in the MMC device just "fakes" the write command with a "read, merge, erase, re-program" sequence in "erase block" size chunks. Not only power hungry but a slow process. On the upside, swap only writes in page size (4096byte) chunks and this eMMC has an erase block size of 4096 bytes. So there should not be any "merge" operation if the file location is erase block aligned. Since you are putting this file on FAT-32, you can (manually) diddle with the file alignment with any decent MSDOS disk editor. Last edited by knc1; 06-23-2012 at 06:54 AM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
In any case, after a kindle has been used awhile, it would be safe to assume that write wear leveling is not effective due to no unused low-level formatted erase blocks. So, a good rule-of-thumb is to only use a swap file when you need it (such as during a large compile) and turn it off when not required (using swapon and swapoff commands). |
|
![]() |
![]() |
![]() |
#7 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 608
Karma: 1588610
Join Date: Jan 2012
Device: Kindle Scribe
|
Code:
[root@kindle root]# swapon /mnt/us/swapfile swapon: /mnt/us/swapfile: Invalid argument |
![]() |
![]() |
![]() |
#8 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 608
Karma: 1588610
Join Date: Jan 2012
Device: Kindle Scribe
|
[CODE]
[root@kindle root]# swapon /mnt/us/swapfile swapon: /mnt/us/swapfile: Invalid argument [CODE] |
![]() |
![]() |
![]() |
#9 | |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
http://www.gerv.net/hacking/how-to-ask-good-questions/ |
|
![]() |
![]() |
![]() |
#10 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 608
Karma: 1588610
Join Date: Jan 2012
Device: Kindle Scribe
|
On the host:
Code:
$su $dd if=/dev/zero of=~/swapfile bs=1024 count=100000 $mkswap ~/swapfile $cp ~/swapfile /media/Kindle $umount /media/Kindle Code:
[root@kindle root]# swapon /mnt/us/swapfile swapon: /mnt/us/swapfile: Invalid argument Last edited by aditya3098; 06-24-2012 at 10:00 AM. Reason: Added $ |
![]() |
![]() |
![]() |
#11 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Is the host running 32bit, Little Endian, ARM?
If not, that is probably your problem. |
![]() |
![]() |
![]() |
#12 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 608
Karma: 1588610
Join Date: Jan 2012
Device: Kindle Scribe
|
|
![]() |
![]() |
![]() |
#13 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
A simple "No" would do.
re-run mkswap on the file after you transfer it to the Kindle, using the Kindle's mkswap command. Swap files have meta-data, which, among other things, prevents you from trying to restore an x86 hibernation image to an ARM machine. |
![]() |
![]() |
![]() |
#14 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 608
Karma: 1588610
Join Date: Jan 2012
Device: Kindle Scribe
|
Still not working
|
![]() |
![]() |
![]() |
#15 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Insufficent data to compute an answer.
Please stop wasting our time. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Troubleshooting my kindle3g locks up when I go online | carbide08 | Amazon Kindle | 5 | 08-21-2011 02:35 PM |
Kobo locks up on this ePub | RSaunders | Devices | 3 | 08-10-2011 01:55 PM |
Library Software Locks Up | sakura-panda | Sony Reader | 8 | 01-02-2010 01:40 AM |
Document locks up Kindle 2 | Rhett | Amazon Kindle | 0 | 10-25-2009 07:45 PM |
HanLin V3 locks up | roytravis | HanLin eBook | 8 | 05-27-2009 10:03 AM |