Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kobo Glo HD support #6

Open
anarcat opened this issue Mar 29, 2017 · 22 comments

Comments

Projects
None yet
6 participants
@anarcat
Copy link

commented Mar 29, 2017

Hi!

Amazing project, thanks so much for doing this.

I've got a rooted (got SSH and all) Kobo Glo HD device here that I'd be curious to see run more free software. If there's anything I can do to help development, please do let me know... i would need to open up the thing to change the SD card for tests, but I was thinking of doing that anyways to get Wikipedia in there... ;)

@lgeek

This comment has been minimized.

Copy link
Owner

commented Mar 30, 2017

Hi. It would be useful to know whether it uses a soldered eMMC or removable uSD for internal storage. You could also check the layout of the internal storage to see if it matches the one used by the i.MX507-based devices and described in the README.

After that, you could try to build and run the kernel source provided by kobo. Same for u-boot. UART access would greatly help with this. Check whether the kernel package includes any proprietary drivers (WiFi is the usual suspect) and replace them with open sources ones from linux-backports. Check whether it includes or depends on additional firmware blobs which could be removed.

Check whether my implementation of kobo_hwconfig works on it. After that, you would be able to give the okreader rootfs a try.

@anarcat

This comment has been minimized.

Copy link
Author

commented Mar 30, 2017

@lgeek

This comment has been minimized.

Copy link
Owner

commented Mar 30, 2017

You could also check the layout of the internal storage to see if it matches the one used by the i.MX507-based devices and described in the README.
Hmm... well, I've got a shell on the thing, so I'm happy to check this further... How can i inspect this? fdisk? parted?

I'd suggest dd-ing the first 20MB or so (dd if=/dev/mmcblk0 of=/mnt/onboard/dump bs=1M count=20) and then copying the file to a computer for analysis. You can use fdisk or parted to see the offset of the first partition. To find the kernel image and maybe some other files (u-boot?), try binwalk. The HWCONFIG block uses the string HW CONFIG as a header signature IIRC.

@lgeek

This comment has been minimized.

Copy link
Owner

commented Apr 4, 2017

@anarcat I've ended up ordering a Glo HD since I'm pretty keen on getting okreader running on the i.MX6-based devices (and checking out the newer eink screens). Don't expect instant bring-up; I'll keep this thread updated.

@anarcat

This comment has been minimized.

Copy link
Author

commented Apr 4, 2017

@nicolas161

This comment has been minimized.

Copy link

commented Apr 19, 2017

Thank you very much for your work, @lgeek.

I also have a Kobo Glo HD, so if you need to test your work on another device you can tell me. I don't have any technical knowledge, though, but I can try to help.

@jellelicht

This comment has been minimized.

Copy link

commented May 21, 2017

Is there anything I could do to help with this? I have a Kobo Glo HD around as well

@almostalive

This comment has been minimized.

Copy link

commented May 22, 2017

Any update @lgeek on getting a Kobo Glo HD?

@lgeek

This comment has been minimized.

Copy link
Owner

commented May 22, 2017

@almostalive There's experimental support in the glohd_bringup branch, which works for me. It's missing u-boot and I need to do some cleanup, but I didn't have time recently.

@jellelicht

This comment has been minimized.

Copy link

commented May 22, 2017

@lgeek: either way, thanks for the work you already did. Could you give maybe give some high level steps on how to start playing with the glohd_bringup branch like you are doing right now? Don't be afraid to RTFM me, I am willing to learn 😉

@almostalive

This comment has been minimized.

Copy link

commented May 26, 2017

@lgeek that is awesome. I will try it out soon! Couple of questions though. For u-boot did you use the one that is on the uSD or did you build it from the source located here https://github.com/kobolabs/Kobo-Reader/blob/master/hw/imx6sl-glohd/uboot.tar.bz2 ? If you built it yourself, did you need to change any of the source code to have it boot up with okreader? Also what config did you use for make? I'm thinking its mx6sl_ntx_lpddr2_config but I'm not sure. I think that is all the questions I have for u-boot.

Also does your koreader repo have any changes not found the offical koreader repo? Asking since I'll be building it from source might aswell try out the latest commits sometime.

The last real questions is, you mention formating the system partition, is there anything on the 3rd partition that needs to stay or could it be reformatted as well and possibly changed to a different fs like ext4?

I'm guessing a Raspberry Pi 2 running debian should be fine for building this albiet slow.

@lgeek

This comment has been minimized.

Copy link
Owner

commented May 27, 2017

@jellelicht I've also updated the README in that branch, it should get you started.

@almostalive I haven't replaced the u-boot image. My koreader fork doesn't have any additional commits, but I also haven't tested the upstream head in this environment. Make sure you use the okreader build script to package koreader, because it replaces some Nickel-specific scripts with okreader versions.

