Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 04-29-2018, 05:35 PM   #1
nohandlebars
Member
nohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshes
 
Posts: 16
Karma: 14242
Join Date: Jan 2018
Device: None
Debian on H2O Aura tutorial

I have been working on a Debian chroot with working x-server and am publishing my build scripts here, I see many people asking about this from time to time and while the forums are a great resource they are difficult to search sometimes and the information is often outdated and way beyond most people to apply let alone reverse engineer. To this end I am starting this thread. I am not by any means a programmer and Linux is more of a hobby for me than anything else, I will help where I can but understand that I will probably be using google just as much as you so try and solve as many issues as you can on your own first!

I would like it noted that nearly none of this is my own original work, it has been sourced and repackaged from other mobileread gurus of old. Marek, Ah-, Guang, Snowbody all come to mind, most of the credit goes to them.

Goals
To create and maintain a universal set of scripts to build a Debian chroot with working x-server on as many Kobo models as possible. I will be updating these scripts as and when I can, adding more features, compatibility and fun things (Doom anyone? )

Known issues
1) This has only been tested on my device, Aura H2O 1st Gen. I have had two people try with on the Glo HD, the chroot works fine from the command line but the binary used to update the e-ink screen does not play nicely with that specific resolution. I am quite certain this can be fixed by editing the source codes in the fb_update folder. Apparently it is something to do with the resolution of the Glo HD not being devisable by 16 or something to that effect.

2) I could not get the standard Linux touch driver to work, it does not end the first touch correctly and while I have a vague idea of where the problem may lie I have not been able to fix it. It currently uses the custom touch driver written by Marek which is fine but if we want multitouch and gestures we either need to get this driver to work with touchegg or fix the standard Linux driver.

3) I started playing around with trying to get this to run from the KSM menu and return there after the chroot is terminated, at the moment I have achieved neither, I have not had the time to pry too deep into this.

For the moment this creates a very bare-bones installation, it is primarily for testing at the moment but the source codes are there and you can add anything you want really. I have been focusing more on actually getting it to work than aesthetics or actual, you know, usability.

What you will need
1) Debian Linux or one of it’s derivatives, Ubuntu or Mint for example. Windows users will need to use either a Live CD or Virtualbox.

2) KSM with telnet or SSH installed on your Kobo.

Instructions
Download the tarball on the link below
Code:
https://mega.nz/#!56xHVRhT!huwDBCAPFfiKr2QFnrTg6sshbeFjqldFuRFxI2tnBx4
Open a terminal and move to the directory where you downloaded the tarball (assuming ~/Downloads)
Code:
cd ~/Downloads
Unzip the tarball
Code:
tar -xvf build_kobo_chroot_vX.X.tar.xz
Move into the directory
Code:
cd build_kobo_chroot_vX.X
If you are using a device with a different resolution
Code:
nano source/fb_update/fast_update.c
Edit the lines
Code:
region.update_region.width = 1430;
region.update_region.height = 1080;
Press cntrl+o to save and then cntrl+x to exit

Code:
nano home/Xvkbd
Edit the line
Code:
xvkbd.windowGeometry: 1080x400+0+998
The 1080 represents the width of the keyboard, the 400 the height and the 998 is it’s y coordinate on the screen, change according to resolution width and preference. Press cntrl+o to save and cntrl+x.

Run image_create_base.sh as super user
Code:
sudo sh image_create_base.sh
You will now be prompted to enter a few details for your base image, the entries below should be fine.
Code:
Set image size in MB: 1000
Set filesystem type: ext3
Set target architecture: armhf
Set Debian release: jessie
This will take a while, go get a coffee or a beer.

Assuming nothing catastrophic happened you should now have a file named armhf_debian_jessie_base.ext3, this is your base image and will be used for all your beautiful creations in the future.

Next we run the script that makes it usable on the Kobo
Code:
sudo sh image_build_system.sh
Again you will be prompted for information on your desired image.
Code:
Set new image name: Whatever your little heart desires.
Set new image size in MB: I wouldn’t go lower than 1500MB, it has to fit on your device though.
Set new image filesystem: ext3
Set user name: Whatever you want
Set user password: Again, whatever you want, just don’t forget it
Time for another coffee or beer. .

Once this is all done you will be left with a folder with the name given above, it contains the image file and all scripts you may need. Copy this onto your devices storage.

Once in KSM move to the "USB" submenu, telnet onto your Kobo from your computer.
Code:
telnet 192.168.2.101
Move into the correct directory.
Code:
cd /mnt/onboard/chrootdirectory
Run the launch_chroot.sh script.
Code:
sh launch_chroot.sh
Once you see the line "starting framebuffer update script" press the "Return" button in KSM, you should see the screen go black, give it a few seconds and it should all be up and running!

Here is a (pretty badly done) video of how to get the framebuffer script to start from within KSM
Code:
https://mega.nz/#!xnxSDahL!9IXTfsOwYzWDNSP1oK0JTjTedyWQTBPVBufDTWn8YQc
I will be uploading some pictures a bit later

Happy hacking!

NH

Last edited by nohandlebars; 05-02-2018 at 02:35 PM. Reason: Typos
nohandlebars is offline   Reply With Quote
Old 04-30-2018, 09:39 PM   #2
Elaxon
Zealot
Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.
 
Posts: 100
Karma: 224118
Join Date: Dec 2014
Device: Kobo H20 Aura
Is this permanent or can I decide to revert to KSM whenever?

Does not seem to be working for me H20 Aura

mkdir: can't create directory '/mnt/kobo': File exists
mounting /mnt/onboard/kobo/kobo.ext3 to /mnt/kobo
mounting auxilliaries
bind mounting /dev
bind mounting /dev/pts
bind mounting /proc
bind mounting /sys
copying /etc/ files
killing ksmhome.sh
starting framebuffer update script
starting chroot as elaxon
sudo: unable to resolve host (none)
elaxon@(none):/$ starting xwindow server
hostname: Name or service not known
xauth: (stdin):1: bad display name "(none):1" in "add" command

libudev: udev_has_devtmpfs: name_to_handle_at on /dev: Function not implemented

