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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 04-30-2012, 01:25 PM   #31
diba
Addict
diba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolate
 
Posts: 396
Karma: 33660
Join Date: Jul 2011
Device: Kindle 3, Kindle 4, Kindle PW, Nexus7 3G
And thats the only thing where a typo could happen. Probably this was the reason at my last try, I read it 2 times slowly aloud after realising having typed jpatch.jar first.
diba is offline   Reply With Quote
Old 04-30-2012, 01:30 PM   #32
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Ok, so I just went suicidal and modified the file in the wrong way. ("jbpatcher.jar" instead of "jbpatch.jar").

And yes, my device is now bricked.

Update:
And here is how I unbricked it:
For a short amount of time (10 secs or so), the Kindle still shows up as a USB device, so I issued "touch /media/Kindle/ENABLE_DIAGS" in that timeframe. After two more reboots, I ended up in (SSH-enabled) diags. I ssh'ed in, and:
Code:
mount /dev/mmcblk0p1 /mnt/mmc/
vi /mnt/mmc/opt/amazon/ebook/bin/init.xargs
rm /var/local/upstart/lab126_gui.restarts
umount /mnt/mmc
idme -d --bootmode main
rm /mnt/us/ENABLE_DIAGS
sync; reboot
And all is good again. I'll update the first post with a big fat warning concerning the init.xargs editing

Last edited by ixtab; 04-30-2012 at 04:01 PM. Reason: Updated code to be more "standards-compliant"
ixtab is offline   Reply With Quote
Advert
Old 04-30-2012, 01:46 PM   #33
diba
Addict
diba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolate
 
Posts: 396
Karma: 33660
Join Date: Jul 2011
Device: Kindle 3, Kindle 4, Kindle PW, Nexus7 3G
Have fun unbricking again! Now I really believe I modified it last time this way ..., probably getting the file modified should be done by copy - paste to avoid typos.
diba is offline   Reply With Quote
Old 04-30-2012, 01:57 PM   #34
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Not a big deal.
ixtab is offline   Reply With Quote
Old 04-30-2012, 02:11 PM   #35
tvjohn
Connoisseur
tvjohn is a glorious beacon of lighttvjohn is a glorious beacon of lighttvjohn is a glorious beacon of lighttvjohn is a glorious beacon of lighttvjohn is a glorious beacon of lighttvjohn is a glorious beacon of lighttvjohn is a glorious beacon of lighttvjohn is a glorious beacon of lighttvjohn is a glorious beacon of lighttvjohn is a glorious beacon of lighttvjohn is a glorious beacon of light
 
Posts: 83
Karma: 12307
Join Date: Apr 2011
Device: Kindle 3, K4NT
Quote:
Originally Posted by ixtab View Post
Thanks for the feedback.


