summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow (europa) <paul@buetow.org>2015-06-20 11:42:32 +0100
committerPaul Buetow (europa) <paul@buetow.org>2015-06-20 11:42:32 +0100
commitd45dd6e6f594c3fe0af6cd86902bc009ed299c96 (patch)
tree20b1ec4d0d347003f545640ab8b44ad724544432
parent5f3143c014ebcf56a6181a47c53d13f9083bc6eb (diff)
fixed tutorial
-rw-r--r--README.md39
1 files changed, 22 insertions, 17 deletions
diff --git a/README.md b/README.md
index 0a49964..9e688e3 100644
--- a/README.md
+++ b/README.md
@@ -30,29 +30,33 @@ sudo umount jessie
Initial (manual) setup on external SD card on the Phone via Android Debugger:
```
-adb root
-adb shell
+adb root && adb wait-for-device && adb shell
mkdir -p /storage/sdcard1/Linux/jessie
exit
adb push jessie.img /storage/sdcard1/Linux
adb shell
cd /storage/sdcard1/Linux
+
# Show used loop devices
losetup -f
+
# Use the next free one (replace the loop number)
losetup /dev/block/loop1 $(pwd)/jessie.img
mount -t ext4 /dev/block/loop1 $(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 -l $(pwd)/jessie/storage/sdcard{0,1}
busybox mount --bind /mnt/shell/emulated \
$(pwd)/jessie/storage/sdcard0
busybox mount --bind /storage/sdcard1 \
$(pwd)/jessie/storage/sdcard1
+
# Check mounts
mount | grep jessie
```
@@ -62,17 +66,25 @@ Second debootstrap stage, but inside the chroot on android!
LD_PRELOAD='' 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
+exit # Leave chroot
+exit # Leave adb shell
```
-Last setup steps
+Setup various scripts:
```
+# jessie.sh
+adb push storage/sdcard1/Linux/jessie.sh /storage/sdcard/Linux/
+adb shell
+cd /storage/sdcard1/Linux
sh jessie.sh enter
+
+# Bashrc
cat <<END >~/.bashrc
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
export EDITOR=vim
hostname $(cat /etc/hostname)
+
# Fixing an error messages while loading the profile
sed -i s#id#/usr/bin/id# /etc/profile
@@ -87,10 +99,10 @@ 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
-exit
+exit # Exit chroot
```
-Debroid services startup
+Debroid services startup (we don't use the Debian runlevels)
```
sh jessie.sh enter
cat <<END > /etc/rc.debroid
@@ -99,18 +111,10 @@ service uptimed status &>/dev/null || service uptimed start
exit 0
END
chmod 0755 /etc/rc.debroid
-exit
+exit # Exit chroot
+exit # Exit adb shell
```
-Enter chroot script (as root):
-
-```
-cp jessie.sh /storage/sdcard1/Linux/jessie.sh
-cd /storage/sdcard1/Linux
-sh jessie.sh enter
-cat /etc/debian_version
-exit
-```
Include to Android startup (userinit.sh seems not to work on CM12, so we use a different way here):
@@ -124,6 +128,7 @@ Afterwards install a program like ROM Toolbox and add the following bootup comma
/system/bin/sh /data/local/debroid.sh
```
+Reboot & test!
-Enjoy!
+Enjoy!