Skip to content
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

Machine abstraction, Pixel 3a and Android 10 #40

Merged
merged 24 commits into from
Feb 9, 2021

Conversation

ypid
Copy link
Collaborator

@ypid ypid commented Nov 10, 2019

Status: Successfully boots on sargo.

Known issues: Backup app missing form build? It has been build because I needed to fix an issue/update it.

Depends on: hashbang/aosp-build#5 Merged
Depends on: hashbang/aosp-build#12 Merged

@ypid ypid force-pushed the machine-abstraction branch from 937821f to b8a2e76 Compare November 10, 2019 16:05
@ypid ypid force-pushed the machine-abstraction branch from a10ca67 to bb515fe Compare November 10, 2019 16:30
@ypid
Copy link
Collaborator Author

ypid commented Nov 14, 2019

I did a second clean built and successfully tested a OTA update <3. Remaining issues:

  • Backup app missing. Probably because of the rename of the upstream project and me not following the wiki to the last point yet. Edit: Upstream provides prebuilts but no in tree building options. Further tracked here: Readd Seedvault (Backup) #41

Workaround found and tested:

  • F-Droid does not build. I already tried building from latest master (bc78eba6baab5c0bc01f983338ebf4489f5d44df), same issue: packages/apps/F-Droid/Android.mk:16: error: writing to readonly directory: "packages/apps/F-Droid/app/build/outputs/apk/full/release/app-full-release-unsigned.apk". ClientWhitelist.java can be changed for now to allow the official F-Droid build. Installing with the priv ext throws an "PackageManagerCompat: java.lang.SecurityException: Caller does not have same cert as new installer package org.fdroid.fdroid.privilege" but works so far.
  • Chromium/Vanadium building untested, no WebView. Applied workaround: ecc5c8a. Tested successfully. Browser is not included for now. Installing one out of system seems like a good enough solution for now.

Fixed:

  • Patch level is shown as 2019-09-06 (October 6, 2019). Build system allowed this to happen, fixed in hashbang/aosp-build@5cca3fa
  • OS does not boot with locked Bootloader "Can't find valid operating system. The device will not start". Fixed in hashbang/aosp-build@3e1802b
  • Alarm does not go off. Fixed in: b968199. I am not sure if I am doing something wrong. This patch does not make it into the final ota image and on my phone. DeskClock still targets SDK 28. Even though I did multiple clean builds by now. The only thing I did not do yet is a clean flash. I will try that in a bit. Edit: Works now with my 2019-12-05 patch level clean build.

Not relevant, fixed for myself:

@ypid
Copy link
Collaborator Author

ypid commented Nov 14, 2019

@lrvick Why did you drop the "ignore allowBackup="false" of apps" patch in aae983a? I think this is still useful so I ported it to Android 10 (only a small change) and am testing it in my next build. Edit: Working.

You still have it mentioned in the README: "Backup - Minor OS changes made to allow backing up any app".

@ypid ypid changed the title [WIP] Machine abstraction [WIP] Machine abstraction, Pixel 3a and Android 10 Nov 14, 2019
@ypid
Copy link
Collaborator Author

ypid commented Nov 18, 2019

I am done for now. My 4th build is good enough for me to actually use it. I have a few other improvements/ideas laying around but I want to tested them more before I feel comfortable submitting them.

See you when it is time to build the 2019-12-05 security patches 😉 Also then, I will maybe reattempt to build F-Droid in tree.

@ypid
Copy link
Collaborator Author

ypid commented Dec 7, 2019

No changes are needed to build the 2019-12-05 patch level. Confirmed working on sargo.

@rkunschke
Copy link

