Magisk-Modules-Alt-Repo / chroot-distro

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

Alpine Linux download link no longer valid #8

Open jjkola opened 2 months ago

jjkola commented 2 months ago

Steps to reproduce:

  1. Previous Alpine Linux downloads removed if downloaded
  2. chroot-distro download alpine
  3. Choose for example minirootfs

Expected outcome: Alpine rootfs is downloaded

Actual outcome: Download errors out with 404.

So, the issue is that the link points to latest-stable but the referenced 3.19 is no longer there is 3.20 has been published in May.

So, either the link needs to be updated to latest 3.20 version or directly reference the v3.19 instead of latest-stable. Or, better yet, process the latest-releases.yaml to provide always up to date information.

jjkola commented 1 month ago

@YasserNull I have investigated this an found that there is software called yq which does provide YAML, JSON and XML parser for shell scripts. Somebody has already provided a magisk module for using with an Android device. This would make it possible to easily parse the release yaml.

Also, I have thought that maybe we should start collecting meta-data about installed distros. The current implementation works but because the code has hardcoded assumptions, for example about archive extensions, we could move those assumptions to metadata. The metadata could be distro specific file, where it would record for example that distro was installed with android folders, what was the root file, backup file, and so on. This would make it so that we can use the correct extensions for the data thus removing the need for checking the format, or in the case of /data folder it could be matter of installation time constant, and if somebody created /data folder (accidentally or not) inside the jail, then host /data wouldn't be leaked inside the jail.

Thus by using a metadata file we could alleviate the need for native code for now. And we could also make it so that the latest versions of 1.x would have knowledge of metadata file and notify users of potentially breaking the metadata, or maybe even removing the metadata if user acknowledges that he/she does not want to keep metadata (for example in the case the user tried the new version and wasn't satisfied with it).