Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 08-26-2010, 12:16 PM   #1
supert
Junior Member
supert began at the beginning.
 
Posts: 8
Karma: 12
Join Date: Aug 2010
Device: kindle dx graphite
Debian on kindle: howto

This post tells you how to put debian on your kindle. I have a DX Graphite running 2.5.5.

I'll update these and tidy them up in the near future, hopefully. Please post improvements, comments etc.

You should learn about chroot if you don't already know, to understand what you are doing.

First, Jailbreak.

Then, USBnetworking:
http://www.mobileread.com/forums/sho...t=49350&page=8
for the usb networking howto

On your kindle root shell:
Code:
# to avoid networking dying try this
/mnt/us/usbnet/bin/usbnet-enable
# not sure if this is necessary:
/etc/init.d.framework stop
mntroot rw
# then add a sensible dns server like 4.2.2.1
vi /etc/resolv.conf
# for some reason this last step seems to undo itself periodically?
route add default gw 192.168.2.1
# to check the routing was added, use
route -n
# some say you need this, I'm not sure
/etc/init.d/netwatchd stop
Sometimes the resolv.conf and the default gateway reset themselves and have to be changed again. I don't know why.

I have another armel machine, a sheevaplug. It's my 'donor' machine. Actually you can use debootstrap from any linux machine, specifying armel architecture.

On the donor machine:
Code:
# make an ext3 disk image and mount it on sheeva (the donor machine)
# this one is quite a large image... you may want less...
# DO NOT use ext2 -- it won't work
dd if=/dev/zero of=/tmp/debian.ext3 bs=1M count=1280
mkfs.ext3 /tmp/debian.ext3
tune2fs -i 0 -c 0 /tmp/debian.ext3

mount -o loop -t ext3 /tmp/debian.ext3 /mnt/debian

# debootstrap a basic debian on to your image
debootstrap --arch=armel testing /mnt/debian http://ftp.us.debian.org/debian
# copy over the prepared debootstrap image, perhaps using the USB flash drive functionality
/srv/Kindle.ext3 --> /mnt/us/debian.ext3



Now on the Kindle, using the root ssh access you got earlier:

Code:
# mount it on kindle
# I put all this in an init script called /etc/init.t/debian start
mount -o loop -t ext3 /mnt/us/debian.ext3 /mnt/debian
# or in fstab later on the Kindle -- not sure if this works?
#/mnt/us/debian.ext3 /mnt/debian ext3 loop,sync,noatime 0 0

# prepare filesystem for chroot
mount -o bind /dev /mnt/debian/dev
mount -o bind /proc /mnt/debian/proc
mount -o bind /sys /mnt/debian/sys

# or, if you were using a different kernel
#mount proc /mnt/debian/proc -t proc
#mount sysfs /mnt/debian/sys -t sysfs
#mount devfs /mnt/debian/dev -t dev

cp /etc/hosts /mnt/debian/etc/hosts
cp /etc/resolv.conf /mnt/debian/etc/resolv.conf

# get a shell on your new system
chroot /mnt/debian /bin/bash
You might like to
Code:
vi /etc/fstab
vi /etc/network/interfaces
apt-get install ssh udev nano openssh-server rsync
Code:
now to ssh straight into your chroot debian system.
# change your debian system to listen for ssh on port (eg) 2222
nano /etc/ssh/sshd_config
# make sure /proc is mounted
service ssh start
# add a user other than root, ideally
to ssh into your kindle:
Code:
ssh root@192.168.2.2 -p 2222


Loose ends:

I've been trying to get X11 working, haven't had too much luck yet. This is what I've tried as per Jesse.
on the donor machine:
Code:
# set up X11 to use /dev/fb:
apt-get build-dep xorg-server
apt-get source xorg-server
# apply the patch as per http://code.google.com/p/savory/source/browse/trunk/x11-on-kindle/?r=12
./autogen.sh --prefix=/mnt/debian
make && make install
umount /mnt/debian
... but it still looks for a VT / tty.

I have unsuccessfully tried hacking /etc/inittab to provide a fake tty, of course this doesn't work


# can we use directfb? fbterm?


Probably I will need to flash the kernel as per yifanlu, recompiling it with with VT support. I think the options need to be (but I am not sure):

CONFIG_NO_USER_SPACE_SCREEN_ACCESS_CONTROL=y
# CONFIG_FB_EARLYSUSPEND is not set
CONFIG_VT=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_VT_CONSOLE=y
CONFIG_HW_CONSOLE=y
CONFIG_DUMMY_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
# CONFIG_FB_MSM_LOGO is not set

Given VT support in the kernel, it may make more sense to run something like fbterm rather than X11.

-supert
supert is offline   Reply With Quote
Old 08-26-2010, 04:52 PM   #2
isotherm
Connoisseur
isotherm is an accomplished Snipe hunter.isotherm is an accomplished Snipe hunter.isotherm is an accomplished Snipe hunter.isotherm is an accomplished Snipe hunter.isotherm is an accomplished Snipe hunter.isotherm is an accomplished Snipe hunter.isotherm is an accomplished Snipe hunter.isotherm is an accomplished Snipe hunter.isotherm is an accomplished Snipe hunter.isotherm is an accomplished Snipe hunter.isotherm is an accomplished Snipe hunter.
 
Posts: 74
Karma: 123797
Join Date: Jul 2010
Device: Kindle 2
I will just add that this also works for Ubuntu ARM 9.04. The 9.04 version is important. I chroot into Ubuntu from time to time in order to compile code or use the full array of Linux tools beyond the few included on the Kindle. I didn't try to get X running at all, though. But some have been somewhat successful:
http://hackaday.com/2009/09/03/ubuntu-9-04-on-kindle-2/
isotherm is offline   Reply With Quote
Old 08-27-2010, 09:35 PM   #3
jesse
Connoisseur
jesse can even cheer up an android equipped with a defective Genuine Personality Prototype.jesse can even cheer up an android equipped with a defective Genuine Personality Prototype.jesse can even cheer up an android equipped with a defective Genuine Personality Prototype.jesse can even cheer up an android equipped with a defective Genuine Personality Prototype.jesse can even cheer up an android equipped with a defective Genuine Personality Prototype.jesse can even cheer up an android equipped with a defective Genuine Personality Prototype.jesse can even cheer up an android equipped with a defective Genuine Personality Prototype.jesse can even cheer up an android equipped with a defective Genuine Personality Prototype.jesse can even cheer up an android equipped with a defective Genuine Personality Prototype.jesse can even cheer up an android equipped with a defective Genuine Personality Prototype.jesse can even cheer up an android equipped with a defective Genuine Personality Prototype.
 
Posts: 62
Karma: 30418
Join Date: Jan 2009
Device: Kindle 2
It turns out that it's easier to fix X than it is to rebuild the Kindle's kernel to add a controlling tty.

http://code.google.com/p/savory/sour...xorg-1.6.patch

Was what I hacked up last smmer. It should do what you need or at least get you started.
jesse is offline   Reply With Quote
Old 08-30-2010, 09:01 AM   #4
troyme
Enthusiast
troyme began at the beginning.
 
Posts: 40
Karma: 34
Join Date: Aug 2010
Device: kindle dx US
I install a chroot ftpd server on my DX, so I can transfer books while reading,it's funny of the chroot debian
troyme is offline   Reply With Quote
Old 08-30-2010, 05:27 PM   #5
supert
Junior Member
supert began at the beginning.
 
Posts: 8
Karma: 12
Join Date: Aug 2010
Device: kindle dx graphite
Jesse,

I tried your patch (I reference it above), compiled & installed but it did not work for me. X still looked for a vt.
Perhaps the problem is debian vs. ubuntu? though I can't believe the package would be significantly different. The patch was applied to the source code supplied by xorg-server which if I recall does not supply Xfbdev.

Not sure what else to try.
supert is offline   Reply With Quote
Old 01-02-2011, 02:16 PM   #6
cm0nster
Junior Member
cm0nster began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Dec 2010
Device: Kindle 3 - 3G
is there any way to install debian on my kindle if the original linux filesystem is messed up so i cannot even boot normally at all?
cm0nster is offline   Reply With Quote
Old 03-25-2011, 07:00 AM   #7
Tanga
Zealot
Tanga shares his or her toysTanga shares his or her toysTanga shares his or her toysTanga shares his or her toysTanga shares his or her toysTanga shares his or her toysTanga shares his or her toysTanga shares his or her toysTanga shares his or her toysTanga shares his or her toysTanga shares his or her toys
 
Posts: 130
Karma: 5792
Join Date: Mar 2011
Location: Australia
Device: Kindle 3
Anyone made any progress with this? Seems like a pretty attractive deal. It would provide access to so many awesome apps.
Tanga is offline   Reply With Quote
Old 03-30-2011, 05:00 AM   #8
seaniko7
wannabe developer
seaniko7 can grok the meaning of the universe.seaniko7 can grok the meaning of the universe.seaniko7 can grok the meaning of the universe.seaniko7 can grok the meaning of the universe.seaniko7 can grok the meaning of the universe.seaniko7 can grok the meaning of the universe.seaniko7 can grok the meaning of the universe.seaniko7 can grok the meaning of the universe.seaniko7 can grok the meaning of the universe.seaniko7 can grok the meaning of the universe.seaniko7 can grok the meaning of the universe.
 
seaniko7's Avatar
 
Posts: 181
Karma: 156548
Join Date: Mar 2011
Device: Kindle: 2xKeyboard, Classic, 2xTouch, 2xPW, PW2; Onyx: Boox M92
I'll soon write quite similiar tutorial with ready made ubuntu image (ext2). ATM I'm struggling with x11 patch, because I don't know how to apply it.
BTW it's fun to play with some nice linux apps on kindle.
seaniko7 is offline   Reply With Quote
Old 04-06-2011, 07:06 PM   #9
FethryDuck
Addict
FethryDuck will become famous soon enoughFethryDuck will become famous soon enoughFethryDuck will become famous soon enoughFethryDuck will become famous soon enoughFethryDuck will become famous soon enoughFethryDuck will become famous soon enough
 
FethryDuck's Avatar
 
Posts: 281
Karma: 520
Join Date: Nov 2010
Location: sometimes Norway, planet Earth
Device: Kindle3, DXG
Quote:
Originally Posted by troyme View Post
I install a chroot ftpd server on my DX, so I can transfer books while reading,it's funny of the chroot debian
Wonder if someone could explain this one ? I don't understand it, - if you have an ftp server on it, how do you put any file to it ? hmm....

You do it over usbnetwork ? .. most probably.. hmm... such a stupid device ( my view ) as it lacks wifi. Would it be possible to make a connection over - is it GPRS ?
FethryDuck is offline   Reply With Quote
Old 04-08-2011, 09:02 AM   #10
yifanlu
Kindle Dissector
yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.yifanlu can program the VCR without an owner's manual.
 
Posts: 662
Karma: 170717
Join Date: Jul 2010
Device: Amazon Kindle 3
Quote:
Originally Posted by Tanga View Post
Anyone made any progress with this? Seems like a pretty attractive deal. It would provide access to so many awesome apps.
More ARM compiled Linux binaries can run already. If you're talking about GUI ubuntu programs, then it's highly unlikely.
yifanlu is offline   Reply With Quote
Old 04-12-2011, 12:02 AM   #11
Giggleton
Suspended
Giggleton ought to be getting tired of karma fortunes by now.Giggleton ought to be getting tired of karma fortunes by now.Giggleton ought to be getting tired of karma fortunes by now.Giggleton ought to be getting tired of karma fortunes by now.Giggleton ought to be getting tired of karma fortunes by now.Giggleton ought to be getting tired of karma fortunes by now.Giggleton ought to be getting tired of karma fortunes by now.Giggleton ought to be getting tired of karma fortunes by now.Giggleton ought to be getting tired of karma fortunes by now.Giggleton ought to be getting tired of karma fortunes by now.Giggleton ought to be getting tired of karma fortunes by now.
 
Posts: 1,687
Karma: 4368191
Join Date: Jan 2011
Location: Oregon
Device: Kindle3
Is this for getting rid of Amazon's footprint on the Kindle? Do epubs still look good?
Giggleton is offline   Reply With Quote
Old 05-19-2011, 12:46 AM   #12
eko
Junior Member
eko began at the beginning.
 
Posts: 1
Karma: 10
Join Date: May 2011
Device: Kindle 3 Wifi
What is ./configure option for xorg to make Xfbdev-4bpp? Its on your mystartx
eko is offline   Reply With Quote
Old 06-02-2011, 04:34 AM   #13
tomashg
Junior Member
tomashg began at the beginning.
 
Posts: 6
Karma: 10
Join Date: May 2011
Location: Nicosia, Cyprus
Device: Amazon Kindle 3W
Hello,
I tried following your guide and created an image, it mounts and i can chroot into it on my kindle without any problems, but but besides that nothing works. as soon as i login i get this:
Code:
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
I have no name!@kindle:/#
whoami gives an error that it cant find a user, also apt-get does not exist and dpkg gives me this
Code:
warning, in file '/var/lib/dpkg/status' near line 3 package 'dpkg': missing description
warning, in file '/var/lib/dpkg/status' near line 3 package 'dpkg': missing maintainer


how can i add more packages to the image or setup a working build?

EDIT: tough i used the squeeze version instead of testing

Last edited by tomashg; 06-02-2011 at 04:40 AM.
tomashg is offline   Reply With Quote
Old 10-31-2012, 07:20 AM   #14
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,552
Karma: 6021142
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Quote:
Originally Posted by supert View Post
Snip...


Loose ends:

I've been trying to get X11 working, haven't had too much luck yet. This is what I've tried as per Jesse.
on the donor machine:
Code:
# set up X11 to use /dev/fb:
apt-get build-dep xorg-server
apt-get source xorg-server
# apply the patch as per http://code.google.com/p/savory/source/browse/trunk/x11-on-kindle/?r=12
./autogen.sh --prefix=/mnt/debian
make && make install
umount /mnt/debian
... but it still looks for a VT / tty.

I have unsuccessfully tried hacking /etc/inittab to provide a fake tty, of course this doesn't work

# can we use directfb? fbterm?

Probably I will need to flash the kernel as per yifanlu, recompiling it with with VT support. I think the options need to be (but I am not sure):

CONFIG_NO_USER_SPACE_SCREEN_ACCESS_CONTROL=y
# CONFIG_FB_EARLYSUSPEND is not set
CONFIG_VT=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_VT_CONSOLE=y
CONFIG_HW_CONSOLE=y
CONFIG_DUMMY_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
# CONFIG_FB_MSM_LOGO is not set

Given VT support in the kernel, it may make more sense to run something like fbterm rather than X11.

-supert
There is a version of X now working in a basic fashion... FYI.

patch for the VT issue (to get X to boot at least) is here: http://www.mobileread.com/forums/sho...8&postcount=28

cheers.
twobob is offline   Reply With Quote
Old 11-01-2012, 12:13 AM   #15
EternalCyclist
Member
EternalCyclist for a long time would go to bed early.EternalCyclist for a long time would go to bed early.EternalCyclist for a long time would go to bed early.EternalCyclist for a long time would go to bed early.EternalCyclist for a long time would go to bed early.EternalCyclist for a long time would go to bed early.EternalCyclist for a long time would go to bed early.EternalCyclist for a long time would go to bed early.EternalCyclist for a long time would go to bed early.EternalCyclist for a long time would go to bed early.EternalCyclist for a long time would go to bed early.
 
Posts: 17
Karma: 17946
Join Date: Oct 2012
Device: KT
Quote:
Originally Posted by tomashg View Post
nothing works.
The recipe in the opening post did not work for me either. But it was a good guide, anyway.

First, you set up the image on an ARM machine? If not:
Spoiler:
Code:
debootstrap --arch=armel testing --foreign /mnt/debian http://ftp.us.debian.org/debian
And then after chrooting into it on your Kindle:
Code:
debootstrap --second-stage


Here is the initscript I am using on the Kindle. To setup the chroot environment.
Maybe you have to create some mount points manually at the first run after mounting /mnt/debian.

Spoiler:
Code:
mount -o loop -t ext3 /mnt/base-us/k5debian.ext3 /mnt/debian
mount -o bind /dev /mnt/debian/dev
mount -o bind /dev/pts /mnt/debian/dev/pts
mount -o bind /proc /mnt/debian/proc
mount -o bind /sys /mnt/debian/sys
mount -o bind /mnt/us /mnt/debian/mnt/us
cp /etc/hosts /mnt/debian/etc/hosts
echo "Debian init complete"


k5debian.ext3 is accessed via /mnt/base-us and not via /mnt/us because of apt-get problems otherwise. It seems to work, but is dangerous, when /mnt/us is mounted via usb on the host PC.


I think it is high time to update http://wiki.mobileread.com/wiki/Debi...n_Kindle_Touch

Last edited by EternalCyclist; 11-01-2012 at 12:20 AM. Reason: Note about using /mnt/base-us
EternalCyclist is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing a "normal" Debian ARMEL Linux on the Kindle choff Kindle Developer's Corner 15 03-27-2013 12:28 AM
Can't install under Debian Lenny cbalmforth Calibre 2 07-01-2010 12:59 PM
Debian on the Kindle freezer2k Kindle Developer's Corner 20 02-08-2010 08:52 PM
no SSH on Hanvon N516 and debian zwieblum OpenInkpot 1 09-22-2009 05:30 AM
Debian 3.1 Released Chaos Lounge 3 06-08-2005 09:01 AM


All times are GMT -4. The time now is 11:57 PM.


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