summaryrefslogtreecommitdiff
path: root/content/html/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid.html
diff options
context:
space:
mode:
authorPaul Buetow <git@mx.buetow.org>2021-05-19 12:41:00 +0100
committerPaul Buetow <git@mx.buetow.org>2021-05-21 05:11:05 +0100
commit680e1f5940b37db75824215153a6a92f1841b01b (patch)
tree581506c5d80853cdbcf31c7c6058cfe80ea121fe /content/html/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid.html
parent03c974ec4e26888ec0ea1bca3ccf51af29d8bc9d (diff)
html is now a submodule
Diffstat (limited to 'content/html/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid.html')
m---------content/html6
-rw-r--r--content/html/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid.html202
2 files changed, 6 insertions, 202 deletions
diff --git a/content/html b/content/html
new file mode 160000
+Subproject 27ed46c9129db86669052d4e7211340da1081d8
diff --git a/content/html/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid.html b/content/html/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid.html
deleted file mode 100644
index d8b0b90b..00000000
--- a/content/html/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid.html
+++ /dev/null
@@ -1,202 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Run Debian on your phone with Debroid</title>
-<link rel="shortcut icon" type="image/gif" href="/favicon.ico" />
-<style type="text/css">
-body {
- margin: auto;
- max-width: 900px;
- background-color: #FFFFEF;
- border: 1px dashed #880000;
- border-radius: 8px;
- padding: 5px;
-}
-img {
- display:block;
- max-width: 80%;
-}
-a.textlink:before {
- content: " ⇒ ";
- padding-left: 2px;
-}
-a.textlink {
- text-decoration: none;
- color: #FF0000;
-}
-a.textlink:hover {
- text-decoration: underline;
-}
-i {
- color: #48AAAD;
-}
-pre {
- background-color: #F1F8E9;
- border: 1px dashed #BB0000;
- border-radius: 8px;
- padding: 5px;
- font-family: "Lucida Console", "Courier New", monospace;
-}
-h1 {
- text-align: center;
- color: #880000;
-}
-h2, h3 {
- color: #BB0000;
-}
-</style>
-</head>
-<body>
-<h1>Run Debian on your phone with Debroid</h1>
-<pre>
- ____ _ _ _
-| _ \ ___| |__ _ __ ___ (_) __| |
-| | | |/ _ \ '_ \| '__/ _ \| |/ _` |
-| |_| | __/ |_) | | | (_) | | (_| |
-|____/ \___|_.__/|_| \___/|_|\__,_|
-
-</pre>
-<p class="quote"><i>Written by Paul Buetow 2015-12-05, last updated 2021-05-16</i></p>
-<p>You can use the following tutorial to install a full-blown Debian GNU/Linux Chroot on a LG G3 D855 CyanogenMod 13 (Android 6). First of all you need to have root permissions on your phone and you also need to have the developer mode activated. The following steps have been tested on Linux (Fedora 23).</p>
-<a href="./2015-12-05-run-debian-on-your-phone-with-debroid/Deboroid.png"><img src="./2015-12-05-run-debian-on-your-phone-with-debroid/Deboroid.png" /></a><br />
-<h2>Foreword</h2>
-<p>A couple of years have passed since I last worked on Debroid. At the moment I am using the Termux app on Android, which is less sophisticated than a fully blown Debian installation, but sufficient for my current requirements. The content of this site may be still relevant and it would also work with more recent versions of Debian and Android. I would expect that some minor modifications need to be made though. </p>
-<h2>Step by step guide</h2>
-<p>All scripts mentioned here can be found on GitHub at:</p>
-<a class="textlink" href="https://github.com/snonux/debroid">https://github.com/snonux/debroid</a><br />
-<h3>First debootstrap stage</h3>
-<p>This is to be performed on a Fedora Linux machine (could work on a Debian too, but Fedora is just what I use on my personal Laptop). The following steps prepare an initial Debian base image, which then later can be transferred to the phone.</p>
-<pre>
-sudo dnf install debootstrap
-# 5g
-dd if=/dev/zero of=jessie.img bs=$[ 1024 * 1024 ] \
- count=$[ 1024 * 5 ]
-
-# Show used loop devices
-sudo losetup -f
-# Store the next free one to $loop
-loop=loopN
-sudo losetup /dev/$loop jessie.img
-
-mkdir jessie
-sudo mkfs.ext4 /dev/$loop
-sudo mount /dev/$loop jessie
-sudo debootstrap --foreign --variant=minbase \
- --arch armel jessie jessie/ \
- http://http.debian.net/debian
-sudo umount jessie
-</pre>
-<h3>Copy Debian image to the phone</h3>
-<p>Now setup the Debian image on an external SD card on the Phone via Android Debugger as follows:</p>
-<pre>
-adb root &amp;&amp; adb wait-for-device &amp;&amp; adb shell
-mkdir -p /storage/sdcard1/Linux/jessie
-exit
-
-# Sparse image problem, may be too big for copying otherwise
-gzip jessie.img
-# Copy over
-adb push jessie.img.gz /storage/sdcard1/Linux/jessie.img.gz
-adb shell
-cd /storage/sdcard1/Linux
-gunzip jessie.img.gz
-
-# Show used loop devices
-losetup -f
-# Store the next free one to $loop
-loop=loopN
-
-# Use the next free one (replace the loop number)
-losetup /dev/block/$loop $(pwd)/jessie.img
-mount -t ext4 /dev/block/$loop $(pwd)/jessie
-
-# Bind-Mound proc, dev, sys`
-busybox mount --bind /proc $(pwd)/jessie/proc
-busybox mount --bind /dev $(pwd)/jessie/dev
-busybox mount --bind /dev/pts $(pwd)/jessie/dev/pts
-busybox mount --bind /sys $(pwd)/jessie/sys
-
-# Bind-Mound the rest of Android
-mkdir -p $(pwd)/jessie/storage/sdcard{0,1}
-busybox mount --bind /storage/emulated \
- $(pwd)/jessie/storage/sdcard0
-busybox mount --bind /storage/sdcard1 \
- $(pwd)/jessie/storage/sdcard1
-
-# Check mounts
-mount | grep jessie
-</pre>
-<h3>Second debootstrap stage</h3>
-<p>This is to be performed on the Android phone itself (inside a Debian chroot):</p>
-<pre>
-chroot $(pwd)/jessie /bin/bash -l
-export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin
-/debootstrap/debootstrap --second-stage
-exit # Leave chroot
-exit # Leave adb shell
-</pre>
-<h3>Setup of various scripts</h3>
-<p>jessie.sh deals with all the loopback mount magic and so on. It will be run later every time you start Debroid on your phone.</p>
-<pre>
-# Install script jessie.sh
-adb push storage/sdcard1/Linux/jessie.sh /storage/sdcard/Linux/jessie.sh
-adb shell
-cd /storage/sdcard1/Linux
-sh jessie.sh enter
-
-# Bashrc
-cat &lt;&lt;END &gt;~/.bashrc
-export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
-export EDITOR=vim
-hostname $(cat /etc/hostname)
-END
-
-# Fixing an error message while loading the profile
-sed -i s#id#/usr/bin/id# /etc/profile
-
-# Setting the hostname
-echo phobos &gt; /etc/hostname
-echo 127.0.0.1 phobos &gt; /etc/hosts
-hostname phobos
-
-# Apt-sources
-cat &lt;&lt;END &gt; sources.list
-deb http://ftp.uk.debian.org/debian/ jessie main contrib non-free
-deb-src http://ftp.uk.debian.org/debian/ jessie main contrib non-free
-END
-apt-get update
-apt-get upgrade
-apt-get dist-upgrade
-exit # Exit chroot
-</pre>
-<h3>Entering Debroid and enable a service</h3>
-<p>This enters Debroid on your phone and starts the example service uptimed:</p>
-<pre>
-sh jessie.sh enter
-
-# Setup example serice uptimed
-apt-get install uptimed
-cat &lt;&lt;END &gt; /etc/rc.debroid
-export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
-service uptimed status &amp;&gt;/dev/null || service uptimed start
-exit 0
-END
-
-chmod 0755 /etc/rc.debroid
-exit # Exit chroot
-exit # Exit adb shell
-</pre>
-<h3>Include to Android startup:</h3>
-<p>I you want to start Debroid automatically every time when your phone starts, then do the following:</p>
-<pre>
-adb push data/local/userinit.sh /data/local/userinit.sh
-adb shell
-chmod +x /data/local/userinit.sh
-exit
-</pre>
-<p>Reboot &amp; test! Enjoy!</p>
-<p>E-Mail me your thoughts at comments@mx.buetow.org!</p>
-<a class="textlink" href="../">Go back to the main site</a><br />
-</body>
-</html>