Magisk-Modules-Alt-Repo / chroot-distro

install linux distributions on android
GNU General Public License v3.0
129 stars 9 forks source link

--as-is doesn't work #28

Closed defectly closed 2 months ago

defectly commented 2 months ago

When i run "chroot-distro command ubuntu --as-is ls", it shows "chroot: exec /bin/--as-is: No such file or directory"

jjkola commented 2 months ago

Thanks for the report. I'll try to rectify the bug this weekend.

jjkola commented 2 months ago

I just tested against the latest code. The code works as it should. Which version of chroot-distro are you using?

Your report nevertheless got me thinking about the command functionality, and I realized that this --as-is functionality can be made default. When I was implementing the --as-is option I didn't think why the original code was implemented as it was. With the help of your report, I realized that it must have been done because there was previously problems with host side environment variables leaking inside the jail. As I have fixed that part of the functionality there is no longer need for extra mangling. So, I will be removing that option, and streamline the functionality.

defectly commented 2 months ago

I just tested against the latest code. The code works as it should. Which version of chroot-distro are you using?

Your report nevertheless got me thinking about the command functionality, and I realized that this --as-is functionality can be made default. When I was implementing the --as-is option I didn't think why the original code was implemented as it was. With the help of your report, I realized that it must have been done because there was previously problems with host side environment variables leaking inside the jail. As I have fixed that part of the functionality there is no longer need for extra mangling. So, I will be removing that option, and streamline the functionality.

I installed latest release from this repository to my neo5lte phone with magisk today. Maybe i wrote incorrect command? But i found another way, i wrote .sh script and ran it with bash without --as-is

jjkola commented 2 months ago

The latest (and the only) release is unfortunately quite problematic and I would suggest against using it unless you are really careful as there is a problem with the way it handles system mount points which can lead to data loss.

The reason is that the code assumes that system mount points are mounted only once but did not check during mount if they were already mounted leading to multiple mounts for the same mount point. If you don't reboot the device or remove the extra mounts, and then try to reinstall or uninstall you will be removing the stuff in system mount points. In the best case you will only remove Termux (if you were using that) and SD card stuff, in the worst case you will have to restore your device either from backups or reset the device to factory settings.

Anyways, the currently available release does not yet support all the features mentioned in the repository. Hopefully there is soon a new version which has all the needed fixes to use chroot-distro safely. If you want to use the bleeding edge version before the release then you can create the installation archive yourself. If you don't know how to do it you can check instructions in the PR #30 which will hopefully land in the main branch soon.