[Guide] Easily Build and Install LineageOS 17.1 with or without Gapps replacement

SolidHal

Member
Oct 4, 2016
5
21
0
I've put together a guide for building your own LineageOS 17.1 (android 10) using a docker build environment or on your own system. The guide includes environment setup, and installation instructions as well as some troubleshooting and debugging information.

The easy way is as simple as cloning two git repos, getting the docker image, and running build_sargo.sh
The hard way goes into more detail, requires more previous knowledge, and doesn't use the docker but is useful for getting more familiar with the process.

The docker image is one that already existed for building lineageos 16modified to supports lineagsos 17.
It also includes patches that haven't been merged upstream yet that fix bluetooth, a bootloop, and increase battery life.

With some small modifications, this could also be used for the Pixel 3a XL (bonito)

https://github.com/SolidHal/Build-lineageos-sargo
 

PGHammer

Senior Member
Jul 10, 2015
455
79
48
59
Accokeek,MD
I've put together a guide for building your own LineageOS 17.1 (android 10) using a docker build environment or on your own system. The guide includes environment setup, and installation instructions as well as some troubleshooting and debugging information.

The easy way is as simple as cloning two git repos, getting the docker image, and running build_sargo.sh
The hard way goes into more detail, requires more previous knowledge, and doesn't use the docker but is useful for getting more familiar with the process.

The docker image is one that already existed for building lineageos 16modified to supports lineagsos 17.
It also includes patches that haven't been merged upstream yet that fix bluetooth, a bootloop, and increase battery life.

With some small modifications, this could also be used for the Pixel 3a XL (bonito)

https://github.com/SolidHal/Build-lineageos-sargo
There should be VERY little modification required from sargo to bonito as one is simply a different size than the other. (I'm actually surprised that nobody ever compared the two in terms of hardware (especially since their simultaneous release).
 

gee one

Senior Member
Jul 29, 2010
1,979
865
0
linux command line
I have built pure lineageos 17 according to https://forum.xda-developers.com/pixel-3a/how-to/guide-easily-build-install-lineageos-17-t4048063
The esim manager has to be disabled or you have to stop enforcing SELinux.

Download:
https://drive.google.com/drive/folders/19MD_1CZrhejh29ui3Q12Ypqfp-mU3dlt?usp=sharing
If you include gapps in your build, the esim manager should stop crashing. If running gappless, I remove esim and hotword enrollment from the proprietary files.
 
  • Like
Reactions: kkjb

spinxen

Member
Nov 5, 2013
9
0
0
If you include gapps in your build, the esim manager should stop crashing. If running gappless, I remove esim and hotword enrollment from the proprietary files.
Hello!
I have also built & installed lineageos 17 according to the guide above, thanks!
Now i like to install Gapps, but how? Booting to linage-recovery and flash from internal storage wont work as it refuse to mount? And adb sideload'ing gapps-nano-zip gives a error message about to little space available? Any ideas?
 

fireclaw722

Member
Sep 25, 2016
8
6
3
Hello!
I have also built & installed lineageos 17 according to the guide above, thanks!
Now i like to install Gapps, but how? Booting to linage-recovery and flash from internal storage wont work as it refuse to mount? And adb sideload'ing gapps-nano-zip gives a error message about to little space available? Any ideas?
The issue is the new dynamic partition scheme doesn't leave enough room to install any extra system apps. There is a patch on the Lineage Gerrit, but it hasn't been merged (https://review.lineageos.org/c/LineageOS/android_device_google_bonito/+/261941).
 

gee one

Senior Member
Jul 29, 2010
1,979
865
0
linux command line
Hello!
I have also built & installed lineageos 17 according to the guide above, thanks!
Now i like to install Gapps, but how? Booting to linage-recovery and flash from internal storage wont work as it refuse to mount? And adb sideload'ing gapps-nano-zip gives a error message about to little space available? Any ideas?
I include gapps when I build the ROM. I have a vendor tree that is based off of opengapps pico. I just unpacked this pico zip and mimic'ed what it installed, plus something like pixel migration tool.
 
  • Like
Reactions: kkjb

spinxen

Member
Nov 5, 2013
9
0
0
I have built pure lineageos 17 according to https://forum.xda-developers.com/pixel-3a/how-to/guide-easily-build-install-lineageos-17-t4048063
The esim manager has to be disabled or you have to stop enforcing SELinux.

Download:
https://drive.google.com/drive/folders/19MD_1CZrhejh29ui3Q12Ypqfp-mU3dlt?usp=sharing
I include gapps when I build the ROM. I have a vendor tree that is based off of opengapps pico. I just unpacked this pico zip and mimic'ed what it installed, plus something like pixel migration tool.
This is somewhat above my level of knowledge, if you have a complete build zip with Gapps, do u mind sharing this with me?
 

PGHammer

Senior Member
Jul 10, 2015
455
79
48
59
Accokeek,MD
LioneageOS 17.1 for Poxel 3a: Notes from the front

I include gapps when I build the ROM. I have a vendor tree that is based off of opengapps pico. I just unpacked this pico zip and mimic'ed what it installed, plus something like pixel migration tool.
Because of the issues, I have stuck with those versions that include GApps (invisiblek's simple LineageOS 17.1 works a treat, and is cloneable for those looking to build their own). Until beta 3 of Android 11 drops, I'm running this. Still no TWRP, or root, or anything else. Other than Pixel Launcher, I'm basically running stock Lineage.
 

P1x3l3d

Member
Jun 24, 2013
5
1
23
Hi guys,

Just built my own image according to the 'easy' method (using docker). Took about 5 hours, and seemed to have gone well, almost no errors ;)

I started out by flashing the Pixel 3a with the lastest Android 10 Factory Image from Google (QQ2A.200305.002, Mar 2020) to be sure it's as clean as possible. Booted into Android 10 once, enabled Developer Settings et cetera.

Then followed the 'Install' steps from https://github.com/SolidHal/Build-lineageos-sargo:
- boot into bootloader (fastboot mode)
- run 'fastboot flash boot boot.img'
- reboot into recovery -> Apply update -> Apply from ADB -> run 'adb sideload lineage-17.1-20200404-UNOFFICIAL-sargo.zip' (in my case)

When entering recovery mode I noticed an error at the botton of the screen: 'E:[libfs_mgr]Failed to mount /data: Invalid argument'. Despite that I could continue and sideload/install my self built lineageos zip, which finished without error (status 0). After installation the phone went back to into recovery mode (as described on the Github guide). Unfortunately, when I continued and picked 'Reboot System Now' I got thrown into the bootloader with enter reason: 'error boot prepare'. Every time the phone boots I see this error now.

Does anybody have a clue what I could be doing wrong? Any help is appreciated, thanks!

Edit: Okay, seems my problem is solved. When flashing the self-built boot.img, in my case I also had to specify which boot part to flash to: boot_a or boot_b. After having done that, booting now works.

Thanks SolidHal for providing your docker file and making it easy to built your own LineageOS 17.1 image! :)
 
Last edited:
  • Like
Reactions: barqs_root

barqs_root

Member
Apr 9, 2020
7
0
0
Salt Lake City
Working and Running Smoothly

Thanks for posting this.
I was also able to build and install this successfully using the easy method. Yes, it takes a long time and requires an ample amount of memory and storage.

The battery life is excellent compared to the other roms/kernels I've tested so far. Started with a factory flash of Android 10.0.0 (QQ2A.200305.002, Mar 2020) (https://developers.google.com/android/ota). Then I followed the instructions here.

I also had the E:[libfs_mgr] error but it still installed correctly after the second try. Specifying boot_a or boot_b may have been what got this to work for me. Thanks to P1x3l3d.

Rooted by patching the boot image with Magisk (https://forum.xda-developers.com/pixel-3a/how-to/how-to-root-pixel-3a-preferred-t3938783).
 

PGHammer

Senior Member
Jul 10, 2015
455
79
48
59
Accokeek,MD
Hi guys,

Just built my own image according to the 'easy' method (using docker). Took about 5 hours, and seemed to have gone well, almost no errors ;)

I started out by flashing the Pixel 3a with the lastest Android 10 Factory Image from Google (QQ2A.200305.002, Mar 2020) to be sure it's as clean as possible. Booted into Android 10 once, enabled Developer Settings et cetera.

Then followed the 'Install' steps from https://github.com/SolidHal/Build-lineageos-sargo:
- boot into bootloader (fastboot mode)
- run 'fastboot flash boot boot.img'
- reboot into recovery -> Apply update -> Apply from ADB -> run 'adb sideload lineage-17.1-20200404-UNOFFICIAL-sargo.zip' (in my case)

When entering recovery mode I noticed an error at the botton of the screen: 'E:[libfs_mgr]Failed to mount /data: Invalid argument'. Despite that I could continue and sideload/install my self built lineageos zip, which finished without error (status 0). After installation the phone went back to into recovery mode (as described on the Github guide). Unfortunately, when I continued and picked 'Reboot System Now' I got thrown into the bootloader with enter reason: 'error boot prepare'. Every time the phone boots I see this error now.

Does anybody have a clue what I could be doing wrong? Any help is appreciated, thanks!

Edit: Okay, seems my problem is solved. When flashing the self-built boot.img, in my case I also had to specify which boot part to flash to: boot_a or boot_b. After having done that, booting now works.

Thanks SolidHal for providing your docker file and making it easy to built your own LineageOS 17.1 image! :)
Did you build in Linux? If so, which version? (I'm not used to building Docker - and especially in Linux - and I'd rather do it right; therefore WHICH version of Linux has everything to do it right is critical.)
 

