Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2e80593e authored by Jackeagle's avatar Jackeagle
Browse files

build_kernel: Remove empty manifests.git init, let repo init create it

Creating an empty bare manifests.git caused repo to fail with
'Cannot initialize work tree for manifests' since the empty repo
has no commits or branches to sync against.

The manifests.git check as the condition is sufficient: it ensures
cp -R runs on stale .repo/ directories (left with only TRACE_FILE
from failed runs), giving _FindRepo() a local repo/main.py to find.
repo init then creates manifests.git fresh from the kernel manifest
URL on first run, and the check skips setup on all subsequent runs.
parent c8dcc32e
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -951,14 +951,11 @@ function build_kernel() {
        echo "Kernel source ${KERNEL_BUILD_TOP} is missing, preparing folder structure"

        # Copy .repo/repo from Android tree to allow nested `repo init`.
        # Also create an empty manifests.git so the repo launcher recognizes
        # this as a valid local checkout and does not walk up to the parent
        # Android tree's .repo (which would cause it to reinitialize the wrong
        # manifest). On a dedicated server, manifests.git already exists from
        # a previously completed repo init, which is why it works there.
        # With .repo/repo/main.py present, _FindRepo() finds the local checkout
        # instead of walking up to the parent Android tree. repo init then
        # creates manifests.git fresh from the kernel manifest URL.
        mkdir -p "${KERNEL_BUILD_TOP}/.repo"
        cp -R "${ANDROID_BUILD_TOP}/.repo/repo" "${KERNEL_BUILD_TOP}/.repo/repo"
        git init --bare "${KERNEL_BUILD_TOP}/.repo/manifests.git" --quiet

        # Allow custom .repo/project-objects dir
        if [ -n "${KERNEL_REPO_PROJECT_OBJECTS_DIR}" ]; then