Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 01-08-2015, 01:59 PM   #1
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 6,974
Karma: 6562801
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O
Post Yet another telnet/sshd & misc tools package...

As my device list attests to, I'm mostly a Kindle guy, but I nonetheless got a H2O for Christmas (mostly because the Kindle Voyage isn't available in France, but that's another matter entirely), and I of course had to 'port' all my Kindle crap to that new device .

Long story short, this is mostly the various tools I build bundled up in one big sack, with a telnetd/sshd setup.

Since I already wrote a readme inside the package, I'll leave the floor to myself:

This is basically a dump of all the custom binaries I use throughout my Kindle hacks,
but built for the Kobo, put in a single package, and symlinked (when not clashing) in the PATH.
That includes, among other things, stuff like htop, strace, ltrace, fbgrab, sqlite3, elfutils, rsync,
ImageMagick, gawk, nano, zsh, the full OpenSSH suite, and a CLI Python 2.7 build.
And yes, just for kicks, there's also KindleTool in there ;D.

I still follow the Kindle spirit of "don't put anything in the rootfs", so all this mostly lives in /mnt/onboard/.niluje,
so don't be surprised if stuff goes missing after a factory reset .

It also provides ftpd/telnetd through inetd (following Kevin Short's KoboTelnet package), plus sshd w/ sftp (dropbear).
The dropbear build provides the same convenience features than my Kindle one (namely, persistent shared key auth:
the keylist is expected in /usr/local/niluje/usbnet/etc/authorized_keys).
There is *no* automatic USB networking handling here. WiFi only.
That said, you *can* manually toggle USBNetworking (on somewhat recent devices), if need be:
cf. /usr/local/stuff/bin/usbnet-toggle.sh for more details (in particular the fact that I'm using legacy Kindle IP settings ;p).

It also installs an udev rule providing a means to run an user-editable script (/usr/local/stuff/bin/stuff.sh) early during boot.
(AFAICT, that loop0 udev trick is used in a number of Kobo packages (David Beinder's kobo-nightmode and Andreas Klauer's AutoPatch, for instance),
no idea who got the idea first ).
This script is used to launch both inetd & dropbear.
Since everything is passwordless, running this on a public/open WiFi would be a *terrible* idea.
If you really need to, I'd recommend disabling inetd, setting up ssh shared key auth, making dropbear actually check passwords,
and locking dropbear to shared key auth only:
by removing the -n switch & adding the -s switch to its startup args, see the comments in /usr/local/stuff/bin/stuff-daemons.sh.

To save space, the Python build is shipped without compiled bytecode. Run /usr/local/stuff/bin/python-setup.sh to generate it.

This touches neither rcS nor inittab, but if you already have an inetd setup in your inittab, you should probably clean that up, or it will clash.
If you have custom stuff in (or symlinked in) /usr/bin, take a closer look at what this package installs to avoid overwriting your own stuff.

Tested on a H2O running FW 3.12.1 - 3.15.0.
I'm fairly sure that this will *not* work on really old Kobo devices/firmwares:
basically, if your device is not running Linux 2.6.35.3 & a hardfp eglibc 2_15, don't use this.

-- NiLuJe ($Id: README 12794 2016-01-16 19:06:59Z NiLuJe $)


The current version is available here: kobo-stuff-1.4.N-r13159.tar.xz. [External link because >20MB (Python ;p)].


The build script, patches & toolchain config are in the x-tc tarball of my snapshots.

Last edited by NiLuJe; 04-11-2016 at 03:50 PM. Reason: Bump to 1.4.N-r13159
NiLuJe is offline   Reply With Quote
Advert
Old 01-08-2015, 09:30 PM   #2
scoky
Connoisseur
scoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy blue
 
Posts: 62
Karma: 13112
Join Date: Feb 2013
Device: Kindle Paperwhite; KOBO AURA HD
Very glad to see you become kobo guy
Thanks for your tools and I have used them in my kindle
scoky is offline   Reply With Quote
Old 01-09-2015, 05:03 PM   #3
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 1,792
Karma: 3944713
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: Kobo H2O, iriver StoryHD
Quote:
Originally Posted by NiLuJe View Post
AFAICT, that loop0 udev trick is used in a number of Kobo packages, no idea who got the idea first
I haven't seen anyone else using it.

The question is, if you do use it, why do you still modify the inittab?
frostschutz is offline   Reply With Quote
Old 01-09-2015, 05:10 PM   #4
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 6,974
Karma: 6562801
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O
@frostschutz: I distinctly remember seeing the idea of using an udev rule to run stuff in various places, some of which appeared to be quite old. I can't think of any examples OTOH besides your AutoPatcher, I'll see if I can dig up specific examples once I'm back on my desktop. (EDIT: Definitely the night mode installer, at the very least).

As for the other thing: there's actually a TODO in the script triggered by the udev rule to switch to using start-stop-daemon from there ;o). I just haven't done it yet because the current method works, I'm not reinventing the wheel, and I didn't want to spend too much effort on all this anyway . But it's definitely in the cards, I've never been a fan of modifying system files on those things, which is why I originally started messing with this stuff back in the Kindle 2.x days .

Last edited by NiLuJe; 02-07-2015 at 07:24 PM.
NiLuJe is offline   Reply With Quote
Old 01-09-2015, 05:23 PM   #5
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 1,792
Karma: 3944713
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: Kobo H2O, iriver StoryHD
Quote:
Originally Posted by NiLuJe View Post
(EDIT: Definitely the night mode installer, at the very least).
Nice. He even chose the same device for it

It's very clean to get scripts started at bootup. And mods that use this method don't clash with one another (unlike doing something like a rcS modification, where only one mod survives).

Nice tool collection, I just grabbed strace from some Debian package that happened to work; SSH I don't need (the Kobo only knows my local wifi - unless it autoconnects to unprotected ones?), but it's bookmarked at any rate.

Actually, one tool I could use is sqlite3 for the database. Provided it doesn't crash if modified directly on the reader - sqlite itself normally can handle it but you never know.

I already have a script that creates shelves and series information from the directory structure (although it only works with my own idea of directory structure I guess), but there's no readily available sqlite3 client to actually get the necessary queries executed on the DB...

Haven't found the time yet to compile it myself (or see if the Debian version works)
frostschutz is offline   Reply With Quote
Advert
Old 01-09-2015, 05:29 PM   #6
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 6,974
Karma: 6562801
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O
@frostschutz: Yep, it's a pretty neat way to handle this kind of stuff. I was a bit wary of the timing at first, but seeing that /mnt/onboard is mounted at that point is good enough for me .

The strace build has a whole history related to KOReader and figuring out what the hell nickel is doing with the eInk driver, it should be a bit more tailored to the actual Kobo kernels than a generic build, especially on the eInk front . fbgrab also comes in handy from time to time .

I haven't checked how it behaves, but that sqlite build (be it the standalone client or the Python module) should come with all the bells and whistles (the Kindle sqlite setup demands it, Amazon even went so far as using the modular capabilities to implement custom functions). That just leaves seeing how well nickel handles having the rug swept from under its feet .

Last edited by NiLuJe; 01-09-2015 at 05:34 PM.
NiLuJe is offline   Reply With Quote
Old 01-10-2015, 12:53 PM   #7
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 6,974
Karma: 6562801
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O
Okay, just got rid of the custom inittab, everything's now started w/ start-stop-daemon from the script triggered by the udev rule .

I'll update the package once I'm done rebuilding stuff to fix a minor issue with the default PATH in dropbear .

EDIT: Done. Bumped to v1.1 .

Last edited by NiLuJe; 01-10-2015 at 02:05 PM.
NiLuJe is offline   Reply With Quote
Old 01-10-2015, 05:23 PM   #8
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 1,792
Karma: 3944713
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: Kobo H2O, iriver StoryHD
Quote:
Originally Posted by NiLuJe View Post
I was a bit wary of the timing at first, but seeing that /mnt/onboard is mounted at that point is good enough for me .
Actually, the /mnt/onboard mount happens only after udev is started, so it's entirely possible it won't be mounted yet. There are also some corner cases (factory reset / firmware update).

So if you execute a script on /mnt/onboard/ there might be a possibility it won't run. Not sure if udev waits for such things at any rate. A script in the internal memory, it's probably worth checking that /mnt/onboard/.kobo or whatever actually exists.

Last edited by frostschutz; 01-10-2015 at 05:27 PM.
frostschutz is offline   Reply With Quote
Old 01-10-2015, 06:53 PM   #9
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 6,974
Karma: 6562801
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O
@frostschutz: Yep, that's exactly why I was afraid of the timing. So far, it appears to work fine on my device (somehow ;D), but I might just have been lucky.

I'll tighten this up.

EDIT: Done. Ended up moving dropbear & busybox out of the vfat partition, so that simplifies everything, and I now feel better when onboard is exported over USBMS, since these things are so finicky. Bumped to 1.3 (1.2 was the intermediary iteration w/ a wait-for-onboard bit of logic).

Last edited by NiLuJe; 01-10-2015 at 11:23 PM.
NiLuJe is offline   Reply With Quote
Old 01-11-2015, 04:42 AM   #10
boriar
Addict
boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.
 
Posts: 242
Karma: 208896
Join Date: Jan 2015
Device: bq Avant XL, Kobo Aura H2O, Onyx Boox M96C Plus
Quote:
Originally Posted by NiLuJe View Post
@frostschutz: Yep, that's exactly why I was afraid of the timing. So far, it appears to work fine on my device (somehow ;D), but I might just have been lucky.

I'll tighten this up.

EDIT: Done. Ended up moving dropbear & busybox out of the vfat partition, so that simplifies everything, and I now feel better when onboard is exported over USBMS, since these things are so finicky. Bumped to 1.3 (1.2 was the intermediary iteration w/ a wait-for-onboard bit of logic).
The link in the first post download the old 1.0. Can you fix it?
Thanks
boriar is offline   Reply With Quote
Old 01-11-2015, 05:02 AM   #11
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,180
Karma: 83000001
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
https://storage.sbg-1.runabove.io/v1...-r11391.tar.xz
eschwartz is offline   Reply With Quote
Old 01-11-2015, 05:52 AM   #12
boriar
Addict
boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.
 
Posts: 242
Karma: 208896
Join Date: Jan 2015
Device: bq Avant XL, Kobo Aura H2O, Onyx Boox M96C Plus
Thanks. That's a quick answer
boriar is offline   Reply With Quote
Old 01-11-2015, 09:04 AM   #13
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,180
Karma: 83000001
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
I know what NiLuJe's links look like. He uses the same host for his Kindle snapshots.
eschwartz is offline   Reply With Quote
Old 01-11-2015, 10:30 AM   #14
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 6,974
Karma: 6562801
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O
Wow. I'm awesome. I managed to update the link text but not the URL itself ;D. Thanks @eschwartz .
NiLuJe is offline   Reply With Quote
Old 01-17-2015, 12:34 PM   #15
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 6,974
Karma: 6562801
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O
On a slightly related note, I updated my standalone FBGrab build with my latest changes.
Among more verbose info and a proper Kobo build, it will also automatically crop the top 11 pixels on a H2O (what's behind the bezel). I did not do anything for the Aura, because I don't have one and I'm not exactly sure if something like that is needed, so if anyone with an Aura has time to spare, I'd be glad for a random snapshot taken w/ fbgrab, and the output from fbgrab -v .

Last edited by NiLuJe; 02-07-2015 at 07:25 PM.
NiLuJe is offline   Reply With Quote
Reply

Tags
ssh, telnet, tools

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Package with console tools CGarces Development 0 09-06-2013 05:04 PM
Combined Tools Package Lizj1 Plugins 5 01-11-2013 10:32 AM
USBNetwork USB Driver & Telnet on Windows XP SP3 namati Kindle Developer's Corner 0 02-24-2012 01:20 AM
Instruction to get root on 60x/90x + remote telnet & FTP mamaich PocketBook 17 08-27-2011 07:41 PM


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


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