File: kernel_build_deb.sh

package info (click to toggle)
android-cuttlefish 1.0.1-0~exp2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 7,192 kB
  • sloc: cpp: 39,149; sh: 2,523; javascript: 242; exp: 152; python: 125; makefile: 88
file content (51 lines) | stat: -rwxr-xr-x 1,478 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh

set +e

SELFPID=$$
renice 10 -p "$SELFPID"
ionice -c 3 -p "$SELFPID"

set -e

if [ x"${CI_PIPELINE_ID}" = x ]; then
    export CI_PIPELINE_ID=1
fi

TDIR=kernel-build-space/buildresult
SDIR=kernel-build-space/source/kernel

rm -rf ${TDIR}

mkdir -p ${TDIR}

# Make a copy of AOSP's kernel. deb-pkg target will make the source tree
# unclean. So we make a copy of it and then build inside the copy.
cp -R ${SDIR}/common ${TDIR}/common
cp -R ${SDIR}/common-modules ${TDIR}/common-modules
cp -R ${SDIR}/.repo ${TDIR}/.repo

# Build the kernel
cd ${TDIR}/common
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-
KERVER=$(make kernelversion)
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig -j32
for i in arch/arm64/configs/gki_defconfig ../common-modules/virtual-device/virtual_device_core.fragment ../common-modules/virtual-device/linux_distro.fragment; do 
    ./scripts/kconfig/merge_config.sh -O . .config ${i}
done
cat <<EOF > ../extraconfig
# CONFIG_MODULE_SIG_PROTECT is not set
# CONFIG_BTRFS_FS is not set
# CONFIG_LOCALVERSION_AUTO is not set
EOF
./scripts/kconfig/merge_config.sh -O . .config ../extraconfig

ANDROIDVERSION=""
if [ x"${KERNEL_MANIFEST_BRANCH}" != x ]; then
    ANDROIDVERSION=$(echo "${KERNEL_MANIFEST_BRANCH}" | sed 's/.*android\([0-9]*\)-.*/\1/')
fi

make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- LOCALVERSION=".aosp${ANDROIDVERSION}-linaro-gig-1-arm64" KDEB_PKGVERSION="${KERVER}"-"${CI_PIPELINE_ID}" deb-pkg -j32

cd -