binfmt_misc weirdness
Thanks for the detailed report! I completely forgot about the /proc entry of binfmt_misc... :silly:
The currently released versions of Advanced Kernel doesn't created the mount point at "/proc/sys/fs/binfmt_misc" for the binfmt_misc filesystem.
Please flash the following Advanced Kernel zip to fix this:
https://drive.google.com/open?id=1zYUFHjN5544iurjkrcZg9E0tQUjCgdya (It's the OC version. If you don't want OC I'll glady provide another zip.)
After booting this kernel the "/proc/sys/fs/binfmt_misc" directory should exist. Insert the binfmt_misc kernel module from earlier, then mount the binfmt_misc filesystem using the following command:
mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
Binfmt_misc should then be fully functional.
"I've been troubleshooting from morning to evening and things doesn't seem to go well."
>>
Notes
• The latest advanced overclocked kernel with binfmt_misc file directory is installed.
• The module was successfully loaded and mounted as confirmed by insmod,
grep binfmt /proc/mounts cmd, and
cat /proc/sys/fs/binfmt_misc/status =
enabled.
• Linux Deploy did interact with the binfmt folder though mounting and 'writing' to ~binfmt_misc/register.
• Clarification, when I say module is loaded in the Problems and Issues section, I meant that binfmt is loaded and mounted.
>>
Problems and Issues
• Whenever the module is ready and Linux Deploy tries to start a container, Root and Magisk goes invisible. By invisible, I mean root cannot be detected. All superuser apps including Magisk Manager fails to find
'su' and is unable to recover unless two methods are done:
One is to keep a terminal running as su (#) before activating the module and/or starting a LDeploy container and enter the cmd-
echo 0 > /proc/sys/fs/binfmt_misc/status -to say "disable' to restore root functions or
two is to reboot (risky due to weird system errors once booted; which is the next issue). This makes starting a init.d script (via Kernel Adiutor; init.d emulation off) for starting binfmt_misc risky.
• If rebooted from failed attempts with the module active / root errors / Linux Deploy breaking root with module active, the Android OS crashes with "Process System isn't responding." To recover, one needs to go to Recovery Mode and reinstall the advanced kernel (binfmt_misc + OC) and Magisk 18.1. From there, the system works to normal status again.
• The binfmt_misc folder seems empty to FX File Manager (#), yet files can be seen when using the
ls -l cmd inside the folder. I managed to find the files visible to FX FM once. Unable to recreate such event (yet?).
• When updating Linux Deploy operating environment, there are times when the module is loaded, root seems to break. Other times, root seems okay.
• Sometimes, new qemu files appear in the binfmt_misc folder. The qemu files have the usual data inside them containing interpreters in /usr/bin/... and stuff. Yet, I have no idea if it is looking for a /usr directory in Android itself or in the chroot container (Ubuntu in my case).
Theory: I tried installing qemu binaries and libs inside my Linux distribution while the module is off. After shutting the container down, I loaded the module and tried updating the operating environment of the app. At times and if passed the root breaking, I'll see new qemu files in the binfmt_misc folder. Though, I am not certain if that's the cause. As long as there are binaries in the OP Env folder of Linux Deploy, similar files appear in the module's folder.
• When installing a new distro of foreign architecture with a valid or existing qemu file in the binfmt_misc directory (In my case, I found i386 in binfmt_misc and LDeploy's OP Env. So, I tried installing Ubuntu Bionic Beaver as i386), I bypassed the debootstrap error, but it returns an error that LDeploy could not execute other tasks as i386. (Unfortunately I was not able to capture the error. Recreating it may face the root problem of which I don't was risking for another recovery and reboots for the time being. Though I'll try if it is absolutely needed for LDeploy's log.)
"I'm currently giving myself and my phone a break to breathe and gather some energy back. That's the information I gathered so far. I'm not sure if I'm missing something or mistaken something. It seems tricky to find a decent binfmt guide online (even YT has almost to none; RedHat has simple ones)."
"As for what version of the kernel, I prefer the non-overclocked kernel for stability and battery for my current system setup. Thanks for the help.
P.S - I did frequent editing to this post. I apologize if confusions were made due to new text(s) popping up.