blob: e80d42a0a2e98da0fb94fc3c9a62245309779582 [file] [log] [blame]
Yongqin Liub1063022020-04-24 19:15:45 +08001#!/bin/bash -ex
2
3function wget_wrapper(){
4 local build_num="${1}" && shift
5 local board="${1}" && shift
6 local target_name="${1}" && shift
7 local local_name="${1}" && shift
8 wget https://ci.android.com/builds/submitted/${build_num}/kernel_${board}/latest/raw/${target_name} -O ${local_name}
9}
10
11function update_kernel_dtb_hikey960(){
12 local build_num="${1}" && shift
13 local kernel_version="${1}" && shift
14 local board="hikey960"
John Stultz650d5212020-06-05 04:16:20 +000015 mkdir -p ${board}/${kernel_version}
16 wget_wrapper ${build_num} ${board} Image.gz-dtb ${board}/${kernel_version}/Image.gz-dtb
17 wget_wrapper ${build_num} ${board} hi3660-hikey960.dtb ${board}/${kernel_version}/hi3660-hikey960.dtb
18 wget_wrapper ${build_num} ${board} manifest_${build_num}.xml ${board}/${kernel_version}/manifest_${build_num}-${board}.xml
Yongqin Liub1063022020-04-24 19:15:45 +080019}
20
21
22function update_kernel_dtb_hikey(){
23 local build_num="${1}" && shift
24 local kernel_version="${1}" && shift
25 local board="hikey"
Yongqin Liucc19ab92020-11-16 16:01:47 +080026 rm -fr ${board}/${kernel_version}
John Stultz650d5212020-06-05 04:16:20 +000027 mkdir -p ${board}/${kernel_version}
28 wget_wrapper ${build_num} ${board} Image.gz-dtb ${board}/${kernel_version}/Image.gz-dtb
29 wget_wrapper ${build_num} ${board} hi6220-hikey.dtb ${board}/${kernel_version}/hi6220-hikey.dtb
30 wget_wrapper ${build_num} ${board} manifest_${build_num}.xml ${board}/${kernel_version}/manifest_${build_num}-${board}.xml
Yongqin Liub1063022020-04-24 19:15:45 +080031}
32
33function update_kernel_dtb(){
34 local build_num="${1}" && shift
35 local kernel_version="${1}" && shift
36
Yongqin Liucc19ab92020-11-16 16:01:47 +080037# update_kernel_dtb_hikey960 ${build_num} ${kernel_version}
Yongqin Liub1063022020-04-24 19:15:45 +080038 update_kernel_dtb_hikey ${build_num} ${kernel_version}
39}
40
41# https://ci.android.com/builds/branches/aosp_kernel-hikey-linaro-android-4.19/grid?
42# https://ci.android.com/builds/submitted/6423191/kernel_hikey960/latest
43# https://ci.android.com/builds/submitted/6423191/kernel_hikey/latest
Yongqin Liu9165c422023-03-03 20:49:59 +080044# update_kernel_dtb 6971857 4.14
45# update_kernel_dtb 6972652 4.19
46
47function update_hikey960_5_10(){
48 local build_num="9668756"
49 local board="hikey960"
50 local kernel_version="5.10"
51
52 rm -fr ${board}/${kernel_version}
53 mkdir -p ${board}/${kernel_version}
54
55 cd ${board}/${kernel_version}
56 mkdir gki abi
57 local f_download_ci="./gki/download_from_ci"
58 local f_abitool="./abi/abitool.py"
59 curl "https://android.googlesource.com/kernel/build/+/master/gki/download_from_ci?format=text" | base64 --decode > "${f_download_ci}"
60 curl "https://android.googlesource.com/kernel/build/+/master/abi/abitool.py?format=text" | base64 --decode > "${f_abitool}"
61 chmod +x "${f_download_ci}"
62 "${f_download_ci}" "${build_num}" kernel_hikey960
63 mv Image.gz Image-vendor.gz
64 wget_wrapper "${build_num}" "aarch64" Image.gz Image-gki.gz
65 cat Image-gki.gz hi3660-hikey960.dtb >Image.gz-dtb
66
67 rm -fr gki abi
68 rm -f ./Image-gki.gz ./Image-vendor.gz vmlinux
69 rm -fr logs
70 cd -
71}
72
73# https://ci.android.com/builds/submitted/9668756/kernel_aarch64/latest
74# https://ci.android.com/builds/submitted/9668756/kernel_hikey960/latest
75update_hikey960_5_10 "9668756"