View Single Post
Old 08-26-2010, 01: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