Mahesh Hegde

Student at MES Chaitanya PU College;

Enthusiastic about Physics, Engineering & Computer Science;


Learning Python, JavaScript & the Unix shell in spare time, and writing code for this website..



Mainly learning Shell Scripting in spare time - it is a way to combine how simple programs work and build powerful utilities.


Have learned some UNIX Shell scripting, got some more ideas as usual, and now trying to get some Linux Package managers working in KBox - A minimal user space implementation of Busybox using fakechroot.


Trying to write a half-working package installation system to get some Linux software working on minimal implementations such as Termux and KBox. What we expect to get done in about 40 lines of code grows into a hardly managable Bourne shell script - for doing at least some things properly.

Regourosly working with the Shell scripts is required for this project.. I think it will take time to build a partially working, usable solution to avoid compiling the binaries on the target device.


Debugging sucks.. Wait, what? I think there is some open source code right now to do it the other way. Of course, till now it has been possible to get some simple Alpine Linux command line tools that do not require root access or complicated system calls / libraries.

Of course, porting lightweight Software Package Management Systems to these non-root implementations is a significantly complicated task for me right now. If you are interested in installing more software than available via termux, I suggest to use Termux-ArchLinux installation script by github user sdrausty. It requires significant storage space but is expected to work if you expect more packages than provided by Termux or Android Runtime Applications.


Did a few things in last month, none much significant.


Have done some significant stuff during last 15 days, including running gnu bash and zsh in android terminal emulator using statically linked debian binaries. Of course, I am simply doing something that termux already does. However, it gives another uncluttered shell environment on my phone. I use CLi apps to do trivial things such as filesystem operatoperations, archival and compression since it saves time, very fast compared to GUI applications, and more customization, and a nerd's way.

More significantly, got nameserver setup right inside proot on termux app. Currently running "wayback machine downloader" inside prooted alpine Linux userland in termux.. :P of course there was a script for alpinelinux setup on git.. but discovered it is a too trivial thing to use someone else's script, :P

Also trying to get openwrt running in termux, but opkg software package manager is giving some problems. It would be better if there was some fedora minimal rootfs but unfortunately no one has done it yet..


Did some nice things since one month. Discovered some great opensource apps, qemu-user-static and lot more.


Got little closer to the GNU/Linux & open source ecosystem, besides ocassionally writing small programs and shell scripts. Exams gone worse for me as they used to be, didn't bother much.


Thinking of creating a new full-pledged personal weblog using gitlab pages and hugo, for sake of it being a permanent professional-looking portfolio and not a simple HTML page, and also for making it easy to share insights on code/software along with code itself :P


Did a few nice things during last months,and did not study for exams :P

1. Fakechroot and fakeroot now run in any android terminal emulator. Performance gain against Proot is not as large as expected, since even using library shims include system call interception, maybe.

It should work for android versions between 4.4 and 9. Below 4.4 PIE executables are not supported.

getopt is an obvious nightmare. busybox getopt is quite incomptent with most of the scripts or else I am not capable to make it work that way.

This technique, unlike termux, can use only official distro binaries (eg: debian) to virtualize a fake rootfs. Of course at the cost of flexibility & static binary support.

Had to edit lot of shell scripts but thanks to both mksh and bash. Of course options can't be provided from command line on android and shell script itself should be edited accordingly. Also had to figure out a perhaps undocumented environment variable FAKECHROOT_ELFLOADER ER.

Interestingly, termux is also moving towards a standard C library instead of android bionic. Don't know about the performance tradeoffs but potentially more power to `patchelf` and thus binary compatibility with standard Linux distros. Termux may adopt musl or less likely glibc. Using libhybris ibhybris to access native android features looks like a possibility.

2. Figured out how to generate direct download link from Google Drive share links. of course there is an id part in the URL. That in uc?id=<id>&export=downloadHTTP _GET string after base url redirects to a direct download link. [Because document overview pages take ages to load.]