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 12-09-2019, 06:52 AM   #1
MrTick
Enthusiast
MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.
 
MrTick's Avatar
 
Posts: 29
Karma: 107593
Join Date: Dec 2018
Device: K3 KT DxG PW1 PW4
Restore ;log command for 5.12.* firmware

This will work if and only if recent jailbreak hotfix was installed before the update.

This script modifies debug_cmds.json file so it includes again ;log command.
It also adds ;mrpi command that launches mrpi (has to be installed in the default extensions location)
Code:
{
    ";log" : "/usr/bin/logThis.sh",
    ";mrpi" : "/mnt/us/extensions/MRInstaller/bin/mrinstaller.sh launch_installer",
This is most useful for people that have Kindle updated to >=5.12.2 with jailbreak only.
KUAL installation requires MRPI and MRPI requires ;log command to install KUAL (or maybe there's an easier method I've missed somewhere?...)

Installation:
  1. copy emergency.sh to the root USB folder
  2. restart your Kindle (Menu->Settings->Restart)
  3. verify the script was executed: following files will apper:
    • done_emergency.sh
    • old_debug_cmds.json
    • new_debug_cmds.json
  4. restart your Kindle again

If the files from 3. did not appear and you can still see emergency.sh file then try reinstalling the JB hotfix.

After successful execution you can unpack MRPI to USB root, add KUAL package to mrpackages folder and run ;mrpi command.

Note: if anything goes wrong, i.e new_debug_cmds.json looks malformed, copy emergency_revert.sh to USB root, rename it to emergency.sh and restart the Kindle.

EDIT: this debug-list fix can probably be included in JB hotfix, but quoting logThis.sh code:
Quote:
...
## We could arguably patch the debug command list, but, meh.
...
Attached Files
File Type: zip restore_log_0.1.zip (737 Bytes, 401 views)

Last edited by MrTick; 12-09-2019 at 07:17 AM.
MrTick is offline   Reply With Quote
Old 12-09-2019, 07:30 AM   #2
Junket
Nil adsuetudine maius
Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.
 
Junket's Avatar
 
Posts: 278
Karma: 400000
Join Date: Nov 2019
Location: US
Device: PW4
Quote:
Originally Posted by MrTick
;log command to install KUAL (or maybe there's an easier method I've missed somewhere?...

;log command MIA in 5.12.2 I believe.

NiLuJe made a hotfix variant of KUAL that can by installed by UYK (Update Your Kindle) instead. See here.
Junket is offline   Reply With Quote
Advert
Old 12-09-2019, 07:33 AM   #3
MrTick
Enthusiast
MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.
 
MrTick's Avatar
 
Posts: 29
Karma: 107593
Join Date: Dec 2018
Device: K3 KT DxG PW1 PW4
Quote:
Originally Posted by Junket View Post
NiLuJe made a hotfix variant of KUAL that can by installed by UYK (Update Your Kindle) instead.
Darn, I knew there should be an easier way

Last edited by MrTick; 12-09-2019 at 07:43 AM.
MrTick is offline   Reply With Quote
Old 12-09-2019, 09:46 AM   #4
pavel-s
Enthusiast
pavel-s began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Sep 2017
Device: PW3/4
Wow, it restored the jailbreak on my PW4 5.12.2! Previously, I tried the UYK method but it didn't work (error 007).

Gorgeous, thanks a lot!

Last edited by pavel-s; 12-09-2019 at 09:51 AM.
pavel-s is offline   Reply With Quote
Old 12-09-2019, 09:52 AM   #5
MrTick
Enthusiast
MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.
 
MrTick's Avatar
 
Posts: 29
Karma: 107593
Join Date: Dec 2018
Device: K3 KT DxG PW1 PW4
Quote:
Originally Posted by pavel-s View Post
Wow, it restored the jailbreak on my PW4 5.12.2!
Awesome! Probably the jailbreak was still there (the bridge at least), as the bridge itself is responsible for running emergency.sh on startup.
MrTick is offline   Reply With Quote
Advert
Old 12-09-2019, 02:46 PM   #6
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 9,828
Karma: 17500002
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O & Forma
Yeah, I didn't want to do it this way because that'd be one more thing to keep track of in the bridge and it's potentially a moving target, plus I'd have had to double-check the depgraph to check when best to patch it, hence that comment in the dispatcher . (Also, I'm lazy).

But, it is an entirely viable approach if you want to bother with it.
NiLuJe is offline   Reply With Quote
Old 12-09-2019, 02:52 PM   #7
Junket
Nil adsuetudine maius
Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.
 
Junket's Avatar
 
Posts: 278
Karma: 400000
Join Date: Nov 2019
Location: US
Device: PW4
^ Typo. You spelt efficient "lazy"
Junket is offline   Reply With Quote
Old 12-10-2019, 03:51 AM   #8
LastSilmaril
Enthusiast
LastSilmaril began at the beginning.
 
Posts: 41
Karma: 10
Join Date: Oct 2011
Device: PW2 3G, KV 3G
Thanks for this. Works like a charm.
LastSilmaril is offline   Reply With Quote
Old 12-10-2019, 04:16 AM   #9
MrTick
Enthusiast
MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.
 
MrTick's Avatar
 
Posts: 29
Karma: 107593
Join Date: Dec 2018
Device: K3 KT DxG PW1 PW4
Quote:
Originally Posted by NiLuJe View Post
(...)that'd be one more thing to keep track of in the bridge and it's potentially a moving target, plus I'd have had to double-check the depgraph to check when best to patch it (...)
Then I'll try to maintain this patch as long as I'm able to

Another hotfix-addon I was wondering recently (at least for PW4+) was the serial console access.
New firmware, right after console startup executes /etc/upstart/custom-login:
Code:
#!/bin/sh

echo '--- SORRY, LOGIN IS DISABLED ON DEVICE ---'
# Disable Ctrl-C
trap '' 2
# Sleep indefinitely
while true; do sleep 86400; done
Because of that it's no longer possible to login from the serial connection.
So maybe purging custom-login would be a nice hotfix-addon (backwards-compatible and probably easier to maintain also )
MrTick is offline   Reply With Quote
Old 12-10-2019, 11:18 AM   #10
knc1
99.44/100% On Holiday
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,151
Karma: 18200597
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Stray thought:
The only real reason for disabling the serial console at a specific point in the start-up sequence is because it was previously enabled in the start-up sequence.


Can you trace back the upstart sequencing to find something else useful about the serial console along upstart's path.
IIRC, there are tools to graph or trace the upstart sequence. Tools that can be run "cold", I.E: only the upstart directory structure is required, not actually executed.
knc1 is offline   Reply With Quote
Old 12-10-2019, 12:49 PM   #11
MrTick
Enthusiast
MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.
 
MrTick's Avatar
 
Posts: 29
Karma: 107593
Join Date: Dec 2018
Device: K3 KT DxG PW1 PW4
The custom-login is executed by /etc/upstart/console.conf:
Code:
(...)
  # This feature is introduced from Zelda platform. For older platforms, we keep the login unlocked
(...)
if [ "$prodVersion" == "0" -o "$unlockedKernel" == "true" -o "$secureCpu" = "0" ]; then
    #Unlocked Prompt if: unlockedKernel or not prod or not secure cpu
    exec getty -L $BAUD /dev/$UART 2>> $STDERR
else
    exec getty -L $BAUD /dev/$UART -i -n -l /etc/upstart/custom-login 2>> $STDERR
fi
Quote:
Originally Posted by knc1 View Post
there are tools to graph or trace the upstart sequence
I'll check this out, initctl2dot seems to be a good candidate.
Unfortunately I've left my Kindle at work so I need to wait with experiments till tomorrow
MrTick is offline   Reply With Quote
Old 12-10-2019, 02:20 PM   #12
knc1
99.44/100% On Holiday
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,151
Karma: 18200597
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by MrTick View Post
The custom-login is executed by /etc/upstart/console.conf:
Code:
(...)
  # This feature is introduced from Zelda platform. For older platforms, we keep the login unlocked
(...)
if [ "$prodVersion" == "0" -o "$unlockedKernel" == "true" -o "$secureCpu" = "0" ]; then
    #Unlocked Prompt if: unlockedKernel or not prod or not secure cpu
    exec getty -L $BAUD /dev/$UART 2>> $STDERR
else
    exec getty -L $BAUD /dev/$UART -i -n -l /etc/upstart/custom-login 2>> $STDERR
fi
I'll check this out, initctl2dot seems to be a good candidate.
Unfortunately I've left my Kindle at work so I need to wait with experiments till tomorrow
Quote:
-o "$secureCpu" = "0"
That condition is the one people are encountering on "serial port" thread.
I suggest that we trash everything of that 'if' statement except the:
Code:
exec getty -L $BAUD /dev/$UART -i -n -l /etc/upstart/custom-login 2>> $STDERR
I.E: Keep only that line of the current 'if' statement.
knc1 is offline   Reply With Quote
Old 12-10-2019, 04:05 PM   #13
MrTick
Enthusiast
MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.MrTick is my name, but call me Ishmael.
 
MrTick's Avatar
 
Posts: 29
Karma: 107593
Join Date: Dec 2018
Device: K3 KT DxG PW1 PW4
Quote:
Originally Posted by knc1 View Post
I suggest that we trash everything of that 'if' statement except the:
Code:
exec getty -L $BAUD /dev/$UART -i -n -l /etc/upstart/custom-login 2>> $STDERR
I'm pretty sure it's the other one we want to keep
MrTick is offline   Reply With Quote
Old 12-10-2019, 04:37 PM   #14
Junket
Nil adsuetudine maius
Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.
 
Junket's Avatar
 
Posts: 278
Karma: 400000
Join Date: Nov 2019
Location: US
Device: PW4
I don't know half of what knc1 does on the subject, but that does look like a typo.

Bad knc1. No posting until you've had coffee. ;p


Code:
secure_cpu: 1, production: 1, unlocked: 0
is the state that we don't want to see.

So we'd want to keep the following:

Code:
exec getty -L $BAUD /dev/$UART 2>> $STDERR

Junket is offline   Reply With Quote
Old 12-10-2019, 07:21 PM   #15
knc1
99.44/100% On Holiday
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,151
Karma: 18200597
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by Junket View Post
I don't know half of what knc1 does on the subject, but that does look like a typo.

Bad knc1. No posting until you've had coffee. ;p


Code:
secure_cpu: 1, production: 1, unlocked: 0
is the state that we don't want to see.

So we'd want to keep the following:

Code:
exec getty -L $BAUD /dev/$UART 2>> $STDERR
But it does not say "unlocked", it says "securecpu" (that SoC option blows a physical fuse, which results in '0' being the secure state).

If it does not say what it means, then all bets are off.
knc1 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
Kindle DXG B009 Restore firmware??? blackwolf511 Kindle Developer's Corner 24 09-14-2016 05:31 PM
Does anyone have a Kindle dxg firmware 2.5.8 restore file to downgrade from 3.2.1? gczobel Kindle Developer's Corner 2 09-08-2015 11:22 AM
does anyone have a kindle dxg firmware 2.5.8 restore file to downgrade from 3.2.1? baruleluna Kindle Developer's Corner 3 09-30-2013 06:43 PM
PRS-950 HELP PLZ! How to restore PRS-950's firmware back to ver.1 ? hitman Sony Reader Dev Corner 0 02-26-2013 01:10 PM
any one has kindle dx restore firmware?? chinaet Kindle Developer's Corner 0 07-25-2009 06:14 AM


All times are GMT -4. The time now is 05:38 PM.


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