Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 01-09-2025, 08:13 PM   #1
Mino101
Member
Mino101 can extract oil from cheeseMino101 can extract oil from cheeseMino101 can extract oil from cheeseMino101 can extract oil from cheeseMino101 can extract oil from cheeseMino101 can extract oil from cheeseMino101 can extract oil from cheeseMino101 can extract oil from cheese
 
Posts: 15
Karma: 1028
Join Date: Jan 2025
Device: Kindle Basic 11th Gen
Lightbulb How can I replace a system file

I am trying to replace a jar under /opt/amazon/ebook/lib from within kindle root terminal (KOReader SSH server) but getting

rm: can't remove '....jar': Read-only file system
How can I do it ?
Mino101 is offline   Reply With Quote
Old 01-10-2025, 09:00 AM   #2
slycat
Junior Member
slycat began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jan 2025
Device: Kindle PW5
Just out of curiosity: what do you mean to achieve by modifying that .jar?

When you first connect there is usually a message from dropbear/SSH that says
Code:
Rootfs is mounted read-only. Invoke mntroot rw to switch back to a writable rootfs.
That should let you have full reign
The specific file or folder may also be immutable if that does not work
Code:
lsattr <dir/file>
and see if you see a lower case "i" in the results. If there is you can then remove the attribute with
Code:
chattr -i <dir/file>
slycat is offline   Reply With Quote
Advert
Old 01-10-2025, 09:28 AM   #3
mergen3107
Wizard
mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.
 
mergen3107's Avatar
 
Posts: 1,506
Karma: 5000046
Join Date: Feb 2012
Location: Cape Canaveral
Device: Kindle Scribe
Also, make sure to
- make backups!
- remember original files' permissions
- make sure to restore the same permissions if they are different after replacement

Generally be careful with system files, Kindles are fragile and take ANY excuse to go into unboot-loop.

Make sure you have your USBNet auto-starting so you can have a chance to change files if it goes into this unboot-loop.
mergen3107 is offline   Reply With Quote
Old 01-10-2025, 11:27 AM   #4
Mino101
Member
Mino101 can extract oil from cheeseMino101 can extract oil from cheeseMino101 can extract oil from cheeseMino101 can extract oil from cheeseMino101 can extract oil from cheeseMino101 can extract oil from cheeseMino101 can extract oil from cheeseMino101 can extract oil from cheese
 
Posts: 15
Karma: 1028
Join Date: Jan 2025
Device: Kindle Basic 11th Gen
Quote:
Originally Posted by slycat View Post
Just out of curiosity: what do you mean to achieve by modifying that .jar?
Trying to find an answer to my own question. Otherwise thanks for the info!

Quote:
Originally Posted by mergen3107 View Post
Also, make sure to
- make backups!
- remember original files' permissions
- make sure to restore the same permissions if they are different after replacement

Generally be careful with system files, Kindles are fragile and take ANY excuse to go into unboot-loop.

Make sure you have your USBNet auto-starting so you can have a chance to change files if it goes into this unboot-loop.
Thanks for the advice! Are these steps really necessary when tampering non critical *.jar files ? I mean, I'm just trying to add some minor features in the built-in reader. And about USBNet, the latest one failed to install from MRI with some message like "script encountered error while running", I guess it isn't compatible with firmware 5.17.x yet. I am using the integrated SSH server in KOReader as a replacement
Mino101 is offline   Reply With Quote
Old 01-10-2025, 11:47 AM   #5
mergen3107
Wizard
mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.
 
mergen3107's Avatar
 
Posts: 1,506
Karma: 5000046
Join Date: Feb 2012
Location: Cape Canaveral
Device: Kindle Scribe
As I said, Kindle firmware is fragile
What you think is not critical, might actually brick it for good.

You need usbnetlite from Marek: https://fw.notmarek.com/khf/

Here be dragons!
mergen3107 is offline   Reply With Quote
Advert
Old 01-10-2025, 12:52 PM   #6
Mino101
Member
Mino101 can extract oil from cheeseMino101 can extract oil from cheeseMino101 can extract oil from cheeseMino101 can extract oil from cheeseMino101 can extract oil from cheeseMino101 can extract oil from cheeseMino101 can extract oil from cheeseMino101 can extract oil from cheese
 
Posts: 15
Karma: 1028
Join Date: Jan 2025
Device: Kindle Basic 11th Gen
Quote:
Originally Posted by mergen3107 View Post
As I said, Kindle firmware is fragile
What you think is not critical, might actually brick it for good.

You need usbnetlite from Marek: https://fw.notmarek.com/khf/

Here be dragons!
Thanks, I'll set it up as soon as I get my simple test running. So after mounting rootfs to be writable, I was able to replace the target *.jar file and restore the exact permissions (modified a string resource that I know where to find) but even after reboot I see no effect, even though I verified that the files are actually still replaced. Maybe the original files are cached somewhere ? Isn't the ereader code under /opt/amazon/ebook, or is there another location ?
Mino101 is offline   Reply With Quote
Old 01-10-2025, 01:12 PM   #7
mergen3107
Wizard
mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.
 
mergen3107's Avatar
 
Posts: 1,506
Karma: 5000046
Join Date: Feb 2012
Location: Cape Canaveral
Device: Kindle Scribe
Have you found older tweaks were people modified margins?

It was a long time ago, but I vaguely remember that /opt/* stuff is a factory stock stuff.

I'll have a look later how I did it, although on 5.9.7 on PW3
mergen3107 is offline   Reply With Quote
Old 01-10-2025, 02:28 PM   #8
Mino101
Member
Mino101 can extract oil from cheeseMino101 can extract oil from cheeseMino101 can extract oil from cheeseMino101 can extract oil from cheeseMino101 can extract oil from cheeseMino101 can extract oil from cheeseMino101 can extract oil from cheeseMino101 can extract oil from cheese
 
Posts: 15
Karma: 1028
Join Date: Jan 2025
Device: Kindle Basic 11th Gen


I trying modifying another resource somewhere else and it worked!

I wonder why the original resource replacement didn't work (I modified a string under /opt/amazon/ebook/lib/wikipedia.jar)
Mino101 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Get System File Date tamarissa Library Management 5 06-02-2020 05:30 AM
The system cannot find the file specified birkmaggs Devices 5 02-06-2019 10:38 AM
Troubleshooting DX: File system corrupt? hfrummer Amazon Kindle 2 01-19-2015 04:50 AM
How can I replace KPW system default font? eloong Kindle Developer's Corner 3 01-19-2013 11:53 AM
how to clean more disk space in root file system to upgrade system chinaet iRex 1 12-18-2006 03:54 PM


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


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