Skip to content

Commit 8aac728

Browse files
committed
Add initial premerge support. Fix bug wrt console support
1 parent 5dadc75 commit 8aac728

File tree

1 file changed

+35
-13
lines changed

1 file changed

+35
-13
lines changed

hikey-kernel-builder.sh

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ usage()
88
echo "-v = kernel version"
99
echo "-a = android version"
1010
echo "-t = toolchain to use from prebuilts"
11+
echo "-m = mirror build, use premerge mirror"
1112
}
1213

1314

1415
set -ex
1516

16-
export TOOLCHAIN="clang-4679922"
17-
# export TOOLCHAIN="clang-r339409b"
17+
# export TOOLCHAIN="clang-4679922"
18+
export TOOLCHAIN="clang-r346389b"
1819
export nproc=9
1920
export ANDROID_VERSION="O-MR1"
2021
export REFERENCE_BUILD_URL="http://testdata.linaro.org/lkft/aosp-stable/android-8.1.0_r29/"
@@ -37,6 +38,8 @@ while [ "$1" != "" ]; do
3738
;;
3839
-s | --skipdownloads ) skipdownloads=1
3940
;;
41+
-m | --mirror-build ) mirrorbuild=1
42+
;;
4043
-h | --help ) usage
4144
exit
4245
;;
@@ -49,16 +52,28 @@ done
4952
if [ "$VERSION" = "4.9" ]; then
5053
export KERNEL_BRANCH=android-hikey-linaro-4.9
5154
export ANDROID_KERNEL_CONFIG_DIR="android-4.9"
55+
if [ "$mirrorbuild" == "1" ]; then
56+
export KERNEL_BRANCH=mirror-android-4.9
57+
fi
5258
elif [ "$VERSION" = "4.14" ]; then
5359
export KERNEL_BRANCH=android-hikey-linaro-4.14
5460
export ANDROID_KERNEL_CONFIG_DIR="android-4.14"
61+
if [ "$mirrorbuild" == "1" ]; then
62+
export KERNEL_BRANCH=mirror-android-4.14
63+
fi
5564
elif [ "$VERSION" = "4.19" ]; then
5665
export KERNEL_BRANCH=android-hikey-linaro-4.19
5766
export ANDROID_KERNEL_CONFIG_DIR="android-4.19"
58-
export TOOLCHAIN="clang-r346389"
67+
export TOOLCHAIN="clang-r346389b"
68+
if [ "$mirrorbuild" == "1" ]; then
69+
export KERNEL_BRANCH=mirror-android-4.19
70+
fi
5971
elif [ "$VERSION" = "4.4" ]; then
6072
export KERNEL_BRANCH=android-hikey-linaro-4.4
6173
export ANDROID_KERNEL_CONFIG_DIR="android-4.4"
74+
if [ "$mirrorbuild" == "1" ]; then
75+
export KERNEL_BRANCH=mirror-android-4.4
76+
fi
6277
fi
6378

6479
# android-4.14 android-4.4 android-4.9 o o-mr1 p
@@ -112,13 +127,18 @@ fi
112127

113128
if echo "$ANDROID_VERSION" | grep -i aosp ; then
114129
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"
130+
elif [ "$VERSION" = "4.19" ]; then
131+
CMD="console=ttyAMA3 androidboot.console=ttyAMA3 androidboot.hardware=hikey firmware_class.path=/vendor/firmware efi=noruntime printk.devkmsg=on buildvariant=userdebug"
132+
# 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"
133+
134+
# console=ttyAMA3,115200 androidboot.console=ttyAMA3 androidboot.hardware=hikey firmware_class.path=/vendor/firmware efi=noruntime printk.devkmsg=on buildvariant=userdebug
135+
136+
115137
elif [ "$ANDROID_VERSION" = "O-MR1" ]; then
116138
CMD="androidboot.console=ttyFIQ0 androidboot.hardware=hikey firmware_class.path=/system/etc/firmware efi=noruntime printk.devkmsg=on buildvariant=userdebug"
117139
# CMD="androidboot.console=ttyFIQ0 androidboot.hardware=hikey firmware_class.path=/system/etc/firmware efi=noruntime printk.devkmsg=on buildvariant=userdebug video=HDMI-A-1:1280x720@60"
118140

119141
elif [ "$ANDROID_VERSION" = "P" ]; then
120-
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 initrd=0x11000000,0x17E28A"
121-
elif [ "$VERSION" = "4.19" ]; then
122142
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"
123143

124144
else
@@ -150,7 +170,10 @@ else
150170
if [ "$ANDROID_VERSION" = "O-MR1" ]; then
151171
git revert --no-edit bbab5cb8a5bd598af247d9eaf5a3033e7d12104e
152172
fi
153-
fi
173+
if [ "$mirrorbuild" == "1" ]; then
174+
cp ~/hikey_defconfig arch/arm64/configs/.
175+
fi
176+
fi
154177
if [ "$VERSION" = "4.14" ]; then
155178
if [ "$ANDROID_VERSION" = "O-MR1" ]; then
156179
git revert --no-edit 20ebc74d51a1542e4290abf5ac9e32b524f891d1
@@ -186,12 +209,11 @@ fi
186209
cp .config ../defconfig
187210

188211
if [ "$VERSION" = "4.19" ]; then
189-
make ARCH=arm64 CC=clang HOSTCC=clang -j$(nproc) Image
190-
make ARCH=arm64 CC=clang HOSTCC=clang -j$(nproc) dtbs
191-
cat arch/arm64/boot/Image arch/arm64/boot/dts/hisilicon/hi6220-hikey.dtb > arch/arm64/boot/Image-dtb
192-
212+
make ARCH=arm64 CC=clang HOSTCC=clang -j$(nproc) Image
213+
make ARCH=arm64 CC=clang HOSTCC=clang -j$(nproc) dtbs
214+
cat arch/arm64/boot/Image arch/arm64/boot/dts/hisilicon/hi6220-hikey.dtb > arch/arm64/boot/Image-dtb
193215
else
194-
make ARCH=arm64 CC=clang HOSTCC=clang -j$(nproc) Image-dtb
216+
make ARCH=arm64 CC=clang HOSTCC=clang -j$(nproc) Image-dtb
195217
fi
196218

197219
cd ..
@@ -203,8 +225,8 @@ fi
203225

204226

205227
if [ "$ANDROID_VERSION" = "O-MR1" ]; then
206-
python mkbootimg --kernel ${PWD}/"$KERNEL_DIR"/arch/arm64/boot/Image-dtb --cmdline console="${CMD}" --os_version O --os_patch_level 2016-11-05 --ramdisk ./ramdisk.img --output boot.img
228+
python mkbootimg --kernel ${PWD}/"$KERNEL_DIR"/arch/arm64/boot/Image-dtb --cmdline "${CMD}" --os_version O --os_patch_level 2016-11-05 --ramdisk ./ramdisk.img --output boot.img
207229
else
208-
python mkbootimg --kernel ${PWD}/"$KERNEL_DIR"/arch/arm64/boot/Image-dtb --cmdline console="${CMD}" --os_version P --os_patch_level 2018-09-01 --ramdisk ./ramdisk.img --output boot.img
230+
python mkbootimg --kernel ${PWD}/"$KERNEL_DIR"/arch/arm64/boot/Image-dtb --cmdline "${CMD}" --os_version P --os_patch_level 2018-09-01 --ramdisk ./ramdisk.img --output boot.img
209231
fi
210232
#

0 commit comments

Comments
 (0)