I wanted to try the build so i cloned you're repository and changed the branch to machine-abstraction
I set up a docker repo with docker run -d -p 5000:5000 --restart=always --name aosp-build registry:2 and started the generation of keys with: make DEVICE=sargo keys and got this error
Generating Key: "releasekey" /usr/local/bin/keys: line 16: make_key: command not found Generating Key: "platform" /usr/local/bin/keys: line 16: make_key: command not found Generating Key: "shared" /usr/local/bin/keys: line 16: make_key: command not found Generating Key: "media" /usr/local/bin/keys: line 16: make_key: command not found Generating Key: "verity" /usr/local/bin/keys: line 16: make_key: command not found Generating Key: "avb" Generating RSA private key, 2048 bit long modulus (2 primes) ................+++++ ........................+++++ e is 65537 (0x010001) Generating Key: "avb_pkmd" /usr/local/bin/keys: line 23: avbtool: command not found make: *** [Makefile:33: keys] Error 127
What did i do wrong?

@ypid
Copy link
Collaborator Author

ypid commented Dec 22, 2019

Hi @rkunschke

I guess the docs are not precise about that. Fixed in a09df67 and hashbang/aosp-build#12.

$ make tools
$ ll build/base/out/.path/make_key 
lrwxrwxrwx 1 builder builder 19 2019-12-22 09:43 build/base/out/.path/make_key -> ../.path_interposer

docker run -d -p 5000:5000 --restart=always --name aosp-build registry:2

The project provides a Makefile which you should use. Not sure where you got that command. Looks random. Such manual docker commands should not be required :)

@rkunschke
Copy link

rkunschke commented Dec 22, 2019

@ypid
make tools gives me this error

mkdir -p config/keys build/base release build/external
docker run --rm --tty --interactive --name "aosp-build-aosp-local" --hostname "aosp-build-aosp-local" --user 0:0 --env DEVICE=crosshatch --security-opt seccomp=unconfined --volume .../os/config: home/build/config --volume /.../os/release:/home/build/release --volume /.../os/scripts:/home/build/scripts --volume.../os/build/:/home/build/build/ hashbang/aosp-build:latest tools
/usr/local/bin/tools: line 8: cd: /home/build/base: No such file or directory
make: *** [Makefile:80: tools] Error 1

make DEVICE=sargo does this

docker build \ --tag hashbang/aosp-build:latest \ --file /.../os2/config/container/Dockerfile \ \ /.../os2
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /.../os2/config/container: no such file or directory
make: *** [Makefile:60: image] Error 1

I just want to build a flashable file
what am i doing wrong?
i am on /ypid/os/ one the machine-abstraction branch. This should work with this commands or am i wrong?

@ypid
Copy link
Collaborator Author

ypid commented Dec 22, 2019

I guess the project still requires some knowledge of Docker, Makefiles and Android and the ability to fix issues yourself to get started.

You need to run those commands in https://github.com/hashbang/aosp-build which builds the image that https://github.com/hashbang/os can then use.

Please try to get some understanding how this all is supposed to fit together!

@rkunschke
Copy link

rkunschke commented Dec 22, 2019

Thank you for this tip. My problem was that i try'ed to build in os repository. Now the build is working without a problem so far.
If the build fishes I will give you some feedback :) thank you

I think I know understand. aosp build starts a docker container which pulls os and builds it.

patch: **** malformed patch at line 32
@ypid
Copy link
Collaborator Author

ypid commented Jan 19, 2020

