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
LineagesOS updater #90
Conversation
I noticed an issue when trying to generate the metadata: the LineageOS release (e.g. 17.1) does not seem to be exposed through any option, but I think the metadata won't work if |
@ajs124 Hmm, perhaps we could add and set a |
Sounds reasonable. AFAICT there isn't any mapping between So what does currently happen if the following two things are set in a configuration?
|
I think currently that configuration would use the LineageOS 17.1 sources in conjunction with the android 11 patches in robotnix, so it would probably break. :) When we add the new LineageOS version we can conditionally include the right sources based on which version was selected. (as we currently do in the vanilla flavor). I take your point about the mapping between |
Another note as you look at generating metadata: |
That does indeed seem to be what happens.
I'm not sure what the correct/best thing to do here is, tbh. My point was just an observation/me wondering if I'm reading the source correctly. |
AFAIK LineageOS (from CyanogenMod's history) always mapped 1:1 to letter-based versions of Android.
The major version of CyanogenMod and then LineageOS increased when the letter changed. Am I missing something about the desired 1:1 relationship? |
🤔 I think, e.g. with android 10, they first released (or at least branched and worked on) 17.0 and then decided to go with 17.1 instead. Not sure why that happened and if and why anyone would want 17.0 instead of 17.1, but I seem to remember that happening. |
Yes, I mean for major versions, you know that e.g. 17.* is used for 10/Q. It seems that the minor versions will be increased whenever AOSP "feature drops" are breaking their workflow enough
AFAIUI starting with LineageOS 17 / Q / AOSP10, the minor version is a somewhat internal "we had to rebase everything" number. I think it should be safe to always map AOSP release number/letters to the major LineageOS version.
It was more of a mess initially, where it was like:
But even as CyanogenMod, the rule of thumb of each letter, one major version increase was true. |
In that case, the selection would be better done by choosing |
@danielfullmer yes, definitely, here 17.0 has been closed and abandoned for 17.1. I also think that setting |
As an FYI, there's also the LineageOS updater backend available here: https://github.com/lineageos-infra/updater |
Sorry I'm only getting back to this now, but I should have some time to finally get this into a useful state soon. How would I best introduce an option/property for |
So, the thing I don't particularly like is having two options (e.g. Since we only have LineageOS right now, I don't have a problem with you just doing a lookup specifically for LineageOS in your module. We also now have these lines in the LineageOS flavor: |
Hm. We could make the option I've seen the code that does the mapping in Since you said "extract that into its own .nix file, and import the functions into your updater module", do you mean we should have a separate updater module for lineage or are you fine with having only one module and it behaving conditionally, as it does right now in this PR? |
Making
You could use that in the lineageos flavor to set
Sorry, I spoke without re-reading the PR recently, having one updater module and having it behave conditionally is fine. |
f28cee4
to
570ef44
Compare
done
done
No problem, if I hadn't taken months to finish this, it probably would have been more on your mind. The remaining things with this I'm not 100% happy about are:
|
Thanks! I hope to test it on my own device soon, in the meantime:
|
|
8d4aaa1
to
6d06e59
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
That makes sense to me.
-
We don't have to set
updater_server_url
to be exactly the same asapps.updater.url
. We can still haveapps.updater.url
end in a/
by default, but then setupdater_server_url
based onapps.updater.url
:
I was thinking we could do something like
resources."packages/apps/Updater".updater_server_url = "${cfg.url}${config.device}";
or
resources."packages/apps/Updater".updater_server_url = "${cfg.url}lineageos-${config.device}";
writeOtaMetadata is moved up, because it's used by releaseScript and otaDir This isn't a no-op for the other flavors, because it changes otaDir into a runCommand and copies (or rather "cat"s) the metadata, whereas it was a symlink until now
Apologies for not following up with this earlier. I just fixed the merge conflicts and added a commit to have the Are there any additional changes you'd like to make before merging, or is this ready to go? |
No problem. I haven't been actively using this and have been meaning to do start doing that, but if you've tested it that's good enough for me. Coincidentally, I also recently prepared a new branch that is mergeable into master, but it probably doesn't differ much from what you did here. |
What I have done so far:
built and flashed a ROM with this change to my payton/Moto X4
verified that it boots and checks the specified URL for updates:
host=rbtnx.ipv2.de:443 remote_addr=[…] remote_user=- request="GET / HTTP/1.1" ssl_proto=TLSv1.3 ssl_cipher=TLS_AES_128_GCM_SHA256 status=200 body_bytes_sent=970 referer="-" user_agent="Dalvik/2.1.0 (Linux; U; Android 10; Moto X4 Build/QQ3A.200805.001)" x-forwarded-for="[…]" rt=0.000 ua="-" us="-" ut="-" ul="-" cs=-
implemented metadata generation
actually install an ota update using this