X.Org X Server 1.16.4
Release Date: 2014-12-20
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.9.0-4-armmp-lpae armv7l Debian
Current Operating System: Linux (none) 2.6.35.3-850-gbc67621+ #3032 PREEMPT Mon Jan 9 13:37:40 CST 2017 armv7l
Kernel command line: console=ttymxc0,115200 rootwait rw quiet lpj=4997120 root=/dev/mmcblk0p1 rootfstype=ext4 hwcfg_p=0x8ffffe00 hwcfg_sz=110 waveform_p=0x8f98b800 waveform_sz=6768096 mem=505M boot_port=2 mx50_1GHz
Build Date: 16 October 2017 09:26:27AM
xorg-server 2:1.16.4-1+deb8u2 (http://www.debian.org/support)
Current version of pixman: 0.32.6
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.1.log", Time: Tue May 1 03:00:08 2018
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
exporting environment variables
fixing coordinate tranformation matrix
Unable to connect to X server

Last edited by Elaxon; 04-30-2018 at 11:02 PM.
Elaxon is offline   Reply With Quote
Old 05-02-2018, 02:33 PM   #3
nohandlebars
Member
nohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshes
 
Posts: 16
Karma: 14242
Join Date: Jan 2018
Device: None
Quote:
Originally Posted by Elaxon View Post
Is this permanent or can I decide to revert to KSM whenever?

Does not seem to be working for me H20 Aura

mkdir: can't create directory '/mnt/kobo': File exists
mounting /mnt/onboard/kobo/kobo.ext3 to /mnt/kobo
mounting auxilliaries
bind mounting /dev
bind mounting /dev/pts
bind mounting /proc
bind mounting /sys
copying /etc/ files
killing ksmhome.sh
starting framebuffer update script
starting chroot as elaxon
sudo: unable to resolve host (none)
elaxon@(none):/$ starting xwindow server
hostname: Name or service not known
xauth: (stdin):1: bad display name "(none):1" in "add" command

libudev: udev_has_devtmpfs: name_to_handle_at on /dev: Function not implemented

X.Org X Server 1.16.4
Release Date: 2014-12-20
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.9.0-4-armmp-lpae armv7l Debian
Current Operating System: Linux (none) 2.6.35.3-850-gbc67621+ #3032 PREEMPT Mon Jan 9 13:37:40 CST 2017 armv7l
Kernel command line: console=ttymxc0,115200 rootwait rw quiet lpj=4997120 root=/dev/mmcblk0p1 rootfstype=ext4 hwcfg_p=0x8ffffe00 hwcfg_sz=110 waveform_p=0x8f98b800 waveform_sz=6768096 mem=505M boot_port=2 mx50_1GHz
Build Date: 16 October 2017 09:26:27AM
xorg-server 2:1.16.4-1+deb8u2 (http://www.debian.org/support)
Current version of pixman: 0.32.6
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.1.log", Time: Tue May 1 03:00:08 2018
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
exporting environment variables
fixing coordinate tranformation matrix
Unable to connect to X server
This is no way permanent, you can simply delete the files whenever you want. You do have to restart your device to get back into KSM though, see number 3 in the Goals section. Are you using an H2O Aura first gen or the 2017 model? There is nothing in your output that suggests it is not working, all those errors are quite normal except the last one but that wouldn't affect the actual xserver from loading, it just means the transformation matrix can't be updated. If you want to fix that error message you can uncomment the following lines in the startx.sh script in the home directory of the chroot.
Code:
#printf "checking which display x is running on\n"
#CURDIS=$(ps -u $(id -u) -o pid= | \
#    while read pid; do
#        cat /proc/$pid/environ 2>/dev/null | tr '\0' '\n' | grep '^DISPLAY=:'
#    done | grep -o ':[0-9]*' | sort -u)
#printf "$CURDIS \n"
printf "exporting environment variables\n"
#export DISPLAY=$CURDIS
And comment the following line
Code:
export DISPLAY=:0
I was using this to get the correct value for the DISPLAY environment variable but it doesn't always work for some reason, the error you are seeing is because I am telling it explicitly that it should be 0 which it usually is but it is not always the case. I will find an elegant solution to this in the future.

I have uploaded a video and linked to it in the first post to see how to get the framebuffer script working from KSM, it is a bit fiddly but basically as long as you press "Return" right after the framebuffer update script starts it should always work.
nohandlebars is offline   Reply With Quote
Old 05-02-2018, 03:30 PM   #4
tshering
Wizard
tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.
 
Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
Quote:
Originally Posted by nohandlebars View Post
I have uploaded a video and linked to it in the first post to see how to get the framebuffer script working from KSM, it is a bit fiddly but basically as long as you press "Return" right after the framebuffer update script starts it should always work.
Very nice! Could you please explain the reason going into the usb menu and having the Qt application kobomenu run, and only after killing ksmhome.sh and running the frame buffer update script closing the kobomenu application? From your PM I take that it is somehow related to the frame buffer update, but I do not get the point.

Last edited by tshering; 05-02-2018 at 03:45 PM.
tshering is offline   Reply With Quote
Old 05-02-2018, 05:32 PM   #5
Elaxon
Zealot
Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.
 
Posts: 100
Karma: 224118
Join Date: Dec 2014
Device: Kobo H20 Aura
Quote:
Originally Posted by tshering View Post
Very nice! Could you please explain the reason going into the usb menu and having the Qt application kobomenu run, and only after killing ksmhome.sh and running the frame buffer update script closing the kobomenu application? From your PM I take that it is somehow related to the frame buffer update, but I do not get the point.
Thank you, I see the video helped me. Yes I am using H20 old model V1 and it does work. I was using telnet through wifi but seems to be no issues with that.

I can see the terminal and the keyboard now like your video. Thanks!
Elaxon is offline   Reply With Quote
Old 05-03-2018, 02:55 PM   #6
nohandlebars
Member
nohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshes
 
Posts: 16
Karma: 14242
Join Date: Jan 2018
Device: None
Quote:
Originally Posted by tshering View Post
Very nice! Could you please explain the reason going into the usb menu and having the Qt application kobomenu run, and only after killing ksmhome.sh and running the frame buffer update script closing the kobomenu application? From your PM I take that it is somehow related to the frame buffer update, but I do not get the point.
There is no particular reason other than this is the method that works reliably, it seems that it is necessary to be in the USB submenu and press "Return" otherwise the framebuffer update script does not draw over KSM. I am not entirely sure why this is the case. I have been looking into the method you outlined in your PM and I think it should be the way to do it but I have not succeeded yet.

Quote:
Originally Posted by Elaxon View Post
Thank you, I see the video helped me. Yes I am using H20 old model V1 and it does work. I was using telnet through wifi but seems to be no issues with that.

I can see the terminal and the keyboard now like your video. Thanks!
No problem! I am glad it worked! Thanks for testing I will be working on getting it a little less fiddly in the future
nohandlebars is offline   Reply With Quote
Old 05-05-2018, 09:32 AM   #7
markyisri
Connoisseur
markyisri ought to be getting tired of karma fortunes by now.markyisri ought to be getting tired of karma fortunes by now.markyisri ought to be getting tired of karma fortunes by now.markyisri ought to be getting tired of karma fortunes by now.markyisri ought to be getting tired of karma fortunes by now.markyisri ought to be getting tired of karma fortunes by now.markyisri ought to be getting tired of karma fortunes by now.markyisri ought to be getting tired of karma fortunes by now.markyisri ought to be getting tired of karma fortunes by now.markyisri ought to be getting tired of karma fortunes by now.markyisri ought to be getting tired of karma fortunes by now.
 
Posts: 59
Karma: 2072648
Join Date: Sep 2016
Device: Kobo Aura Edition 2
Can this work on an Aura Edition 2 or will it need changes?
markyisri is offline   Reply With Quote
Old 05-07-2018, 12:14 AM   #8
nohandlebars
Member
nohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshes
 
Posts: 16
Karma: 14242
Join Date: Jan 2018
Device: None
Quote:
Originally Posted by markyisri View Post
Can this work on an Aura Edition 2 or will it need changes?
Only one way to find out it's not permenant and its not particularly risky, try it and tell us what happens. Will do what I can to troubleshoot.
nohandlebars is offline   Reply With Quote
Old 05-10-2018, 11:45 AM   #9
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,158
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Sounds interesting.
TBH, "multitouch" is a a bit over-rated, very HW dependant and can be less intuitive. If basic single touch is good, then that would be fine.

I had to look up "KSM". Here is a thread on KSM 9

I think I'd want a 2nd working H2O, as I use my H2O too much to read stuff and proof my own writing.
Quoth is offline   Reply With Quote
Old 05-13-2018, 10:20 AM   #10
markyisri
Connoisseur
markyisri ought to be getting tired of karma fortunes by now.markyisri ought to be getting tired of karma fortunes by now.markyisri ought to be getting tired of karma fortunes by now.markyisri ought to be getting tired of karma fortunes by now.markyisri ought to be getting tired of karma fortunes by now.markyisri ought to be getting tired of karma fortunes by now.markyisri ought to be getting tired of karma fortunes by now.markyisri ought to be getting tired of karma fortunes by now.markyisri ought to be getting tired of karma fortunes by now.markyisri ought to be getting tired of karma fortunes by now.markyisri ought to be getting tired of karma fortunes by now.
 
Posts: 59
Karma: 2072648
Join Date: Sep 2016
Device: Kobo Aura Edition 2
Quote:
Originally Posted by nohandlebars View Post
Only one way to find out it's not permenant and its not particularly risky, try it and tell us what happens. Will do what I can to troubleshoot.
I will give this a try. How much source code is being compiled, and do your scripts require the machine they're on to be online?
markyisri is offline   Reply With Quote
Old 05-13-2018, 04:36 PM   #11
nohandlebars
Member
nohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshesnohandlebars can read faster than his screen refreshes
 
Posts: 16
Karma: 14242
Join Date: Jan 2018
Device: None
Quote:
Originally Posted by FrustratedReader View Post
Sounds interesting.
TBH, "multitouch" is a a bit over-rated, very HW dependant and can be less intuitive. If basic single touch is good, then that would be fine.

I had to look up "KSM". Here is a thread on KSM 9

I think I'd want a 2nd working H2O, as I use my H2O too much to read stuff and proof my own writing.
I more want the mutitouch for right click functionality but this can probably be achieved with a long press somehow. I use my device as a reader on a daily basis still, the Debian system is not running all the time and all you have to do is restart it to get back to your "normal" ereader

Quote:
Originally Posted by markyisri View Post
I will give this a try. How much source code is being compiled, and do your scripts require the machine they're on to be online?
There isn't much to actually compile, just the framebuffer update binary and the custom touch driver. You can see this all in the "source" directory. Your Kobo does not need to be online to run the scripts, you do need internet to build them though.
nohandlebars is offline   Reply With Quote
Old 10-24-2018, 08:51 AM   #12
chech
Enthusiast
chech began at the beginning.
 
Posts: 34
Karma: 10
Join Date: Oct 2018
Device: kobo aura h2o
hello i want install debian on h20 but your mega link talk me bad encription keys it is possible to have a good link thinks a lot
chech is offline   Reply With Quote
Old 11-23-2018, 07:54 AM   #13
zaoqi
github.com/zaoqi
zaoqi does all things with Zen-like beautyzaoqi does all things with Zen-like beautyzaoqi does all things with Zen-like beautyzaoqi does all things with Zen-like beautyzaoqi does all things with Zen-like beautyzaoqi does all things with Zen-like beautyzaoqi does all things with Zen-like beautyzaoqi does all things with Zen-like beautyzaoqi does all things with Zen-like beautyzaoqi does all things with Zen-like beautyzaoqi does all things with Zen-like beauty
 
Posts: 87
Karma: 32020
Join Date: Mar 2017
Location: - Zhejiang China
Device: Boox c67ml,Note S,Max2,KT3,KPW4,Kobo AurdHD,Touch N905C
Can it work without computer?
zaoqi is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Aura HD Debian for Aura HD guang6321 Kobo Developer's Corner 107 03-25-2018 11:34 PM
Aura H2O Aura H2O Debian chroot nohandlebars Kobo Developer's Corner 0 03-08-2018 06:51 PM
Kobo Aura H2O 2nd Edition vs old Kobo Aura H2O screen dimentions. iXPert12 Kobo Reader 1 09-18-2017 09:35 AM
Kobo aura h2o display on aura hd? gezzer Kobo Developer's Corner 3 02-22-2017 10:32 AM
export from glo to aura hd to aura h2o mcp000 Kobo Reader 3 11-25-2015 05:46 AM


All times are GMT -4. The time now is 03:51 PM.


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