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 11-22-2017, 12:46 PM   #1
knc1
Analog Forever!
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: 15,394
Karma: 17000317
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Collection of runme scripts

The current jailbreak process that installs the ";log mrpi" search bar command also installs a ";log runme" search bar command.

Entering the:
;log runme
command runs a (user supplied) script in the topmost visible level of USB storage that is named:
RUNME.sh
(Duh..., currently must be the mixed case shown)

It was meant to be a handy way to fix things that go wrong.
Except there has never been any example usages.

So here is a thread in which to collect runme scripts.
knc1 is offline   Reply With Quote
Advert
Old 11-22-2017, 12:52 PM   #2
knc1
Analog Forever!
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: 15,394
Karma: 17000317
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Unable to login as root after an Amazon update

Which sort of makes having serial port access useless until you fix it via 'diags'.

Instead, use this script at the top of visible USB storage and call it with:
;log runme

File must be named: RUNME.sh (case is important, at least for now) an MUST use *nix line endings, not Windows line endings.
Code:
#!/bin/sh

# Disable passwd for 'root'
cp /etc/passwd /mnt/us/passwd-frm
sed "s/^root:[^:]*:/root::/" </mnt/us/passwd-frm >/mnt/us/passwd-to

mntroot rw
cp /mnt/us/passwd-to /etc/passwd
mntroot ro
You will notice that I am keeping a "before" and an "after" copy of the password file on USB storage.
Just in case the result of this script needs trouble shooting.
(So how bad can things get? You can't log in now, at the worst you can't log in afterward. )

When faced with the login prompt, for user enter: root
If asked for the password, just enter: enter (return key, a blank line).

Edit:
Worked just fine on my PW3-5.9.2
Before:
Code:
root:x:0:0:root:/tmp/root:/bin/sh
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:100:sync:/bin:/bin/sync
operator:x:37:37:Operator:/var:/bin/sh
sshd:x:103:99:Operator:/var:/bin/sh
messagebus:x:92:92:messagebus:/bin/false
nobody:x:99:99:nobody:/tmp:/bin/sh
default:x:1000:1000:Default non-root user:/dev/null:/bin/sh
framework:x:9000:150:Framework User:/tmp/framework:/bin/sh
guestuser:x:1002:1001:Guest user:/tmp/guestuser:/bin/sh
After:
Code:
root::0:0:root:/tmp/root:/bin/sh
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:100:sync:/bin:/bin/sync
operator:x:37:37:Operator:/var:/bin/sh
sshd:x:103:99:Operator:/var:/bin/sh
messagebus:x:92:92:messagebus:/bin/false
nobody:x:99:99:nobody:/tmp:/bin/sh
default:x:1000:1000:Default non-root user:/dev/null:/bin/sh
framework:x:9000:150:Framework User:/tmp/framework:/bin/sh
guestuser:x:1002:1001:Guest user:/tmp/guestuser:/bin/sh
Note to self: Bridge passwd and shadow files across Amazon updates or do this fix-up in the bridge code.

Last edited by knc1; 11-22-2017 at 01:50 PM.
knc1 is offline   Reply With Quote
Old 11-22-2017, 03:03 PM   #3
knc1
Analog Forever!
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: 15,394
Karma: 17000317
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Install a fake registration to enable disk export

Some firmware versions do not allow the USB storage area to be accessible over USB unless the Kindle is registered.

A particular PITA is the firmware versions currently shipping on the KOA2 -
You have to be able to put the blocker directory name on USB storage to prevent an OTA update before you let the Kindle call home to register it. But you can't put anything on the USB storage until it is registered.

A significant problem with Kindles purchased as "gifts" during the up coming gift giving season.
This is one legitimate use of a fake registration file.

Use this RUNME.sh script (with *nix line endings, not Windows line endings) to install a temporary registration information file.
Note: This file will be removed anytime you contact with Amazon, so it should not interfere with registering the Kindle for real.
This also enables all menu entries, both main menu tree and settings menu tree.

Code:
#!/bin/sh

