{"id":330,"date":"2011-06-14T17:52:19","date_gmt":"2011-06-14T15:52:19","guid":{"rendered":"http:\/\/tomashg.com\/?p=330"},"modified":"2012-02-22T00:55:40","modified_gmt":"2012-02-21T22:55:40","slug":"debian-on-kindle-plus-network-tools","status":"publish","type":"post","link":"https:\/\/tomashg.com\/?p=330","title":{"rendered":"Debian on Kindle plus network tools"},"content":{"rendered":"<p style=\"text-align: left;\"><a href=\"https:\/\/tomashg.com\/wp-content\/uploads\/2011\/06\/IMAG0514.jpg\"><img fetchpriority=\"high\" decoding=\"async\" class=\"size-medium wp-image-386\" title=\"IMAG0514\" src=\"https:\/\/tomashg.com\/wp-content\/uploads\/2011\/06\/IMAG0514-225x300.jpg\" alt=\"\" width=\"225\" height=\"300\" srcset=\"https:\/\/tomashg.com\/wp-content\/uploads\/2011\/06\/IMAG0514-225x300.jpg 225w, https:\/\/tomashg.com\/wp-content\/uploads\/2011\/06\/IMAG0514-771x1024.jpg 771w, https:\/\/tomashg.com\/wp-content\/uploads\/2011\/06\/IMAG0514.jpg 1952w\" sizes=\"(max-width: 225px) 100vw, 225px\" \/><\/a><\/p>\n<p>Finally after a lot of endless nights tingering around I decided to post about my newly\u00a0acquired\u00a0Amazon Kindle 3. Since I study \u00a0presentations and books from PDF files I thought a device like this would be really useful, and after\u00a0reading\u00a0somewhere that it could run Ubuntu Linux and even with X11 I knew exactly what I needed. Without wasting time I went to the local electronics store to check their prices. To my surprise they offered the previous generation for 350 euros (really wtf?) when you could order the latest version from Amazon for barely 120 euros with DHL shipping.<\/p>\n<p>Day one, I literally took it apart, jailbroken, changed the boring\u00a0wallpapers\u00a0to something more cool and installed SSH. But it wasn&#8217;t enough.. Although it runs natively on some basic Linux install, it is very limiting. After studying some guides and forums I was up and running!<\/p>\n<p>Here are the steps I followed to installed a Debian <a title=\"choort\" href=\"http:\/\/en.wikipedia.org\/wiki\/Chroot\" target=\"_blank\">chroot<\/a> on my Kindle device and some network tools.<\/p>\n<p><strong><span style=\"text-decoration: underline; color: #ff0000;\">NOTE<\/span>: <\/strong>This is not an expert how to guide, just what I did to make it work, so it is not the best or most safe way to do it, I can&#8217;t have any responsibility if you brick your device. Please if you want to follow the steps make sure you know what you are doing.<\/p>\n<p><a href=\"https:\/\/tomashg.com\/wp-content\/uploads\/2011\/06\/IMAG0492.jpg\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-389\" title=\"IMAG0492\" src=\"https:\/\/tomashg.com\/wp-content\/uploads\/2011\/06\/IMAG0492-225x300.jpg\" alt=\"\" width=\"225\" height=\"300\" srcset=\"https:\/\/tomashg.com\/wp-content\/uploads\/2011\/06\/IMAG0492-225x300.jpg 225w, https:\/\/tomashg.com\/wp-content\/uploads\/2011\/06\/IMAG0492-771x1024.jpg 771w, https:\/\/tomashg.com\/wp-content\/uploads\/2011\/06\/IMAG0492.jpg 1952w\" sizes=\"(max-width: 225px) 100vw, 225px\" \/><\/a><\/p>\n<p>First we have to create a\u00a0file system\u00a0image, the following commands create a 512MB ext3 image and mounts it on \/mnt. To make it larger just change the count parameter.<\/p>\n<pre class=\"brush:shell\">dd if=\/dev\/zero of=\/tmp\/wheezy.ext3 bs=1M count=512\r\nmkfs.ext3 \/tmp\/wheezy.ext3\r\ntune2fs -i 0 -c 0 \/tmp\/wheezy.ext3\r\nsudo mount -o loop -t ext3 \/tmp\/wheezy.ext3 \/mnt\/<\/pre>\n<p>Now we have to install and configure <a title=\"multistrap\" href=\"http:\/\/wiki.debian.org\/Multistrap\">multistrap<\/a>, its a <a title=\"debootstrap\" href=\"http:\/\/wiki.debian.org\/Debootstrap\">debootstrap<\/a> like utility that installs a Debian base system plus you can specify extra repositories and packets to install in the configuration file.<\/p>\n<pre class=\"brush:shell\">sudo apt-get install multistrap\r\nnano wheezy-config<\/pre>\n<p>Here is a\u00a0simple\u00a0configuration I used, more can be found at the previous links.<\/p>\n<pre class=\"brush:shell\">[General]\r\nunpack=true\r\narch=armel\r\ndirectory=\/mnt\/\r\ndebootstrap=Grip Updates\r\naptsources=Debian Grip Updates\r\n\r\n[Grip]\r\npackages=ntpdate udev lrzsz netcat telnetd apt\r\nsource=http:\/\/www.emdebian.org\/grip\r\nkeyring=emdebian-archive-keyring\r\nsuite=wheezy\r\n\r\n[Updates]\r\npackages=apt\r\nsource=http:\/\/ftp.uk.debian.org\/debian\r\nkeyring=debian-archive-keyring\r\nsuite=wheezy-proposed-updates\r\n\r\n[Debian]\r\npackages=\r\nsource=http:\/\/ftp.uk.debian.org\/debian\r\nkeyring=debian-archive-keyring\r\nsuite=wheezy<\/pre>\n<p>Next step is to finally install the chroot on our image, this should take a while.<\/p>\n<pre class=\"brush:shell\">sudo\u00a0multistrap\u00a0-f\u00a0wheezy-config<\/pre>\n<p>After everything is done, unmount the image and copy it to your Kindle. Now you are ready to mount it on your Kindle and chroot into it. To make things easier here is a script by <a href=\"http:\/\/xkid.biz\/wordpress\/?p=4\">Xkid<\/a> you could use.<\/p>\n<pre class=\"brush:shell\">#!\/bin\/sh\r\necho \"[*] Mounting Rootfs...\"\r\nmount -o loop,noatime -t ext3 \/mnt\/us\/debian.ext3 \/mnt\/debian\r\necho \"[*] Preparing Filesystem...\"\r\nmount -o bind \/dev \/mnt\/debian\/dev\r\nmount -o bind \/proc \/mnt\/debian\/proc\r\nmount -o bind \/sys \/mnt\/debian\/sys\r\necho \"[*] Preparing Network Connections...\"\r\ncp \/etc\/hosts \/mnt\/debian\/etc\/hosts\r\ncp \/etc\/resolv.conf \/mnt\/debian\/etc\/resolv.conf\r\necho \"[*] Starting Shell...\"\r\nchroot \/mnt\/debian \/bin\/bash\r\necho \"[*]Unmounting Rootfs...\"\r\numount \/mnt\/debian\/dev\r\numount \/mnt\/debian\/proc\r\numount \/mnt\/debian\/sys\r\numount \/mnt\/debian<\/pre>\n<p>After you have sucessfully chrooted into your image, you have to configure dpkg by running<\/p>\n<pre class=\"brush:shell\">dpkg --configure -a<\/pre>\n<p><a href=\"https:\/\/tomashg.com\/wp-content\/uploads\/2011\/06\/IMAG0524.jpg\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-387\" title=\"IMAG0524\" src=\"https:\/\/tomashg.com\/wp-content\/uploads\/2011\/06\/IMAG0524-225x300.jpg\" alt=\"\" width=\"225\" height=\"300\" srcset=\"https:\/\/tomashg.com\/wp-content\/uploads\/2011\/06\/IMAG0524-225x300.jpg 225w, https:\/\/tomashg.com\/wp-content\/uploads\/2011\/06\/IMAG0524-771x1024.jpg 771w, https:\/\/tomashg.com\/wp-content\/uploads\/2011\/06\/IMAG0524.jpg 1952w\" sizes=\"(max-width: 225px) 100vw, 225px\" \/><\/a><\/p>\n<p>By this stage you should have a working apt-get, from there you can install pretty much anything else you want. Here are some packets you might find interesting.<\/p>\n<p>net-tools &#8211; A collection of network programs like ifconfig, arp, route etc<br \/>\nnetcat &#8211; Networking utility which reads and writes data across network connections<br \/>\ngcc, g++ &#8211; GNU C\/C++ compilers<br \/>\nlinks &#8211; Terminal web browser<br \/>\nnano &#8211; Text editor<\/p>\n<p>Plus I compiled a lot of custom networking tools from source. Also I tried nmap and aircrack-ng though with little success so far.<\/p>\n<p><a href=\"https:\/\/tomashg.com\/wp-content\/uploads\/2011\/06\/IMAG0520.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-388\" title=\"IMAG0520\" src=\"https:\/\/tomashg.com\/wp-content\/uploads\/2011\/06\/IMAG0520-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"https:\/\/tomashg.com\/wp-content\/uploads\/2011\/06\/IMAG0520-300x225.jpg 300w, https:\/\/tomashg.com\/wp-content\/uploads\/2011\/06\/IMAG0520-1024x771.jpg 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Have fun.<\/p>\n<p>&nbsp;<\/p>\n<p>PS: Use <a href=\"http:\/\/tinyapps.org\/docs\/kindle_standalone_terminal.html\">Luigis terminal<\/a> or <a href=\"http:\/\/www.mobileread.com\/forums\/showthread.php?t=125860\">Full Screen Terminal<\/a> to mount and run Debian from within your kindle.<\/p>\n<p>&nbsp;<\/p>\n<p>PS: For more information check out these links:<\/p>\n<p><a href=\"http:\/\/wiki.debian.org\/Multistrap\">http:\/\/wiki.debian.org\/Multistrap<\/a><\/p>\n<p><a href=\"http:\/\/www.mobileread.com\/forums\/showthread.php?t=96048\">http:\/\/www.mobileread.com\/forums\/showthread.php?t=96048<\/a><\/p>\n<p><a href=\"http:\/\/www.mobileread.com\/forums\/showthread.php?t=133005\">http:\/\/www.mobileread.com\/forums\/showthread.php?t=133005<\/a><\/p>\n<p><a href=\"http:\/\/www.mobileread.com\/forums\/showthread.php?t=125860\">http:\/\/www.mobileread.com\/forums\/showthread.php?t=125860<\/a><\/p>\n<p><a href=\"http:\/\/www.mobileread.com\/forums\/showthread.php?t=88004\">http:\/\/www.mobileread.com\/forums\/showthread.php?t=88004<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Finally after a lot of endless nights tingering around I decided to post about my newly\u00a0acquired\u00a0Amazon Kindle 3. Since I study \u00a0presentations and books from PDF files I thought a device like this would be really useful, and after\u00a0reading\u00a0somewhere that it could run Ubuntu Linux and even with X11 I knew exactly what I needed. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[67,47,32],"tags":[73,70,69,71,68,42,72],"class_list":["post-330","post","type-post","status-publish","format-standard","hentry","category-kindle","category-linux-technology","category-technology","tag-amazon","tag-chroot","tag-debian","tag-debootstrap","tag-kindle-2","tag-linux","tag-multistrap"],"_links":{"self":[{"href":"https:\/\/tomashg.com\/index.php?rest_route=\/wp\/v2\/posts\/330","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tomashg.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tomashg.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tomashg.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tomashg.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=330"}],"version-history":[{"count":59,"href":"https:\/\/tomashg.com\/index.php?rest_route=\/wp\/v2\/posts\/330\/revisions"}],"predecessor-version":[{"id":561,"href":"https:\/\/tomashg.com\/index.php?rest_route=\/wp\/v2\/posts\/330\/revisions\/561"}],"wp:attachment":[{"href":"https:\/\/tomashg.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tomashg.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tomashg.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}