Skip to content

KindleHIDPassthrough: stop the daemon before unpacking, delegate to install.sh - #24

Open
zampierilucas wants to merge 1 commit into
KindleTweaks:mainfrom
zampierilucas:fix/hid-passthrough-update-over-live-install
Open

KindleHIDPassthrough: stop the daemon before unpacking, delegate to install.sh#24
zampierilucas wants to merge 1 commit into
KindleTweaks:mainfrom
zampierilucas:fix/hid-passthrough-update-over-live-install

Conversation

@zampierilucas

@zampierilucas zampierilucas commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Installing over a live install landed a partial tree. The daemon holds dist/ld-linux-armhf.so.3 open so writes come back ETXTBSY, busybox tar stops at the first entry it cannot replace, and that file is entry 8 of 120. The extract wrote six .so files, then set -e ended the script before upstart, udev, the scriptlet and the plugin were installed, with KFPM still showing success. Reproduced on a Basic 5.

So it stops the daemon before unpacking, and hands the rest to scripts/install.sh installAll rather than duplicating it here, which also picks up stale file removal, config.ini preservation and the mesquite cache clear. Uninstall delegates the same way, with a fallback for when the install dir is already gone.

Safe to merge before the upstream release. v3.12.0 already runs its installer from the install dir, and the daemon stop fixes the partial tree on its own. Upstream change is zampierilucas/kindle-hid-passthrough#149.

…nstall.sh

Installing or updating over a live install was silently landing a partial
tree. The running daemon holds dist/ld-linux-armhf.so.3 open for execution,
so writes to it come back ETXTBSY, and busybox tar stops at the first entry
it cannot replace instead of skipping it. That file is entry 8 of 120 in the
release tarball, so the extract wrote six .so files and abandoned the rest,
then set -e ended the script before the upstart job, the udev rule, the
scriptlet and the KOReader plugin were installed. KFPM still reported
success. Stop the daemon and give it a moment before unpacking.

The rest of the script duplicated logic that upstream already has in
scripts/install.sh, and the copies had drifted. The KOReader plugin was
merged into place rather than replaced, so lua files dropped between
releases stayed behind and KOReader kept loading them, and nothing cleared
the mesquite cache, so BTManager carried on serving the previous version's
html and js. Hand off to scripts/install.sh installAll instead, which owns
daemon lifecycle, stale file removal, config.ini preservation and the
appreg refresh, and stays in step with the tarball it shipped in.

Uninstall delegates the same way, keeping an inline fallback for the case
where the install directory is already gone.

Signed-off-by: Lucas Zampieri <lcasmz54@gmail.com>
@penguins184

Copy link
Copy Markdown
Contributor

I will consider merging this but just fyi, since KF@4 is deprecated and KF@5 will be worked on this whole repository is going to be migrated under a KPM-Compatible format.

@zampierilucas

Copy link
Copy Markdown
Contributor Author

@penguins184 Yes, I talked to hackerdude earlier today as Im already planning to move to kpm

@penguins184

Copy link
Copy Markdown
Contributor

Your own repo? Just curious. I will be consulting other devs when I return from vacation tomorrow and will probably begin development on the replacement KF@5 and new KindleTweaks repository

I think I'll get it out quickly then add more features as I go

But thanks for letting me know!

Do you still want these merged? I think I'll be rewriting the codebase for KF from scratch and this has to be turned KPM-compliant

@zampierilucas

Copy link
Copy Markdown
Contributor Author

@penguins184 Yeah, I might have to be my own repo in the meantime while I sort some things out as hid-passthrough puts files outside the roots, and thats goes against KPM rules, so I have some work to do before can propose it to official repos

@penguins184

Copy link
Copy Markdown
Contributor

Ah, sure. Upon asking hackerdude I think the official repo will only have stuff like kterm/KOReader and core utilities

@zampierilucas

Copy link
Copy Markdown
Contributor Author

Yep, and I mean, I would love to have a shared community repo, with all the stuff we normally use, but I'll iron issue of my programs in my repo first, and then contribute to that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants