[HOWTO] Built a Pie-GSI


  • Thanks to Phh and PhieF for patches and build scripts

Please read carefully !

  • The original build script from PhieF includes a defaut device encryption without password. So there is noway to get access to your data via TWRP. I have removed this in my built script.
  • The original build script from PhieF includes also rooting the device by default. Because a ‚normal‘ user don‘t need root and a lot of banking apps wont work on rooted devices I have removed root.
  • The original build script from PhieF builts the full set of 6 different GSI. I have changed to 1 GSI. Between line 119 til 124 of buildbot_treble.sh you can decide which GSI type you want to build. Therefore you have to stop the build script after repo sync.
  • The patches / additional sources from Phh do have a mistake. So I have created a fork of the Samsung drivers which are incl. in the manifest.xml

The building itself is very easy. Start my built script and after some hours you will have your GSI image in out folder

My script you can download here:

if you want better use original script with default encryption and SuperSU you should change line 5 in my script to:
git clone https://github.com/phief/e_gsi_localmanifest .repo/local_manifests


Hi there!

First, thank you for your effort for creating and compiling this scripts!
I have tried (Ubuntu 20.04) to create GSI build from this script for 5-6 times but every time my build process fails with (more or less) this errors:

hi, I’m not sure because as I have written, all theses scripts and patches are from others. But I have had also a lot of crazy errors when using a linux with python3 and Ubuntu 20 has python3.

So better to downgrade python or lot better to downgrade to ubuntu 18.04 LTS and trying once more. I hope it will run than without errors.

but wait, it could also be an unix issue. try first
unix2dos gsi.sh

and start once more

Actually, i saw your post somewere about Linux Mint so i think i’ll better create Mint 19.3 VM and try with that.
Thanks for the your help and the info!

Yes, I’m building with Mint 19.3

Hi @harvey186I’ve tried to download your building script, but it seems it is not available anymore … could you please check it?

new link to manifest for PIE-GSI here https://ecloud.global/s/jNzTQPjs5i5xPCy

Build script here https://ecloud.global/s/wJiLRcbw2oSmy42
It won’t work for Q-GSI

1 Like

@harvey186 Hi again,
I’m trying to build a standard ROM image to start…
Here my steps:

  1. I have a Virtual Machine LM19.3 64bits
  2. here the commands I did:
sudo apt install docker.io systemctl start docker sudo docker pull registry.gitlab.e.foundation:5000/e/os/docker-lineage-cicd:community

sudo mkdir -p

sudo docker run
-v “/srv/e/src:/srv/src”
-v “/srv/e/zips:/srv/zips”
-v “/srv/e/logs:/srv/logs”
-v “/srv/e/ccache:/srv/ccache”
-e “BRANCH_NAME=v0.11-pie”
-e “DEVICE_LIST=starlte”
-e “OTA_URL=”
-e “REPO=https://gitlab.e.foundation/e/os/releases.git”

the building is starting but I get the following error:

Branch name v0.11-pie is a tag on e/os/releases, prefix with refs/tags/ for ‘repo init’

[Sat Sep 12 20:03:04 UTC 2020] Copying ‘/srv/local_manifests/*.xml’ to ‘.repo/local_manifests/’
Traceback (most recent call last):
File “/root/build_manifest.py”, line 61, in
TypeError: write() argument must be str, not bytes

[Sat Sep 12 20:03:05 UTC 2020] Syncing branch repository
[Sat Sep 12 20:03:05 UTC 2020] Missing “vendor/lineage”, aborting

Would you please tell me if I’m missing something?
Thx again

You can’t build a GSI with docker. And I’m a none docker builder. So I have no knowledge about docker.
If you want build a standart rom with docker, pls check the docker build docu.

Your error message is pointing to a wrong repo command

As yku can see here, there is no branch v.011-pie only a ‘tag’. For using the tags, the comnand must be different. But I don’t know how :pensive:

I would try using ‘v1-pie’

Edit: by the way, you know that there is a Q version under custom rom available for your device?

I didn’t know it… so what I miss is how to build a GSI ROM help…
Is there a howto for building a GSI rom?

could you please point me to this custom rom?
thx again

Here you can find my Q build for starlte [CUSTOM BUILD] Galaxy S9 starlte --- Android Q

This script is for building PIE-GSI https://ecloud.global/s/wJiLRcbw2oSmy42

sorry, I posted the building steps for S9 starlte because I followed the e foundation guide to build a ROM…
When (if) my build were ok, I would have changed to test my own device…

my device is an A7 2018… for this device I would need the Q ROM

Thanks I’m going to try with this script…

A Q rom, yes, but not a GSI !!! Or is it a treble supported device ??

And pls keep in mind, in the moment only MY Q-builds are ungoogled. The sources of eOS Q are NOT ungoogled !!!

Yes it is a treble supported device thpe arm64a only…
I would need:

  • a way to build a gsi degoogled image
  • a download degoogled image for pie or q

Thx again :grinning:

For Q, no way in the moment. to ungoogle a lot of source changes must be done.

You will find in the GSI section

Sorry to bother you again…
I am a newbie in this field…
OK, I started to execute the commands of the building script.
The first line is:
repo init -u https://gitlab.e.foundation/e/os/releases.git -b refs/tags/v1-pie

and this is the result in terminal

user@pc:~$ repo init -u https://gitlab.e.foundation/e/os/releases.git -b refs/tags/v1-pie
gpg: keybox ‘/home/user/.repoconfig/gnupg/pubring.kbx’ created
gpg: /home/user/.repoconfig/gnupg/trustdb.gpg: trustdb created
gpg: key 16530D5E920F5C65: public key “Repo Maintainer repo@android.kernel.org” imported
gpg: key 67B7E448692B382C: public key “Conley Owens cco3@android.com” imported
gpg: Total number processed: 2
gpg: imported: 2

Get https://gerrit.googlesource.com/git-repo/clone.bundle
Get https://gerrit.googlesource.com/git-repo
remote: Counting objects: 1, done
remote: Finding sources: 100% (31/31)
remote: Total 31 (delta 11), reused 31 (delta 11)
Unpacking objects: 100% (31/31), done.
From https://gerrit.googlesource.com/git-repo
65f51ad…50a81de master -> origin/master

  • [new tag] v2.9 -> v2.9
    repo: warning: Python 2 is no longer supported; Please upgrade to Python 3.6+.

… A new version of repo (2.8) is available.
… New version is available at: /home/user/.repo/repo/repo
… The launcher is run from: /usr/bin/repo
!!! The launcher is not writable. Please talk to your sysadmin or distro
!!! to get an update installed.

repo: Updating release signing keys to keyset ver 2.3
Downloading manifest from https://gitlab.e.foundation/e/os/releases.git
Invalid clone.bundle file; ignoring.
fatal: Couldn’t find remote ref refs/tags/v1-pie
fatal: Couldn’t find remote ref refs/tags/v1-pie

^Caborted by user

I’m on LM19.3 64bits

if you are using tags, you have to use v.011-pie

if you are using branches, you have to use v1-pie


in this page you can see the branches and tags https://gitlab.e.foundation/e/os/releases

thanks for your support…
I’ve been able to finally create a VM on LM19.3 with a building chain and I did complete the repo sync command…
this evening I’m going to start building…
I’ll keep you updated :smiley: