Skip to content

Commit 16628ac

Browse files
committed
Add -c option which launches a build based on the residue of the
prior build without doing any downloads or resetting of configs. This is useful especially when fixing kernel build errors. Signed-off-by: Tom Gall <tom.gall@linaro.org>
1 parent a669909 commit 16628ac

File tree

1 file changed

+26
-14
lines changed

1 file changed

+26
-14
lines changed

hikey-kernel-builder.sh

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ usage()
99
echo "-a = android version"
1010
echo "-t = toolchain to use from prebuilts"
1111
echo "-m = mirror build, use premerge mirror"
12+
echo "-c = continue build, no download, no reconfig, just build"
1213
}
1314

1415

@@ -47,6 +48,9 @@ while [ "$1" != "" ]; do
4748
;;
4849
-g | --gcc ) usegcc=1
4950
;;
51+
-c | --continue ) cont=1
52+
skipdownloads=1
53+
;;
5054
-h | --help ) usage
5155
exit
5256
;;
@@ -145,8 +149,9 @@ fi
145149
# fi
146150

147151

152+
if [ "$skipdownloads" != "1" ]; then
148153
git clone https://github.com/tom-gall/LinaroAndroidKernelConfigs.git
149-
#fi
154+
fi
150155

151156
if echo "$ANDROID_VERSION" | grep -i aosp ; then
152157
CMD="androidboot.console=ttyFIQ0 androidboot.hardware=hikey firmware_class.path=/vendor/firmware efi=noruntime printk.devkmsg=on buildvariant=userdebug overlay_mgr.overlay_dt_entry=hardware_cfg_enable_android_fstab video=HDMI-A-1:1280x720@60"
@@ -166,15 +171,20 @@ elif [ "$ANDROID_VERSION" = "P" ]; then
166171
CMD="console=ttyAMA3,115200 androidboot.console=ttyAMA3 androidboot.hardware=hikey firmware_class.path=/vendor/firmware efi=noruntime printk.devkmsg=on buildvariant=userdebug overlay_mgr.overlay_dt_entry=hardware_cfg_enable_android_fstab initrd=0x11000000,0x17E28A"
167172

168173
else
169-
echo "What Andoid Version are you running?"
174+
echo "What Andoid Version are you planning to run?"
170175
fi
171176

172177
if [ "$skipdownloads" = "1" ]; then
173178
cd "$KERNEL_DIR"
174-
if [ "$mirrorbuild" == "1" ]; then
175-
git merge --no-edit remotes/origin/${UPSTREAM_KERNEL_BRANCH}
179+
if [ "$cont" = "1" ]; then
180+
# nothing to do
181+
echo "nothing to do"
182+
else
183+
if [ "$mirrorbuild" == "1" ]; then
184+
git merge --no-edit remotes/origin/${UPSTREAM_KERNEL_BRANCH}
185+
fi
186+
make mrproper
176187
fi
177-
make mrproper
178188
# git checkout master
179189
# git clean -fd
180190
# git pull
@@ -234,15 +244,17 @@ export CROSS_COMPILE=aarch64-linux-android-
234244

235245
cd "$KERNEL_DIR"
236246

237-
# copy kernel config for any version besides AOSP
238-
if [ "$ANDROID_VERSION" = "O-MR1" ]; then
239-
cp ../LinaroAndroidKernelConfigs/${ANDROID_VERSION}/${VERSION}/hikey_defconfig .config
240-
elif [ "$VERSION" = "4.19" ]; then
241-
ARCH=arm64 scripts/kconfig/merge_config.sh arch/arm64/configs/hikey_defconfig ../configs/${CONFIG_FRAGMENTS_PATH}/${ANDROID_KERNEL_CONFIG_DIR}/android-base.config ../configs/${CONFIG_FRAGMENTS_PATH}/${ANDROID_KERNEL_CONFIG_DIR}/android-recommended-arm64.config
242-
elif [ "$ANDROID_VERSION" = "P" ]; then
243-
cp ../LinaroAndroidKernelConfigs/${ANDROID_VERSION}/${VERSION}/hikey_defconfig .config
244-
else # AOSP BUILD
245-
ARCH=arm64 scripts/kconfig/merge_config.sh arch/arm64/configs/hikey_defconfig ../configs/${CONFIG_FRAGMENTS_PATH}/${ANDROID_KERNEL_CONFIG_DIR}/android-base.config ../configs/${CONFIG_FRAGMENTS_PATH}/${ANDROID_KERNEL_CONFIG_DIR}/android-recommended-arm64.config
247+
if [ "$cont" != "1" ]; then
248+
# copy kernel config for any version besides AOSP
249+
if [ "$ANDROID_VERSION" = "O-MR1" ]; then
250+
cp ../LinaroAndroidKernelConfigs/${ANDROID_VERSION}/${VERSION}/hikey_defconfig .config
251+
elif [ "$VERSION" = "4.19" ]; then
252+
ARCH=arm64 scripts/kconfig/merge_config.sh arch/arm64/configs/hikey_defconfig ../configs/${CONFIG_FRAGMENTS_PATH}/${ANDROID_KERNEL_CONFIG_DIR}/android-base.config ../configs/${CONFIG_FRAGMENTS_PATH}/${ANDROID_KERNEL_CONFIG_DIR}/android-recommended-arm64.config
253+
elif [ "$ANDROID_VERSION" = "P" ]; then
254+
cp ../LinaroAndroidKernelConfigs/${ANDROID_VERSION}/${VERSION}/hikey_defconfig .config
255+
else # AOSP BUILD
256+
ARCH=arm64 scripts/kconfig/merge_config.sh arch/arm64/configs/hikey_defconfig ../configs/${CONFIG_FRAGMENTS_PATH}/${ANDROID_KERNEL_CONFIG_DIR}/android-base.config ../configs/${CONFIG_FRAGMENTS_PATH}/${ANDROID_KERNEL_CONFIG_DIR}/android-recommended-arm64.config
257+
fi
246258
fi
247259

248260
cp .config ../defconfig

0 commit comments

Comments
 (0)