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.txtAfter 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.xzThe 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).