From: Hongguang Date: Fri, 13 May 2022 21:43:25 +0000 (-0700) Subject: Add a script to install deadpool artifacts from go/ab X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5f5b19a0b1a4c8b969720b301f03a1a8f6594a5e;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git Add a script to install deadpool artifacts from go/ab Bug: 220644706 Change-Id: I6eb8f7d50016def7275a35b3ca2d358f617a4181 --- 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/