@tvjohn: did your edited file look like this? (I know you probably can't access it right now, so "from memory" is ok). Also, how did you edit that file? Directly on the device using vi or similar, or by copying it back and forth? If the latter, could it be that you used Mac line endings instead of Unix ones while saving?
I can't see it currently, that's right I thought I used the right name, but maybe not.

I used vi via the built-in "Terminal" on OS X. OS X uses LF as line end, & I use "Textwrangler" to edit files on the Mac, & I can select line ends to suit the target.

I'm looking through the DeBrick thread now of course, but so far I'm unsure how I can access the Amazon file where I inserted that line. Is the root partition supposed to be mounted to allow access beside the usual /mnt/us?

I have managed to get into diags mode, & switched to usbnet mode, as of course that's how I edited the file, but my connection is always refused.

I'll do some more reading, thanks.
tvjohn is offline   Reply With Quote
Advert
Old 04-30-2012, 02:26 PM   #36
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Quote:
Originally Posted by tvjohn View Post
I'm looking through the DeBrick thread now of course, but so far I'm unsure how I can access the Amazon file where I inserted that line. Is the root partition supposed to be mounted to allow access beside the usual /mnt/us?
That is the problem. You can't really access it unless you get a full shell somehow.

Quote:
Originally Posted by tvjohn View Post
I have managed to get into diags mode, & switched to usbnet mode, as of course that's how I edited the file, but my connection is always refused.
That's probably because you don't have the SSH-enabled diags partition. You can get an image with built-in SSH from http://gitbrew.org/~dasmoover/kindle/touch/forensic/ (either *p2.img is ok). The only problem now is that you can't easily update the partition (If you had a running main partition, you could just dd it.)

So the easiest way is probably to flash that diags partition.

There *might* be an alternative: re-apply the jailbreak as described here: https://wiki.mobileread.com/wiki/Kind....tar.gz_method
It still supports a /mnt/us/runme.sh.

You could probably create a runme.sh which simply replaces the init.xargs with a pristine copy, and removes the gui_restarts thingy. (It would be a subset of the commands in my above post). I haven't tested this, though.

Either way, I strongly recommend installing the SSH-enabled diags partition as soon as you can, as it's a real lifesaver. I de-bricked my device in 5 minutes with it...
ixtab is offline   Reply With Quote
Old 04-30-2012, 03:09 PM   #37
tvjohn
Connoisseur
tvjohn is a glorious beacon of lighttvjohn is a glorious beacon of lighttvjohn is a glorious beacon of lighttvjohn is a glorious beacon of lighttvjohn is a glorious beacon of lighttvjohn is a glorious beacon of lighttvjohn is a glorious beacon of lighttvjohn is a glorious beacon of lighttvjohn is a glorious beacon of lighttvjohn is a glorious beacon of lighttvjohn is a glorious beacon of light
 
Posts: 83
Karma: 12307
Join Date: Apr 2011
Device: Kindle 3, K4NT
Quote:
Originally Posted by ixtab View Post
...
There *might* be an alternative: re-apply the jailbreak as described here: https://wiki.mobileread.com/wiki/Kind....tar.gz_method
It still supports a /mnt/us/runme.sh.

You could probably create a runme.sh which simply replaces the init.xargs with a pristine copy, and removes the gui_restarts thingy. (It would be a subset of the commands in my above post). I haven't tested this, though.

Either way, I strongly recommend installing the SSH-enabled diags partition as soon as you can, as it's a real lifesaver. I de-bricked my device in 5 minutes with it...
Ok, I'll have to try that. In fact, my new RUNME.sh:

test -f /mnt/us/RUNME.done && exit
# The following set of commands will be executed (in the context of your Kindle) exactly once. To make them execute again, remove RUNME.done
#
# (mntroot rw and mntroot ro below are only shown for convenience, and not needed for this particular script. These commands allow
# to modify the internal file system. Use only if you know what you are doing. Oh well, you should have only ended up needing this advice
# if you knew what you were doing in the first place.*;-)
mntroot rw
showlog > /mnt/us/log.txt
echo 0 > /var/local/upstart/lab126_gui.restarts
cp /mnt/us/init.xargs /opt/amazon/ebook/bin/init.xargs
mntroot ro


I checked my mac terminal history & luckily init.xargs vi window contents are still there (ah, just realised you actually posted that anyway, thanks) so I made a new file of that & copied it to the mounted Kindle.


I'll go & get a (stiff) drink now, then maybe have another go with your mod'

Actually, perhaps better to do that SSH enabled diags first!

Thank you for your speedy response ixtab, Mayan Goddess is watching over us
tvjohn is offline   Reply With Quote
Old 04-30-2012, 03:19 PM   #38
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Watch out, I think its "runme.sh" (lowercased!) -- at least from quickly looking into the actual data.tar.gz . You might just create both RUNME.sh and runme.sh if in doubt.

Also, be aware that unless I'm completely wrong, this data.tar.gz will run inside the diags partition, so you may need to adapt the script to write to the main partition instead. But don't take my word for it. Probably it's best to look inside the data.tar.gz to understand its magic (I didn't thoroughly look inside, I never needed it anymore after having the SSH diags); otherwise the logic looks fine.

Oh, and beware: it's the Mayan goddess of suicide. Somewhat fitting in this context

Cheers!

Update: Oh, and you may also want to copy the init.xargs somewhere (/mnt/us/init.xargs.broken?) before overwriting it, just to verify that it was indeed the culprit...

Last edited by ixtab; 04-30-2012 at 03:30 PM.
ixtab is offline   Reply With Quote
Old 04-30-2012, 03:33 PM   #39
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by ixtab View Post
Code:
mount /dev/mmcblk0p1 /mnt/main/
vi /mnt/main/opt/amazon/ebook/bin/init.xargs
rm /var/local/upstart/lab126_gui.restarts
idme -d --bootmode main
rm /mnt/us/ENABLE_DIAGS
umount /mnt/main
sync; reboot
On a "normal" kindle, those /mnt/main paths should be /mnt/mmc
geekmaster is offline   Reply With Quote
Old 04-30-2012, 03:40 PM   #40
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by ixtab View Post
Watch out, I think its "runme.sh" (lowercased!) -- at least from quickly looking into the actual data.tar.gz . You might just create both RUNME.sh and runme.sh if in doubt.
Umm... you do know that FAT fs ignores file case, right? Although linux is fine with creating both files, windows will get all unhappy about accessing a FAT fs with both of those files on it.
geekmaster is offline   Reply With Quote
Old 04-30-2012, 03:59 PM   #41
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Quote:
Originally Posted by geekmaster View Post
On a "normal" kindle, those /mnt/main paths should be /mnt/mmc
You're probably right. I think I created that mountpoint because I couldn't make sense of the others. "mmc" may be available, but semantically I consider it to mean the device, not the "main" partition on it.

