|
|
Thread Tools | Search this Thread |
05-19-2017, 04:38 PM | #1 |
Enthusiast
Posts: 37
Karma: 50278
Join Date: Feb 2017
Device: Kindle PW3
|
Debian on modern kindles with pre-built qemu and debian image, scripts, desktop
Hello, this is my first big post. I have been lurking for awhile, and have gone and tried everything on this forum. When I started, I didn't know anything about linux, coding, or debian. Now, after a year, I know a lot more. I will release a couple tutorials in the future about stuff I learned, giving back to this forum.
One of the many things that I couldn't do at first is get debian on my kindle. However, finally I figured it out. Now I have a fully functional desktop on my kindle =). All this information you can find on this forum, but here it is consolidated. These are all the tips that if I had In the beginning, when I didn’t know everything, I could have done a lot earlier. The only tutorial you will need for setting up debian is https://wiki.mobileread.com/wiki/Deb...n_Kindle_Touch I will copy much from there, but add a couple steps. I have attached the completed product (debian image) of this whole post, but I will explain the process. You will need a jailbroken kindle with usbnet. 1. Setup qemu with an armel system Spoiler:
2. debootstrapping an debian image in qemu First, you want to find out how much space you have on the kindle. I often find that I run out of space in debian, so always have the largest debian installation possible. Code:
Type “df” on the kindle Scroll up, and look for /mnt/us Under available, look at the amount of space available. Divide by 1000 Now in the following command under the count, type in a bit less than that number. A good size is 1700 (1.7 GB). Spoiler:
NOTE: Attached is the image up to this step!!! It is smalldebian.ext3 This file is the bare minimum container size, being only 200 MB. In order to increase the size of your debian installation, follow these steps: Code:
in ubuntu, type dd if=/dev/zero of=debian.ext3 bs=1M count=<SIZE WANTED THAT WILL FIT ON KINDLE> mkfs.ext3 debian.ext3 tune2fs -i 0 -c 0 debian.ext3 sudo mkdir /mnt/debian/ sudo mkdir /mnt/smalldebian/ sudo mount -o loop -t ext3 debian.ext3 /mnt/debian/ sudo mount -o loop -t ext3 smalldebian.ext3 /mnt/smalldebian/ sudo cp -r /mnt/smalldebian/* /mnt/debian/ sudo umount /mnt/debian/ sudo umount /mnt/smalldebian/ STEP 3: copy the image to kindle. IMPORTANT: Copy the image to /mnt/base-us/ . this is to stop hangups and bricks. STEP 4: Chroot into debian Attached is the “chrootdebian.txt” file. Copy this to the kindle’s /mnt/us/ Turn on wifi Now on the kindle type Code:
sh /mnt/us/chrootdebian.txt SECTION 2:-------------------------------------------- Setting up debian and installing a desktop environment. I have made a script that installs the system described here: https://www.mobileread.com/forums/sh...52&postcount=5 Explaining install script - you can skip: Spoiler:
NOTE: In start-x there is the script to start the desktop environment. It starts a xephyr server over top on the current ui. Change the resolution to fit you kindle. PART 3: I have provided a script that does all the above steps smoothly (including fixing the locales and installing stuff) To run copy matchbox-dos.zip and installdebian.txt to kindle /mnt/us/ NOTE: this is NOT done inside a chroot, debian needs to be unmounted Then execute installdebian.txt ( sh /mnt/us/installdebian.txt) It will do everything for you. After installing you will find some files on /mnt/us/ chroot.sh is for opening a shell into an already mounted debian system. The launch-debian files mount debian and directly starts the desktop environment. Use the attached chrootdebian.txt (sh) file to mount and chroot debian. Summary: If you encounter any problems please report and if you need help with anything please ask. Any feedback welcome. Good Luck. smalldebian.ext3 links: https://mega.nz/#!4mwkzZza!V7H4EwYMTJHkNxYk8s7HdXybkQyMj1ula69nBsm CtKo http://mir.cr/1V0UD2WN Last edited by theol0403; 08-24-2017 at 07:06 PM. Reason: I realized that after installation you had no tools to launch debian |
05-19-2017, 05:49 PM | #2 |
Evangelist
Posts: 416
Karma: 765432
Join Date: Apr 2016
Location: Italy
Device: Kindle PW3 5.8.5.0.1
|
Nice tutorial, thanks for sharing
On what firmware version you tried this? |
Advert | |
|
05-19-2017, 06:12 PM | #3 |
Enthusiast
Posts: 37
Karma: 50278
Join Date: Feb 2017
Device: Kindle PW3
|
I have a paperwhite G090 7th Generation with the latest firmware (5.8.9.1). =)
|
05-19-2017, 06:25 PM | #4 | |
Evangelist
Posts: 416
Karma: 765432
Join Date: Apr 2016
Location: Italy
Device: Kindle PW3 5.8.5.0.1
|
Quote:
|
|
05-19-2017, 06:30 PM | #5 |
Enthusiast
Posts: 37
Karma: 50278
Join Date: Feb 2017
Device: Kindle PW3
|
Yes, I know that, but you have to statically build them (include many gtk files inside the program) for it to work. So compiling gtk the normal way won't work. I am currently working on building from the kindle source. Do you think I should remove that line? Thanks for the feedback
|
Advert | |
|
05-19-2017, 07:14 PM | #6 |
Evangelist
Posts: 416
Karma: 765432
Join Date: Apr 2016
Location: Italy
Device: Kindle PW3 5.8.5.0.1
|
You can easily compile gtk apps using pkg-config, e.g.:
Code:
gcc test.c -o test.out `pkg-config gtk+-2.0 --cflags --libs` |
05-19-2017, 07:27 PM | #7 |
Enthusiast
Posts: 37
Karma: 50278
Join Date: Feb 2017
Device: Kindle PW3
|
Yes, but will it work on the kindle? Actually, it might. I will try right now. I thought I did but maybe not.
EDIT: You were right It works!!! I will remove that line. Thanks Last edited by theol0403; 05-19-2017 at 08:40 PM. |
05-19-2017, 08:56 PM | #8 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Most likely only v-2, and not any v-3, but I admit I haven't checked recently. We have a respectable number of GTK+ applications posted - Install one and see if it works. |
|
05-19-2017, 09:03 PM | #9 |
Enthusiast
Posts: 37
Karma: 50278
Join Date: Feb 2017
Device: Kindle PW3
|
Alright now I know that. I have downloaded pretty much every application on this fourm, so I "knew" that it was possible. However, I thought that the applications were statistically compiled with the gtk library. All the gtk on kindle tutorials have a long gcc command that links everything. However, just right now I natively compiled in qemu a gtk app, and put it on the kindle. It worked. So now I know. Thanks.
|
05-19-2017, 09:12 PM | #10 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
The ones that where compiled statically may have been:
targeting GTK+ V-3 targeting some not so current firmware version targeting some not so current touchscreen model or the poster just made the same mistake you almost did. If you hit a post by twobob - those are most certainly correct (for the device/firmware version he was targeting). He ported a lot of things to the Kindle while he was here. Edit: The mention of twobob and very long lists of libraries just sparked a memory. Since (at the time) Kindle firmware did not ship with the build-time version control symbolic links, he would copy the firmware libraries to where he was building and then include them in the build commands, so that the linker could find them, not so the build would be static. Edit-2: I haven't checked recently, but I don't think QT is pre-installed. Amazon would not want to be paying the license fees for commercial use. QT is only free for non-commercial use. The folks behind the Gimp ToolKit did not impose fees on the users, commercial or otherwise. Last edited by knc1; 05-19-2017 at 09:29 PM. |
07-11-2017, 04:52 AM | #11 |
Evangelist
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
|
theol0403, Thanks a lot! I just used your method to compile a Kindle application! See: https://www.mobileread.com/forums/sh...4&postcount=48
|
07-28-2017, 12:53 PM | #12 |
github.com/zaoqi
Posts: 87
Karma: 32020
Join Date: Mar 2017
Location: - Zhejiang China
Device: Boox c67ml,Note S,Max2,KT3,KPW4,Kobo AurdHD,Touch N905C
|
Debian 9 ("stretch") — current stable release
|
07-28-2017, 01:34 PM | #13 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
That is too new, you will have compatibility problems with the system libraries.
Even the newest firmware build, for the newest generation of Kindles, only uses GLIBC-2.20: Ref: https://www.mobileread.com/forums/sh...4&postcount=24 The system library used for Debian 9 is GLIBC-2.24: Ref: https://packages.debian.org/stretch/libc6 Translation: Symbols are versioned. If you create a program that requires any symbols more recent than GLIBC-20, it will not run on a Kindle. Unless you provide those newer symbols in a library that you create yourself and use it to 'extend' the older version of the system library that is pre-installed. If what you built runs on a Kindle, consider yourself lucky, because that is what happened, you got lucky. Note: It is real hard to create a 'C' language program without a reference to memcpy. And memcpy changed at GLIBC-2.14. Any system with an older version of the system library will be unable to provide that symbol. Now take another look at my list of what devices / what firmware versions provide which GLIBC versions. |
07-28-2017, 04:12 PM | #14 |
Enthusiast
Posts: 37
Karma: 50278
Join Date: Feb 2017
Device: Kindle PW3
|
Thanks Knc1 for your great answer
I have the latest paperwhite with the latest firmware bought last year. Jessie is the newest version that can run on the kindle. If you try debootstrapping debian sid or later it will give you "FATAL: KERNEL TOO OLD" error. Same with compiling software on an emulator above jessie and running it on the kindle.
However, jessie is not perfect either. If I try to install and run Firefox ESR or Gnash from the jessie repositories it gives me the same error. To get them to work I have to explicitly install them from wheezy repositories. So wheezy is much better for working with the kindles except that things are older and you may have trouble compiling recent versions of software (note that jessie and jessie-backports are the current stable release, so most packages and libraies are up to date, unlike wheezy which is oldstable). |
08-03-2017, 11:42 AM | #15 |
github.com/zaoqi
Posts: 87
Karma: 32020
Join Date: Mar 2017
Location: - Zhejiang China
Device: Boox c67ml,Note S,Max2,KT3,KPW4,Kobo AurdHD,Touch N905C
|
KT3 supports Debian 9!
|
Tags |
debian, jessie, kindle, pw3, qemu |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Glo Where's Debian GNU/Linux image for Kobo Glo?哪里有Kobo Glo的Debian GNU/Linux镜像? | zaoqi | Kobo Developer's Corner | 0 | 04-09-2017 03:33 AM |
Easy debian install with prebuilt image. | Xqtftqx | Kindle Developer's Corner | 67 | 02-07-2017 06:49 PM |
Using built-in imagemagick to crop an image | nasser | Kindle Developer's Corner | 12 | 08-07-2016 10:18 AM |
WebReaderViewer - built in image/frame/string/html viewer for kindle | Aeris | Kindle Developer's Corner | 13 | 11-05-2013 03:11 AM |
More memory for qemu image | Mackx | iRex Developer's Corner | 2 | 06-27-2010 03:20 PM |