Giter Club home page Giter Club logo

debiankindle's Introduction

Installing Debian on your Kindle

Update (2020): This project is deprecated. I have no idea if any of the following instructions are still accurate, or if any of the links are still working. I have now moved over to Gitlab.

Installing Debian on your Kindle

The first thing you need to do is jailbreak your Kindle. The jailbreaking process involves allowing the installation of unsigned applications to your Kindle. I used this guide from LifeHacker.com

Once you have jailbroken, you will be able to install a terminal. Installing a terminal allows you to access the underlying Linux system on your Kindle. For this hack, I used KTerm. You can get KTerm from here. To install it, you have to unzip the ZIP file you downloaded into the extensions folder on your Kindle's root directory from a computer.

Now that you have a terminal, you will be able to install the Debian chroot. Here's where it gets complicated. First, you need to generate a Debian image appropriate for your device. Use MakeImage.sh to do this. Run the script on a Linux system to generate the image. If you do not have access to a Linux system, message me and I can provide a pre-generated one.

Now, move the debian.ext3 file on to your Kindle's root directory. You're almost there. Once you have moved debian.ext3, you need to move the RunDebian.sh script and the UpdateInitScript.sh script as well as RunBeforeDebian.sh

on to your Kindle. Now you can run them. Do this by typing cd ../.. and then ./RunDebian.sh --root on your Kindle. You are now root on your Kindle!

Then, hit CTRL-D on your Kindle until you see [US]$ or [US]# you are now back in your Kindle's terminal. Type ./RunBeforeDebian.sh on your Kindle to setup mountpoints and install the debian command/. Now, you should be able to type debianin the Kindle's terminal to access Debian. If you need root access (to install sudo, add users, etc) typedebian --root` to start Debian as root.

You should now have a working Debian install.

Finally, you need to setup Debian (IF YOU HAVE A PREGENERATED IMAGE YOU CAN SKIP THIS STEP) First, type debian --root to enter Debian as root. Then, type cd /deboostrap. Next, type ./deboostrap --second-stage and let that do it's thing. If it fails, hit CTRL-D until you see [US]$ then type debian --root again. Once that completes, type dpkg --configure -a. Now type adduser <USERNAME> replacing <USERNAME> with your name. Next, type apt-get install sudo. Then, type adduser <USERNAME> sudo replacing <USERNAME> with your name and follow the prompts. Finally, hit CTRL-D until you see [US]$ and type debian. Login with your username and password. Finally, type echo alias "sudo"="sudo -S".

-Enjoy!

Open an issue in the Issue Tracker if you encounter any issues, or PM me on Reddit (u/dylanhamer13) if you need help with any of the instructions.

Thanks for the support, Kat

debiankindle's People

Contributors

06kellyjac avatar arionmiles avatar czd avatar kathamer avatar nincollin avatar paulpanther avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

debiankindle's Issues

Error when checking for debian.ext3 file

Problem

There is an error in the RunDebian.sh that prevents checking for the existence of debian.ext3.

The RunDebian.sh script uses the following line of code to check if the debian.ext3 file is in the same directory as RunDebian.sh:

if [ -a debian.ext3 ]

This check fails with an error, on the kindle as well as on my Linux computer. The following line of code worked successfully:

if [ -f debian.ext3 ]

You can reproduce the issue as follows (replace all paths with real file paths):

mkdir test
cd test
cp /path/to/debian.ext3 . #copies debian.ext3 file to current directory
cp /path/to/RunDebian.sh . #copies RunDebian.sh to current directory
chmod a+x RunDebian.sh
./RunDebian.sh

