Compare commits

...

4 Commits

Author SHA1 Message Date
ec06bb2377 add build-tools path 2025-11-28 14:20:57 -05:00
95894bc379 change required tools 2025-11-28 12:42:59 -05:00
5dad1e212b fix susfs patch 2025-11-28 12:36:34 -05:00
3b139f43d2 add susfs patch to track changes 2025-11-28 12:25:04 -05:00
2 changed files with 2303 additions and 4 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -26,12 +26,22 @@ set_vars() {
# We expect that we're going to be running out of [PROJECT]/meta, so we hop up one directory.
BASEDIR=$(realpath "$(dirname -- "$(realpath -- "${BASH_SOURCE[0]}")")/..")
# Add build-tools to PATH
PATH="${BASEDIR}/prebuilts/build-tools/linux-x86/bin:${PATH}"
# Build toolchain locations
CLANGDIR="${BASEDIR}/prebuilts/clang/host/linux-x86/clang-r547379"
GCCDIR="${BASEDIR}/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9"
GCCDIR32="${BASEDIR}/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9"
CLANGDIR="${BASEDIR}/prebuilts/clang/host/linux-x86/clang-r547379"
KERNELBUILDTOOLS="${BASEDIR}/prebuilts/kernel-build-tools/linux-x86"
# Array for all of the custom paths introduced by prebuilts
PREBUILTS_PATH=(
"${CLANGDIR}/bin"
"${GCCDIR}/bin"
"${KERNELBUILDTOOLS}/bin"
)
# Common options used for `make`, particularly for cross-compile
MAKEOPTS=(
O="${BASEDIR}/work"
@@ -44,6 +54,7 @@ set_vars() {
CLANG_TRIPLE=aarch64-linux-gnu-
)
# Environment tools that are already somewhere in the project so we'll use them instead of adding extra dependencies
BUSYBOX="${BASEDIR}/prebuilts/magisk/lib/x86_64/libbusybox.so"
MAGISKBOOT="${BASEDIR}/prebuilts/magisk/lib/x86_64/libmagiskboot.so"
@@ -53,8 +64,7 @@ set_vars() {
check_tools() {
# Ensure that we have everything we need to work before we get started.
TOOLS_NEEDED=()
[ ! -x "$(command -v make)" ] && TOOLS_NEEDED+=(make)
[ ! -x "$(command -v patch)" ] && TOOLS_NEEDED+=(patch)
[ ! -x "$(command -v curl)" ] && TOOLS_NEEDED+=(curl)
[ ! -x "$(command -v zip)" ] && TOOLS_NEEDED+=(zip)
if [ "${#TOOLS_NEEDED[@]}" -gt 0 ]; then
echo "You are missing: ${TOOLS_NEEDED[@]}"
@@ -102,7 +112,8 @@ add_susfs() {
cp "${BASEDIR}/external/susfs4ksu/kernel_patches/fs/"* "fs/" || { echo "Failed to copy fs patches"; exit 1; }
cp "${BASEDIR}/external/susfs4ksu/kernel_patches/include/linux/"* "include/linux/" || { echo "Failed to copy linux patches"; exit 1; }
patch --fuzz=3 -p1 < "${BASEDIR}/external/susfs4ksu/kernel_patches/50_add_susfs_in_gki-android15-6.6.patch" || { echo "Failed to patch kernel source for susfs"; exit 1; }
# Patch modified so that it works within a constrained environment
patch -p1 < "${BASEDIR}/meta/50_add_susfs_in_gki-android15-6.6.patch" || { echo "Failed to patch kernel source for susfs"; exit 1; }
popd > /dev/null
}