3 source gbash.sh ||
exit
5 DEFINE_string
--required build_id
"" "GMS Build Id on go/ab"
6 DEFINE_string
--required install_path
"" "The target deadpool-kernel path"
8 gbash
::init_google
"${@}"
10 if [[ "${FLAGS_build_id}" == "" ||
"${FLAGS_install_path}" == "" ]]; then
11 gbash
::quiet_die
"Please specify build_id and install_path"
15 tmp_dir
=$
(mktemp
-d -t deadpool-kernel-XXXXXXXXXX
)
17 # TODO: firmware should be built from kernel
18 # Back up deadpool.dtb and dtbo.img
19 cp -rf ${FLAGS_install_path}/4.9/deadpool.dtb
${tmp_dir}/
20 cp -rf ${FLAGS_install_path}/4.9/dtbo.img
${tmp_dir}/
23 rm -rf ${FLAGS_install_path}/4.9/*
25 # Download go/ab artifacts
26 /google
/data
/ro
/projects
/android
/fetch_artifact
--bid ${FLAGS_build_id} \
27 --target kernel_deadpool
--nouse_oauth2 'Image'
29 mv Image.gz
${tmp_dir}/
31 /google
/data
/ro
/projects
/android
/fetch_artifact
--bid ${FLAGS_build_id} \
32 --target kernel_deadpool
--nouse_oauth2 'unstripped/*.ko'
35 /google
/data
/ro
/projects
/android
/fetch_artifact
--bid ${FLAGS_build_id} \
36 --target kernel_deadpool
--nouse_oauth2 'unstripped/*.bin'
39 mkdir
-p ${FLAGS_install_path}/4.9/lib
/firmware
/video
/
40 mkdir
-p ${FLAGS_install_path}/4.9/lib
/modules
/
42 # Restore deadpool.dtb and dtbo.img
43 mv ${tmp_dir}/deadpool.dtb
${FLAGS_install_path}/4.9/
44 mv ${tmp_dir}/dtbo.img
${FLAGS_install_path}/4.9/
46 # Install go/ab artifacts
47 mv ${tmp_dir}/Image.gz
${FLAGS_install_path}/4.9/
48 mv ${tmp_dir}/*.bin
${FLAGS_install_path}/4.9/lib
/firmware
/video
/
49 mv ${tmp_dir}/optee
* ${FLAGS_install_path}/4.9/lib
/
50 mv ${tmp_dir}/*.ko
${FLAGS_install_path}/4.9/lib
/modules
/