A build error (ref: hashbang/aosp-build#9) prevents me from building the 2020-01-05 security patches. Any input would be highly appreciated.

@ypid
Copy link
Collaborator Author

ypid commented Jan 26, 2020

hashbang/aosp-build#9 does not longer prevent me to build the update. Only a small fix was needed to build 2020-01-05 for sargo, ref: hashbang/aosp-build#12 and 9481753.
Confirmed working on sargo.

@ypid ypid changed the title [WIP] Machine abstraction, Pixel 3a and Android 10 Machine abstraction, Pixel 3a and Android 10 Jan 26, 2020
@ypid ypid requested a review from lrvick January 26, 2020 20:44
@lrvick
Copy link
Member

lrvick commented Feb 2, 2020

@lrvick Why did you drop the "ignore allowBackup="false" of apps" patch in aae983a? I think this is still useful so I ported it to Android 10 (only a small change) and am testing it in my next build. Edit: Working.

You still have it mentioned in the README: "Backup - Minor OS changes made to allow backing up any app".

I was skeptical if it was actually useful in practice as many apps seem to ignore it.

Happy to see it included back if you have confirmed it does in fact play nice for you.

@lrvick
Copy link
Member

lrvick commented Feb 2, 2020

This is a lot of solid work in the right direction and gets us close!

That said, I see the lack of chromium/F-droid as a major regression we need to address before we merge to master.

Also we can't take the GrapheneOS webview as this is just an unsigned binary on github with no supply chain integrity. We will have to find a solution to build this from source as well.

Will be continuing to play with this and likely merge most of it once I get a working build (even if missing features)

@lrvick
Copy link
Member

lrvick commented Feb 2, 2020

Honestly, the more I think about it, it may be better to just drop chromium from the project entirely and stick with the default webview by default until maybe there is a nice in-tree chromium-webview that builds from source... but even then leave the standalone browser out of it.

My thinking is:

  1. The base OS itself is never going to be updated as often as a standalone browser via f-droid would be, and browsers need constant updates.
  2. Any effort done to get a standalone browser in f-droid proper would benefit all users regardless of their ROM.
  3. The f-droid team -is- interested in seeing bromite merge if someone can get it to work in their VM. That would pave the way for other forks as well.

@ypid
Copy link
Collaborator Author

ypid commented Feb 2, 2020

I was skeptical if it was actually useful in practice as many apps seem to ignore it.
Happy to see it included back if you have confirmed it does in fact play nice for you.

This has proven to be useful for me. When you check logcat while making an adb backup, you can see what apps do not want to be backed up. When I applied this patch and restored my backup, a few more apps worked right away that had to be setup manually without the patch.

Also we can't take the GrapheneOS webview as this is just an unsigned binary on github with no supply chain integrity. We will have to find a solution to build this from source as well.

They are at least signed by Daniel Micay’s OpenPGP key. But I agree with you.

it may be better to just drop chromium from the project entirely and stick with the default webview

Sounds reasonable to me. This is also what I do right now, I don’t include the browser in the build and let F-Droid install/update my browser. The only issue is the webview, because I did not find a way to install it without root as I figured it must be part of the /system build?

@ypid
Copy link
Collaborator Author

ypid commented Mar 9, 2020

2020-02-05 and 2020-03-05 can be build. For 2020-03-05 967a7c3 was needed.

Currently the WebView is broken but I assume that is because the app ID of Vanadium was changed. I pushed an untested commit which should fix that. I guess I will make another build in a few days to see if that works.

I generated the repo XML files for all supported devices. Generating those took hours. @lrvick Is that just my connection or does it take very long for you as well?

Happy building :)

@ypid
Copy link
Collaborator Author

ypid commented Mar 13, 2020

Unfortunately, my quick and dirty attempt to fix the web view did not work. I will leave it as this for now until the next security patch. Feel free to pick up the work. This is still a workaround anyway.

@lrvick
Copy link
Member

lrvick commented Mar 13, 2020 via email

@ypid
Copy link
Collaborator Author

ypid commented Apr 12, 2020

No changes are needed to build the 2020-04-05 patch level. Confirmed working on sargo.

@ypid
Copy link
Collaborator Author

ypid commented May 7, 2020

No changes are needed to build the 2020-05-05 patch level. Confirmed working on sargo.

@ypid
Copy link
Collaborator Author

ypid commented Jun 4, 2020

hashbang/aosp-build#23 is required to build 2020-06-05. Confirmed working on sargo.

@ypid
Copy link
Collaborator Author

ypid commented Jul 10, 2020

No changes are needed to build the 2020-07-05 patch level. Confirmed working on sargo.

@ypid
Copy link
Collaborator Author

ypid commented Aug 8, 2020

No changes are needed to build the 2020-08-05 patch level. Confirmed working on sargo.

@ypid
Copy link
Collaborator Author

ypid commented Feb 9, 2021

I am going to merge this. The browser integration changes with GrapheneOS anyway.

@ypid ypid merged commit 0800570 into hashbang:10 Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants