Skip to content

Instantly share code, notes, and snippets.

@axxx007xxxz
Last active April 26, 2024 10:05
Show Gist options
  • Star 25 You must be signed in to star a gist
  • Fork 14 You must be signed in to fork a gist
  • Save axxx007xxxz/60fea50f4b123e0163f972d1709068c2 to your computer and use it in GitHub Desktop.
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
@SirRGB
Copy link

SirRGB commented Apr 3, 2024

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

For 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_seed and orhpan_file from /etc/mke2fs.conf

I 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

FAILED: out/soong/.intermediates/frameworks/base/tools/aapt2/aapt2/linux_glibc_x86_64/e560d7b19ebf7276b3e850d3d346dec8/aapt2
out/host/linux-x86/bin/symbol_inject -i out/soong/.intermediates/frameworks/base/tools/aapt2/aapt2/linux_glibc_x86_64/e560d7b19ebf7276b3e850d3d346dec8/unversioned/aapt2 -o out/soong/.intermediates/frameworks/base/tools/aapt2/aapt2/linux_glibc_x86_64/e560d7b19ebf7276b3e850d3d346dec8/aapt2 -s soong_build_number -from 'SOONG BUILD NUMBER PLACEHOLDER' -v $(cat out/soong/build_number.txt)
flag needs an argument: -v
Usage of out/host/linux-x86/bin/symbol_inject:
  -dump
    	dump the symbol table for copying into a test
  -from string
    	optional existing value of the symbol for verification
  -i string
    	input file
  -o string
    	output file
  -s string
    	symbol to inject into
  -v string
    	value to inject into symbol

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.

@SirRGB
Copy link

SirRGB commented Apr 5, 2024

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.

https://support.gurobi.com/hc/en-us/articles/17316546307217-Error-while-loading-shared-libraries-libcrypt-so-1

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