diff options
| author | Paul Buetow (europa) <paul@buetow.org> | 2015-06-20 10:06:36 +0100 |
|---|---|---|
| committer | Paul Buetow (europa) <paul@buetow.org> | 2015-06-20 10:06:36 +0100 |
| commit | ceb3b3ce56a511880bbd4e24de86a4f302814896 (patch) | |
| tree | a8df7d9bb77192887430e7983f565faeec0ee0f5 | |
| parent | 15a4dbc52ec4367327a895b386a0d65b0020e971 (diff) | |
add Debroid to Android userinit
| -rw-r--r-- | README.md | 35 | ||||
| -rw-r--r-- | data/local/userinit.sh | 4 | ||||
| -rw-r--r-- | storage/sdcard1/Linux/jessie.sh (renamed from jessie.sh) | 10 |
3 files changed, 44 insertions, 5 deletions
@@ -1,4 +1,4 @@ -DEBRIOD +Debroid ======= Install a full blown Debian GNU/Linux Chroot on a LG G3 D855 CyanogenMod 12. Needs root and needs developer mode activated. @@ -68,13 +68,11 @@ exit Last setup steps ``` +sh jessie.sh enter 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) -# Example how to start single services -# service uptimed status &>/dev/null || service uptimed start - # Fixing an error messages while loading the profile sed -i s#id#/usr/bin/id# /etc/profile @@ -89,14 +87,43 @@ 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 +``` + +Debroid services startup +``` +sh jessie.sh enter +cat <<END > /etc/rc.debroid +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH +service uptimed status &>/dev/null || service uptimed start +exit 0 +END +chmod 0755 /etc/rc.debroid +exit ``` Enter chroot script (as root): ``` +sh jessie.sh enter cp jessie.sh /storage/sdcard1/Linux/jessie.sh cd /storage/sdcard1/Linux +sh jessie.sh start_services sh jessie.sh enter +exit +``` + +Include to Android startup + +``` +# This script is called from /etc/init.d/*userinit, but +# does not exist yet, so create it now +cat <<END >/data/local/userinit.sh +#!/system/bin/sh + +cd /storage/sdcard1/Linux +sh jessie.sh start_services +END ``` Enjoy! diff --git a/data/local/userinit.sh b/data/local/userinit.sh new file mode 100644 index 0000000..7872455 --- /dev/null +++ b/data/local/userinit.sh @@ -0,0 +1,4 @@ +#!/system/bin/sh + +cd /storage/sdcard1/Linux +sh jessie.sh start_services diff --git a/jessie.sh b/storage/sdcard1/Linux/jessie.sh index 5e9826c..0e5efe0 100644 --- a/jessie.sh +++ b/storage/sdcard1/Linux/jessie.sh @@ -7,6 +7,10 @@ export ROOT=$(pwd)/jessie export LOOP_DEVICE=/dev/block/loop1 export SHELL=/bin/bash +function start_services { + HOME=/root LD_PRELOAD='' chroot $ROOT $SHELL /etc/rc.debroid +} + function enter_chroot { HOME=/root LD_PRELOAD='' chroot $ROOT $SHELL -l } @@ -56,8 +60,12 @@ case $ARG in enter_chroot umount_chroot ;; + start_services) + mount_chroot + start_services + ;; *) - echo "Usage: $0 session|mount|umount|enter" + echo "Usage: $0 session|mount|umount|enter|start_services" exit 1 ;; esac |
