|
|
Thread Tools | Search this Thread |
01-03-2021, 12:02 PM | #1 |
Evangelist
Posts: 478
Karma: 2390534
Join Date: Jun 2020
Location: Somewhere in the Universe
Device: Kobo Libra, Glo HD, Touch C/B, Mini, Glo, Aura SE, Clara HD, KT
|
[Xorg works!] [HOWTO] Create your own native development environment on your Kobo!
Hi,
It's been a while since I last posted, but now I think I have something to share with you. Those last months, I wasn't finding any interesting books to read and started to find my Kobo just ... boring. And I thought 'then maybe some hacking could be fun' and here I am with this guide. It will help you set up Alpine Linux with gcc, g++ or clang to develop custom applications for your Kobo. Then you could use them (if they are CLI apps) with https://github.com/llandsmeer/inkvt (thanks NiLuJe & Llandsmeer !). And now, you can run Xorg on it! (https://www.mobileread.com/forums/sh....php?p=4077882) So, how ? Prerequisites 1. A Kobo with a fair amount of free space (ideally 3GB+). Preferably with kernel >3.0, but maybe it'll work with older versions too, you just have to try! I tested with my Glo HD and Libra and both worked (Glo HD has 3.0.35, Libra has 4.1). 2. A computer (or something you can ssh/telnet with). 3. NiLuJe's stuff (not mandatory, but is very useful for SSH) https://www.mobileread.com/forums/sh...d.php?t=254214 Let's start! 1. First, enable devmode on your Kobo. Fairly easy; just "search" devmodeon in your Kobo's search bar. It will add some games to your "Beta features" menu, but more importantly, it will give us entire access to the Kobo via telnet. 2. Check what IP your Kobo is using by going to Settings/Technical information. 3. Tap the WiFi icon at the top of the screen and leave the menu open. It will disable "wifi sleep" which could disrupt our telnet access. Note: you can also set up usbnet from there and then telnet via USB, with no interruptions. 4. In a Linux terminal/Telnet-able machine, type "telnet <IP>". E.g. Code:
telnet 192.168.0.183 5. Check your Linux kernel version by typing in "uname -r". If it is less than 3.0, you may encounter problems. 6. Change directory to /mnt/onboard: Code:
cd /mnt/onboard Code:
dd if=/dev/zero of=/mnt/onboard/alpine.img bs=1M count=2048 7. Format the disk image. If your Kobo is from the future or has this capability, you *could* be able to format it in ext4 format natively by adding the "-t ext4" flag in the command line. However, mke2fs here only supports ext2, which is usable too, albeit older. So you could try to format a 2G image on your host system with an ext4 filesystem, then txz-compress it and extract it in your Kobo's storage. This didn't work in my Glo HD though, but did in my Libra. So we'll use the legacy way: Code:
mke2fs -F /mnt/onboard/alpine.img Code:
mount /mnt/onboard/alpine.img /mnt/user Code:
cd /mnt/user Code:
df -h Code:
/dev/loop1 2047.7M 13.0K 2047.2M 0% /mnt/user On your Kobo: Code:
cd /mnt/user && wget https://dl-cdn.alpinelinux.org/alpine/v3.12/releases/armv7/alpine-minirootfs-3.12.3-armv7.tar.gz This should get the tar archive with the Alpine Linux filesystem on your disk image. 10. On your Kobo, we'll now get the tar archive extracted. Ensure you're still on your SSH/Telnet session and type: Code:
cd /mnt/user && tar -xvf alpine-minirootfs*.tar.gz 11. Prepare the chroot. Type in: Code:
mount -v --bind /dev /mnt/user/dev mount -v --bind /dev/pts /mnt/user/dev/pts mount -vt proc proc /mnt/user/proc mount -vt sysfs sysfs /mnt/user/sys mount -vt tmpfs tmpfs /mnt/user/run mount -vt tmpfs tmpfs /mnt/user/tmp mkdir /mnt/user/dev/shm mount -vt tmpfs tmpfs /mnt/user/dev/shm cp /etc/resolv.conf /mnt/user/etc 12. Chroot. Type in: Code:
chroot /mnt/user /bin/sh 13. Now, Alpine Linux comes with the holy grail: a package manager!, apk. First, try installing Nano: Code:
apk add nano 14. If you want to have a compiler, nothing is easier! Just type in: Code:
apk add gcc g++ 15. Well, it's done! If you reboot your Kobo, you can think of adding the disk image to /etc/fstab so it is automatically mounted at startup, and set up an init script which mounts /dev, /sys, /run, etc. automatically. I hope you enjoyed this! Let me know if it worked for you and ask questions if you want! For Xorg, go there: https://www.mobileread.com/forums/sh....php?p=4077882 Disclaimer: I am not responsible if you brick your Kobo with this technique, or if you lose files. Last edited by NiMa; 01-07-2021 at 02:56 PM. |
01-03-2021, 12:38 PM | #2 |
Banned
Posts: 2,296
Karma: 5300240
Join Date: Jun 2020
Location: Edmonton, AB
Device: Kobo Aura H2O Edition 2 (mark 7), Kobo Mini
|
Very nice! I'll be sure to try this with my Kobo Mini!
|
Advert | |
|
01-03-2021, 12:41 PM | #3 |
Evangelist
Posts: 478
Karma: 2390534
Join Date: Jun 2020
Location: Somewhere in the Universe
Device: Kobo Libra, Glo HD, Touch C/B, Mini, Glo, Aura SE, Clara HD, KT
|
|
01-03-2021, 01:07 PM | #4 |
Banned
Posts: 2,296
Karma: 5300240
Join Date: Jun 2020
Location: Edmonton, AB
Device: Kobo Aura H2O Edition 2 (mark 7), Kobo Mini
|
delete post
|
01-03-2021, 01:35 PM | #5 |
the rook, bossing Never.
Posts: 12,264
Karma: 89531599
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
I've a Kobo H2O original with no touch. Bezel issues?
Perhaps I can use it for something! Thanks. |
Advert | |
|
01-03-2021, 02:27 PM | #6 |
Running with scissors
Posts: 1,556
Karma: 14325282
Join Date: Nov 2019
Device: none
|
As an old geezer who started using unix back when you had to buy it from Bell Labs, and the computers it ran on were as big as a refrigerator, it still boggles my mind to see it running on these (comparatively) tiny devices, even after years of using Android phones that are running on Linux. And compared to those old computers Linux is so blazing fast on these tiny devices.
It would be even more amazing if X works on your Kobo. I don't have a spare Kobo but I think I'll try that Alpine Linux on an old 32 bit Celeron laptop I never use. |
01-03-2021, 02:57 PM | #7 | |
Evangelist
Posts: 478
Karma: 2390534
Join Date: Jun 2020
Location: Somewhere in the Universe
Device: Kobo Libra, Glo HD, Touch C/B, Mini, Glo, Aura SE, Clara HD, KT
|
Quote:
|
|
01-03-2021, 03:47 PM | #8 |
Running with scissors
Posts: 1,556
Karma: 14325282
Join Date: Nov 2019
Device: none
|
Offhand I would guess that the display doesn't expose enough, give enough information, for the X server to work. But I hope I'm wrong and you get it to work! That would be too crazy.
|
01-03-2021, 04:21 PM | #9 | |
Evangelist
Posts: 478
Karma: 2390534
Join Date: Jun 2020
Location: Somewhere in the Universe
Device: Kobo Libra, Glo HD, Touch C/B, Mini, Glo, Aura SE, Clara HD, KT
|
Quote:
That done, I'll probably know more when returning to the Kobo... Maybe I'll post an update this week or next week... EDIT: Maybe I could do something with FBInk... I'll investigate that soon |
|
01-03-2021, 04:49 PM | #10 |
Banned
Posts: 2,296
Karma: 5300240
Join Date: Jun 2020
Location: Edmonton, AB
Device: Kobo Aura H2O Edition 2 (mark 7), Kobo Mini
|
Code:
[root@pixie root]# uname -r 2.6.35.3-850-gbc67621+ |
01-03-2021, 05:05 PM | #12 | |
Evangelist
Posts: 478
Karma: 2390534
Join Date: Jun 2020
Location: Somewhere in the Universe
Device: Kobo Libra, Glo HD, Touch C/B, Mini, Glo, Aura SE, Clara HD, KT
|
Quote:
And if you try and it works, please let me know, I'll extend support to kernel 2.6+ |
|
01-03-2021, 05:13 PM | #14 |
Resident Curmudgeon
Posts: 75,995
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
There is no need to bother extended support for firmware 2.6+. The current 4.25 firmware can be side loaded on the Mini. So @Elektron just has to download the correct firmware file for his Mini and side load it to update the Mini.
|
01-03-2021, 05:16 PM | #15 | |
Banned
Posts: 2,296
Karma: 5300240
Join Date: Jun 2020
Location: Edmonton, AB
Device: Kobo Aura H2O Edition 2 (mark 7), Kobo Mini
|
Quote:
@NiMa: I'll see if it works. If it does, I can tell you tomorrow at the earliest. |
|
Tags |
compiler, g++, gcc, kobo |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
building Kobo development environment | pasquale8120 | Kobo Developer's Corner | 36 | 03-29-2019 09:02 AM |
Need help in setting up a Development environment | gabox01 | Development | 6 | 05-01-2018 06:35 AM |
help set up development environment? | brianinmaine | Kindle Developer's Corner | 7 | 01-19-2014 08:23 AM |
setup development environment | JeffElkins | Calibre | 21 | 10-22-2008 03:25 PM |
Setting up development environment | tompe | OpenInkpot | 9 | 08-27-2008 02:26 PM |