-
-
Save axxx007xxxz/60fea50f4b123e0163f972d1709068c2 to your computer and use it in GitHub Desktop.
| #!/bin/bash | |
| if [ $UID != "0" ]; then | |
| echo "ERROR: You must run this script as root!" | |
| exit 1 | |
| fi | |
| dnf install \ | |
| @development-tools \ | |
| android-tools \ | |
| automake \ | |
| bison \ | |
| bzip2 \ | |
| bzip2-libs \ | |
| ccache \ | |
| curl \ | |
| dpkg-dev \ | |
| gcc \ | |
| gcc-c++ \ | |
| gperf \ | |
| libstdc++.i686 \ | |
| libxml2-devel \ | |
| lz4-libs \ | |
| lzop \ | |
| make \ | |
| maven \ | |
| ncurses-compat-libs \ | |
| openssl-devel \ | |
| pngcrush \ | |
| python \ | |
| python3 \ | |
| python3-mako \ | |
| python-mako \ | |
| python-networkx \ | |
| schedtool \ | |
| squashfs-tools \ | |
| syslinux-devel \ | |
| zip \ | |
| zlib-devel \ | |
| zlib-devel.i686 | |
| curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > /usr/bin/repo && chmod +x /usr/bin/repo |
I wasnt able to reproduce the error after a re-setup of fedora 39 on another PC without the legacy setup.
Needed to install libxcrypt-compat for a successful build tho.
Update:
I built using jenkins before and it worked fine, but something in qpr2 broke building for me
It might be a jenkins issue or fedora specific, for now Im back to manual compilation, at least for A14.
A10/11/12/13 still work fine on jenkins, Im pretty sure I saw aosp building some tools from source now, which seems to have broken jenkins ig.
https://github.com/Jarlpenguin/releases
*can confirm, jenkins issue
trying to transition my workflow to docker
While its not impossible to setup a build environment on fedora, I found setting up a containerized ubuntu 22.04 install using podman works quite well, with minimal overhead.
Here is the setup, it maps your host home directory to the container so you will see all source files directly on file manager. Also disables selinux labels to bypass some permission issues.
podman run \
--hostname aosp \
--name aosp \
--interactive \
--tty \
--detach \
--security-opt label=disable \
--volume "$HOME":/root \
ubuntu:22.04
While its not impossible to setup a build environment on fedora, I found setting up a containerized ubuntu 22.04 install using podman works quite well, with minimal overhead.
Here is the setup, it maps your host home directory to the container so you will see all source files directly on file manager. Also disables selinux labels to bypass some permission issues.
podman run \ --hostname aosp \ --name aosp \ --interactive \ --tty \ --detach \ --security-opt label=disable \ --volume "$HOME":/root \ ubuntu:22.04
Thanks for the considerations, but I have my own solution with a few scripts built-in. Might not be for everyone, but thats my current workflow. You can probably use rootful containers to make volumes ownership easier, but I kinda wanted it to work rootless, so I did it like this..
https://github.com/sirrgb/dockdroid
I gave the options above if for reference, someone might find it helpful. I always lean towards simple in terms of setting up a new system or build environment. Initialize the container via podman, install dependends, repo sync, and the rest of the configuration is handled on host (memory opts -zram, git, etc.). Maybe I'm just lazy, but to each his own, there's no "right answer"
Your configuration seems more comprehensive, which is great and fits your use case well.
Shame Fedora isn't AOSP friendly as other distros..
https://divestos.org/pages/build#deps
Divest OS has a comprehensive guide for the setup, even works for A7. You can ignore the firejail setup though, at least I did.
If you dont go that old (aka A9/up) you can ignore
sudo ln -sf /usr/share/crypto-policies/LEGACY/java.txt /etc/crypto-policies/back-ends/java.config;and
openjdk-8-jdkFor A8/below you also need to dig into update-alternatives (or just alternatives) and set up python2 -> python and java symlinks
https://docs.fedoraproject.org/en-US/packaging-guidelines/Alternatives
For A10 I had to manually apply this fix
https://www.reddit.com/r/LineageOS/comments/18lej4b/if_your_build_is_failing_with_an_error_regarding
aka remove
metadata_csum_seedandorphan_filefrom/etc/mke2fs.confI did run into issues since qpr2 since symbol_inject is now source built
https://android-review.googlesource.com/c/platform/prebuilts/build-tools/+/2671917/2/linux-x86/bin/symbol_inject
Id be happy to know that Im not the only one having this issue on fedora 39 when trying to build lineage os 21/crdroid 10.3, so lmk if anyone of yall can replicate it.