Skip to content
Lectio / docs / installation

Installation and going back to Amazon's software

How to install Lectio on a Kindle: jailbreak, USBNetwork, full backup, build, and install; then updates, going back to Amazon, and coming from minios.

This page sums up the journey. The exact commands, the links to the files to download, and the values to check are in INSTALL.md in the repository: follow it step by step, and read it all once before you start.

Warning: installing rewrites the Kindle’s system partition. The full backup in step 4 is the only way back to Amazon’s software: do not skip it and do not lose it. Lectio has been tested on one unit only. If a step does not behave as described, stop.

What you need

  • A Kindle 4 or a Kindle 5th generation, charged above 50%.
  • A USB cable.
  • A computer: INSTALL.md describes Windows 10/11 with WSL (Ubuntu); Linux and macOS work too (on Macs with Apple silicon, with zig 0.13 and the Homebrew packages listed in the README).
  • About 3 GB of free disk space and one or two hours.

The journey in eight steps

  1. Check your Kindle: in Device Info, look at the serial number (9023… for the Kindle 5th generation, B00E… for the Kindle 4) and the firmware version, which must be 4.1.x. On 4.0.x, first update to 4.1.4 with Amazon’s official update. Write the serial number down: you may need it for the root password.
  2. Jailbreak: install the developer key with MobileRead’s Kindle 4 jailbreak. If it works, your library shows a book called “You are Jailbroken”.
  3. USBNetwork: install MobileRead’s USBNetwork package, which turns the USB cable into a network link, and log in to the Kindle over SSH from the computer.
  4. Full backup: copy Lectio’s helpers to the Kindle, check that its disk layout is the expected one (if any value differs, stop), then save the Kindle’s whole memory to a file of about 2 GB and compare the two SHA-256 hashes, which must be identical. Keep a copy of the file outside your computer.
  5. Build: on the repository’s main branch (the v1.0-bare … v1.3-chess tags are minios releases: checking one out builds minios), run the tests and then make release pointing to your backup. The first time it also compiles MuPDF, which takes a while. The result is the dist/lectio/ folder (also zipped as dist/lectio-release.zip).
  6. Copy to the Kindle: with the Kindle in drive mode, copy dist/lectio/ into the lectio-flash folder and a few books into the books folder.
  7. Install: over SSH, run flash.sh install. The script checks the release checksums, the partition size, and the kernel position, then asks you to type FLASH. It writes the system, reads it back to compare, wipes the diagnostics system (Lectio keeps Amazon’s kernel and bootloader), and reboots. If it says READ-BACK MISMATCH, do not reboot and ask for help.
  8. First start: the first time, Lectio shows “Preparing covers” while it makes the books’ covers.

After installing, Lectio has no USBNetwork or SSH: from then on, the USB drive is how you talk to it.

Updating Lectio

No SSH needed:

  1. build the new version with make release, as in step 5;
  2. plug in the Kindle and copy the contents of dist/lectio/ into lectio-flash/;
  3. create an empty file lectio-flash/DO_INSTALL, eject the drive, and unplug the cable.

When the cable comes out, Lectio installs the update and reboots. The log is in lectio-flash/flash.log.

Going back to Amazon’s software

  1. Cut the restore images out of your backup with make restore-images: they are p1.img, p2.img, diags-kernel.img, and SHA256SUMS.
  2. Copy these four files into lectio-flash/backup/ on the Kindle.
  3. Create an empty file lectio-flash/DO_RESTORE, eject the drive, and unplug the cable.

Lectio writes Amazon’s system back, verifies it, and reboots into the Kindle’s original software. The log is in lectio-flash/flash.log.

In Folders, lectio-flash is protected: Lectio does not let you delete it.

Coming from minios

Install Lectio over minios the usual way: copy the release into minios-flash/ and add DO_INSTALL. On its first start Lectio renames minios-flash to lectio-flash and .minios to .lectio, keeping your positions, settings, and restore images.

If something goes wrong

ProblemWhat to do
Blank or garbled screen after installingPlug in the USB cable. If the drive appears, read .lectio/log.txt; if needed, go back to Amazon’s software with DO_RESTORE.
A book has no cover or the wrong titleDelete .lectio/covers/ from the computer: the covers are made again at the next start.
Neither the screen nor the drive worksYou need the chip’s USB recovery mode. On the Kindle 4 it needs no soldering: with the Kindle off and connected to the computer, hold down on the 5-way, press power, and keep down held for about 15 seconds. To leave it, hold power for about 20 seconds. From there the backup is written back with the tools named in INSTALL.md, a step not yet tried with Lectio.