Skip to content

Instantly share code, notes, and snippets.

@axxx007xxxz
Last active December 9, 2025 15:36
Show Gist options
  • Select an option

  • Save axxx007xxxz/60fea50f4b123e0163f972d1709068c2 to your computer and use it in GitHub Desktop.

Select an option

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
@clexan
Copy link

clexan commented Dec 8, 2025

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

@SirRGB

@SirRGB
Copy link

SirRGB commented Dec 8, 2025

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

@SirRGB

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

@clexan
Copy link

clexan commented Dec 9, 2025

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..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment