JuNest on Android

101 views
Skip to first unread message

feel

unread,
Dec 18, 2015, 11:54:53 AM12/18/15
to JuNest
Hi,

I would like to discuss about having JuNest on Android. My experience on Android is quite low.
Several, people requested to have the JuNest app for Android; there are few issues in github:
https://github.com/fsquillace/junest/issues/119 and https://github.com/fsquillace/junest/issues/110

There are a couple of projects that make me think that this is actually feasible, in particular: https://github.com/pelya/debian-noroot

The actions I would suggest are the following:
- Create a small proof of concept
    1. Use on of the Android terminal (i.e. https://play.google.com/store/apps/details?id=yarolegovich.materialterminal or https://play.google.com/store/apps/details?id=ru.meefik.busybox)
    2. Copy the JuNest arm image (is a .tar.gz) to Android
    3. Run the JuNest script as:
JUNEST_HOME=<path to your junest directory> /opt/junest/junest-arm -f

- Once the proof of concept works, create a simple Android app that similar to the POC:
    1. Download the most update JuNest ARM image in a certain location
    2. Open a terminal
    3. Run JuNest script

I have started doing a POC but I have encountered few permissions problems using the classic Android terminal.
Maybe using a different terminal it should help. Wondering if one of you guys can make some tests as well and tell me the right way to go.

Thank you,
Filippo

Sergii Pylypenko

unread,
Dec 18, 2015, 1:55:56 PM12/18/15
to JuNest
I'd better not bother with proof of concept, because it will definitely not be small.
Simply use one of several existing proot launchers, and replace rootfs image.

If you want quick and dirty way to check whether it will run at all,
simply extract your system image into /data/local/tmp, and launch it from there,
but note that adb shell has some permissions that regular apps cannot have:

adb push image.tar.gz /data/local/tmp
adb push busybox /data/local/tmp
adb shell
cd /data/local/tmp
./busybox tar xvf image.tar.gz
./proot /bin/bash -l
#enjoy your Linux shell

If you want only the terminal, I suggest to look into GNURoot, there are two versions of the app:
https://github.com/corbinlc/GNURootDebian  - this is the newer one, with built-in VNC
https://github.com/corbinlc/gnuroot  - this is the older one, with terminal only.
I don't know how to compile these apps, ask Corbin for that.

Debian noroot is first and foremost graphical interface with built-in X server, there is no terminal at all,
and you will use graphical XTerm to run your shell commands.

To build it, you first will need to compile X server, this is definitely not a simple task,
compilation instructions even contain a section how to set up a clean build environment in chroot.

https://github.com/pelya/commandergenius/blob/sdl_android/project/jni/application/xserver/readme.txt

After building X server, you can build Debian noroot using command:

./build.sh xserver-debian

Then replace AppDataDownloadUrl inside AndroidAppSettings.cfg with your own system image,
and with a bit of luck that should work. You can also remove  update1 and update2 from xserver-debian/AndroidData,
you don't need them yet. The Debian reference image can be downloaded from here:

http://sourceforge.net/projects/libsdl-android/files/ubuntu/jessie/dist-debian-jessie.tar.xz

The rootfs is located inside directory "img", there are also directories img-<ARCH> in the same archive,
one of them is copied into img when data is unpacked, but you may also do not split
your system image into data and architecture-specific binaries, and create two separate archives instead,
then put link http://.../your-image-<ARCH>.tar.xz into AndroidAppSettings.cfg, and <ARCH>
will be replaced by "armeabi-v7a" or "x86" when downloading the archive.

The Android part of the app launches command "img/proot.sh ./startx.sh" to launch chroot,
you can also change this command inside AndroidAppSettings.cfg (but keep tabs after -exec, they are important).
Reply all
Reply to author
Forward
0 new messages