# If present, save current registration info file
[ -f /var/local/java/prefs/reginfo ] && cp /var/local/java/prefs/reginfo /mnt/us/reginfo.bak || true

# Add a fake registration file, format as for 5.9.2 and earlier
cat > '/var/local/java/prefs/reginfo' << EOF
givenName=Hacker
userId=amzn1.account.XXXXXXXX3AAA587YYYYYYYYYYYYY
deviceName=FakeReg
userName=Hacker
deviceEmailAddress=hacker@kindle.com
EOF
NOTE: You must reboot (restart with long press of power button) after running the above script.

Which results in (this is a PW3, fm 5.9.2):
Notice the device name above and in the upper left of the home screen:


Last edited by knc1; 11-22-2017 at 03:16 PM.
knc1 is offline   Reply With Quote
Old 11-24-2017, 02:03 PM   #4
doctoralvarez
Connoisseur
doctoralvarez began at the beginning.
 
Posts: 58
Karma: 10
Join Date: Jun 2016
Device: PW3
Thanks knc1

Quote:
Originally Posted by knc1 View Post
Some firmware versions do not allow the USB storage area to be accessible over USB unless the Kindle is registered.

A particular PITA is the firmware versions currently shipping on the KOA2 -
You have to be able to put the blocker directory name on USB storage to prevent an OTA update before you let the Kindle call home to register it. But you can't put anything on the USB storage until it is registered.

A significant problem with Kindles purchased as "gifts" during the up coming gift giving season.
This is one legitimate use of a fake registration file.

Use this RUNME.sh script (with *nix line endings, not Windows line endings) to install a temporary registration information file.
Note: This file will be removed anytime you contact with Amazon, so it should not interfere with registering the Kindle for real.
This also enables all menu entries, both main menu tree and settings menu tree.

Code:
#!/bin/sh

# If present, save current registration info file
[ -f /var/local/java/prefs/reginfo ] && cp /var/local/java/prefs/reginfo /mnt/us/reginfo.bak || true

# Add a fake registration file, format as for 5.9.2 and earlier
cat > '/var/local/java/prefs/reginfo' << EOF
givenName=Hacker
userId=amzn1.account.XXXXXXXX3AAA587YYYYYYYYYYYYY
deviceName=FakeReg
userName=Hacker
deviceEmailAddress=hacker@kindle.com
EOF
NOTE: You must reboot (restart with long press of power button) after running the above script.

Which results in (this is a PW3, fm 5.9.2):
Notice the device name above and in the upper left of the home screen:

Thanks for Alm your help knc1, I will be checking when script to remove oldKUAL arrives
doctoralvarez is offline   Reply With Quote
Old 11-24-2017, 03:38 PM   #5
knc1
Analog Forever!
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: 15,394
Karma: 17000317
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by doctoralvarez View Post
Thanks for Alm your help knc1, I will be checking when script to remove oldKUAL arrives
The developer who made his go away used a very big hammer.
(so we know it can be done)
We will try for something a little more elegant for the general release.

We may need a "fixup" for KPVbooklet also.

And one to get rid of broken RP/CRP installs on the KOA2 -
Those depend on having a 'Diags' partition and the KOA2 does not have a 'Diags' partition.
It went bye-bye in the re-organization to support Android.

Last edited by knc1; 11-24-2017 at 03:41 PM.
knc1 is offline   Reply With Quote
Advert
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kindle 3 sysvinit scripts Feathers_McGraw Kindle Developer's Corner 10 08-29-2016 07:53 PM
Firmware upgrade scripts davidfor Kobo Developer's Corner 29 04-29-2014 05:34 PM
K4 My Kindle 4 NT does not execute RUNME.sh! HariSeldon85 Kindle Developer's Corner 15 09-03-2012 02:52 PM
K5 is it possible to run k5 launchpad scripts on k5 techiemonkey Kindle Developer's Corner 3 07-30-2012 10:10 AM
Network Control Scripts synerr iRex 3 01-13-2008 07:54 AM


All times are GMT -4. The time now is 05:22 AM.


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