termux / proot

An chroot-like implementation using ptrace.
https://wiki.termux.com/wiki/PRoot
Other
761 stars 160 forks source link

/sys /dev on Termux openSUSE not binding properly #105

Closed radumamy closed 4 years ago

radumamy commented 4 years ago

Hi.

I have loaded openSUSE Leap 15.1 via proot/Termux and software like yast is complaining that /sys and /dev are not mounted. In my startup script I do have -b /sys and -b /dev and - b /proc.

Please see below error.

localhost:~ # yast The /sys filesystem is not mounted. The /dev filesystem is not mounted. If you are running in a chroot environment, bind-mount missing filesystems.

When I'm using XFCE I can see /sys and /dev folders with a x (cross) on them and /proc with a padlock. I can browse the content of /proc, but for the other two I get an failed to open directory error, permission denied.

Can this please be fixed?

Thank you.

oxr463 commented 4 years ago

What command are you using? Did you try the -S switch?

michalbednarski commented 4 years ago

Yast checks if these directories are available by using ls on them and on modern Android devices that's not allowed.

Comment out that check in usr/sbin/yast2

radumamy commented 4 years ago

`#!/data/data/com.termux/files/usr/bin/bash cd $(dirname $0)

unset LD_PRELOAD in case termux-exec is installed

unset LD_PRELOAD command="proot" command+=" --link2symlink" command+=" -0" command+=" -r opensuse-leap-fs" if [ -n "$(ls -A opensuse-leap-binds)" ]; then for f in opensuse-leap-binds/* ;do . $f done fi command+=" -b /proc" command+=" -b /sys" command+=" -b /dev" command+=" -b /dev/pts" command+=" -b opensuse-leap-fs/root:/dev/shm"

uncomment the following line to have access to the home

command+=" -b /data/data/com.termux/files/home:/root"

uncomment the following line to mount /sdcard directly t

command+=" -b /sdcard"

command+=" -w /root" command+=" /usr/bin/env -i" command+=" HOME=/root" command+=" PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bi command+=" TERM=$TERM" command+=" LANG=en_GB.UTF-8" command+=" LANG=C.UTF-8" command+=" /bin/bash --login" com="$@" if [ -z "$1" ];then exec $command else $command -c "$com"`

radumamy commented 4 years ago

Yast checks if these directories are available by using ls on them and on modern Android devices that's not allowed.

Comment out that check in usr/sbin/yast2

michalbednarski, thank you. this worked in CLI but it still doesn't launch in GUI. Any ideas how I can solve it there too?

michalbednarski commented 4 years ago

Where did you get installation script (or rootfs in case of manual installation)? Did you install xfce separately?

radumamy commented 4 years ago

@michalbednarski I have used the script from AnLinux and Andronix. I have replaced their rootfs with the original one from openSUSE including XFCE. I have posted my instructions on openSUSE forum https://forums.opensuse.org/showthread.php/538516-PROOT-or-CHROOT-as-guest-OS-(Android-Termux) Please bear in mind I am no expert, I'm happy I've got it working to a certain extent. Yast and Zypper weren't working, but thanks to you, I managed to get Yast working. Now only Zypper is left to fix. I would really like to get this working properly, can you please help? I was thinking of putting it here on Github. The only way I could get it to update is to install Yum and use that with openSUSE official repos. What do you think?