termux / proot

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

Android Huavei mobile phones and Proot #87

Open JanuszChmiel opened 4 years ago

JanuszChmiel commented 4 years ago

I have read The following debate related to Userland development.

https://github.com/CypherpunkArmory/UserLAnd/issues/170 So I Am wondering, if non functioning Pokedata of Huavei Android kernels can not be also The cause of The problems with The file system extraction. Programmers had to recode Proot source to overcome The issue with Pokedata, so Proot work much more faster. But what if this googly thinked work around can cause file system extractions issues on some devices. There is one fact. Some Android kernels do not support Proot as it should. There are issues with file system case file sensitivity and other issues. The question is, if there is even The chance from The perspective of Proot developers to overcome those issues. Or if those issues are The effect of various ddevelopment strategies while developing The Android kernels for various devices. What would happen, if would try older release of Proot, which have been originally created by Electron company? Or it was necessary to recode it to be compatible with Termux, so I can not simply recompile it from Termux and give it A try. I want to find some work around to support Huavei 10 lite mate and android 7.0 kernel. I had A right. The most functioning distribution is Fedora. Its container is causing only a few issues while installing some specific packages such as Perl interpreter. But Fedora have other important issues related to dbus. Debian is much more universal and Dbus is working even while using Debian chrooted container. No crashes, no issues. I have analysed many many articles on The Internet to find other routines which would work as a Proot, but I had no luck. Proot is very probably very improtant programmers invention and there is no similar technique. Qemu work very slowly if user do not installer rooted Android and if user will not install KQEMU kernel module for Android. I Am still thinkink and may be, that I will have some success on future.

michalbednarski commented 4 years ago

POKEDATA issue doesn't appear to be present on your device (according to log you've posted in https://github.com/termux/proot/issues/84#issuecomment-562524615)

I still think you should be able to use Debian with modifications (as I've previously described in https://github.com/termux/proot/issues/84#issuecomment-564673007), however for some packages there might be further configuration changes necessary; please let me know which packages have issues there.

Also, could you run following commands (outside proot) and share trace.txt so I could confirm/reject hypothesis that case folding behavior is triggered by tracing program:

pkg install -y gdb strace
mkdir casetest
cd casetest
strace -o trace.txt touch teststrace TESTSTRACE
gdb --batch -ex r --args touch testgdb TESTGDB &>> trace.txt
touch testdirect TESTDIRECT
proot -v 9 touch testproot TESTPROOT &>> trace.txt
PROOT_NO_SECCOMP=1 proot -v 9 touch testnproot TESTNPROOT &>> trace.txt
ls -l &>> trace.txt
JanuszChmiel commented 4 years ago

Dear MR Bednarski, Here is attached log file. I hope, that it will not be problems, that I have created it on download folder to easily move it from mobile device to The computer. The most annoing fact is, that not only Debian have issues with packages. All Linux distributions. But working with Debian makes The biggest sense for Me. Because task mate-desktop configures Dbus so it can be started by using Marco window manager. Fedora is using much more different philosophy so Dbus configuration from container is rather impossible. The onlyone hack is to use very old DBUS from Fedora before version 27 with 31 and this is not good technique. I will report Debian problems with packages here since my previous issue is closed.

trace.txt

Thank you for yours patience with Me. My second phone, Samsung Galaxy 5.1 with Android 6.1 have The same issue. So it is not only Huavei kernel problem, it seems to Me, that there are more manufacturers who have made this strange think with their kernels.

michalbednarski commented 4 years ago

Looks like trace.txt wasn't generated correctly because some newlines were removed while you've copy-pasted commands

Could you try doing that using following snippet which replaces newlines with semicolons and switches to home directory (as on storage system is always case insensitive by design; after running code you can cp trace.txt /storage/emulated/0/Download/trace2.txt in order to upload it)

mkdir ~/casetest ; cd ~/casetest ; strace -o trace.txt touch teststrace TESTSTRACE ; gdb --batch -ex r --args touch testgdb TESTGDB &>> trace.txt ; touch testdirect TESTDIRECT ; proot -v 9 touch testproot TESTPROOT &>> trace.txt ; PROOT_NO_SECCOMP=1 proot -v 9 touch testnproot TESTNPROOT &>> trace.txt ; ls -l &>> trace.txt
JanuszChmiel commented 4 years ago

Ok, I will do by this way as you have adviced to Me. I have not used copy and paste operations. I have used Windows Explorer to copy file from downloads folder to my harddisk and I have used attach file buton on The Github page. I will run it by using yours latest commands. I hope, that nothing will corrupt file stransfer for now.

JanuszChmiel commented 4 years ago

trace2.txt

Oh I have understood. My previous log have been generated incorrectly because I have used copy and paste commands to copy The command between Github WEB page window and Putty Window. May be, that NVDA screen reader places extra empty lines because it uses virtual area to present information about loaded WEB page. I will use select all and copy for The second time to use copy operation directly from The Browser.

JanuszChmiel commented 4 years ago

OK, lI will rather return to The Debian, because The template apt install task-mate-desktop registers DBUS so marco window manager can correctly initiate ATSPI accessibility bus and Orca screen reader can perfectly work thanks to revolutionar and fully functioning Pulseaudio sound server which run directly from Termux. So thanks to yours script path, I can correctly install Debian. For a science validity and to prevent chaos from my side, here is The pathing script, if I have not corrupted some code inside it.

pather.txt

When you confirm that patching script is OK, I will install Debian and I will install mate-desktop But there is so many many packages, that we have very probably very limited chance to success. If I would know, which steps apt is doing that dbus is working with Marco, I could only install gnome-orca and Marco. But I have tested it, it is not enough. Only task-mate-desktop configures something very strangly but it is working with Orca. Mraco C source contain The needed code to initiate at-spi accessibility bus.

michalbednarski commented 4 years ago

Looking at log you've provided it looks like problem has occurred with proot (in both operation modes), but not with gdb nor strace, I've made some additional tests in C and I'd ask for running below command and sharing case-test-results.txt

pkg install -y clang ; wget https://gist.github.com/michalbednarski/438b058f77f43dba78aa8d2ddd08f629/raw/de21dee783274d114fe0ed7b930bfa9219052fb6/proot-case-tests.c ; clang proot-case-tests.c -o ~/proot-case-tests ; ~/proot-case-tests &> case-test-results.txt

Depending on results it might be possible to make proot avoid kernel bug, although no promises yet.

Here testing program source can be viewed as gist.


If you've successfully installed system using above script then it means it was pasted correctly; in form you've attached it to above post it fails because of bash having problem with file having Windows style line endings as well as script has markdown markers. I yet have to prepare Debian configuration, although I'd prefer to fix problem on proot side if it turns out to be possible.

JanuszChmiel commented 4 years ago

Here is The bug when installing task-mate-desktop I have used The following command

DEBIAN_FRONTEND=noninteractive apt install task-mate-desktop

Preparing to unpack .../19-python2.7_2.7.16-2+deb10u1_arm64.deb ... Progress: [ 2%] [#.........................................................] Unpacking python2.7 (2.7.16-2+deb10u1) ... Selecting previously unselected package libpython2-stdlib:arm64. Preparing to unpack .../20-libpython2-stdlib_2.7.16-1_arm64.deb ... Unpacking libpython2-stdlib:arm64 (2.7.16-1) ... Selecting previously unselected package libpython-stdlib:arm64. Preparing to unpack .../21-libpython-stdlib_2.7.16-1_arm64.deb ... Unpacking libpython-stdlib:arm64 (2.7.16-1) ... Errors were encountered while processing: /tmp/apt-dpkg-install-tv2usz/06-perl-modules-5.28_5.28.1-6_all.deb /tmp/apt-dpkg-install-tv2usz/08-libperl5.28_5.28.1-6_arm64.deb

E: Sub-process /usr/bin/dpkg returned an error code (1) And I can only dream about The successfull installation.

To be 100 % sure, that commands are working, I have used The following commands before typing ./enter_deb from The bin folder. mkdir -p deboot_debian/etc/dpkg/dpkg.cfg.d

echo path-exclude /usr/share/man/man7/pam.7.gz > deboot_debian/etc/dpkg/dpkg.cfg.d/01_bad_case

JanuszChmiel commented 4 years ago

I Am afraid, that my The onlyone hope is to make my own virtual HTTP WEB server, which will host all .deb packages for ARM64 architeczure for The Debian version which is being used by The script. Rename all package names of .deb files so there will be only little letters, lover case never uppercase. Modify all .deb files so all file names inside it will only contain lover case letters, no uppercase. Recode Binary .so files and other so if it refer to uppercase .so file or similar file name so I would had to recode its call to lovercase letters. But when I analyse it, it would engage one or more year process.

JanuszChmiel commented 4 years ago

Here is The needed .txt file. What do you think, is there any chance to avoid kernel bug, or unfortunately no?

case-test-results.txt

I Am deeply appraciting you that you have The good will to invest yours time for my issue. Without yours knowledge, I would have The zero chance to success.

Thank you for yours thinkink, debugging and for yours kind access to Me.

michalbednarski commented 4 years ago

Test cases didn't trigger kernel bug while invoking most important calls used by proot, which suggests that it'd probably be possible to avoid the bug, but still I have no idea how as I still don't know what actually triggers bug. I'll yet have to think how to analyze this further.

JanuszChmiel commented 4 years ago

Thank you for The analysis. I will be patiently waiting for yours future instructions. I could even give you a remote access to my phone so you will have direct access to it no problem. I believe you that you will not corrupt it. So I Am even ready to debug with you by this way. Sure I Am also ready to send next protocols according to yours instructions.

michalbednarski commented 4 years ago

I've modified patched installation to apply fixes and install task-mate-desktop. This script should be run from Termux home directory. Note that this script will erase existing installation and install new system with task-mate-desktop package. Patched installation has updated list of path excludes for dpkg and also skips configuration of udisks2 which is separate issue (probably not to be fixed on proot side). debian-mate-case.txt


To actually fix case sensitivity issue I think that I'd need interactive access to your phone, so in order to grant me remote access run following commands in Termux and post result from last one (which contains address to which I'll have to connect, but I still need to authenticate with my SSH key so it should be okay to post on public issue)

pkg install -y tmate ;
wget https://github.com/michalbednarski.keys ;
tmate -a michalbednarski.keys
JanuszChmiel commented 4 years ago

Dear MR Bednarski, You are really The expert!!! I Am now running yours special script to install whole Debian with Mate. Because I want to make something also for many other Termux users, I will give you The permission to remotely control my phone. Because if you will be able to find The case file insensitivity issue, it would even help to specific Samsumg mobile phones users. I also have very positive feelings inside my soul that there is so kind man in The globe, who has so good will to help to other users by using his deep programmers knowledge. Yours lectors from university can be very prought on you. Yours C language knowledge are excellent and you even knows The kernel in deep level.

I think, that you will do yours best to not corrupt it. I have big problem, that I could not simply unplug The LION battery, since I do not see at all and plastic cover of he phone in this model is very un easy to open. But I think, that if you will only test from Termux that it should not happen, that phone will get to The never ending reboots or hang in some threads.

michalbednarski commented 4 years ago

As far as i know in case of system hang you could reboot by long pressing (for about 10 seconds) power button, but I think it won't be necessary here.

Anyway, note that after running above commands you'll have to share connection address that is shown after running last command as otherwise I won't be able to connect nor see that you've ran them

JanuszChmiel commented 4 years ago

I hope, that this output will be useful to you. There is no my IP address.

[tmate] ssh session: ssh LrH6Wjc2pQ4ACEm2WVY7WxCWM@lon1.tmate.io Tip: if you wish to use tmate only for remote access, run: tmate -F [0/0]To see the following messages again, run in a tmate session: tmate show-messagesPress or to continue

Connecting to ssh.tmate.io... Note: clear your terminal before sharing readonly access ssh session read only: ssh ro-ZLNepSQWWrWx83x6APGDXv9Gx@lon1.tmate.io ssh session: ssh LrH6Wjc2pQ4ACEm2WVY7WxCWM@lon1.tmate.io

JanuszChmiel commented 4 years ago

Do you have The possibility to connect? Or The output was not useful? Or do I have to run only tmate command Or is it OK and I can leave my phone intact connected to The AC adapter?

michalbednarski commented 4 years ago

Thanks, I'm connected now

JanuszChmiel commented 4 years ago

Does everything work smoothly? Connection is stable?

michalbednarski commented 4 years ago

Thank you, I've just finished analysis and exited tmate, you might still need to release wakelock and/or exit Termux from Termux notification.

Tomorrow I'll start implementing workaround

Reduced code triggering bug and some technical notes are available at https://gist.github.com/michalbednarski/bef82aec3519d9f3225b72b9764a78ed

JanuszChmiel commented 4 years ago

Thank you very very much for yours time and for The analysis. It is positive, that Proot can be modified. You are really truly professional. I wish you good night and I Am ready to test newest Proot.

michalbednarski commented 4 years ago

I think I have a fix, you can install it with following commands (If you still have environment after my yesterday analysis you can skip first two lines)

pkg install -y proot git make clang ;
git clone https://github.com/termux/proot.git ;
cd proot/src ;
git fetch ;
git checkout -f origin/f2fs-case ;
make ;
make install ;

You can go back to normal proot version with apt install --reinstall proot

JanuszChmiel commented 4 years ago

Thank you very very much for yours complex programmers work. I have yours environment from yesterday. So I can only use git clone https://github.com/termux/proot.git ; cd proot/src ; git fetch ; git checkout -f origin/f2fs-case ; make ; make install ; I have even noticed, that new version of Proot is available in The repository. Is it yours patched version or no?

michalbednarski commented 4 years ago

I meant skipping git clone command as well (but if you keep it, it will just fail and remaining commands will continue using already cloned repo)

Update in apt repo is rebuild after dependency update and has no functional changes.

JanuszChmiel commented 4 years ago

I will test yours new version by installing original Debian script. It it will not fail, it will be A strong evidence, that you have really found The solution. Thank you for yours hard work on this fix. I Am comfuser. When I do apt dist-upgrade it will install Proot from The rpository. So I will not use this for some time to let yours Proot version installed. I Am starting with Debian distro.

JanuszChmiel commented 4 years ago

aI Am verx sorry to you, but I have experienced other errors. May be, that I have to remove Proot dir and clone it again or the work around can not solve The strange issue with file naming.

I: Extracting libpam-modules-bin... I: Extracting libpam-runtime... E: Tried to extract package, but file already exists. Exit... proot warning: f2fs bug probe failed to open third file with different errno than expected (errno=17): File exists proot error: can't create temporary file: Not a directory proot info: Please set PROOT_TMP_DIR env. variable to an alternate location (with write permission). proot error: execve("/usr/bin/env"): No such file or directory proot info: possible causes:

installation successfully completed to enter the guest system type: $HOME/bin/enter_deb

JanuszChmiel commented 4 years ago

Do not be afraid dear MR bednarski. Yours programmers work have not been lost to empty. In The end, I have yours modified Debian installation script with task-mate-desktop, so I will also test this. I will also try to install other distribution and install as much packages as possible to test file naming issue here. You have done yours best it seems that we are fighting with AN informatic enthrophy phenomena, it is not possible but may be, that internal flash chip inside my phone is corrupted so some Bytes of data are being randomly changing in time.

I have found interesting script Atilo to install various Linux distros including Fedora, Arch Linux. I will also test small Debian script and I will also test Arch Linux install script created by MR Rausty.

michalbednarski commented 4 years ago

Looks like I've got sign with errno wrong in initial bug probe code (which decides if workaround should be activated on device), could you try running installation with PROOT_F2FS_WORKAROUND=1 environment variable set

(Run export PROOT_F2FS_WORKAROUND=1 and then proceed with installation as usual)

If still won't work with that I'd ask for log from following installation commands (these commands erase existing Debian installation)

rm -rf deboot_debian debootstrap debootstrap-1.0.116
PROOT_F2FS_WORKAROUND=1 PROOT_VERBOSE=9 bash -x debian_on_termux.sh |& gzip -9 > log-setup.txt.gz
JanuszChmiel commented 4 years ago

Dear Mr Bednarski, you have really solved The case insensitive file system when using Proot on my device. Installation of Debian have been passed like A charm. No errors. Yours reconstruction of Proot C source code and yours last advice export PROOT_F2FS_WORKAROUND=1 Those two thinks have solved The issue. Only for informatic science purposes, I Am attaching The process of The Debian installation. Many users of Huavei devices will congratulate for yours outstanding work. And I Am very sorry for some of my amateours chaos. You are very patient human being. Thank you again. Very well done.

JanuszChmiel commented 4 years ago

Here is The evidence, that Debian have been really installed successfully.

Debian successfully installed.txt

JanuszChmiel commented 4 years ago

Dear Mr Bednarski, Yours Proot modiffication is bringing sweet fruids. I can install all packages for Debian. But unfortunately, this well thinked modiffication have brought also one shadow effect. Applications such as Caja file manager or Orca screen reader can not work. Why? I Am getting The following error from Caja for example.

GLib-GIO-WARNING **: 00:26:26.910: Error creating IO channel for /proc/mounts: No such file or directory Do you think, that it would be overcomed, or is it The price for A work around, that Proot allocate separate process for some files creation so Dbus will not work thanks to this? Or do you think, that there is still The place to solve also this issue? Or we have got on The end of The way and we can not do more? Thank you very much for yours thinkinkink and I AM very sorry for my bothering.

michalbednarski commented 4 years ago

That sounds like separate issue to be analyzed separately, but if you think it's due to workaround you can try turning workaround off by entering your Debian with:

PROOT_F2FS_WORKAROUND=0 bin/enter_deb

(Using proot with workaround disabled should be okay when you're not installing packages; PROOT_F2FS_WORKAROUND=0 disables workaround, PROOT_F2FS_WORKAROUND=1 enables workaround, anything else or lack of variable causes proot to automatically check if workaround should be activated)

Yesterday update for proot was released to apt repository; it also fixed use-after-free bug that was present in version that you've installed from GitHub for testing so you should update (preferably from apt but you can also re-run same commands to install from source).

JanuszChmiel commented 4 years ago

Thank you very much for yours advice. And thank you for yours support. I will store yours modified Proot source as A backup if somebody will overcode Proot and if this module would stop to work like now.

JanuszChmiel commented 4 years ago

Dear MR Bednarski, If AN C or C++ app which run from Linux environment by using Proot report The following error.

shmget: Permission denied What does it mean up? Does shmget something to do with Kernel function? Or is it some Libc function, which can not work due to A difference between Linux and Android kernel? Would Proot support An alternative if An app request shmget, Or is it out of Proot possibility and is it necessary to install some special shmem.so library for running distribution? I have tried to configure Debian to support keyboard, Orca and because I do not see at all I do not have to have graphical output on The screen. So I have configured Xorg by using xorg.conf to support Xorg-videodummi driver. As A result, X apps can work from The software perspective. But I need to have VNc server running. Fortunately, there is older program, x11vnc. But unfortunately, I AM getting bug related to shmget: Permission denied as The last line of The log file for vncx11. So I do not know, if this error is fatal unfortunatelz for Me, so server will immediatelz stop working. I have found one commercial Xserver related app on Google Plaz store, which even support all arrow keys. Unfortunately, developers of this app did not include Czech keyboard layout. Xserver XSDL can not detect many keys it is some hydden issue between Xserver XSDL and Huavei 10 mate lite. So I have tried to do my best to run real Xserver in conjunction with dummi video driver. Thank you very very much for yny advices.

michalbednarski commented 4 years ago

shmget is syscall used for System V shared memory, which is not supported on Android (nor handled by proot, however there were third-party workarounds based on Termux's libandroid-shmem, but I don't think you'll need them here)

You can pass -noshm switch to x11vnc and it will work without need for shared memory

When using XServer XSDL with external physical keyboard one workaround I've found is to remap menu key (the key between right alt and ctrl, you can use another key if you want) to function as alt key. This way handling of special characters is handled in guest system and not Android.

To remap key:

Once you have key remapped you can configure keyboard layout in guest system and then use remapped key as alt when writing diactrics.

JanuszChmiel commented 4 years ago

Oh MR Bednarski. You are really so deeply intelligent and so kind human being, that you would learn on university all absolvents of The informatic sciences. You have helped Me so much and thank you very much for yours next advice. Fortunately for Me, many C and C++ programmers have allowed users to not only use shared memory allocations on their code. It is very nice from them, even it require some more work while they have coded their apps.

I have even found commercial, but more accessible Xserver for Android without integrated Pulseaudio sound server, which fully support Talkback even while running X session. So I can use app menu, I can stop The server, keys are correctly announced if Talkback read them before I press them on The screen. Here is The Google Play store link.

https://play.google.com/store/apps/details?id=dk.mochasoft.x11&hl=en_US It support all keys out of The box, sure, they did not added Czech keyboard layout. But arrow keys are working perfectly.

JanuszChmiel commented 4 years ago

I have interesting warning from Proot. May be that it can have something to do with error creationg I/O channel for proc/mounts

I have started mate desktop environment. It partially working, even multitasking is working. I can run app by pressing Run application dialog window. Windows can be opened and closed. But when I have run mate-session, I have got The following bug.

proot error: POKEDATA workaround stub got signal 0

proot warning: ptrace(POKEDATA): Bad address

To have Mate desktop environment working. I had to reassign hod key for run application dialog from ALT+F2 to CTRL+r But I Am still heavy fighting. I can not use system tray of Mate. When Caja display desktop, run dialog window recall hodkey stop to react. It seems to Me, that so heavily compley multi tasking oriented desktop is too complex for Proot, which must monitor kernel in real time.

But I have some successes.

It do not seems to Me, that shmem is The problem. Gnome-keyring-daemon work it only display warning, that in secure memory might be used but it do not crash at all. I will contirue on my Mate mission.

michalbednarski commented 4 years ago

Wasn't mate-session first command you use to get desktop environment with panel and window manager running? I think that once you're able to get to run dialog you shouldn't need to launch it.

As far as I see in glib source, the Error creating IO channel for /proc/mounts warning means that glib won't be able to receive notification about new filesystem being mounted, which won't happen inside proot anyway so probably that warning can be ignored.

proot error: POKEDATA workaround stub got signal 0 - previously I've seen in proot logs that POKEDATA workaround was not active on your device, have you got this message on different device than the one you've posted logs previously from?

JanuszChmiel commented 4 years ago

I have got error related to pokedata from The same device. I Am running Termux stable and proot by using apt install proot But I have very positive notice to you MR Gednarski. I Am able to run complete mate desktop environment including run dialog, mate-panel menu which show applications. I had to run mate-control-center and I have chosen hod keys. I had to reassign default hod keys because from unknown reason, ALT+F2, ALT+F1 hod keys did not work. May be, that scan codes for those keys are different while running Mate from desktop. So I have chosen CTRL+m to recall mate panel apps list, and CTRL+r to recall run application dialog. I will try to consult with mate programmers issues related to mate applets and icons, which can not work for now, but it is out of Proot issues. Reality is, that even mate show icons. I can type Czech by using Czech characters. What have enabled Me this revolutionar step? Firstly of all yours and Proot team work. Without it, I would never be able to run mate. XVFB, and X11vnc, which fully support many X11 protocol features. And I have even found opensource and freely available VNC client for Android, which is fast, its core have been programmed in C or C++. App support many keys including SHIFT,Capslock, except of numeric Insert. But I have found out, that Android 7 detect it as numpad zero no matter, if numlock is on or off, so may be, that this is The reason that it is some Android APi or kernel bug.

LXDE do not work, because I can not find The way, how to remap ALT+F1, ALT+F2 hod keys. May be, that I would had to edit some of its source code. And because I AM not C or C++ professional, it would end with some crashes.

I do not know, if LXDE has hodkeys defined in some .editable text files, I Am afraid, that it will be compiled in lx-hodkey module.

But Mate is more accessible. I AM using it official window manager Marco. Because using other can cause Orca screen reader to lost focus inside some GUI. I simply type mate-session & And Mate even automatically start Orca. Sure. I do not run original Linux. So Orca lost focus till I press CTRL+r or CCTRL+m to activate mate-panel functions. Caja work perfectly including file copy and renaming operations, I will also try its build in FTP operations.

By other words, thanks to yours team, visually impaired users can run full mate-desktop environment with Orca. There are some limitations. Orca navigation mode do not work if one process open its more than one window. But I AM aware, that it is The penalty of The fact, that I do not run standard Linux and may be, that in some times, programmers will be able to repair also those complex issues.

JanuszChmiel commented 4 years ago

I also get The following warning when running mate-session. _IceTransmkdir: Owner of /tmp/.ICE-unix should be set to root Do you think, that this can negatively determine DBUS socket communication? I run mate-session as non root user as janusz.

JanuszChmiel commented 4 years ago

Oh viola. Thanks to clever user on The INternet. I have found even The solution how to correctly work with Mate panel. It show even icons and applets. Fortunately, Mate programmers did not fallen in love so much with shared memory functions such as shmget. So I do not have to be sad, that there is no shmem Android library compatible with Libc ffor Debian ARM64. Here is The command.

dbus-launch --auto-syntax --exit-with-session mate-session

Even Gnome would be run. I have heart about one command line option, which force gnome-session to skyp 3D instructions test. But latest Gnome is much less accessible than Mate. I will try to look at source code of LXDE-hod key. I will write scan codes for ALT+F1 and ALT+F2 for Android keyboard. May be, that I will have The chance to modify and recompile Lxde. Debian is perfect, it allow to compile from their sources, I can even download and install The source code dependencies dep, so I will have The chance to experiment. I must only hope, that some of Debian distribution compilers will not modify source code of Dbus so I will never have The chance to run Debian from Proot. So my eyes will be full of The tears of sadness. I must hope, that some Dbus programmers will not release new Dbus, which will not work from environment based on Proot.

Thank you for yous patience with Me MR Gendarski and others. I hope, that my experiments will be also useful for others.

JanuszChmiel commented 4 years ago

Dear MR Bednarski, I would like to deeply apologize you and all members of Proot team for my out topic debates with you. The reason is, that I have never met so friendly developer like you are. I have spent many many years until I have found you so kind human being for programmers debates. My phone has got important updates. I think, that because I have not inserted my SIM cart to it update program did not offered Me those updates. But never mind. Yours path will help other users, who did not get this update from Android 7.0 to 8.0. The result of Android 8 Update includes reprogrammed Pokedata and every probably file system case insesntivity repair. Because I can install Mate not for 50 minutes or more, but only for 20 minutes or may be for 18 minutes. Installation of icon themes, which consists with many little files is also much more faster. I must only hope, that Huavei will not release new Android which will contain older bugs again. Now, my phone is so fast, that its speed is close to device with USB flash chips no with SSD disk. So I Am not getting errors related to previously slower file system. Data are loaded to RAM much more faster. The performance is so good, that I will consider to use my phone for work daily activities. Because Mate desktop environment do not use shared memory functions or it uses it very rare, it is even possible to run complete Mate desktop with full Orca support. I must only redesign some Mate-panel hodkeys. Because ALT+F2 when using it from external keyboard is causing severe crass inside X11 vnc on XVFB module. So connection lost.

When I redesign hod keys to some other key combination, I can activate run dialog window, and even application menu. Mate app such archive manager work, but mate-system monitor crashes. Since it want to find some static based file, which is not produced by chroot environment so code hangs up. Lxtasks for managing tasks also uses shmem function so I can not use it. FOrtunately, Caja and Nautilus file manager are working perfectly. Pcmanfm also call shared memory, so it do not work. So thank you very very much for yours work on Proot source code. You and Proot developers are bringing positive opportunities for many Android users. We only have to hope, that Android developers will not recode their kernel so sys calls, which are used by Proot will not stop work. I will try Proot with ANdroid 9 and 10.

JanuszChmiel commented 4 years ago

Oh no. And I Am afraid, that I have gone to The finish station. Newest ANdroid 8.0 update from 2019 have disabled access to /proc/stats folder. And because I have read on The separate post, that this can not be solved, because kernel directly block it, I Am afraid that my hope, that I will be able to use multiple window tasks from Linux are gone for ever. I do not think, that this can be overcomed. And unfortunately, Marco call some function which need to monitor this folder and it is crucial operation, because Marco developers have decided, that if this folder can not be accessed, it terminate window manager. I have even tried to run apps without window manager. But without much positive effects. First of all, because window manager do not exist, I can not switch between several opened windows or sub windows. ALT+ESCF cause crash, because window manager do not work. What can I do about it? I must onlz run The only one app. Theoretically, I may be could create multiple separate sessions for every app, but it would not run too smoothly. It was A good adventure, but powerful Android kernel developers have succesfully defeeted Proot community. There is currently The only one reliable way how to run Linux normally on non rooted Android. Run it by using very slow Qemu virtualisation. Slow, non usable way for screen readers and speech synthesizers users. And I do not want to know, which ugly thinks have been happened against Proot sys calls on Android 10. The sad fact is, that I believe, that Android developers have included those restrictions not against Proot users. But against specific operations of malware software.

I Am still dreaming about it but I Am afraid, that proc/stats can not be replaced while developing various apps for Linux. No body will want to try to invent new complex techniques which would replace this important folder information detection.

So by other words. Android 8 have introduced reliable Pokedata, case insensitive file system is very probably gone, but they have included security path against Proot technique so apps for Linux can not access /proc/stats. Very probably, this limitation exist also for original Android shell which accept some Linux commands.

michalbednarski commented 4 years ago

In regards to /proc/stat there already exists workaround to copy example contents of /proc/stat (for example from desktop Linux) and bind-mount it in guest (Using proot -b option, with this workaround task managers still won't be able to show CPU usage but usually won't crash).

I've made small script automating that task: patchdeb.sh.txt

(Contents of /proc/stat were borrowed from TermuxArch script, TermuxArch as far as I know was only distribution script to include /proc/stat workaround, unfortunately I haven't made proper documentation for distribution script authors and such hints on proot configuration are scattered in issues here)

JanuszChmiel commented 4 years ago

Yes, my only one small hope is, that window managers will not crash. I know, that you are doing yours best Mr Bednarski. The problem is The fact, that Android developers have doing all The best for The users security and that they want to minimize The similarity between Linux and Android. I will try yours work around. I always want to be as much positive as possible. Newest Android introduces much more faster file operations. When I have used 7.0, I had to wait for 23 SEC or more before I have been able to heart welcome to Orca from The amplifier. Time between application execution command and its result is much more faster for now.

Thank you very very much for yours script. I will give it A try. My realistic goal is to have WIndow manager functioning and I will be hoping, that DBUS will also support Firefox that there will not be some other hydden issues. Because you are so kind and open to my pleas, here is The most functioning script to install Ubuntu. It uses very googly preconfigured chroot container. Dbus and other thinks are working ammazingly, really. It is inside this big .zip archive.

https://github.com/EXALAB/Anlinux-Resources/archive/master.zip

I will also try Arch Linux from Mr Rausty.

JanuszChmiel commented 4 years ago

So can i run yours script for example by typing ./start.sh from Termux? It did not recall Debian. I will also send you Debian launching script enter_deb script if you would try to add The option to The right place. Do you think, that it would allow Me to switch between several opened application windows, or unfortunately no for now so I will have to accept only Orca and one app at The same time without sub windows opened?

I have invested time to run ArchLinux, but unfortunately, ArchLinux developers have followed The Fedora development way so Dbus do not work from chroot and it is even emphasized on their Arch wiki. So older Arch 1 or 2 years before 2020 have accepted to use Dbus from chroot from Android, but unfortunately, todays newest stable no.

So I have been forced to remove Arch Linux and I will be really focus on Debian and Ubuntu. And I will only hope, that their developers will also not follow Arch Linux and Fedora Dbus approach, which will not work from chroots.

JanuszChmiel commented 4 years ago

Verz well done Mr Bednarski. Debuan Buster and multi windows switching is really working. Marco do not crash thanks to access denied to proc/stat file. Very well done. I have finally finished The mission thanks to yours patience. I Am very sorry to all Termux memvers that I have intruded you so much about tropic, which is very probably not interesting to others. Thanky you all for yours tolerant approach to my pleas. I Am also very sorry to all experts here, that I Am a little confuser man, but I have good heart and I do not want to make somebody here sad or engry. It is not easy to use complex apps from chroot environment, The evidence is, that currently only Debian allow Dbus inter process communication so reliably, that even Orca screen reader can reliably communicate with other processes without crashes. And I will try to constructively dabate with some apps developers, so they would extend their C code to allow also no shmem use. Pulseaudio, x11vnc are The good examples, that it is possible to live also without sharing memory. So thank you again for yours kind access to Me. You have brought big joy to my life.