aosp-merger: Support merging lineage device/kernels

Change-Id: I6c2212fde254500119091e7523982a2346dfe768
This commit is contained in:
Michael Bestas 2023-03-24 19:08:55 +02:00
parent 471bc4d095
commit a57dda10d1
No known key found for this signature in database
GPG Key ID: F2D6C348F85577F5
7 changed files with 62 additions and 8 deletions

View File

@ -69,7 +69,7 @@ cd "${TOP}/${PROJECTPATH}"
repo abandon "${STAGINGBRANCH}" .
repo start "${STAGINGBRANCH}" .
if [ -f ".gitupstream-lineage" ]; then
if grep -q "${lineageos_branch}" .gitupstream-lineage; then
if grep -q "${lineageos_device_branch}" .gitupstream-lineage; then
LINEAGEBRANCH="$(cat .gitupstream-lineage | cut -d ' ' -f 2)"
else
LINEAGEBRANCH="${lineageos_branch}"

View File

@ -33,6 +33,7 @@ source "${vars_path}/common"
source "${vars_path}/pixels"
source "${vars_path}/kernel_repos"
source "${vars_path}/qcom"
source "${vars_path}/lineage_devices"
TOP="${script_path}/../../.."
@ -156,7 +157,7 @@ push_clo_merge() {
# Merge LineageOS to forks
merge_lineage() {
"${script_path}"/_merge_helper.sh --project-path "${repo}" --new-tag "${lineageos_branch}" --branch-suffix "${os_branch}_merge-${lineageos_branch}"
"${script_path}"/_merge_helper.sh --project-path "${repo}" --new-tag "${1}" --branch-suffix "${os_branch}_merge-${1}"
}
post_lineage_merge() {
@ -164,11 +165,11 @@ post_lineage_merge() {
}
upload_lineage_merge_to_review() {
"${script_path}"/upload-merge.sh --branch-suffix "${os_branch}_merge-${lineageos_branch}" --lineage
"${script_path}"/upload-merge.sh --branch-suffix "${os_branch}_merge-${1}" --lineage
}
push_lineage_merge() {
"${script_path}"/push-merge.sh --branch-suffix "${os_branch}_merge-${lineageos_branch}" --lineage
"${script_path}"/push-merge.sh --branch-suffix "${os_branch}_merge-${1}" --lineage
}
# error message
@ -280,7 +281,7 @@ main() {
for repo in $(repo list -p -g lineage); do
(
merge_lineage
merge_lineage "${lineageos_branch}"
)
done
@ -288,9 +289,32 @@ main() {
cat "${MERGEDREPOS}" | grep -w conflict-merge || true
read -p "Waiting for conflict resolution. Press enter when done."
post_lineage_merge
upload_lineage_merge_to_review
upload_lineage_merge_to_review "${lineageos_branch}"
unset MERGEDREPOS
elif [ "${1}" = "lineage-devices" ]; then
for device in ${lineage_devices[@]}; do
(
source "${vars_path}/${device}"
export MERGEDREPOS="${TOP}/merged_repos_${device}.txt"
# Remove any existing list of merged repos file
rm -f "${MERGEDREPOS}"
for repo in ${device_repos[@]}; do
(
merge_lineage "${lineageos_device_branch}"
)
done
# Run this to print list of conflicting repos
cat "${MERGEDREPOS}" | grep -w conflict-merge || true
read -p "Waiting for conflict resolution. Press enter when done."
post_lineage_merge
upload_lineage_merge_to_review "${lineageos_device_branch}"
unset MERGEDREPOS
)
done
elif [ "${1}" = "submit-platform" ]; then
export MERGEDREPOS="${TOP}/merged_repos.txt"
@ -331,9 +355,20 @@ main() {
elif [ "${1}" = "submit-lineage" ]; then
export MERGEDREPOS="${TOP}/merged_repos_lineage.txt"
push_lineage_merge
push_lineage_merge "${lineageos_branch}"
unset MERGEDREPOS
elif [ "${1}" = "submit-lineage-devices" ]; then
for device in ${lineage_devices[@]}; do
(
source "${vars_path}/${device}"
export MERGEDREPOS="${TOP}/merged_repos_${device}.txt"
push_lineage_merge "${lineageos_device_branch}"
unset MERGEDREPOS
)
done
fi
}

View File

@ -68,7 +68,7 @@ echo "#### Verification complete - no uncommitted changes found ####"
for PROJECTPATH in ${PROJECTPATHS}; do
cd "${TOP}/${PROJECTPATH}"
if [ "${LINEAGE}" = true ]; then
if grep -q "${lineageos_branch}" .gitupstream-lineage; then
if grep -q "${lineageos_device_branch}" .gitupstream-lineage; then
UPSTREAMBRANCH="$(cat .gitupstream-lineage | cut -d ' ' -f 2)"
else
UPSTREAMBRANCH="${lineageos_branch}"

View File

@ -1 +1,7 @@
# Fairphone 4
# Usage: ${device_repos[@]}
device_repos=(
device/fairphone/FP4
kernel/fairphone/sm7225
)

View File

@ -1 +1,7 @@
# SHIFT6mq
# Usage: ${device_repos[@]}
device_repos=(
device/shift/axolotl
kernel/shift/sdm845
)

View File

@ -17,5 +17,6 @@ readonly common_aosp_build_id=TQ2A.230305.008.C1 # Mar 2023, Pixel 4a - 5a, 7 Pr
readonly topic=mar23-1
readonly lineageos_branch=lineage-20.0
readonly lineageos_device_branch=lineage-20
readonly merge_method="merge"

6
vars/lineage_devices Normal file
View File

@ -0,0 +1,6 @@
# LineageOS supported devices (excluding Pixels)
# Usage: ${lineage_devices[@]}
readonly lineage_devices=(
FP4
axolotl
)