Termux-packages: Give support for MagiskSU inside termux-chroot

Created on 5 Feb 2018  路  6Comments  路  Source: termux/termux-packages

This can be done easily by adding $ARGS="$ARGS -b /sbin:/sbin -b /root:/root" which will make magisk's binary directories available under proot.

enhancement

All 6 comments

This issue probably belongs at github.com/termux/proot.

@Grimler91 Actually code of the termux-chroot script is in this repository (https://github.com/termux/termux-packages/blob/master/packages/proot/termux-chroot), so this is the correct place.

Oh, sorry about that @ShadowEO.

May I ask what is use case for this? The only one I can see is ability to use su when you autostart termux-chroot, is this what you need?

Otherwise it doesn't really make sense:

  • If you want to have chrooted root session run termux-chroot after running tsu (or whatever su wrapper you use); Running su inside termux-chroot will escape chroot
  • If you don't autostart termux-chroot just use su instead termux-chroot

You can edit termux-chroot script on device (e.g. vim $(which termux-chroot); changes will be undone after proot package update or pkg install --reinstall proot), then see if change works as intended and if everything is good please send pull request

The reason I was suggesting this, I could not get su, nor tsu to work without adding the arguments in the original request. It would simply not detect su's existence while inside proot and you are indeed correct, I am autostarting termux-chroot. More specifically, I am running the SSH server on-device, then connecting through another more touch-friendly client (Terminus, so I can have the up/down/left/right buttons in the terminal) where sshd starts the chroot for me, then my shell.

I have done the changes on my personal device and have tested them and it works fine, I will send a pull request when I am next on my Nexus 7 to grab the modified script.

As requested, I have sent the pull request, sorry this took so long. I've been rather busy IRL! The pull request should close this issue. It should also be future-proof (barring changes to MagiskSU itself), as even though Android has /root and /sbin available even without MagiskSU installed, I could see them potentially being removed in the future.

I added a conditional to my original version of my changes to ensure that this doesn't cause breakage if for some reason /root and /sbin don't exist on the device. (I checked on my stock LG V20 and they do exist as of 7.1.2, but I figured I may as well be safe since I noticed the conditionals elsewhere for binds.)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

loveablefellow007 picture loveablefellow007  路  3Comments

newmania picture newmania  路  3Comments

bkdwt picture bkdwt  路  3Comments

ILadis picture ILadis  路  3Comments

jackbrycesmith picture jackbrycesmith  路  3Comments