No data from the third (data) partition is needed, but keeping it vfat allows you to continue mounting the device on Windows in case you care about that. Also, because of the hacky way in which that partition is writable both by the device and the host computer, a journaled FS might have a higher likelyhood of getting in an inconsistent state. Don't forget to update the fstab, by the way.

The only potential issue with building on RPi2 is that it might not have enough memory. A while ago, 1 GB used to be enough, but lately I've only built okreader on systems with 4GB+ RAM. Try disabling parallel make (the -j flag) in build.sh if you run into related issues.

@almostalive

This comment has been minimized.

Copy link

commented May 27, 2017

Thanks for the info. The u-boot image was my biggest concern before starting the build and since I don't have to worry about it, I'm going to give this a try sometime this weekend.

For koreader I figured I would of course build everything right from your scripts and repos first just so I know everything works. Then eventually replace the koreader submodule path with upstream to play with, while still using your scripts.

I don't have a Windows pc so I don't care about that. Just wanted to make sure nothing important was there.

I'll give it a couple tries on rpi2 and if that fails, I'll see if I can setup a cross compile enviroment on my main pc running Arch and modify the scripts as needed. If neither of those works then qemu.

Thank you for this and I'll let you know how it goes.

@almostalive

This comment has been minimized.

Copy link

commented Jun 12, 2017

built and installed. sorry it took so long to reply. pure jessie or stretch both failed on the raspbery 2 but ubuntu 16.04 server worked fine. I'm drunk so I can't remember the exact errors.

On building, you use git@github.com for submodules. I had to change that to 'https://github.com' to pull them because i would get ssh errors. i used --depth 1 when updating the submodules which made the imx6-linux folder not properly work. getting pass those two things where easy.

After installing okreader on my glo hd, I notice it was faster but had two problems. Trying to connect via wifi says "Failed to initialize network control client: Failed to connect to wpa_supplicant control socket: /var/run/wpa_supplicant/eth0" from koreader. And plugging in vai usb shows nothing on my linux machines. I can chrage but I can't acess the sd card from usb.

@anarcat

This comment has been minimized.

Copy link
Author

commented Jun 20, 2017

i'm probably really too late for this, but:

[root@(none) ~]# lsmod
dhd 242221 0 - Live 0x7f004000
sdio_wifi_pwr 486 0 - Live 0x7f000000
lowmem 905 0 - Live 0x7f04f000 (P)

i haven't tried the binary analysis yet, that seems a bit beyond my skillset for now. i did crack the case open to change the SD card to a larger one so that Wikipedia works better though, so I'm likely to try this again soon.

thanks!

@lgeek

This comment has been minimized.

Copy link
Owner

commented Jun 21, 2017

@almostalive Both problems could be caused by a failure to load the kernel modules, either because they're not available in /lib/modules or because of a version mismatch with the kernel image. To start with, could you check that the modules built in linux-okreader-modules-imx6 and that the package is installed on your rootfs?

@anarcat Yeah, we've made a bit of progress since then :)

@almostalive

This comment has been minimized.

Copy link

commented Jun 26, 2017

@lgeek the problem was sort of a mismatch with the kernel version. The folder was /lib/modules/3.0.35 so I decided to dd the first 15M to see what binwalk would say about the kernel - image name: "Linux-3.0.35+". so changed it to /lib/modules/3.0.35+ and gave it a try. It all worked!!!

@anarcat

This comment has been minimized.

Copy link
Author

commented Mar 13, 2018

Yeah, we've made a bit of progress since then :)

So is there anything else you'd need from me here? i got an image I could work on here... from what @almostalive is saying here, it looks like "it all worked" - does that mean we can boot okreader here now?

After being frustrated by Nickel (Kobo's native interface) for a full day, I'm eager to ditch that stupid OS in favor of something more open that i could run wallabako on...

@lgeek

This comment has been minimized.

Copy link
Owner

commented Mar 13, 2018

@anarcat I've been using the version from the glohd_bringup branch on my Glo HD since May last year. I've not tried using wallabako.

@anarcat

This comment has been minimized.

Copy link
Author

commented Mar 14, 2018

@lgeek so it works! that's nice to hear... i'll probably give it a try then!

i wasn't expecting anyone to use wallabako with okreader just yet: i still need to figure out how it all fits together... this probably belongs more in koreader/koreader#2621, so don't worry about that just yet. :)

unless you think wallabako should be somehow integrated more directly into okreader instead of being a koreader plugin?

@Frenzie

This comment has been minimized.

Copy link

commented Mar 14, 2018

@anarcat

I have tried reverse-engineering the Kobo database format, and it's a
real mess. The content table, for example, has about 90 columns,
most of which are basically useless. There are multiple rows per book,
one per book but also one per chapter per book (instead of having,
say, a separate chapters) table.

Fun. :-)

@jellelicht

This comment has been minimized.

Copy link

commented Mar 26, 2018

What does one need to do exactly with the partitions on the SD card after building okreader? The README is quite clear on most other steps, but this section about partitions 1 and 3 mostly left me confused 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.