From 5f5b19a0b1a4c8b969720b301f03a1a8f6594a5e Mon Sep 17 00:00:00 2001 From: Hongguang Date: Fri, 13 May 2022 14:43:25 -0700 Subject: [PATCH] Add a script to install deadpool artifacts from go/ab Bug: 220644706 Change-Id: I6eb8f7d50016def7275a35b3ca2d358f617a4181 --- install_deadpool_artifacts.sh | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 install_deadpool_artifacts.sh diff --git a/install_deadpool_artifacts.sh b/install_deadpool_artifacts.sh new file mode 100644 index 000000000000..3b99f8a75e5c --- /dev/null +++ b/install_deadpool_artifacts.sh @@ -0,0 +1,42 @@ +#!/bin/bash -eu + +source gbash.sh || exit + +DEFINE_string --required build_id "" "GMS Build Id on go/ab" +DEFINE_string --required install_path "" "The target deadpool-kernel path" + +gbash::init_google "${@}" + +if [[ "${FLAGS_build_id}" == "" || "${FLAGS_install_path}" == "" ]]; then + gbash::quiet_die "Please specify build_id and install_path" +fi + +# Working dir +tmp_dir=$(mktemp -d -t deadpool-kernel-XXXXXXXXXX) + +# TODO: firmware should be built from kernel +# Back up firmwares +mv ${install_path}/4.9/lib/firmware/video/* ${tmp_dir}/ + +# Clean target +rm -rf ${install_path}/4.9/* + +# Download go/ab artifacts +/google/data/ro/projects/android/fetch_artifact --bid ${FLAGS_build_id} \ + --target kernel_deadpool --nouse_oauth2 'Image' +gzip Image +mv 'Image.gz' ${tmp_dir}/ +/google/data/ro/projects/android/fetch_artifact --bid ${FLAGS_build_id} \ + --target kernel_deadpool --nouse_oauth2 '*.ko' +mv '*.ko' ${tmp_dir}/ + +mkdir -p ${install_path}/4.9/lib/firmware/video/ +mkdir -p ${install_path}/4.9/lib/modules/ + +# Restore firmwares +mv ${tmp_dir}/*.bin ${install_path}/4.9/lib/firmware/video/ + +# Install go/ab artifacts +mv ${tmp_dir}/Image.gz ${install_path}/4.9/ +mv ${tmp_dir}/optee* ${install_path}/4.9/lib/ +mv ${tmp_dir}/*.ko ${install_path}/4.9/lib/modules/ -- 2.20.1