|
|
@@ -19,25 +19,36 @@ runs:
|
|
|
set -x
|
|
|
cd "$CONFIG"
|
|
|
echo "Building the kernel..."
|
|
|
+
|
|
|
+ # 1. Initialize variables as empty (clears them out for "default")
|
|
|
+ BAZEL_LTO=""
|
|
|
+ SCRIPT_LTO=""
|
|
|
+
|
|
|
+ # 2. Only populate if explicit modifications are requested
|
|
|
+ if [[ "$LTO" == "thin" || "$LTO" == "full" ]]; then
|
|
|
+ BAZEL_LTO="--lto=$LTO"
|
|
|
+ SCRIPT_LTO="LTO=$LTO"
|
|
|
+ fi
|
|
|
+
|
|
|
if [[ $BRANCH == SM-A055* || $BRANCH == SM-X926B* ]]; then
|
|
|
chmod +x build_kernel.sh
|
|
|
- LTO="$LTO" ./build_kernel.sh || true
|
|
|
+ env $SCRIPT_LTO ./build_kernel.sh || true
|
|
|
elif [[ $BRANCH == SM-S926* ]]; then
|
|
|
#tools/bazel run --nocheck_bzl_visibility --config=stamp --sandbox_debug --verbose_failures --debug_make_verbosity=I //projects/s5e9945:s5e9945_user_dist
|
|
|
- tools/bazel build --nocheck_bzl_visibility --config=stamp --sandbox_debug --verbose_failures --debug_make_verbosity=I --lto="$LTO" //projects/s5e9945:s5e9945_user
|
|
|
+ tools/bazel build --nocheck_bzl_visibility --config=stamp --sandbox_debug --verbose_failures --debug_make_verbosity=I $BAZEL_LTO //projects/s5e9945:s5e9945_user
|
|
|
elif [[ $BRANCH == SM-A556* ]]; then
|
|
|
#tools/bazel run --nocheck_bzl_visibility --config=stamp --sandbox_debug --verbose_failures --debug_make_verbosity=I //projects/s5e8845:s5e8845_user_dist
|
|
|
- tools/bazel build --nocheck_bzl_visibility --config=stamp --sandbox_debug --verbose_failures --debug_make_verbosity=I --lto="$LTO" //projects/s5e8845:s5e8845_user
|
|
|
+ tools/bazel build --nocheck_bzl_visibility --config=stamp --sandbox_debug --verbose_failures --debug_make_verbosity=I $BAZEL_LTO //projects/s5e8845:s5e8845_user
|
|
|
elif [[ $BRANCH == SM-S938B* ]]; then
|
|
|
sed -i '/drivers\/net\/usb\/smsc75xx\.ko/d;/drivers\/net\/usb\/smsc95xx\.ko/d' kernel_platform/common/modules.bzl
|
|
|
chmod +x build_kernel_GKI.sh
|
|
|
- LTO="$LTO" ./build_kernel_GKI.sh || true
|
|
|
+ env $SCRIPT_LTO ./build_kernel_GKI.sh || true
|
|
|
elif [[ $KERNEL_VER == 6.* ]]; then
|
|
|
chmod +x build_kernel_GKI.sh
|
|
|
- LTO="$LTO" ./build_kernel_GKI.sh || true
|
|
|
+ env $SCRIPT_LTO ./build_kernel_GKI.sh || true
|
|
|
elif [[ -d kernel_platform ]]; then
|
|
|
cd kernel_platform
|
|
|
- tools/bazel build --lto="$LTO" //common:kernel_aarch64
|
|
|
+ tools/bazel build $BAZEL_LTO //common:kernel_aarch64
|
|
|
fi
|
|
|
|
|
|
- name: start make build
|
|
|
@@ -49,12 +60,12 @@ runs:
|
|
|
cd "$CONFIG"
|
|
|
if [[ -f build_kernel_GKI.sh ]]; then
|
|
|
chmod +x build_kernel_GKI.sh
|
|
|
- LTO="$LTO" ./build_kernel_GKI.sh || true
|
|
|
+ env $SCRIPT_LTO ./build_kernel_GKI.sh || true
|
|
|
elif [[ -f build_kernel.sh ]]; then
|
|
|
sudo apt update
|
|
|
sudo apt-get install -y libyaml-dev
|
|
|
chmod +x build_kernel.sh
|
|
|
- LTO="$LTO" ./build_kernel.sh || true
|
|
|
+ env $SCRIPT_LTO ./build_kernel.sh || true
|
|
|
fi
|
|
|
|
|
|
#if [[ $BRANCH == SM-S928B* || "$BRANCH" == "SM-S938B-Oneui7" || "$BRANCH" == "SM-S931B-Oneui8" || "$BRANCH" == "SM-F741B-Oneui8" || "$BRANCH" == "SM-X710-Oneui6.1.1" ]]; then
|