First build attempt

Sadly the forum is “protecting” against “bots” but in fact blocks humans, by having to wait an hour between messages :slight_smile: so even PM slows down and cannot respond in timely manner, so limited with reply hence writing the full picture as much as possible.

Incredible how such a promising project e/OS is having so many BASIC issues that many cannot figure out.. it shouldn’t be that hard. hopefully this can be changed, without having to re-explain to newcomers - if they follow basic guide, things should work, or at least not fail with old/known issues :slight_smile: :slight_smile:

OK, to the point:

Regarding “#5” above, AI suggested adding “-e “GIT_CONFIG_PARAMETERS=‘safe.directory=*’” \” and in resolved that issue,

then failed with:

/root/build.sh: line 87: DEVICE_LIST_V4.1.1-A15: invalid variable name

found many references in forum, this is bash in build.sh saying “.” and ”-” are illegal identifiers.

Sorry for totally Naive question.. Why do people need to re-discover this still? isn’t it known that tags have “.” and “-” for many years ? is this some kind of a TEST if we (newcomers) can figure things out? or “read the forum” ?

The AI got to this misguided direction and with certainty and long explanations!:

-e 'DEVICE_LIST_V4_1_A15=mi439' \
-e "USER_ID=1000" \
-e "BRANCH_NAME=v4_1_a15" \
-e "DEVICE=mi439" \
-e "DEVICE_LIST=mi439" \
-e "REPO=https://gitlab.e.foundation/e/os/android.git" \
-e "GIT_CONFIG_PARAMETERS='safe.directory=*'" \

yet still docker/run: ERROR: Failed to initialize repository

No luck, reading more found:

there it says one has to over-write the /root/build.sh (inside the docker)

so.. again, a) why is this not done on the docker side? what’s the idea of docker if it is broken?

b) where does one find the community build.sh ?

Not trivial, at all.. each gitlab access it asks for login, and no way to register without “work” email..

Are you worthy?…. Lets TEST it!!

after some time found the url:

https://gitlab.e.foundation/e/os/docker-lineage-cicd/-/raw/master/build-community.sh

Now what? ah, right, the “solution” gave the “diff”, so, we write that into a patch file:

# cat > patch.1
diff --git a/build-community.sh b/build-community2.sh
index 5d3c5e6..bf7d217 100644
--- a/build-community.sh
+++ b/build-community2.sh
@@ -41,7 +41,7 @@ fi
 # Treat DEVICE_LIST as DEVICE_LIST_<first_branch>
 first_branch=$(cut -d ',' -f 1 <<<"$BRANCH_NAME")
 if [ -n "$DEVICE_LIST" ]; then
-  device_list_first_branch="DEVICE_LIST_$(sed 's/.*-\([a-zA-Z]*\)$/\1/' <<<$first_branch)"
+  device_list_first_branch="DEVICE_LIST_$(sed 's/.*-\([a-zA-Z0-9]*\)$/\1/' <<<$first_branch)"
   device_list_first_branch=${device_list_first_branch^^}
   read $device_list_first_branch <<<"$DEVICE_LIST,${!device_list_first_branch}"
 fi
@@ -80,7 +80,7 @@ if [ "$LOCAL_MIRROR" = true ]; then
 fi
 
 for branch in ${BRANCH_NAME//,/ }; do
-  branch_dir=$(sed 's/.*-\([a-zA-Z]*\)$/\1/' <<<$branch)
+  branch_dir=$(sed 's/.*-\([a-zA-Z0-9]*\)$/\1/' <<<$branch)
   branch_dir=${branch_dir^^}
   device_list_cur_branch="DEVICE_LIST_$branch_dir"
   devices=${!device_list_cur_branch}

Then apply the patch to original file:

# patch build-community.sh < patch.1 
patching file build-community.sh
Hunk #1 succeeded at 43 (offset 2 lines).
Hunk #2 succeeded at 82 (offset 2 lines).

ok, regex/diffs looks like post from 2025:

# diff build-community.sh build-community.sh.orig 
46c46
<   device_list_first_branch="DEVICE_LIST_$(sed 's/.*-\([a-zA-Z0-9]*\)$/\1/' <<<$first_branch)"
---
>   device_list_first_branch="DEVICE_LIST_$(sed 's/.*-\([a-zA-Z]*\)$/\1/' <<<$first_branch)"
85c85
<   branch_dir=$(sed 's/.*-\([a-zA-Z0-9]*\)$/\1/' <<<$branch)
---
>   branch_dir=$(sed 's/.*-\([a-zA-Z]*\)$/\1/' <<<$branch)

now edit the docker run to map the patched build.sh:

-v "/work/ROMs/build-community.sh:/root/build.sh" \
-e "USER_ID=1000" \
-e "BRANCH_NAME=v4.1-a15" \
-e "DEVICE=mi439" \
-e "DEVICE_LIST=mi439" \
-e "REPO=https://gitlab.e.foundation/e/os/android.git" \
-e "GIT_CONFIG_PARAMETERS='safe.directory=*'" \

run docker gets:

Running: yes | repo init -u “https://gitlab.e.foundation/e/os/android.git” -b “v4.1-a15”

and….

Copying ‘/srv/local_manifests/*.xml’ to '.repo/local_manifests/

Syncing branch repository

GREAT !!!

but, wait, the directory name mismatches..

renamed the directory to match:

/work/ROMs/e/src# du -shc V4_1_A15/
173G V4_1_A15/
173G total

but that is totally wrong, it seems to create A15 directory.. so stopped it renamed to A15 and rerun..

FINALLY, some progress :slight_smile:

What I’m saying, it shouldn’t be that way… I’m willing to donate time to fix that, shouldn’t take too much to update the docker image to have a corrected build.sh given it’s been like that since at least a year :slight_smile:

although not sure it IS doing anything useful, the repo is growing but not sure why since it was synched before the build started,

# du -shc .
191G    .
191G    total

Now continuing in previous reply:

regarding:

“The existence of Mi439 · lineage-19.1 · The Muppets / proprietary_vendor_xiaomi · GitLab means that one can avoid the need for extract.sh"

does that mean that i can skip the loop mounting system/vendor completely? Thats good news!!

Thanks for the ultimate guide link, a bit too much details for first build. will look later.. I didn’t anticipate docker build would be so time consuming…

anyways, managed to make some progress, build is running, and i’ll flash one of the pre-built to see how it looks like!

Just to be sure, not complaining, just trying to bring to attention, and cause some positive change to everyone, not just those who can “figure it out” and are “worthy” :slight_smile: The importance of the effort should transcend any communication issues.. hey, I’m blocked from replying for the next hour or so :slight_smile: :slight_smile:

will update as build progresses…

Stormy.