Posts
Search
Contact
Cookies
About
RSS

Kobo Mini dropbear (with scp) ncurses and nano (editor)

Added 27 Sep 2013, 1:31 a.m. edited 19 Jun 2023, 3:42 a.m.

nanoKoboMini

If you like tinkering with things you really must get a Kobo Mini, its "only" £30, its more ergonomic than other readers - noticeable lighter in bed!, and for a number of reason much more tinkerer friendly :D The best thing is that the device boots off a removable micro sd card, something which assuming you've imaged the SD from the get go, means its basically unbrickable. (user removable boot media should be mandatory by law!) If like me you on principle refuse to buy DRM goods, you're probably not missing a lot by skipping registration which the default firmware insists on :/ (there's an sqlite db with registration data that's easy to spoof with bogus data - so you can use your hardware, just an easy google away) anyhow once you've imaged the internal SD (and probably upgraded it too!) the world really is your lobster! There are a few ways to launch your own scripts and its de rigueur to have /mnt/onboard/run.sh execute on each boot... (even if mine is doing nothing at the moment) I noticed that the rather handy koboLauncher had a USB Networking option, but it didn't seem to work too well and sometimes conflicted with usb mass media mode, so I decided to use its dropbear over wifi. (incidentally this was probably more to do with what I was doing than the author of koboLauncher - YMMV) All worked well ( sadly no scp though :-( ) except for the kobo software ditching the wifi periodically but if you're just doing a quick session you can restart wifi with the gui (happily resuming your ssh session) and for longer hacks you can always kill all the kobo software. While talking about the kobo software I have to say the readers text layout is far from ideal with a forced missing line at the top and a massive gap at the bottom sometimes - often a full 1/5th of the screen unused. I'll soon be replacing all the kobo software if I don't hit any road blocks... Anyhow my first experiment was to get scp working, and for the practice I thought I'd just replace the whole of dropbear as well as include scp - haven't done any cross compiling for a while ! I used kobo's toolchain from the command line which worked fine - at least till I got to ncurses - which is so not a K.I.S.S. project ! at this point I have to say thank you very much to the author of http://www.ailis.de/~k/archives/19-ARM-cross-compiling-howto.html for his very astute notes on cross compiling ncurses - thanks! as with zlib (static link in dropbear) dropbear itself basically unlike ncurses cross compiling nano was no drama and just worked... I made a tarball of all the ncurses stuff once I had manually installed and tested scp, everything basically just worked! :D I've since bundled everything together and its available below I opted to not run dropbear all the time but switch it on and off as I wanted, for which I'm using koboLauncher - all I did was basically rip the guts out of his usbnetworking script and made changes to reflect that dropbear is "installed" in /usr/bin. I still have a folder in koboLauncher/ssh where dropbear stores its keys etc I also added IP information so if you're not on a static address you know which IP address to ssh to! here's the launcher script I use

#!/bin/sh

root=$ROOT/ssh

touch /var/log/lastlog

if [ -f /var/run/dropbear.pid ]
then
    kill `cat /var/run/dropbear.pid`
    msgbox "ssh" "stopped!"
else
    dropbear -E -r $root/host.key.rsa -d $root/host.key.dss > $root/dropbear.log 2>&1
    ip=`busybox ifconfig | busybox grep 'inet addr:'`
    msgbox "ssh" "ssh started $ip"
fi
nice and simple even if the grep is a bit sucky ;) and as promised earlier .... dropbear-scp-curses-nano-kobomini.tgz While you are free to use this on your device - please do not redistribute it and please only link to this page and not directly to the file - thanks... stay tuned - I feel more kobo mini developments are coming..... edit: adding a note here as I keep forgetting how to set up usb networking on the other side... Once a usb cable is connecting the two machines, running ifconfig should show another device (for me despite having readable and memorable device names like wlan0 etc its chosen the forgettable and sometimes changing enp0s20u2 (go figure)) you might want to use dmesg just to confirm this is actually a usb network device.... to assign a static ip address sudo ifconfig enp0s20u2 192.168.2.11 netmask 255.255.255.0 I have a little script on my custom menu that will tell me what the kobo's (fixed) ip address is, and I've even saved it in filezilla (my main weapon of choice for transferring stuff to the kobo)