Skip to content

Commit e6a6d96

Browse files
committed
Make some changes 6 build with make
1 parent 01c9980 commit e6a6d96

File tree

1 file changed

+103
-87
lines changed

1 file changed

+103
-87
lines changed

.github/actions/action.yml

Lines changed: 103 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,97 +1056,97 @@ runs:
10561056
echo "CUSTOM_LOCALVERSION=$CUSTOM_LOCALVERSION" >> "$GITHUB_ENV"
10571057
echo "::endgroup::"
10581058
1059-
- name: Run sed and perl Commands
1060-
shell: bash
1061-
if: ${{ env.OP_KERNEL_VERSION == '6.12' }}
1062-
run: |
1063-
echo "Changing to configuration directory: $CONFIG..."
1064-
cd "$CONFIG/kernel_platform"
1065-
1066-
echo "Running sed commands..."
1067-
1068-
sed -i 's/CONFIG_LTO=n/CONFIG_LTO=y/' "./common/arch/arm64/configs/gki_defconfig"
1069-
sed -i 's/CONFIG_LTO_CLANG_FULL=y/CONFIG_LTO_CLANG_NONE=y/' "./common/arch/arm64/configs/gki_defconfig"
1070-
sed -i 's/CONFIG_LTO_CLANG_THIN=y/CONFIG_LTO_CLANG_NONE=y/' "./common/arch/arm64/configs/gki_defconfig"
1071-
cat >> ./common/arch/arm64/configs/gki_defconfig <<EOF
1072-
CONFIG_TCP_CONG_BIC=n
1073-
CONFIG_TCP_CONG_WESTWOOD=n
1074-
CONFIG_TCP_CONG_HTCP=n
1075-
CONFIG_LOCALVERSION="-OP-Wild"
1076-
CONFIG_ANDROID_BINDER_IPC_RUST=m
1077-
EOF
1078-
1079-
# sed -i '/_ARM64_GKI_MODULES_LIST = \[/,/\]/ {
1080-
# /\]/i\
1081-
# "net/ipv4/tcp_bic.ko",\
1082-
# "net/ipv4/tcp_htcp.ko",\
1083-
# "net/ipv4/tcp_westwood.ko",
1084-
# }' ./common/modules.bzl
1085-
1086-
# sed -i "s/$(printf '\044'){{kernelrelease}}/\"$(printf '\044'){{kernelrelease}}\"/g" ./build/kernel/kleaf/impl/kernel_modules_install.bzl
1087-
# sed -i -e '/_GKI_AARCH64_MAKE_GOALS/,/]/ s/"modules",\?//g' -e '/_GKI_AARCH64_MAKE_GOALS/,/]/ {/^[[:space:]]*$/d}' -e 's/module_implicit_outs = get_gki_modules_list("arm64") + get_kunit_modules_list("arm64")/module_implicit_outs = []/' common/BUILD.bazel
1088-
# sed -i -e 's/":tests_zip_arm64",//' -e '/extra_dist/,/]/ {/^[[:space:]]*$/d}' -e 's/kmi_enforced = True,/kmi_enforced = False,/' -e 's/kmi_symbol_list_strict_mode = True,/kmi_symbol_list_strict_mode = False,/' -e 's/trim_nonlisted_kmi = True,/trim_nonlisted_kmi = False,/' common/BUILD.bazel
1089-
1090-
# Run sed commands for modifications
1091-
sed -i 's/check_defconfig//' ./common/build.config.gki
1092-
1093-
if [[ "$OP_KERNEL_VERSION" == "6.12" ]]; then
1094-
sed -i '/check_defconfig = select({/,/}/c\ check_defconfig = "disabled"' ./build/kernel/kleaf/common_kernels.bzl
1095-
fi
1096-
1097-
# sed -i 's/echo "${KERNELVERSION}${file_localversion}${config_localversion}${LOCALVERSION}${scm_version}"/echo "${KERNEL_FULL_VER}${config_localversion}"/' ./common/scripts/setlocalversion
1098-
# chmod +x ./common/scripts/setlocalversion
1099-
sed -i "/stable_scmversion_cmd/s/-maybe-dirty//g" ./build/kernel/kleaf/impl/stamp.bzl || echo "No stamp.bzl!"
1100-
sed -i 's/-dirty//' ./build/kernel/kleaf/workspace_status_stamp.py || echo "No workspace_status_stamp.py!"
1101-
1102-
# Run perl command to modify UTS_VERSION
1103-
DATESTR=$(date -u)
1104-
perl -pi -e 's{UTS_VERSION="\$\(echo \$UTS_VERSION \$CONFIG_FLAGS \$TIMESTAMP \| cut -b -\$UTS_LEN\)"}{UTS_VERSION="#1 SMP PREEMPT $DATESTR"}' ./common/scripts/mkcompile_h
1059+
# - name: Run sed and perl Commands
1060+
# shell: bash
1061+
# if: ${{ env.OP_KERNEL_VERSION == '6.12' }}
1062+
# run: |
1063+
# echo "Changing to configuration directory: $CONFIG..."
1064+
# cd "$CONFIG/kernel_platform"
1065+
1066+
# echo "Running sed commands..."
1067+
1068+
# sed -i 's/CONFIG_LTO=n/CONFIG_LTO=y/' "./common/arch/arm64/configs/gki_defconfig"
1069+
# sed -i 's/CONFIG_LTO_CLANG_FULL=y/CONFIG_LTO_CLANG_NONE=y/' "./common/arch/arm64/configs/gki_defconfig"
1070+
# sed -i 's/CONFIG_LTO_CLANG_THIN=y/CONFIG_LTO_CLANG_NONE=y/' "./common/arch/arm64/configs/gki_defconfig"
1071+
# cat >> ./common/arch/arm64/configs/gki_defconfig <<EOF
1072+
# CONFIG_TCP_CONG_BIC=n
1073+
# CONFIG_TCP_CONG_WESTWOOD=n
1074+
# CONFIG_TCP_CONG_HTCP=n
1075+
# CONFIG_LOCALVERSION="-OP-Wild"
1076+
# CONFIG_ANDROID_BINDER_IPC_RUST=m
1077+
# EOF
1078+
1079+
# # sed -i '/_ARM64_GKI_MODULES_LIST = \[/,/\]/ {
1080+
# # /\]/i\
1081+
# # "net/ipv4/tcp_bic.ko",\
1082+
# # "net/ipv4/tcp_htcp.ko",\
1083+
# # "net/ipv4/tcp_westwood.ko",
1084+
# # }' ./common/modules.bzl
1085+
1086+
# # sed -i "s/$(printf '\044'){{kernelrelease}}/\"$(printf '\044'){{kernelrelease}}\"/g" ./build/kernel/kleaf/impl/kernel_modules_install.bzl
1087+
# # sed -i -e '/_GKI_AARCH64_MAKE_GOALS/,/]/ s/"modules",\?//g' -e '/_GKI_AARCH64_MAKE_GOALS/,/]/ {/^[[:space:]]*$/d}' -e 's/module_implicit_outs = get_gki_modules_list("arm64") + get_kunit_modules_list("arm64")/module_implicit_outs = []/' common/BUILD.bazel
1088+
# # sed -i -e 's/":tests_zip_arm64",//' -e '/extra_dist/,/]/ {/^[[:space:]]*$/d}' -e 's/kmi_enforced = True,/kmi_enforced = False,/' -e 's/kmi_symbol_list_strict_mode = True,/kmi_symbol_list_strict_mode = False,/' -e 's/trim_nonlisted_kmi = True,/trim_nonlisted_kmi = False,/' common/BUILD.bazel
1089+
1090+
# # Run sed commands for modifications
1091+
# sed -i 's/check_defconfig//' ./common/build.config.gki
1092+
1093+
# if [[ "$OP_KERNEL_VERSION" == "6.12" ]]; then
1094+
# sed -i '/check_defconfig = select({/,/}/c\ check_defconfig = "disabled"' ./build/kernel/kleaf/common_kernels.bzl
1095+
# fi
1096+
1097+
# # sed -i 's/echo "${KERNELVERSION}${file_localversion}${config_localversion}${LOCALVERSION}${scm_version}"/echo "${KERNEL_FULL_VER}${config_localversion}"/' ./common/scripts/setlocalversion
1098+
# # chmod +x ./common/scripts/setlocalversion
1099+
# sed -i "/stable_scmversion_cmd/s/-maybe-dirty//g" ./build/kernel/kleaf/impl/stamp.bzl || echo "No stamp.bzl!"
1100+
# sed -i 's/-dirty//' ./build/kernel/kleaf/workspace_status_stamp.py || echo "No workspace_status_stamp.py!"
1101+
1102+
# # Run perl command to modify UTS_VERSION
1103+
# DATESTR=$(date -u)
1104+
# perl -pi -e 's{UTS_VERSION="\$\(echo \$UTS_VERSION \$CONFIG_FLAGS \$TIMESTAMP \| cut -b -\$UTS_LEN\)"}{UTS_VERSION="#1 SMP PREEMPT $DATESTR"}' ./common/scripts/mkcompile_h
11051105

1106-
- name: Build the Kernel
1107-
shell: bash
1108-
if: ${{ env.OP_KERNEL_VERSION == '6.12' }}
1109-
run: |
1110-
echo "Changing to configuration directory: $CONFIG..."
1111-
cd "$CONFIG"
1112-
1113-
echo "Building the kernel..."
1114-
# Clear Cache
1115-
sudo sh -c 'sync; echo 3 > /proc/sys/vm/drop_caches'
1116-
1117-
(stdbuf -oL bash -c '
1118-
while true; do
1119-
echo "=== $(date) ==="
1120-
free -h
1121-
echo "======"
1122-
df -h
1123-
echo "======"
1124-
top -b -n 1 | head -n 15
1125-
echo ""
1126-
sleep 60
1127-
done
1128-
') &
1129-
MONITOR_PID=$!
1130-
trap "kill $MONITOR_PID" EXIT
1131-
1132-
KERNEL_PATH="$GITHUB_WORKSPACE/$CONFIG/kernel_platform"
1133-
BASE_PATH="/usr/lib/ccache:${CLANG_BIN_PATH}:${KERNEL_PATH}/prebuilts/kernel-build-tools/linux-x86/bin/:${KERNEL_PATH}/prebuilts/kernel-build-tools/linux_musl-x86/bin/"
1134-
export PATH="${BASE_PATH}:${PATH}"
1135-
1136-
BUILD_START=$(date +%s)
1137-
cd kernel_platform
1138-
./tools/bazel build --config=fast --config=stamp --lto=none --subcommands //common:kernel_aarch64_dist --disk_cache="$CCACHE_DIR" --sandbox_writable_path="$CCACHE_DIR" --verbose_failures --sandbox_debug || exit 1
1139-
1140-
BUILD_END=$(date +%s)
1141-
BUILD_TIME=$((BUILD_END - BUILD_START))
1142-
1143-
echo "BUILD_START=$BUILD_START" >> "$GITHUB_ENV"
1144-
echo "BUILD_END=$BUILD_END" >> "$GITHUB_ENV"
1145-
echo "BUILD_TIME=$BUILD_TIME" >> "$GITHUB_ENV"
1106+
# - name: Build the Kernel
1107+
# shell: bash
1108+
# if: ${{ env.OP_KERNEL_VERSION == '6.12' }}
1109+
# run: |
1110+
# echo "Changing to configuration directory: $CONFIG..."
1111+
# cd "$CONFIG"
1112+
1113+
# echo "Building the kernel..."
1114+
# # Clear Cache
1115+
# sudo sh -c 'sync; echo 3 > /proc/sys/vm/drop_caches'
1116+
1117+
# (stdbuf -oL bash -c '
1118+
# while true; do
1119+
# echo "=== $(date) ==="
1120+
# free -h
1121+
# echo "======"
1122+
# df -h
1123+
# echo "======"
1124+
# top -b -n 1 | head -n 15
1125+
# echo ""
1126+
# sleep 60
1127+
# done
1128+
# ') &
1129+
# MONITOR_PID=$!
1130+
# trap "kill $MONITOR_PID" EXIT
1131+
1132+
# KERNEL_PATH="$GITHUB_WORKSPACE/$CONFIG/kernel_platform"
1133+
# BASE_PATH="/usr/lib/ccache:${CLANG_BIN_PATH}:${KERNEL_PATH}/prebuilts/kernel-build-tools/linux-x86/bin/:${KERNEL_PATH}/prebuilts/kernel-build-tools/linux_musl-x86/bin/"
1134+
# export PATH="${BASE_PATH}:${PATH}"
1135+
1136+
# BUILD_START=$(date +%s)
1137+
# cd kernel_platform
1138+
# ./tools/bazel build --config=fast --config=stamp --lto=none --subcommands //common:kernel_aarch64_dist --disk_cache="$CCACHE_DIR" --sandbox_writable_path="$CCACHE_DIR" --verbose_failures --sandbox_debug || exit 1
1139+
1140+
# BUILD_END=$(date +%s)
1141+
# BUILD_TIME=$((BUILD_END - BUILD_START))
1142+
1143+
# echo "BUILD_START=$BUILD_START" >> "$GITHUB_ENV"
1144+
# echo "BUILD_END=$BUILD_END" >> "$GITHUB_ENV"
1145+
# echo "BUILD_TIME=$BUILD_TIME" >> "$GITHUB_ENV"
11461146

11471147
- name: Build Kernel
11481148
shell: bash
1149-
if: ${{ env.OP_KERNEL_VERSION != '6.12' }}
1149+
# if: ${{ env.OP_KERNEL_VERSION != '6.12' }}
11501150
env:
11511151
PYTHONWARNINGS: "ignore:invalid escape sequence"
11521152
run: |
@@ -1190,6 +1190,20 @@ runs:
11901190
export HOSTCC="ccache clang"
11911191
export HOSTCXX="ccache clang++"
11921192
1193+
export RUSTC_FORCE_RUSTC_VERSION=rustc-android
1194+
export HOSTRUSTFLAGS="--target x86_64-unknown-linux-gnu"
1195+
export KBUILD_SYMTYPES=
1196+
export DEPMOD=depmod
1197+
export DTC=$(command -v dtc)
1198+
export PROCMACROLDFLAGS="-fuse-ld=lld --rtlib=compiler-rt --sysroot=$KERNEL_PATH/build/kernel/build-tools/sysroot"
1199+
export BRANCH=android16-6.12
1200+
export KMI_GENERATION=5
1201+
export CLANG_VERSION=r536225
1202+
export RUSTC_VERSION=1.82.0
1203+
export AARCH64_NDK_TRIPLE=aarch64-linux-android31
1204+
export X86_64_NDK_TRIPLE=x86_64-linux-android31
1205+
export ARM_NDK_TRIPLE=arm-linux-androideabi31
1206+
11931207
export LLVM=1
11941208
export ARCH=arm64 SUBARCH=arm64
11951209
export CROSS_COMPILE=aarch64-linux-gnu-
@@ -1242,6 +1256,8 @@ runs:
12421256
fi
12431257
echo "============================================"
12441258
1259+
source "$KERNEL_PATH/build/kernel/_setup_env.sh"
1260+
12451261
make O="$OUT" gki_defconfig
12461262
make LLVM=1 rustavailable
12471263

0 commit comments

Comments
 (0)