As to the filename issue (RUNME.sh vs runme.sh) you're right. You can only have one because of the FAT filesystem...

geekmaster, since you know more about the jailbreak: can you confirm that it's running inside the diags system, thus requiring mounting the main partition first (probably to /mnt/mmc ) to copy files back and forth?
ixtab is offline   Reply With Quote
Old 04-30-2012, 04:14 PM   #42
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by ixtab View Post
geekmaster, since you know more about the jailbreak: can you confirm that it's running inside the diags system, thus requiring mounting the main partition first (probably to /mnt/mmc ) to copy files back and forth?
The one I did with the "generic" mntus.params that is safe for all kindle models, runs in both main and diags boots (depending on ENABLE_DIAGS or the idme bootmode var or the MfgTool select boot getting it there). And it works in both main and diags on 5.1.0 too. Any script launched from mntus.param can run before /mnt/us is mounted, so mine mounts /mnt/us (the writable version) itself. It irks me when people post instructions to mount to /mnt/base-us (the read-only version) then remount it writable.

It looks for BOTH a runme.sh or a RUNME.sh, and runs one if present. Of course, whatever partition you booted becomes the root, so you need to mount main if you booted diags. /mnt/mmc is a good mount point to recommend because it is not used and it is always present. Of course, you COULD mount to any folder, but in my posts I standardized on /mnt/mmc (easy to type, free, and always available with no extra steps to confuse noobs).

I have a "smart" RUNME.sh that checks /proc/bootmode (or whatever -- I don't remember clearly). Then it sets a sentinel file and deletes RUNME.done just before rebooting, then does the idme and reboot commands. The sentinel is to prevent a stuck reboot loop.

My smart RUNME.sh makes CLEAN backup copies of mmcblk0p1 and mmcblk0p2 by booting to the OTHER partition before each copy -- all automagically...

Anyway, although my script works great for me, it is one of many that I did not post because it is not totally noob-proof.

UPDATE: If you are referring to yifanlu's jailbreak, I believe that it does run in diags, as I recall. The details are posted at his website... But if you mean MINE, then it runs in either bootmode, and it mounts main to mmc itself before calling RUNME.sh, then unmounts it on return.

And I still have a reserve jailbreak method that should still work in case data.tar.gz gets disabled in a future update.



Last edited by geekmaster; 04-30-2012 at 04:25 PM.
geekmaster is offline   Reply With Quote
Old 04-30-2012, 04:52 PM   #43
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Quote:
Originally Posted by geekmaster View Post
UPDATE: If you are referring to yifanlu's jailbreak, I believe that it does run in diags, as I recall. The details are posted at his website... But if you mean MINE, then it runs in either bootmode, and it mounts main to mmc itself before calling RUNME.sh, then unmounts it on return.
I think I do. It's the one referred to on the Wiki (which in turn is the one from Yifan, I just re-uploaded it because it seems to have disappeared from his site). I wasn't even aware that you had made yet another one. It's easy to get lost with all the different versions

But how on earth can yours run on the main partition in 5.1.0, if they removed data.tar.gz extraction logic from that version? Or am I getting something completely wrong here?
ixtab is offline   Reply With Quote
Old 05-01-2012, 02:07 PM   #44
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
If you have ideas for useful patches, feel free to post them here. I don't want this to be stuck in the "demo + TTS enabling" phase forever

Note: "patches", not "an entirely new OS" (Also see updated first post). While it's hard to define what exactly qualifies as a "patch", maybe something like "small changes to the UI or its logic, which slightly modify the way the device behaves" could do as a vague definition.

Also note that not everything may be possible to do, because the Kindle (and especially the K5) consist of many building blocks, not all of which are Java. For instance, the request that just popped up (to have the home button behave as "page forward") cannot be catered for with this mechanism alone, as it involves components outside of the Java "subsystem".

That said, if you have some nice ideas, post them here. But I can't promise that I can implement everything (and I wouldn't mind at all if others tried to develop something).
ixtab is offline   Reply With Quote
Old 05-01-2012, 02:58 PM   #45
silver18
THE NOOB
silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.
 
silver18's Avatar
 
Posts: 701
Karma: 1545649
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
Could it be used to restore the browser rotation (adding the corresponding menu entry)?
Thanks!!!
silver18 is offline   Reply With Quote
Reply

Tags
jbpatch, kindle touch hacks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump


All times are GMT -4. The time now is 03:32 AM.


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