barqs_root

Member
Apr 9, 2020
7
0
0
Salt Lake City
PGHammer, I don't think it's going to matter too much what distro you use because you're going to have to install the latest platform-tools and install docker from a repo anyways. Just use something recent. Ubuntu comes to mind if you're not a huge GNU/Linux guy.
I built using Debian Stretch and had no issues other than my ram got all used up so I had to create more swap and add
vm.swappiness=60 to /etc/sysctl.conf
You need 100+GB HDD, 16GB+ RAM, and a fat swap space (I used a 20GB Swap file)
Also someone (anon12?) already posted a ~700MB zip of their build in this thread and I can confirm it works.
 

swagglepuff

Senior Member
Jul 3, 2016
174
35
0
Also someone (anon12?) already posted a ~700MB zip of their build in this thread and I can confirm it works.
How did you you get this to install, I get signature verification failed, error:21. Then abd aborts the installation. I confirmed the integrity of the images with the provided checksum files. I even downgraded back to February's update because I was on Aprils update and thought that maybe that was the issues.
The steps I did are as follows:
Unlock bootloader
Enable debugging
Booting into the boot loader- run ./fastboot flash boot_a boot.img( ./ before is required due to being stuck on windows while I work from home.) Successfully installs to boot_a in 2.5sec.
Booting to recovery
Wipe/factory reset
Apply update from ADB- ./adb sideload lineage-17.1-20200222-UNOFFICIAL-sargo.zip
This is the following errors
E: failed to verify whole-file signature
Update package verification took 35.0 s (result 1).
E: Signature verification failed
E: error: 21

Install from ADB completed with status 2.
Installation aborted.