From b91e9a71a3d23187e638f8df75ba7e8ce9cb92eb Mon Sep 17 00:00:00 2001 From: Kn0ax <42520461+Kn0ax@users.noreply.github.com> Date: Tue, 4 Jan 2022 19:00:37 +0100 Subject: [PATCH 01/36] setup: install software-properties-common before adding GitHub packages repository. Some env. don't have software-properties-common and scripts fails to run apt-add-repository command; # bash android_build_env.sh Adding GitHub apt key and repository! Executing: /tmp/apt-key-gpghome.aXdgtXadYz/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0 gpg: key C99B11DEB97541F0: "Nate Smith " not changed gpg: Total number processed: 1 gpg: unchanged: 1 sudo: apt-add-repository: command not found --- setup/android_build_env.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/setup/android_build_env.sh b/setup/android_build_env.sh index 55f81d33..9e0c16b4 100755 --- a/setup/android_build_env.sh +++ b/setup/android_build_env.sh @@ -14,6 +14,7 @@ DEBIAN_11_PACKAGES="libncurses5" PACKAGES="" echo "Adding GitHub apt key and repository!" +sudo apt-get install software-properties-common -y sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0 sudo apt-add-repository https://cli.github.com/packages From e366973b1d9c9636efaa5a0c0c44a6b50c2c1ff5 Mon Sep 17 00:00:00 2001 From: Stefen Wakefield Date: Fri, 7 Jan 2022 22:39:37 -0600 Subject: [PATCH 02/36] setup/install_android_sdk: update packages and sync with upstream --- setup/android-sdk-minimal.txt | 12 ++++++------ setup/install_android_sdk.sh | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/setup/android-sdk-minimal.txt b/setup/android-sdk-minimal.txt index 6d0a5f5f..9b1ce6eb 100644 --- a/setup/android-sdk-minimal.txt +++ b/setup/android-sdk-minimal.txt @@ -1,8 +1,8 @@ -build-tools;30.0.3 -build-tools;31.0.0-rc2 -cmake;3.10.2.4988404 -ndk;22.1.7171670 +build-tools;31.0.0 +build-tools;32.0.0 +cmake;3.18.1 +ndk;23.1.7779620 platform-tools tools -platforms;android-30 -platforms;android-S +platforms;android-31 +platforms;android-32 diff --git a/setup/install_android_sdk.sh b/setup/install_android_sdk.sh index be83344e..8a85cdb8 100755 --- a/setup/install_android_sdk.sh +++ b/setup/install_android_sdk.sh @@ -7,7 +7,7 @@ trap 'rm -rf /tmp/tools.zip 2>/dev/null' INT TERM EXIT CUR_DIR="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)" CUR_DIR="${CUR_DIR/setup/}" -SDK_TOOLS=commandlinetools-linux-6858069_latest.zip +SDK_TOOLS=commandlinetools-linux-7583922_latest.zip function setup_android_sdk() { echo "Installing Android SDK" From 783bf3d782c31f86d8a2174f85a03b994fe91af7 Mon Sep 17 00:00:00 2001 From: Kn0ax <42520461+Kn0ax@users.noreply.github.com> Date: Tue, 11 Jan 2022 14:56:20 +0100 Subject: [PATCH 03/36] removed -get --- setup/android_build_env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/android_build_env.sh b/setup/android_build_env.sh index 9e0c16b4..b4340c54 100755 --- a/setup/android_build_env.sh +++ b/setup/android_build_env.sh @@ -14,7 +14,7 @@ DEBIAN_11_PACKAGES="libncurses5" PACKAGES="" echo "Adding GitHub apt key and repository!" -sudo apt-get install software-properties-common -y +sudo apt install software-properties-common -y sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0 sudo apt-add-repository https://cli.github.com/packages From 3c30dcd60e3d8cc2d0e4ab9ffde5fcd7af9de710 Mon Sep 17 00:00:00 2001 From: Gerardo Doro Date: Mon, 24 Jan 2022 22:14:57 +0100 Subject: [PATCH 04/36] Update android_build_env.sh Fixed `gpg: keyserver receive failed: Server indicated a failure error` when `sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0` --- setup/android_build_env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/android_build_env.sh b/setup/android_build_env.sh index b4340c54..9a035683 100755 --- a/setup/android_build_env.sh +++ b/setup/android_build_env.sh @@ -15,7 +15,7 @@ PACKAGES="" echo "Adding GitHub apt key and repository!" sudo apt install software-properties-common -y -sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0 +sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C99B11DEB97541F0 sudo apt-add-repository https://cli.github.com/packages sudo apt update From bc4c85fbc8d2616571ceeebee767002598183575 Mon Sep 17 00:00:00 2001 From: SahilSonar Date: Sat, 29 Jan 2022 16:46:27 +0530 Subject: [PATCH 05/36] scripts: github: Add script to push all repos from manifest to github --- github/push-all-repos-git.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 github/push-all-repos-git.sh diff --git a/github/push-all-repos-git.sh b/github/push-all-repos-git.sh new file mode 100644 index 00000000..fffb5827 --- /dev/null +++ b/github/push-all-repos-git.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# A github script to push all repositories from a manifest + +# This again, will have to be adapted based on your setup. + +cwd=$PWD +PROJECTS="$(grep 'aosip' .repo/manifests/aosip.xml | awk '{print $2}' | awk -F'"' '{print $2}' | uniq | grep -v caf)" +for project in ${PROJECTS}; do + cd "$project" || exit + git push git@github.com:AOSIP/"$(git remote -v | head -n1 | awk '{print $2}' | sed 's/.*\///' | sed 's/\.git//')".git HEAD:refs/heads/nougat-mr2 + cd - || exit +done +cd "$cwd" || exit From ea3f4326d3b383e229d89722b6186f48ba3fb4d4 Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Thu, 17 Feb 2022 09:43:12 +0530 Subject: [PATCH 06/36] android_build_env: Install libswitch-perl as well Required to compile MTK libs --- setup/android_build_env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/android_build_env.sh b/setup/android_build_env.sh index b4340c54..0f212e23 100755 --- a/setup/android_build_env.sh +++ b/setup/android_build_env.sh @@ -46,7 +46,7 @@ sudo DEBIAN_FRONTEND=noninteractive \ maven ncftp ncurses-dev patch patchelf pkg-config pngcrush \ pngquant python2.7 python-all-dev re2c schedtool squashfs-tools subversion \ texinfo unzip w3m xsltproc zip zlib1g-dev lzip \ - libxml-simple-perl apt-utils gh \ + libxml-simple-perl libswitch-perl apt-utils gh \ ${PACKAGES} -y echo -e "Setting up udev rules for adb!" From ae8bcbd5f728e61fb02456adfcd1c341f30dc169 Mon Sep 17 00:00:00 2001 From: Stefen Wakefield Date: Sun, 20 Mar 2022 21:18:04 -0500 Subject: [PATCH 07/36] android_build_env: use upgrade to hkps for keyserver because why not --- setup/android_build_env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/android_build_env.sh b/setup/android_build_env.sh index c4d8a4c4..372385c5 100755 --- a/setup/android_build_env.sh +++ b/setup/android_build_env.sh @@ -15,7 +15,7 @@ PACKAGES="" echo "Adding GitHub apt key and repository!" sudo apt install software-properties-common -y -sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C99B11DEB97541F0 +sudo apt-key adv --keyserver hkps://keyserver.ubuntu.com --recv-key C99B11DEB97541F0 sudo apt-add-repository https://cli.github.com/packages sudo apt update From b606b67e13827eefa8f53be2ff6aebc5e42ceb9a Mon Sep 17 00:00:00 2001 From: Gokul GK <8915158+gokulkgm@users.noreply.github.com> Date: Tue, 29 Mar 2022 21:34:46 +0530 Subject: [PATCH 08/36] setup: ccache: Update SCM protocol to https --- setup/ccache.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/ccache.sh b/setup/ccache.sh index 6f16cf43..b295704b 100755 --- a/setup/ccache.sh +++ b/setup/ccache.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash cd /tmp || exit 1 -git clone git://github.com/ccache/ccache.git +git clone https://github.com/ccache/ccache.git cd ccache || exit 1 ./autogen.sh ./configure --disable-man --with-libzstd-from-internet --with-libb2-from-internet From 67eb0508849c6ebd32eb9251979e60e332983d98 Mon Sep 17 00:00:00 2001 From: Gokul GK <8915158+gokulkgm@users.noreply.github.com> Date: Fri, 22 Apr 2022 08:01:46 +0530 Subject: [PATCH 09/36] setup: android_build_env: extend focal packages to jammy as well --- setup/android_build_env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/android_build_env.sh b/setup/android_build_env.sh index 372385c5..a005c25b 100755 --- a/setup/android_build_env.sh +++ b/setup/android_build_env.sh @@ -27,7 +27,7 @@ LSB_RELEASE="$(lsb_release -d | cut -d ':' -f 2 | sed -e 's/^[[:space:]]*//')" if [[ ${LSB_RELEASE} =~ "Mint 18" || ${LSB_RELEASE} =~ "Ubuntu 16" ]]; then PACKAGES="${UBUNTU_16_PACKAGES}" -elif [[ ${LSB_RELEASE} =~ "Ubuntu 20" || ${LSB_RELEASE} =~ "Ubuntu 21" ]]; then +elif [[ ${LSB_RELEASE} =~ "Ubuntu 20" || ${LSB_RELEASE} =~ "Ubuntu 21" || ${LSB_RELEASE} =~ "Ubuntu 22" ]]; then PACKAGES="${UBUNTU_20_PACKAGES}" elif [[ ${LSB_RELEASE} =~ "Debian GNU/Linux 10" ]]; then PACKAGES="${DEBIAN_10_PACKAGES}" From bd07812ee27bfbc5d49633d31d976a0a9fda6747 Mon Sep 17 00:00:00 2001 From: Pig <23kongw@brrice.edu> Date: Thu, 2 Jun 2022 12:31:16 -0400 Subject: [PATCH 10/36] Add libxcrypt-compat for Arch env setup Fixes the following: perl: error while loading shared libraries: libcrypt.so.1: cannot open shared ob ject file: No such file or directory make[2]: *** [/home/pppig236/loss/kernel/xiaomi/sm6150/kernel/Makefile:135: kern el/kheaders_data.tar.xz] Error 127 --- setup/arch-manjaro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/arch-manjaro.sh b/setup/arch-manjaro.sh index f01b0ea3..3a307c79 100755 --- a/setup/arch-manjaro.sh +++ b/setup/arch-manjaro.sh @@ -12,7 +12,7 @@ echo '[2/4] Syncing repositories and updating system packages' sudo pacman -Syyu --noconfirm --needed multilib-devel # Install android build prerequisites echo '[3/4] Installing Android building prerequisites' -packages="ncurses5-compat-libs lib32-ncurses5-compat-libs aosp-devel xml2 lineageos-devel" +packages="ncurses5-compat-libs lib32-ncurses5-compat-libs aosp-devel xml2 lineageos-devel libxcrypt-compat" for package in $packages; do echo "Installing $package" git clone https://aur.archlinux.org/"$package" From d7921f5033a6dd32ccb06c5d5fabc1a80579c8e7 Mon Sep 17 00:00:00 2001 From: Kunmun Date: Tue, 21 Jun 2022 13:34:37 +0530 Subject: [PATCH 11/36] setup: android_build_env: Update the installation of GitHub CLI package Following the official procedure as mentioned in [1]. The previous method was deprecated leaving behind an error with missing repository as [2] doesn't exist. Reference: [1] https://github.com/cli/cli/blob/trunk/docs/install_linux.md\#debian-ubuntu-linux-raspberry-pi-os-apt [2] https://cli.github.com/packages --- setup/android_build_env.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/setup/android_build_env.sh b/setup/android_build_env.sh index a005c25b..b7898355 100755 --- a/setup/android_build_env.sh +++ b/setup/android_build_env.sh @@ -13,11 +13,7 @@ DEBIAN_10_PACKAGES="libncurses5" DEBIAN_11_PACKAGES="libncurses5" PACKAGES="" -echo "Adding GitHub apt key and repository!" sudo apt install software-properties-common -y -sudo apt-key adv --keyserver hkps://keyserver.ubuntu.com --recv-key C99B11DEB97541F0 -sudo apt-add-repository https://cli.github.com/packages - sudo apt update # Install lsb-core packages @@ -38,7 +34,7 @@ fi sudo DEBIAN_FRONTEND=noninteractive \ apt install \ adb autoconf automake axel bc bison build-essential \ - ccache clang cmake expat fastboot flex g++ \ + ccache clang cmake curl expat fastboot flex g++ \ g++-multilib gawk gcc gcc-multilib git gnupg gperf \ htop imagemagick lib32ncurses5-dev lib32z1-dev libtinfo5 libc6-dev libcap-dev \ libexpat1-dev libgmp-dev '^liblz4-.*' '^liblzma.*' libmpc-dev libmpfr-dev libncurses5-dev \ @@ -46,9 +42,15 @@ sudo DEBIAN_FRONTEND=noninteractive \ maven ncftp ncurses-dev patch patchelf pkg-config pngcrush \ pngquant python2.7 python-all-dev re2c schedtool squashfs-tools subversion \ texinfo unzip w3m xsltproc zip zlib1g-dev lzip \ - libxml-simple-perl libswitch-perl apt-utils gh \ + libxml-simple-perl libswitch-perl apt-utils \ ${PACKAGES} -y +echo -e "Install GitHub CLI" +curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg +echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null +sudo apt update +sudo apt install -y gh + echo -e "Setting up udev rules for adb!" sudo curl --create-dirs -L -o /etc/udev/rules.d/51-android.rules -O -L https://raw.githubusercontent.com/M0Rf30/android-udev-rules/master/51-android.rules sudo chmod 644 /etc/udev/rules.d/51-android.rules From 73851179ce3f4c349f47f6781da4ebc701188401 Mon Sep 17 00:00:00 2001 From: Akhil Narang Date: Mon, 27 Jun 2022 17:32:47 +0530 Subject: [PATCH 12/36] Add in a comment, add in a missing command from github's install docs Signed-off-by: Akhil Narang --- setup/android_build_env.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup/android_build_env.sh b/setup/android_build_env.sh index b7898355..913c1673 100755 --- a/setup/android_build_env.sh +++ b/setup/android_build_env.sh @@ -45,8 +45,9 @@ sudo DEBIAN_FRONTEND=noninteractive \ libxml-simple-perl libswitch-perl apt-utils \ ${PACKAGES} -y -echo -e "Install GitHub CLI" +echo -e "Installing GitHub CLI" curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg +sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null sudo apt update sudo apt install -y gh From 2cd4ed12583a0efd4bb433a7d8c544207f4c2bd7 Mon Sep 17 00:00:00 2001 From: aashil123 <34879849+aashil123@users.noreply.github.com> Date: Fri, 1 Jul 2022 12:01:11 +0530 Subject: [PATCH 13/36] Arch env install font as well Bare arch server setup doesn't have a font which throws this error while compling -https://katb.in/axoxiyibumo --- setup/arch-manjaro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/arch-manjaro.sh b/setup/arch-manjaro.sh index 3a307c79..3640d433 100755 --- a/setup/arch-manjaro.sh +++ b/setup/arch-manjaro.sh @@ -9,7 +9,7 @@ echo '[1/4] Enabling multilib repo' sudo sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf # Sync, update, and prepare system echo '[2/4] Syncing repositories and updating system packages' -sudo pacman -Syyu --noconfirm --needed multilib-devel +sudo pacman -Syyu --noconfirm --needed multilib-devel fontconfig ttf-droid # Install android build prerequisites echo '[3/4] Installing Android building prerequisites' packages="ncurses5-compat-libs lib32-ncurses5-compat-libs aosp-devel xml2 lineageos-devel libxcrypt-compat" From c80dee83c91396d4dbfaff73cab457c51f3075e6 Mon Sep 17 00:00:00 2001 From: Mohammad Hasan Keramat J Date: Tue, 6 Sep 2022 02:44:11 +0430 Subject: [PATCH 14/36] setup: fedora: Add clang * Fedora 31 -> 36 Signed-off-by: Mohammad Hasan Keramat J --- setup/fedora.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup/fedora.sh b/setup/fedora.sh index e357786c..5418499c 100755 --- a/setup/fedora.sh +++ b/setup/fedora.sh @@ -3,7 +3,7 @@ # SPDX-License-Identifier: GPL-3.0-only # # Script to setup an Android 10 build -# environment for Fedora 31 / Rawhide. +# environment for Fedora 36 / Rawhide. # Packages sudo dnf install \ @@ -12,6 +12,7 @@ sudo dnf install \ bison \ bzip2 \ ccache \ + clang \ curl \ flex \ gawk \ From e61f66424b0534dae6277743aad7d355ac827d99 Mon Sep 17 00:00:00 2001 From: Arrowsploit Date: Sun, 13 Nov 2022 14:50:32 +0530 Subject: [PATCH 15/36] Arch-Androidenvsetup: Don't install libxcrypt-compat from AUR * The package "libxcrypt-compat" is available in Archlinux core repository : https://archlinux.org/packages/core/x86_64/libxcrypt-compat Also it's getting installed by aosp-devel as a dependency : https://aur.archlinux.org/cgit/aur.git/commit/PKGBUILD?h=aosp-devel&id=8cf0210389af8c1b082f746144e56930c9cf7cd8 Therefore if we clone it from aur and compile, it generates an older version of package and as we using --noconfirm option, it downgrades the package without asking. So let aosp-devel do the job of installing it. Signed-off-by: Arrowsploit --- setup/arch-manjaro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/arch-manjaro.sh b/setup/arch-manjaro.sh index 3a307c79..f01b0ea3 100755 --- a/setup/arch-manjaro.sh +++ b/setup/arch-manjaro.sh @@ -12,7 +12,7 @@ echo '[2/4] Syncing repositories and updating system packages' sudo pacman -Syyu --noconfirm --needed multilib-devel # Install android build prerequisites echo '[3/4] Installing Android building prerequisites' -packages="ncurses5-compat-libs lib32-ncurses5-compat-libs aosp-devel xml2 lineageos-devel libxcrypt-compat" +packages="ncurses5-compat-libs lib32-ncurses5-compat-libs aosp-devel xml2 lineageos-devel" for package in $packages; do echo "Installing $package" git clone https://aur.archlinux.org/"$package" From be34c745f75e0331bb4464e2170146a2c94e5306 Mon Sep 17 00:00:00 2001 From: Giovix92 Date: Fri, 23 Dec 2022 14:22:38 +0100 Subject: [PATCH 16/36] setup: android_build_env: Add support for PopOS The script works across all 2x.xx versions of PopOS (LTS/non-LTS), just add the required checks to let it join the roster. Change-Id: I9b108b18814462b5a838f0dc8574c58b90c7e495 --- setup/android_build_env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/android_build_env.sh b/setup/android_build_env.sh index 913c1673..bb6e1051 100755 --- a/setup/android_build_env.sh +++ b/setup/android_build_env.sh @@ -23,7 +23,7 @@ LSB_RELEASE="$(lsb_release -d | cut -d ':' -f 2 | sed -e 's/^[[:space:]]*//')" if [[ ${LSB_RELEASE} =~ "Mint 18" || ${LSB_RELEASE} =~ "Ubuntu 16" ]]; then PACKAGES="${UBUNTU_16_PACKAGES}" -elif [[ ${LSB_RELEASE} =~ "Ubuntu 20" || ${LSB_RELEASE} =~ "Ubuntu 21" || ${LSB_RELEASE} =~ "Ubuntu 22" ]]; then +elif [[ ${LSB_RELEASE} =~ "Ubuntu 20" || ${LSB_RELEASE} =~ "Ubuntu 21" || ${LSB_RELEASE} =~ "Ubuntu 22" || ${LSB_RELEASE} =~ 'Pop!_OS 2' ]]; then PACKAGES="${UBUNTU_20_PACKAGES}" elif [[ ${LSB_RELEASE} =~ "Debian GNU/Linux 10" ]]; then PACKAGES="${DEBIAN_10_PACKAGES}" From 9aeb2929c6c422ed511e0ae88d4c36e4d71db69a Mon Sep 17 00:00:00 2001 From: LeddaZ Date: Mon, 26 Dec 2022 18:08:01 +0100 Subject: [PATCH 17/36] scripts: fedora: Update for F37 --- setup/fedora.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/setup/fedora.sh b/setup/fedora.sh index 5418499c..eb8f5ba7 100755 --- a/setup/fedora.sh +++ b/setup/fedora.sh @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: GPL-3.0-only # -# Script to setup an Android 10 build -# environment for Fedora 36 / Rawhide. +# Script to setup an Android 10+ build +# environment for Fedora 37 / Rawhide. # Packages sudo dnf install \ @@ -44,7 +44,6 @@ sudo dnf install \ openssl-devel \ java-1.8.0-openjdk-devel \ ImageMagick \ - ncurses-compat-libs \ schedtool \ lzip \ vboot-utils \ @@ -53,6 +52,8 @@ sudo dnf install \ # The package libncurses5 is not available, so we need to hack our way by symlinking the required library. sudo ln -s /usr/lib/libncurses.so.6 /usr/lib/libncurses.so.5 sudo ln -s /usr/lib/libncurses.so.6 /usr/lib/libtinfo.so.5 +sudo ln -s /usr/lib64/libncurses.so.6 /usr/lib64/libncurses.so.5 +sudo ln -s /usr/lib64/libncurses.so.6 /usr/lib64/libtinfo.so.5 # Repo echo "Installing Git Repository Tool" From 9653c7d5bd819c1879055b4b3f7bf3b6c8642f99 Mon Sep 17 00:00:00 2001 From: Sipun Ku Mahanta Date: Mon, 2 Jan 2023 05:50:22 +0000 Subject: [PATCH 18/36] scripts: setup: Revive crowdin cli installation script - Source -https://github.com/crowdin/crowdin-cli#installation Change-Id: Id529f6840c3763ef5b9125f7107efaf1e996d78f Signed-off-by: Sipun Ku Mahanta --- setup/crowdin-cli.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/setup/crowdin-cli.sh b/setup/crowdin-cli.sh index 0460b2f9..216d0930 100755 --- a/setup/crowdin-cli.sh +++ b/setup/crowdin-cli.sh @@ -3,6 +3,12 @@ # Script to setup environment for crowdin # shellcheck disable=SC1010 -sudo apt install python-git -curl -sSL https://get.rvm.io | bash -s stable --ruby -rvm all do gem install crowdin-cli +# Install crowdin-cli +wget https://artifacts.crowdin.com/repo/deb/crowdin3.deb -O crowdin.deb +sudo dpkg -i crowdin.deb +echo "crowdin-cli installed" +echo "" + +# Test crowdin-cli +echo "Your crowdin version:" +crowdin --version \ No newline at end of file From 7db88877a878d401de5fb8b5093eac4041703518 Mon Sep 17 00:00:00 2001 From: Arrowsploit Date: Wed, 5 Apr 2023 14:18:36 +0530 Subject: [PATCH 19/36] setup: Install git-lfs * Some custom rom sources started using git-lfs. Installing this Git extension will allow us to track those larger files from remote server Signed-off-by: Arrowsploit --- setup/android_build_env.sh | 2 +- setup/arch-manjaro.sh | 2 +- setup/fedora.sh | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/setup/android_build_env.sh b/setup/android_build_env.sh index bb6e1051..3bc45dc0 100755 --- a/setup/android_build_env.sh +++ b/setup/android_build_env.sh @@ -35,7 +35,7 @@ sudo DEBIAN_FRONTEND=noninteractive \ apt install \ adb autoconf automake axel bc bison build-essential \ ccache clang cmake curl expat fastboot flex g++ \ - g++-multilib gawk gcc gcc-multilib git gnupg gperf \ + g++-multilib gawk gcc gcc-multilib git git-lfs gnupg gperf \ htop imagemagick lib32ncurses5-dev lib32z1-dev libtinfo5 libc6-dev libcap-dev \ libexpat1-dev libgmp-dev '^liblz4-.*' '^liblzma.*' libmpc-dev libmpfr-dev libncurses5-dev \ libsdl1.2-dev libssl-dev libtool libxml2 libxml2-utils '^lzma.*' lzop \ diff --git a/setup/arch-manjaro.sh b/setup/arch-manjaro.sh index 36b07318..b7b88a56 100755 --- a/setup/arch-manjaro.sh +++ b/setup/arch-manjaro.sh @@ -9,7 +9,7 @@ echo '[1/4] Enabling multilib repo' sudo sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf # Sync, update, and prepare system echo '[2/4] Syncing repositories and updating system packages' -sudo pacman -Syyu --noconfirm --needed multilib-devel fontconfig ttf-droid +sudo pacman -Syyu --noconfirm --needed git git-lfs multilib-devel fontconfig ttf-droid # Install android build prerequisites echo '[3/4] Installing Android building prerequisites' packages="ncurses5-compat-libs lib32-ncurses5-compat-libs aosp-devel xml2 lineageos-devel" diff --git a/setup/fedora.sh b/setup/fedora.sh index eb8f5ba7..cb3d0e74 100755 --- a/setup/fedora.sh +++ b/setup/fedora.sh @@ -18,6 +18,7 @@ sudo dnf install \ gawk \ gcc-c++ \ git \ + git-lfs \ glibc-devel \ glibc-static \ libstdc++-static \ From eab9b8b5428020f85278c1d4f29add5a01b8e696 Mon Sep 17 00:00:00 2001 From: TogoFire Date: Wed, 9 Nov 2022 22:39:30 -0300 Subject: [PATCH 20/36] setup: add in openSUSE setup script Change-Id: 133113140ac60ed39c891d37cbe66c6b4c3b4e99 Signed-off-by: TogoFire --- setup/opensuse.sh | 94 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 setup/opensuse.sh diff --git a/setup/opensuse.sh b/setup/opensuse.sh new file mode 100644 index 00000000..f3c8480e --- /dev/null +++ b/setup/opensuse.sh @@ -0,0 +1,94 @@ +#!/usr/bin/env bash + +# Script to setup an android build environment for openSUSE. + +# openSUSE Mirrors (https://github.com/Firstyear/mirrorsorcerer) +sudo zypper in mirrorsorcerer +sudo systemctl enable --now mirrorsorcerer + +# Packages +sudo zypper install \ + android-tools \ + autoconf213 \ + bc \ + bison \ + bzip2 \ + ccache \ + clang \ + curl \ + flex \ + gawk \ + gpg2 \ + gperf \ + gcc-c++ \ + git \ + git-lfs \ + glibc-devel \ + ImageMagick \ + java-11-openjdk \ + java-1_8_0-openjdk \ + java-1_8_0-openjdk-devel \ + liblz4-1 \ + libncurses5 \ + libncurses6 \ + libpopt0 \ + libressl-devel \ + libstdc++6\ + libX11-6 \ + libxml2-tools \ + libxslt1 \ + libX11-devel \ + libXrandr2 \ + lzip \ + lzop \ + kernel-devel \ + maven \ + make \ + megatools \ + Mesa-libGL1 \ + Mesa-libGL-devel \ + mokutil \ + nano \ + neofetch \ + ncurses5-devel \ + ncurses-devel \ + openssl \ + opi \ + patch \ + perl-Digest-SHA1 \ + python \ + python-rpm-generators \ + readline-devel \ + schedtool \ + screenfetch \ + sha3sum \ + squashfs \ + vim \ + wget \ + wireguard-tools \ + xf86-video-intel \ + zip \ + zlib-devel + +# Devel Basis on OpenSUSE (https://darryldias.me/2020/devel-basis-on-opensuse-sle/) +sudo zypper install -t pattern devel_basis + +# The package libncurses5 is not available, so we need to hack our way by symlinking the required library. +sudo ln -s /usr/lib/libncurses.so.6 /usr/lib/libncurses.so.5 +sudo ln -s /usr/lib/libncurses.so.6 /usr/lib/libtinfo.so.5 +sudo ln -s /usr/lib64/libncurses.so.6 /usr/lib64/libncurses.so.5 +sudo ln -s /usr/lib64/libncurses.so.6 /usr/lib64/libtinfo.so.5 + +# Repo +echo "Installing Git Repository Tool" +sudo curl --create-dirs -L -o /usr/local/bin/repo -O -L https://storage.googleapis.com/git-repo-downloads/repo +sudo chmod a+rx /usr/local/bin/repo + +echo -e "Setting up udev rules for ADB!" +sudo curl --create-dirs -L -o /etc/udev/rules.d/51-android.rules -O -L https://raw.githubusercontent.com/M0Rf30/android-udev-rules/master/51-android.rules +sudo chmod 644 /etc/udev/rules.d/51-android.rules +sudo chown root /etc/udev/rules.d/51-android.rules +sudo udevadm control --reload-rules + +# Set default editor +git config --global core.editor "nano" From 851851e1de4324ae89875e2581758e5e5bcde6cf Mon Sep 17 00:00:00 2001 From: Meghthedev Date: Sun, 23 Jul 2023 10:29:17 +0530 Subject: [PATCH 21/36] setup: Install rsync * some custom roms require rsync in build, "error: rsync command not found", Installing this by default in the script fixes it --- setup/android_build_env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/android_build_env.sh b/setup/android_build_env.sh index 3bc45dc0..f6f9fe57 100755 --- a/setup/android_build_env.sh +++ b/setup/android_build_env.sh @@ -42,7 +42,7 @@ sudo DEBIAN_FRONTEND=noninteractive \ maven ncftp ncurses-dev patch patchelf pkg-config pngcrush \ pngquant python2.7 python-all-dev re2c schedtool squashfs-tools subversion \ texinfo unzip w3m xsltproc zip zlib1g-dev lzip \ - libxml-simple-perl libswitch-perl apt-utils \ + libxml-simple-perl libswitch-perl apt-utils rsync \ ${PACKAGES} -y echo -e "Installing GitHub CLI" From 1569b14171e54e5b6e4e9f00450abdce39355044 Mon Sep 17 00:00:00 2001 From: Ruchit Date: Sat, 9 Sep 2023 18:26:59 +0530 Subject: [PATCH 22/36] setup: fedora: Install libxcrypt-compat Fixes perl: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory on fedora rawhide --- setup/fedora.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup/fedora.sh b/setup/fedora.sh index cb3d0e74..f50d47ec 100755 --- a/setup/fedora.sh +++ b/setup/fedora.sh @@ -48,7 +48,8 @@ sudo dnf install \ schedtool \ lzip \ vboot-utils \ - vim + vim \ + libxcrypt-compat # The package libncurses5 is not available, so we need to hack our way by symlinking the required library. sudo ln -s /usr/lib/libncurses.so.6 /usr/lib/libncurses.so.5 From b8f2bcb2aad192a452d75fbbd23b2a00037c6b1a Mon Sep 17 00:00:00 2001 From: Meghthedev Date: Sat, 9 Sep 2023 20:31:42 +0530 Subject: [PATCH 23/36] scripts: ccache: use cmake to configure build * follow the official working method current script yields the following error: ccache.sh: line 6: ./autogen.sh: No such file or directory ccache.sh: line 7: ./configure: No such file or directory make: *** No targets specified and no makefile found. Stop. [sudo] password for user: make: *** No rule to make target 'install'. Stop. /tmp autogen.sh no longer exists in the upstream repo --- setup/ccache.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup/ccache.sh b/setup/ccache.sh index b295704b..db026f1e 100755 --- a/setup/ccache.sh +++ b/setup/ccache.sh @@ -3,8 +3,8 @@ cd /tmp || exit 1 git clone https://github.com/ccache/ccache.git cd ccache || exit 1 -./autogen.sh -./configure --disable-man --with-libzstd-from-internet --with-libb2-from-internet +mkdir -p build && cd build || exit 1 +cmake -DHIREDIS_FROM_INTERNET=ON -DZSTD_FROM_INTERNET=ON -DCMAKE_BUILD_TYPE=Release .. make -j"$(nproc)" sudo make install rm -rf "${PWD}" From 6687c35e5e048469a41a6d28075535fb775577d6 Mon Sep 17 00:00:00 2001 From: Akhil Narang Date: Sat, 6 Apr 2024 13:50:12 +0530 Subject: [PATCH 24/36] Add in some script to parse android APNs and copy some attributes from one to another Signed-off-by: Akhil Narang --- random-py/apn.py | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100755 random-py/apn.py diff --git a/random-py/apn.py b/random-py/apn.py new file mode 100755 index 00000000..161d63ea --- /dev/null +++ b/random-py/apn.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python + +import sys +from pathlib import Path +from xml.etree import ElementTree + +# ./apn.py source.xml destination.xml +# If no arguments are provided, the user will be prompted to enter the file paths + +if len(sys.argv) < 3: + source = input("Enter the source XML path: ") + destination = input("Enter the destination XML path: ") +else: + source = sys.argv[1] + destination = sys.argv[2] + +source_path = Path(source) +destination_path = Path(destination) + +if not source_path.exists() or not destination_path.exists(): + print("Please ensure that both the files exist") + sys.exit(1) + +source_apn_xml = ElementTree.parse(source_path) +destination_apn_xml = ElementTree.parse(destination_path) + +tags_to_match = ("apn", "mcc", "mnc") +tags_to_copy = ("network_type_bitmask", "type") +required_tags = tags_to_match + tags_to_copy + +mapping = {} + +for child in source_apn_xml.getroot(): + if not all(tag in child.attrib for tag in required_tags): + continue + mapping["|".join([child.attrib[tag] for tag in tags_to_match])] = { + tag: child.attrib[tag] for tag in tags_to_copy + } + + +for child in destination_apn_xml.getroot(): + if not all(tag in child.attrib for tag in tags_to_match): + continue + key = "|".join([child.attrib[tag] for tag in tags_to_match]) + if key in mapping: + for tag in tags_to_copy: + child.attrib[tag] = mapping[key][tag] + +destination_apn_xml.write(destination) From 8e4fd70553163edd4d28ff47858e0b250b372fbe Mon Sep 17 00:00:00 2001 From: Akhil Narang Date: Sat, 6 Apr 2024 14:02:26 +0530 Subject: [PATCH 25/36] fix(apn): write with utf-8 encoding Signed-off-by: Akhil Narang --- random-py/apn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/random-py/apn.py b/random-py/apn.py index 161d63ea..1cfdf981 100755 --- a/random-py/apn.py +++ b/random-py/apn.py @@ -46,4 +46,4 @@ for tag in tags_to_copy: child.attrib[tag] = mapping[key][tag] -destination_apn_xml.write(destination) +destination_apn_xml.write(destination, encoding="utf-8") From b8dcd09dde776177af3668643422886ea0e6f3dc Mon Sep 17 00:00:00 2001 From: Akhil Narang Date: Sat, 6 Apr 2024 15:42:58 +0530 Subject: [PATCH 26/36] refactor: update script name in preparation for another Signed-off-by: Akhil Narang --- random-py/{apn.py => apn-copy-tag.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename random-py/{apn.py => apn-copy-tag.py} (100%) diff --git a/random-py/apn.py b/random-py/apn-copy-tag.py similarity index 100% rename from random-py/apn.py rename to random-py/apn-copy-tag.py From 1f2974abd5e29ed154c6487b7aba36128a7d520d Mon Sep 17 00:00:00 2001 From: Akhil Narang Date: Mon, 13 May 2024 11:43:00 +0530 Subject: [PATCH 27/36] chore: add in another script Soon to be updated by Omkar Signed-off-by: Akhil Narang --- random-py/apn-copy-entries.py | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 random-py/apn-copy-entries.py diff --git a/random-py/apn-copy-entries.py b/random-py/apn-copy-entries.py new file mode 100644 index 00000000..47403fec --- /dev/null +++ b/random-py/apn-copy-entries.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python + +import sys +from pathlib import Path +from xml.etree import ElementTree + +# ./apn.py source.xml destination.xml +# If no arguments are provided, the user will be prompted to enter the file paths + +if len(sys.argv) < 3: + source = input("Enter the source XML path: ") + destination = input("Enter the destination XML path: ") +else: + source = sys.argv[1] + destination = sys.argv[2] + +source_path = Path(source) +destination_path = Path(destination) + +if not source_path.exists() or not destination_path.exists(): + print("Please ensure that both the files exist") + sys.exit(1) + +source_apn_xml = ElementTree.parse(source_path) +destination_apn_xml = ElementTree.parse(destination_path) + +tags_to_match = ("mcc", "mnc") +tags_to_copy = ("apn",) +required_tags = tags_to_match + tags_to_copy + +destination_root = destination_apn_xml.getroot() + +combinations = set() + +for child in destination_root: + combinations.add("|".join([child.attrib[tag] for tag in tags_to_match])) + +for child in source_apn_xml.getroot(): + key = "|".join([child.attrib[tag] for tag in tags_to_match]) + if key in combinations: + destination_root.append(child) + +destination_apn_xml.write(destination, encoding="utf-8") From 10860bac21b99401fe050b6e572854d9e8950d9a Mon Sep 17 00:00:00 2001 From: Omkar Chandorkar Date: Sun, 7 Apr 2024 00:02:27 +0530 Subject: [PATCH 28/36] random: Add scripts to copy IMS APN as well as sort APNs (cherry picked from commit c6201a816f3029e00376aa93b40ebafee68e1190) Signed-off-by: Omkar Chandorkar Signed-off-by: Akhil Narang --- random-py/apn-copy-entries.py | 22 ++++++++++++++-------- random-py/sort_apn.py | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 8 deletions(-) create mode 100644 random-py/sort_apn.py diff --git a/random-py/apn-copy-entries.py b/random-py/apn-copy-entries.py index 47403fec..d397461f 100644 --- a/random-py/apn-copy-entries.py +++ b/random-py/apn-copy-entries.py @@ -4,7 +4,7 @@ from pathlib import Path from xml.etree import ElementTree -# ./apn.py source.xml destination.xml +# ./apn-copy-entries.py source.xml destination.xml # If no arguments are provided, the user will be prompted to enter the file paths if len(sys.argv) < 3: @@ -25,19 +25,25 @@ destination_apn_xml = ElementTree.parse(destination_path) tags_to_match = ("mcc", "mnc") -tags_to_copy = ("apn",) -required_tags = tags_to_match + tags_to_copy +tags_to_copy = ("apn") destination_root = destination_apn_xml.getroot() combinations = set() -for child in destination_root: - combinations.add("|".join([child.attrib[tag] for tag in tags_to_match])) +# Define a function to check if a child element is already in the destination root +def is_in_destination(child, destination_root): + for dest_child in destination_root: + if child.attrib == dest_child.attrib: + return True + return False +# Modify the loop that appends children from the source to the destination for child in source_apn_xml.getroot(): - key = "|".join([child.attrib[tag] for tag in tags_to_match]) - if key in combinations: - destination_root.append(child) + # Only consider children with apn='ims' + if child.attrib.get('apn') == 'ims': + # Only append the child if it is not already in the destination + if not is_in_destination(child, destination_root): + destination_root.append(child) destination_apn_xml.write(destination, encoding="utf-8") diff --git a/random-py/sort_apn.py b/random-py/sort_apn.py new file mode 100644 index 00000000..f52df7b1 --- /dev/null +++ b/random-py/sort_apn.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python + +import sys +from pathlib import Path +from xml.etree import ElementTree + +# ./sort_apn.py apns-conf.xml +# If no arguments are provided, the user will be prompted to enter the file paths + +if len(sys.argv) < 2: + apns = input("Enter the apns-conf XML path: ") +else: + apns = sys.argv[1] + +apns_path = Path(apns) + +if not apns_path.exists(): + print("Please ensure that the files exist") + sys.exit(1) + +def sort_apns(apns_path): + # Parse the XML file into an ElementTree + tree = ElementTree.parse(apns_path) + root = tree.getroot() + + # Sort the children of the root by 'mcc' and 'mnc' + root[:] = sorted(root, key=lambda child: (child.attrib.get('mcc', ''), child.attrib.get('mnc', ''))) + + # Write the sorted ElementTree back into the XML file + with open(apns_path, 'wb') as f: + f.write(ElementTree.tostring(root, encoding='utf-8')) + +# Call the function with the XML file path +sort_apns(apns_path) From 7c1bc0990dd0ca79b8f51b24024d67a74ea2ea1c Mon Sep 17 00:00:00 2001 From: Akhil Narang Date: Mon, 13 May 2024 11:45:36 +0530 Subject: [PATCH 29/36] fix: set the new scripts as executable Signed-off-by: Akhil Narang --- random-py/apn-copy-entries.py | 0 random-py/sort_apn.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 random-py/apn-copy-entries.py mode change 100644 => 100755 random-py/sort_apn.py diff --git a/random-py/apn-copy-entries.py b/random-py/apn-copy-entries.py old mode 100644 new mode 100755 diff --git a/random-py/sort_apn.py b/random-py/sort_apn.py old mode 100644 new mode 100755 From 93a17e4b29f88f13bd1b58bec7c5a9e6c890e3b1 Mon Sep 17 00:00:00 2001 From: basamaryan Date: Tue, 5 Nov 2024 14:33:44 -0500 Subject: [PATCH 30/36] setup: Install pyelftools This is needed for Lineage's py extract utils --- setup/android_build_env.sh | 2 +- setup/arch-manjaro.sh | 2 +- setup/fedora.sh | 1 + setup/opensuse.sh | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/setup/android_build_env.sh b/setup/android_build_env.sh index f6f9fe57..c07331bd 100755 --- a/setup/android_build_env.sh +++ b/setup/android_build_env.sh @@ -40,7 +40,7 @@ sudo DEBIAN_FRONTEND=noninteractive \ libexpat1-dev libgmp-dev '^liblz4-.*' '^liblzma.*' libmpc-dev libmpfr-dev libncurses5-dev \ libsdl1.2-dev libssl-dev libtool libxml2 libxml2-utils '^lzma.*' lzop \ maven ncftp ncurses-dev patch patchelf pkg-config pngcrush \ - pngquant python2.7 python-all-dev re2c schedtool squashfs-tools subversion \ + pngquant python2.7 python3-pyelftools python-all-dev re2c schedtool squashfs-tools subversion \ texinfo unzip w3m xsltproc zip zlib1g-dev lzip \ libxml-simple-perl libswitch-perl apt-utils rsync \ ${PACKAGES} -y diff --git a/setup/arch-manjaro.sh b/setup/arch-manjaro.sh index b7b88a56..671761de 100755 --- a/setup/arch-manjaro.sh +++ b/setup/arch-manjaro.sh @@ -9,7 +9,7 @@ echo '[1/4] Enabling multilib repo' sudo sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf # Sync, update, and prepare system echo '[2/4] Syncing repositories and updating system packages' -sudo pacman -Syyu --noconfirm --needed git git-lfs multilib-devel fontconfig ttf-droid +sudo pacman -Syyu --noconfirm --needed git git-lfs multilib-devel fontconfig ttf-droid python-pyelftools # Install android build prerequisites echo '[3/4] Installing Android building prerequisites' packages="ncurses5-compat-libs lib32-ncurses5-compat-libs aosp-devel xml2 lineageos-devel" diff --git a/setup/fedora.sh b/setup/fedora.sh index f50d47ec..23e4ca36 100755 --- a/setup/fedora.sh +++ b/setup/fedora.sh @@ -40,6 +40,7 @@ sudo dnf install \ zip \ perl-Digest-SHA \ python2 \ + python3-pyelftools \ wget \ lzop \ openssl-devel \ diff --git a/setup/opensuse.sh b/setup/opensuse.sh index f3c8480e..b4b92af1 100644 --- a/setup/opensuse.sh +++ b/setup/opensuse.sh @@ -58,6 +58,7 @@ sudo zypper install \ perl-Digest-SHA1 \ python \ python-rpm-generators \ + python3-pyelftools \ readline-devel \ schedtool \ screenfetch \ From cfc9031bbe6b3fdda0bf76c1802f71601b3dc8d5 Mon Sep 17 00:00:00 2001 From: jensgrunzer1 <125598768+jensgrunzer1@users.noreply.github.com> Date: Fri, 28 Mar 2025 07:29:43 +0100 Subject: [PATCH 31/36] Aur helpers (#210) * Update arch-manjaro.sh * Update arch-manjaro.sh --- setup/arch-manjaro.sh | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/setup/arch-manjaro.sh b/setup/arch-manjaro.sh index 671761de..0a742f48 100755 --- a/setup/arch-manjaro.sh +++ b/setup/arch-manjaro.sh @@ -13,15 +13,22 @@ sudo pacman -Syyu --noconfirm --needed git git-lfs multilib-devel fontconfig ttf # Install android build prerequisites echo '[3/4] Installing Android building prerequisites' packages="ncurses5-compat-libs lib32-ncurses5-compat-libs aosp-devel xml2 lineageos-devel" -for package in $packages; do - echo "Installing $package" - git clone https://aur.archlinux.org/"$package" - cd "$package" || exit - makepkg -si --skippgpcheck --noconfirm --needed - cd - || exit - rm -rf "$package" -done - +if command -v paru 2>&1 >/dev/null +then + paru -S --noconfirm --needed $packages +elif command -v yay 2>&1 >/dev/null +then + yay -S --noconfirm --needed $packages +else + for package in $packages; do + echo "Installing $package" + git clone https://aur.archlinux.org/"$package" + cd "$package" || exit + makepkg -si --skippgpcheck --noconfirm --needed + cd - || exit + rm -rf "$package" + done +fi # Install adb and associated udev rules echo '[4/4] Installing adb convenience tools' sudo pacman -S --noconfirm --needed android-tools android-udev From de6cca8268026dfa7bd5745fb743baeaa19d8ed2 Mon Sep 17 00:00:00 2001 From: Akhil Narang Date: Fri, 18 Apr 2025 17:29:07 +0530 Subject: [PATCH 32/36] feat: add in a script to install `acpi_call` Required for https://www.reddit.com/r/linuxhardware/comments/y9ex5s/comment/lg0kjf8/ https://github.com/Kuchteq/asus-shutter-linux/ Signed-off-by: Akhil Narang --- setup/acpi_call.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 setup/acpi_call.sh diff --git a/setup/acpi_call.sh b/setup/acpi_call.sh new file mode 100755 index 00000000..1cfed88f --- /dev/null +++ b/setup/acpi_call.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + + +lsmod | rg -q acpi_call && { + echo "acpi_call already installed"; + exit 0; +} + +git clone https://github.com/nix-community/acpi_call /tmp/acpi_call +make -C /tmp/acpi_call +sudo make -C /tmp/acpi_call install +sudo depmod -a +sudo modprobe acpi_call +rm -rf /tmp/acpi_call/ From 366cd95f4719cf0f04ab4b31c9752b38ac9b99cc Mon Sep 17 00:00:00 2001 From: Akhil Narang Date: Fri, 18 Apr 2025 17:31:45 +0530 Subject: [PATCH 33/36] chore: add in an alias to trigger my zenbook 14X camera on/off Credits to https://www.reddit.com/r/linuxhardware/comments/y9ex5s/comment/lg0kjf8/ https://github.com/Kuchteq/asus-shutter-linux/ Signed-off-by: Akhil Narang --- aliases | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aliases b/aliases index 568b1ed2..a89e2c2a 100755 --- a/aliases +++ b/aliases @@ -19,3 +19,6 @@ export EDITOR="nano" # Set timezone export TZ="Asia/Kolkata" + +alias camera_off="echo '\_SB.ATKD.WMNB 0x00 0x53564544 0x0000000000060078' | sudo tee /proc/acpi/call" +alias camera_on="echo '\_SB.ATKD.WMNB 0x00 0x53564544 0x0000000100060078' | sudo tee /proc/acpi/call" From 8927ded9e9a86667ca104cdc6f5897bcc12f5982 Mon Sep 17 00:00:00 2001 From: Akhil Narang Date: Fri, 18 Apr 2025 17:32:50 +0530 Subject: [PATCH 34/36] fix: shellcheck workflow Use ubuntu-latest, checkout@v4 Signed-off-by: Akhil Narang --- .github/workflows/shellcheck.yml | 4 ++-- files | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index 7ba50010..e10d5014 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -3,9 +3,9 @@ name: ShellCheck scripts jobs: shellCheck: name: ShellCheck - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Run shellcheck. run: | while read -r script; do shellcheck --exclude=SC1090,SC1091 $script; done < files diff --git a/files b/files index 980f25ea..e9d6c1f0 100644 --- a/files +++ b/files @@ -29,6 +29,7 @@ rr/channel.sh rr/crowdin.sh rr/copy_ftp.sh rr/push_json.sh +setup/acpi_call.sh setup/android_build_env.sh setup/arch-manjaro.sh setup/ccache.sh From f28a7835e259e781f4aab96883f4fd281ba731da Mon Sep 17 00:00:00 2001 From: Vishal Cj Date: Thu, 15 May 2025 18:38:49 +0530 Subject: [PATCH 35/36] setup: fedora: Install openssl-devel-engine as well. (#212) fixes: /home/vishalcj17/build-box/vauxite/kernel/msm-5.4/scripts/extract-cert.c:24:10: fatal error: 'openssl/engine.h' file not found 24 | #include Signed-off-by: Vishalcj17 --- setup/fedora.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/setup/fedora.sh b/setup/fedora.sh index 23e4ca36..15504368 100755 --- a/setup/fedora.sh +++ b/setup/fedora.sh @@ -44,6 +44,7 @@ sudo dnf install \ wget \ lzop \ openssl-devel \ + openssl-devel-engine \ java-1.8.0-openjdk-devel \ ImageMagick \ schedtool \ From 18a2cc91208c9d213e8940182fdd7e79996ffdf7 Mon Sep 17 00:00:00 2001 From: Akhil Narang Date: Fri, 24 Oct 2025 21:45:17 +0530 Subject: [PATCH 36/36] feat: add in helper function to upload to katbin Signed-off-by: Akhil Narang --- functions | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/functions b/functions index 055f1cdb..6c1fced1 100755 --- a/functions +++ b/functions @@ -222,3 +222,19 @@ GDrive ID: \`${GDRIVE_UPLOAD_ID}\` tgm "${UPLOAD_INFO}" echo "Get the file with ${GDRIVE_UPLOAD_ID}" } + +# Paste content to katb.in +function katbin() { + local content + if [[ -z "$1" ]]; then + if [[ -t 0 ]]; then + echo "Error: No content provided. Provide as argument or pipe in." + return 1 + else + content=$(cat) + fi + else + content="$1" + fi + curl -sL 'https://katb.in/api/paste' --json '{"paste":{"content":"'"$content"'"}}' | jq -r '"https://katb.in/\(.id)"' +}