After running the above commands, you will receive the following error (note that a slightly different error occurs on the kindle because it does not use /bin/bash, but /bin.sh):
[*] Looking for Debian...
./RunDebian.sh: 8: [: -a: unexpected operator
[!] Could not find Debian image!

Solution:

I was able to make that line of code work by replacing the -a flag with -f:

if [ -f debian.ext3 ]

Replace line 8 in the original RunDebian.sh script with the line above, and re-run it in your test directory, and you will see that it works.

Mounting debian.ext3 fails with errors

Problem

The RunDebian.sh file contains several lines that call for parts of the root filesystem to be mounted to the chroot environment. However, the mount points it points to do not exist.

Upon running RunDebian.sh, the following errors are thrown:

[*] Looking for Debian...
[*] Found Debian image!
[*] Mounting rootfs...
mount: mount point /mnt/debian does not exist
[*] Preparing Filesystem...
mount: mount point /mnt/debian/dev does not exist
mount: mount point /mnt/debian/proc does not exist
mount: mount point /mnt/debian/sys does not exist
[*] Preparing Network...
cp: can't create '/mnt/debian/etc/hosts': No such file or directory
cp: can't stat '/etc/resolv.conf': No such file or directory
[*] Starting Shell...

chroot: can't change root directory to /mnt/debian: No such file or directory
[*] Unmounting rootfs...
umount: /mnt/debian/dev: not found
umount: /mnt/debian/proc: not found
umount: /mnt/debian/sys: not found
umount: /mnt/debian: not found

Solution (sort of...)

I incorporated the following lines of code into my fork's version of RunDebian.sh to check for the existence of the mount point directories /mnt/debian , /mnt/debian/dev, /mnt/debian/proc, and /mnt/debian/sys:

if [ -d /mnt/debian ]; then
    echo "[*]Mount point exists for debian"
else
    echo "[*]Creating mount point for debian"
    mkdir /mnt/debian
fi
if [ -d /mnt/debian/dev ] && [ -d /mnt/debian/proc ] && [ -d /mnt/debian/sys ]; then
    echo "[*]Mount points exist for proc sys and dev"
else
    echo "[*]Creating mount points for proc sys and dev"
    mkdir /mnt/debian/dev /mnt/debian/proc /mnt/debian/sys
fi

Unfortunately, after incorporating that check, there are more issues related to mounting, so it appears there are more underlying issues in mounting. I haven't had time to check those, but here are the new errors:

[*] Looking for Debian...
[*] Found Debian image!
[*] Mounting rootfs...
[*]Creating mount point for debian
[*]Creating mount points for proc sys and dev
[*] Preparing Filesystem...
mount: mount point /mnt/debian/dev does not exist
mount: mount point /mnt/debian/proc does not exist
mount: mount point /mnt/debian/sys does not exist
[*] Preparing Network...
cp: can't create '/mnt/debian/etc/hosts': No such file or directory
cp: can't stat '/etc/resolv.conf': No such file or directory
[*] Starting Shell...

chroot: can't execute '/bin/bash': No such file or directory
[*] Unmounting rootfs...
umount: /mnt/debian/dev: not found
umount: /mnt/debian/proc: not found
umount: /mnt/debian/sys: not found

Add a license

It seems you forgot to add a license, unless I'm mistaken. A LICENSE.md file would do :)

debian.ext3 Filesize

Debian.ext3 is about 1.5GB for me, but seems to be at least 1gb of 0-padding. I haven't been able to move debian.ext3 to my root partition since mv /mnt/us/debian.ext3 / results in my KT2 running out of space.

Should the original image be made with a lower amount of blocks (say 300) when making the empty file with dd?

UpdateInitScript.sh does not properly check for RunDebian.sh

Problem

This is similar to Issue #3

The script uses if [ -a RunDebian.sh ] which returns an error of:
./UpdateInitScript.sh: 2: [: -a: unexpected operator

It should be:
if [ -f RunDebian.sh ]

Proof of Concept

Strip down the UpdateInitScript.sh to look like this:

#!/bin/sh
if [ -a 'RunDebian.sh' ]; then
    mv RunDebian.sh /bin/debian
    if [ $? -eq 0 ]; then
        echo "[*] Installation succcessful..."
    else
        echo "[!] Debian init script installation failed!"
        echo "Are you root?"
        exit 5
    fi
else
    echo "[!] Debian init script does not exist!"
    echo "Please put RunDebian.sh in the root directory of the Kindle."
fi

Then do the following:

mkdir test && cd test
cp /path/to/RunDebian.sh .
cp /path/to/UpdateInitScript.sh .
./UpdadeInitScript.sh

You will receive the unexpected operator error.

Solution

Change it to:

if [ -f RunDebian.sh ]

The instructions in the README appear cut off

Hi,

It looks like the instructions for how to install debian are cut off.

They stop during the "Downgrade your Kindle's operating system" section after explaining how to find your device's model and don't get to how to do the downgrade. I can kind of see how things would progress from looking at other rooting guides, but it's pure guesswork. (especially given all the different models and revisions)

There's also little explanation on how to use the files in the repo. I can kind of guess at it from reading them (it looks like one has to be run on a debian system, and two other have to be somehow copied to and run under the kindle's linux?)

A bit more explanation in this area would be really helpful.

Thanks for putting this together,
-Matt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.