Skip to content

Commit

Permalink
build_slider: Remove BUILD_KERNEL and EXPERIMENTAL_BUILD
Browse files Browse the repository at this point in the history
1) Use BUILD_AOSP_KERNEL to replace BUILD_KERNEL
2) Use BUILD_STAGING_KERNEL to replace EXPERIMENTAL_BUILD

Bug: 239510636
Signed-off-by: Robin Peng <[email protected]>
Change-Id: I00b02fd7fdc1a78a1928508b4d2af2d0afbb17a2
  • Loading branch information
Robin Peng committed Jul 22, 2022
1 parent b6e2ec8 commit ee46baa
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 35 deletions.
55 changes: 22 additions & 33 deletions build_slider.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@ function exit_if_error {

# Default enable BUILD_STAGING_KERNEL
BUILD_STAGING_KERNEL=${BUILD_STAGING_KERNEL:-1}
if [ "${BUILD_AOSP_KERNEL}" = "1" ]; then
BUILD_KERNEL=1
EXPERIMENTAL_BUILD=0
elif [ "${BUILD_STAGING_KERNEL}" = "1" ]; then
BUILD_KERNEL=1
EXPERIMENTAL_BUILD=1
fi

EXPERIMENTAL_BUILD=${EXPERIMENTAL_BUILD:-0}
TRIM_NONLISTED_KMI=${TRIM_NONLISTED_KMI:-1}
LTO=${LTO:-thin}
KMI_SYMBOL_LIST_STRICT_MODE=${ENABLE_STRICT_KMI:-1}
Expand All @@ -28,21 +19,20 @@ GKI_KERNEL_PREBUILTS_DIR=
GKI_KERNEL_BUILD_CONFIG=
GKI_KERNEL_OUT_DIR=
CHECK_DIRTY_AOSP=0
if [ -z "${BUILD_KERNEL}" ]; then
if [ "${EXPERIMENTAL_BUILD}" != "0" -o -n "${GKI_DEFCONFIG_FRAGMENT}" ]; then
BUILD_KERNEL=1
else
CHECK_DIRTY_AOSP=1
BUILD_KERNEL=0
fi
MAKE_CORE_KERNEL=0
if [ "${BUILD_AOSP_KERNEL}" = "1" -o "${BUILD_STAGING_KERNEL}" = "1" -o -n "${GKI_DEFCONFIG_FRAGMENT}" ]; then
MAKE_CORE_KERNEL=1
else
CHECK_DIRTY_AOSP=1
MAKE_CORE_KERNEL=0
fi

if [ "${BUILD_KERNEL}" = "0" ]; then
if [ "${MAKE_CORE_KERNEL}" = "0" ]; then
USING_PREBUILTS=1
GKI_KERNEL_PREBUILTS_DIR=$(readlink -m "prebuilts/boot-artifacts/kernel/")
else
USING_PREBUILTS=
if [ "${EXPERIMENTAL_BUILD}" != "0" ]; then
if [ "${BUILD_STAGING_KERNEL}" = "1" ]; then
GKI_KERNEL_OUT_DIR=android13-5.10-pixel-staging
GKI_KERNEL_BUILD_CONFIG=aosp-staging/build.config.gki.aarch64
else
Expand All @@ -62,17 +52,15 @@ if [ -n "${BUILD_ABI}" ]; then
exit_if_error 1 "BUILD_ABI is deprecated"
fi

if [ "${BUILD_KERNEL}" = "0" ]; then
if [ "${MAKE_CORE_KERNEL}" = "0" ]; then
if [ "${LTO}" = "none" ]; then
echo "LTO=none requires BUILD_KERNEL=1, EXPERIMENTAL_BUILD=1, or"
echo "LTO=none requires BUILD_AOSP_KERNEL=1, BUILD_STAGING_KERNEL=1, or"
echo " GKI_DEFCONFIG_FRAGMENT to be set."
exit_if_error 1 "LTO=none requires building the kernel"
elif [ -n "${GKI_DEFCONFIG_FRAGMENT}" -o \
"${EXPERIMENTAL_BUILD}" != "0" ]; then
echo "BUILD_KERNEL=0 is incompatible with EXPERIMENTAL_BUILD and"
echo " GKI_DEFCONFIG_FRAGMENT."
exit_if_error 1 "Flags incompatible with BUILD_KERNEL detected"
fi
elif [ "${BUILD_AOSP_KERNEL}" = "1" -a "${BUILD_STAGING_KERNEL}" = "1" ]; then
echo "BUILD_AOSP_KERNEL=1 is incompatible with BUILD_STAGING_KERNEL."
exit_if_error 1 "Flags incompatible with BUILD_AOSP_KERNEL detected"
fi

# These are for build.sh, so they should be exported.
Expand All @@ -98,8 +86,8 @@ else
SHA_FILE=boot.img
fi

# If BUILD_KERNEL is not explicitly set, be sure that there are no aosp/
# changes not present in the prebuilt.
# If BUILD_AOSP_KERNEL and BUILD_STAGING_KERNEL is not explicitly set,
# be sure that there are no aosp/ changes not present in the prebuilt.
if [ "${CHECK_DIRTY_AOSP}" != "0" ]; then
PREBUILTS_SHA=$(strings ${GKI_KERNEL_PREBUILTS_DIR}/${SHA_FILE} |
grep "Linux version 5.10" |
Expand All @@ -111,12 +99,13 @@ if [ "${CHECK_DIRTY_AOSP}" != "0" ]; then
"$(git --no-optional-locks status -uno --porcelain ||
git diff-index --name-only HEAD)" ]; then
echo "WARNING: There are aosp/ changes which are not in the prebuilts."
echo " Because you did not specify BUILD_KERNEL=0 or 1, $0"
echo " defaulted to building with the prebuilts. Please be aware that"
echo " your changes to aosp/ will not be present in the final images. If"
echo " you have made changes to aosp/, it is recommended to explicitly"
echo " set BUILD_KERNEL=0 if you wish to use the prebuilts, or to 1 if"
echo " you wish to build any local changes you may have."
echo " Because you did not specify BUILD_AOSP_KERNEL/BUILD_STAGING_KERNEL=0"
echo " or 1, $0 defaulted to building with"
echo " the prebuilts. Please be aware that your changes to aosp/ will not"
echo " be present in the final images. If you have made changes to aosp/,"
echo " it is recommended to explicitly set BUILD_AOSP_KERNEL/BUILD_STAGING_KERNEL=0"
echo " if you wish to use the prebuilts, or to 1 if you wish to build any"
echo " local changes you may have."
fi
popd > /dev/null
fi
4 changes: 2 additions & 2 deletions update_symbol_list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ else

echo "========================================================"
echo " The symbol list has been updated locally in ${GKI_KERNEL_DIR}/ and private/gs-google."
echo " Compiling with BUILD_KERNEL=1 is now required until the new symbol(s)"
echo " are merged. Re-compile using the below command:"
echo " Compiling with BUILD_AOSP_KERNEL=1 or BUILD_STAGING_KERNEL=1 is now required until"
echo " the new symbol(s) are merged. Re-compile using the below command:"
echo
if [ "${BUILD_AOSP_KERNEL}" = "1" ]; then
echo " SKIP_MRPROPER=1 BUILD_AOSP_KERNEL=1 ${BUILD_SCRIPT}"
Expand Down

0 comments on commit ee46baa

Please sign in to comment.