![]() |
#1 |
rm -rf /
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 219
Karma: 3333683
Join Date: Nov 2019
Location: United Kingdom
Device: K5, KT, KT2, KT3, KT4, KV, PW2, PW3, PW4, PW5
|
Notes on Kindle NFS Boot
I've been meaning to write this up properly for a while now but never seem to find the time. Until then, here's some notes and example scripts to assist with the process of booting a rootfs over NFS via USBNet. You definitely want to have a device with a soldered/permanently attached serial connection before attempting this.
Prerequisites: You need to build a kernel using a custom initramfs entrypoint script to mount the NFS share early in the boot process: Spoiler:
A means of automatically configuring the USBNet interface is also necessary: Spoiler:
Setting up NFS share: A "stock" rootfs image won't boot successfully and it's useful to be able to make changes that can be removed later, so we need to set up a fairly complicated mount point: Code:
mkdir -p /data/kindle-rootfs/KT2 mkdir -p /srv/{rootfs,union,bootmod}/KT2-5.12.2.1 kindletool extract update_kindle_5.12.2.1.bin /tmp/update gzip -d /tmp/update/rootfs.img.gz mv rootfs.img /data/kindle-rootfs/KT2/5.12.2.1.img # We use unionfs-fuse as standard unionfs doesn't play nice over NFS sudo unionfs-fuse -o cow,max_files=32768 \ -o allow_other,noforget,suid,dev,nonempty \ /srv/user/KT2-5.12.2.1=RW:\ /srv/bootmod/KT2-5.12.2.1=RO:\ /srv/rootfs/KT2-5.12.2.1=RO \ /srv/union/KT2-5.12.2.1
Once that's done, we can export the directory structure as an NFS share: Spoiler:
These options are probably not great/are insecure but if it's stupid and it works... ![]() We also need a way of letting the device know which share to mount - this is a cut down version of the server that I use for this: Spoiler:
... and also a config file containing serial number/mount paths: Spoiler:
Bootmods: As alluded to, a stock rootfs image won't boot by default - upstart scripts will need to be tweaked and the like. Here's what the structure of my KT2 bootmods folder looks like: Spoiler:
All things combined, this will allow the device to boot fully and bring up an SSH server and x11vnc instance (yes, I've also been sitting on an x11vnc KUAL plugin that I really should release...). A couple of these are stock upstart scripts with minor tweaks, diff the originals from a stock rootfs image if you want to see the differences. dropbear.conf: Spoiler:
filesystems_userstore.conf Spoiler:
langpicker.conf Spoiler:
x11vnc.conf Spoiler:
We also need to blank the root password: Spoiler:
... and edit /usr/bin/mntroot so that it doesn't break now that we're booting from NFS Spoiler:
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Forma Why some notes are popup notes, some are jumping notes in Kobo Forma | codychan | Kobo Reader | 11 | 11-22-2022 02:25 PM |
How to boot Kindle PW 4 into diags? | Le Legend | Kindle Developer's Corner | 4 | 09-28-2021 02:46 AM |
How to show kernel boot information instead Amazon boot picture? | madtrapper | Kindle Developer's Corner | 8 | 01-04-2013 08:51 AM |
Kindle 4 does not boot | leihongwang | Kindle Developer's Corner | 14 | 05-14-2012 02:03 AM |
Opus cannot boot, stuck on boot screen | baloma | Bookeen | 35 | 11-13-2010 04:20 AM |