-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install script uses wrong device path for A/B device, silently succeeds #5
Comments
Thank you for your thorough description. I wrote the update binary while only targeting LineageOS and only testing it on my device, so it's no surprise that there are some edge cases where it fails. I will research a solution and I will update the script accordingly. |
A further observation: My device also has |
(Magisk itself installs fine via |
Same problem with OnePlus 6, LineageOS v19.1. |
Magisk does this: https://github.com/topjohnwu/Magisk/blob/master/scripts/util_functions.sh Specifically
I will have a play with it manually tomorrow. |
It turns out my own |
@PatrykMis can you check if your own |
LineageOS devs tell me the reason is because MicroG sets WITH_GMS = true leading to lack of extra space in the system partition, it means no installer (Magisk or MindTheGapps or anything else) will be able to write extra stuff to /system or /vendor or anything, so this is not a problem with your script. I'll follow this issue up separately with them later. The other stuff I mentioned still applies though, about slot detection and the right device. The MindTheGapps install script is a bit simpler than Magisk's so perhaps you could use that instead: |
Not nessesarily. On Redmi 7 (Onclite), Lineage 19.1 with MicroG it works well; but this model doesn't have A/B partitioning scheme. |
I updated the installation script to detect the partitions programmatically by searching the |
Unfortunately, it does not work too, but in my case the problem might be somewhere else. I've attached full recovery.log Output of
Looking at the recovery log, the only mention of system partition is here: |
Not sure, but I think this is just the system partition for the recovery OS not your actual main system OS. As I mentioned in my second post, the OS system devices don't exist until certain setup things have been run. I don't know the specific details of this, but I'd imagine copying whatever MindTheGapps does will work. |
@PatrykMis The recovery log seems to indicate that the script fails because of the missing |
@infinity0 You might be right, but the update script you referenced also seems to install everything on the active slot. |
@arovlad I was just guessing about the failure without looking at the details, but your explanation of the failure due to I don't think your current strategy is the best though. |
This is a valid point and I will look into potential fixes but there's hardly anything that can be done besides blacklisting a few names or mounting every partition that we find and checking for the required folders. This is a case where we cannot escape hard-coding a string.
It is highly unlikely that future versions of Android will ever rename the system partition to something else. Even if it were to happen, the partition will probably be symlinked to the new name so there will be no issues whatsoever.
All pieces of software will eventually become obsolete at some point if they fall out of use or are not properly maintained, so this is hardly an argument. Even so, if the system partition will hypothetically be replaced with something else the script will simply fail as it cannot find it.
I strongly disagree. In my humble opinion, the way they mount the partitions is the same as mine but in an over-complicated fashion. They check the fstab for the mount points which complicates things even further as it involves even more hard-coding and thus even more ways in which it can fail. @infinity0 Thanks for your input. |
What I meant is that other partitions matching your search pattern As I understand, their complexity is based on Android docs, so it is just checking for all the concrete options, and not trying to guess unknown future scenarios. I can empathise with wanting to be future-proof, I'm just not sure it can be done safely. |
I changed the script to hard-code |
Device: OnePlus 8T (KB2003), LineageOS 19.1 with MicroG, same LineageOS recovery.
getprop ro.treble.enabled
showstrue
.Androidacy/WebviewManager-Module does work for me.
Firstly you want to
set -e
at the top of your install script, so it actually fails if one of the steps fails.Then to my actual problem: these lines don't work:
On my system, they should instead be:
You'd also need to write logic to detect what the active slot is (either A or B). On my recovery ROM at least,
{system_b,vendor_b}
doesn't exist when the active slot is A. I have no idea if this holds true in the general case.Then there is a further problem, which is that
cp
creates empty files on both/system
and/vendor
for me, showing no error message nor failure exit code. This is the case even if I boot into my normal system, mount read-write, and try it. It is possible to create files in those paths, but not to put content in those empty files. I haven't figured out how to fix this yet...The text was updated successfully, but these errors were encountered: