Issue to build a correct image for Pixel sailfish from AOSP - Google Pixel Questions & Answers

Dears,
I apologize if same kind of topic already exist. I searched but did not find anything.
I want to build my own image for Pixel (sailfish) from AOSP.
I built it and flashed it, but my Pixel is now blocked and reboot continuously.
I would like to know what is wrong in my procedure:
repo init https://android.googlesource.com/platform/manifest -b android-8.0.0_r30
repo sync
Extract binaries from qcom-sailfish-opr3.170623.013-e4997420.tgz and sailfish-opr3.170623.013-factory-bdc49b40.zip
source build/envsetup.sh
lunch aosp_sailfish-userdebug
make
Then to flash:
First flashed official ROM : sailfish-opr3.170623.013
then
fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash system_other system_other.img
fastboot flash vendor vendor.img
fastboot flash userdata userdata.img
Did I made something wrong ?
any thanks I advance for your support

Something tells me that if it were that easy, there would be 100s of Oreo roms, not just 1.

If you have TWRP installed you can get a console-ramoops from it.
If you do I am guessing you will be running into this error:
Code:
[ 2.875998] c2 1 init: /system/bin/secilc: Failed to resolve typeattributeset statement at /system/etc/selinux/mapping/26.0.cil:561
[ 2.876026] c2 1 init: /system/bin/secilc: Failed to compile cildb: -2
[ 2.876116] c2 1 init: /system/bin/secilc exited with status 254
[ 2.876159] c2 1 init: panic: rebooting to bootloader
The commits to fix this can be found here:
https://review.carbonrom.org/#/q/topic:stock_vendor
or here:
https://gerrit.omnirom.org/#/q/topic:stock_vendor

thank you, I will try

I finally found a workaround, let me explained.
I am not satisfied, but at least it works...
I downloaded the google factory image corresponding to android-8.0.0_r30 from
https://developers.google.com/android/images
OPR3.170623.013, Nov 2017
Inside there is a zip with .img files
I replaced those files with mine, and used flash-all
Now it works...
the problem is that there are many files, an dI am able to generate/update only few of them...
aboot.img -> ??
android-info.txt -> ok
apdp.img -> ??
boot.img -> ok
bootlocker.img -> ??
cmnlib32.img -> ??
cmnlib64.img -> ??
devcfg.img -> ??
hosd.img -> ??
hyp.img -> ??
keymaster.img -> ??
list.txt -> ??
modem.img -> ??
pmic.img -> ??
ramdisk-recovery.img -> ok
ramdisk.img -> ok
rpm.img -> ??
system.img -> ok
system_other.img -> ok
tz.img -> ??
userdata.img -> ok
vendor.img -> ok
xbl.img -> ??

So, what does your new rom have over the factory versions? 8.1 just dropped a few hrs ago.

I think his mission is learning. Not supplying you with an l33t firmware.
Sent from my Pixel using Tapatalk

maulich said:
I think his mission is learning. Not supplying you with an l33t firmware.
Click to expand...
Click to collapse
Didn't want one. I was genuinely wondering what his customizations were, Stock 8.x on the Pixel, is quite close to AOSP, and now that 8.1 is out with all the bug fixes that 8.0 needed...

I was able to build 8.0.0 for Pixel without issues. Make sure to disable the jack server when building, otherwise you'll likely have errors:
Code:
make ANDROID_COMPILE_WITH_JACK:=false
edit: for 8.1.0 you need to do
Code:
export ANDROID_COMPILE_WITH_JACK=false
before compiling for the option to have an effect
edit: also you should flash the images with fastboot flashall -w
8.1.0 Sources are also available now at android-8.1.0_r1, I'm currently downloading them.
However even with a successful build, there are minor issues I had, see here:
https://forum.xda-developers.com/android/help/compiled-aosp-8-0-0-source-pixel-dialer-t3714890

Hello,
I just realized that when I build the aosp for sailfish, the vendor.img partition is not built.
it uses a prebuilt image, located in
/vendor/google_devices/sailfish/proprietary/vendor.img
Does anybody knows how to generate our own vendor.img file ?
thanks in advance

maulich said:
I think his mission is learning. Not supplying you with an l33t firmware.
Sent from my Pixel using Tapatalk
Click to expand...
Click to collapse
Yes right, mission is learning.

zongojim said:
Hello,
I just realized that when I build the aosp for sailfish, the vendor.img partition is not built.
it uses a prebuilt image, located in
/vendor/google_devices/sailfish/proprietary/vendor.img
Does anybody knows how to generate our own vendor.img file ?
thanks in advance
Click to expand...
Click to collapse
The vendor partition contains proprietary things from the hardware manufacturers, things like device drivers and photo processing for example. Since the source code for those isn't freely available, you cannot build the image yourself.

HeavyHDx said:
The vendor partition contains proprietary things from the hardware manufacturers, things like device drivers and photo processing for example. Since the source code for those isn't freely available, you cannot build the image yourself.
Click to expand...
Click to collapse
yes I know this. But in previous Nexus images, we can use the binaries delivered by Google from:
https://www.google.com/url?sa=t&rct...roid/drivers&usg=AOvVaw314pNmO5TDKaw5H1b3pyYS
Then we could build vendor.img partition including these binaries.
For Pixel, I also retrieved the binaries, and now would like to build the new vendor.img partition.
vendor.img contains other information than only binaries, that I am interested to change (for instance sepolicy files, or init rc files)

Alright, 8.1.0 seems to work perfectly without any crashes this time. I'll sign it real quick and do a bit of testing and then I'll make a thread and upload the ROM.

HeavyHDx said:
Alright, 8.1.0 seems to work perfectly without any crashes this time. I'll sign it real quick and do a bit of testing and then I'll make a thread and upload the ROM.
Click to expand...
Click to collapse
I'm also trying to build AOSP for 8.1.0. However, my ultimate goal would be building it with the new Android GO configuration, any ideas how to approach this?

ka-la said:
I'm also trying to build AOSP for 8.1.0. However, my ultimate goal would be building it with the new Android GO configuration, any ideas how to approach this?
Click to expand...
Click to collapse
No idea, I'm also new to to this all. I discovered that the dialer does crash when making or receiving phone calls, however. I'm currently making my post.

HeavyHDx said:
No idea, I'm also new to to this all. I discovered that the dialer does crash when making or receiving phone calls, however. I'm currently making my post.
Click to expand...
Click to collapse
Did you make... the Dialer app your default Phone app under Settings -> Apps -> Advanced -> Default Apps -> Phone app?

ka-la said:
Did you make... the Dialer app your default Phone app under Settings -> Apps -> Advanced -> Default Apps -> Phone app?
Click to expand...
Click to collapse
Yup.
Thread is up now:
https://forum.xda-developers.com/pixel/development/rom-aosp-8-1-0-sailfish-t3715557

ka-la said:
I'm also trying to build AOSP for 8.1.0. However, my ultimate goal would be building it with the new Android GO configuration, any ideas how to approach this?
Click to expand...
Click to collapse
Man, I'd love to see that. I asked the Nova guys last night if they could enhance their Google Assistant tool to let you pick what app, so I could have it open Google Go (search lite) and I sideloaded YoutubeGo and it works good.

Hi, ran my 8.0.0 AOSP build without issues on the dialer. Have a look at the AOSP fixes which I collected from developers.
https://github.com/GeyerA/device_google_marlin/commit/dd78aff040dccef47ba0a77a84f1bc2b2373c468
Here also the content of aosp_fixes.mk which I kept in the vendor_tree (credit to PureNexusProject).
Code:
# Copyright (C) 2017 The Pure Nexus Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Google property overides
ifeq ($(filter marlin sailfish,$(TARGET_PRODUCT)),)
PRODUCT_PROPERTY_OVERRIDES += \
keyguard.no_require_sim=true \
ro.control_privapp_permissions=enforce \
ro.url.legal=http://www.google.com/intl/%s/mobile/android/basic/phone-legal.html \
ro.url.legal.android_privacy=http://www.google.com/intl/%s/mobile/android/basic/privacy.html \
ro.com.google.clientidbase=android-google \
ro.error.receiver.system.apps=com.google.android.gms \
ro.setupwizard.enterprise_mode=1 \
ro.com.android.dataroaming=false \
ro.atrace.core.services=com.google.android.gms,com.google.android.gms.ui,com.google.android.gms.persistent \
ro.setupwizard.rotation_locked=true \
ro.config.notification_sound=Chime.ogg \
ro.config.alarm_alert=Flow.ogg \
ro.config.ringtone=Zen.ogg
ro.carrier=unknown
endif
I also built the gapps directly with the ROM which might make a difference. Maybe this is of help.... Also, what does logcat say?

Related

Solution to Moto G (2013) Tearing with Lollipop Bootloader (41.19) and Android KitKat

After upgrading my bootloader to Lollipop (41.18 / 41.19), I had decided to revert back the kernel / system to Android 4.4.4, this combination introduced an horizontal line going from the top of the screen to the bottom (a.k.a. tearing).
After hours of investigation, I realized that the following Motorola patch updates the Lollipop kernel to match the changes made to the bootloader:
https://github.com/MotorolaMobilityLLC/kernel-msm/commit/0d868145ddd71389c1df8b875aea2c5cee2b1cb3
if you apply the same patch to kernel version 4.4.4, it will solve the tearing issue with the Lollipop bootloader
attached a build of the GPE-4.4.4 kernel that includes the fix (based on kernel-msm-kitkat-4.4.4-KTU84P.M003)
p.s. The only part in the kernel that is changed is the device tree.
You can build a boot.img for Retail US 4.4.4?
Thanks!
juancmb said:
You can build a boot.img for Retail US 4.4.4?
Thanks!
Click to expand...
Click to collapse
attached, based on KXB21.14-L1.61.
tal.aloni said:
attached, based on KXB21.14-L1.61.
Click to expand...
Click to collapse
Oh, thank you!
It is possible to build a boot.img with the patch for Retail US 4.4.2 KXB20.9-1.10-1.24-1.1? I've been trying to compile it myself but I have not achieved yet, I'm noob with this.
Sorry and thank you.
motogextreme said:
It is possible to build a boot.img with the patch for Retail US 4.4.2 KXB20.9-1.10-1.24-1.1? I've been trying to compile it myself but I have not achieved yet, I'm noob with this.
Sorry and thank you.
Click to expand...
Click to collapse
I was not able to find the source code for this specific version, in any case, I won't be able to provide a build for every kernel out there,
I'm using BuilduntuVM.
You'll need NDK r10d and a few additional prerequisites:
Code:
sudo apt-get install p7zip-full
7z x android-ndk-r10d-linux-x86.bin
Code:
sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2
sudo apt-get install lzop
Steps:
1. Apply the attached patches.
Code:
patch -p1 < ../build_fix.patch
patch -p1 < ../tearing_fix_for_lollipop_bootloader.patch
2. Build the kernel.
Code:
export CROSS_COMPILE=/home/yourusername/NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-
export ARCH=arm
make clean
make mrproper
make msm8226_defconfig
make menuconfig
make -j3
3. Build the device tree using dtbTool
Code:
../dtbTool/dtbTool -p scripts/dtc/ -o arch/arm/boot/dt.img arch/arm/boot/
4. Use Android Image Kitchen to unpack boot.img and replace "boot.img-dtb" with the one you built (dt.img), and then repack boot.img, use "repackimg.bat --original" to keep the original ramdisk.
5. Flash the resulting boot.img to your Moto G.
tal.aloni said:
I was not able to find the source code for this specific version, in any case, I won't be able to provide a build for every kernel out there,
I'm using BuilduntuVM.
You'll need NDK r10d and a few additional prerequisites:
Code:
sudo apt-get install p7zip-full
7z x android-ndk-r10d-linux-x86.bin
Code:
sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2
sudo apt-get install lzop
Steps:
1. Apply the attached patches.
Code:
patch -p1 < ../build_fix.patch
patch -p1 < ../tearing_fix_for_lollipop_bootloader.patch
2. Build the kernel.
Code:
export CROSS_COMPILE=/home/yourusername/NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-
export ARCH=arm
make clean
make mrproper
make msm8226_defconfig
make menuconfig
make -j3
3. Build the device tree using dtbTool
Code:
../dtbTool/dtbTool -p scripts/dtc/ -o arch/arm/boot/dt.img arch/arm/boot/
4. Use Android Image Kitchen to unpack boot.img and replace "boot.img-dtb" with the one you built (dt.img), and then repack boot.img.
5. Flash the resulting boot.img to your Moto G.
Click to expand...
Click to collapse
So this will build every kitkat kernel fixed?
I'll need it for non-GPE version (KXB21.14-L1.40). If you provided a more extense tutorial, it'd be great
PS: As you can see, I'm a noob on Android Dev ?
if you need a different version, first you go to https://github.com/MotorolaMobilityLLC/kernel-msm/releases and locate the kernel source code for the version you require, then you build it per my instructions (google for more detailed instructions).
cgrs,
attached a build of the KXB21.14-L1.40 kernel including the fix.
p.s. you don't have to quote my whole post.
Is there any way to make it work for Peregrine (XT1040)?
You can see that the same patch was applied to the Peregrine tree, so the solution should be the same.
tal.aloni said:
...
cgrs,
attached a build of the KXB21.14-L1.40 kernel including the fix.
p.s. you don't have to quote my whole post.
Click to expand...
Click to collapse
Unfortunately after flashing your boot.img for 'KXB21.14-L1.40' on my stock KK Ver. 'XT1032_RETAIL-GB_4.4.4_KXB21.14-L1.40_36_cid7' I loose all cellular & wifi services on my phone.
Is there something wrong with my flashing method?
Code:
mfastboot flash boot boot.img
mfastboot flash modem NON-HLOS.bin
mfastboot erase modemst1
mfastboot erase modemst2
mfastboot flash fsg fsg.mbn
After reverting back to the original kernel everything is back to normal.
I also noticed there is ~2MB file size difference between the original and your boot.img files
Original => 10MB
Patched => 8MB
Is this normal?
Would it be possible to patch my boot.img? I dumped my linux partition on my PC, setting up a build environment will cost me many hours.
Thank you very much!
# Attached : my original boot.img from XT1032_RETAIL-GB_4.4.4_KXB21.14-L1.40_36_cid7
apparently there's a bug in Android Image Kitchen v2.4, and it's enough to unpack and repack boot.img to cause the wifi issue you encountered.
I've updated the original posts with proper images.
Thanks for reporting the issue.
Edit:
The bug is in mkbootfs, the program responsible to recompress the ramdisk, that's an optional step that can be skipped with "repackimg.bat --original" (which will leave the original ramdisk as is), we don't need to modify the ramdisk anyway.
Wow! so would be possible to make a cm11 build with kernel fixed! A lot of compliment to @tal.aloni ! no more screen flickering in stock kk! I have flashed your first boot.img in stock rom, and works good!!!
tal.aloni said:
apparently there's a bug in Android Image Kitchen v2.4, and it's enough to unpack and repack boot.img to cause the wifi issue you encountered.
I've updated the original posts with proper images.
Thanks for reporting the issue.
Click to expand...
Click to collapse
No problem! No more tearing now and WiFi is working as expected.
Thanks for patching!
Cheers,
miami_
Can you please make a kernel for xt1033 Indian version.
pradeeppk said:
Can you please make a kernel for xt1033 Indian version.
Click to expand...
Click to collapse
I don't have an XT1033 to test, why don't you do it:
http://forum.xda-developers.com/showpost.php?p=67571375&postcount=6
I believe XT1032 and XT1033 (and possibly all Falcon variants) use the same Kernel.
lost101 said:
I believe XT1032 and XT1033 (and possibly all Falcon variants) use the same Kernel.
Click to expand...
Click to collapse
I installed your Android 6.0 Rom (deviant version) and started getting the scrolling line issue. How do I fix that?

[tool] ANDROID-ROM-REPACK-TOOLS

Note:I am sorry I can't post this in the Android development thread because my number of posts is low. Hopefully some mod can move it there.
Introduction
Since this project (Android_IMG_REPACK_TOOLS) is dead for 2 years now (last supported version is Marshmallow). I decided to do a new rom repacker that supports up to Android Oreo.
Supported OS
Linux
Supported Android Versions
android-5 (Lollipop)
android-wear-5
android-6 (Marshmallow)
android-7 (Nougat)
android-8 (Oreo)
android-9 (Pie) beta
Binaries included
append2simg
img2simg
simg2img
simg2simg
make_ext4fs (Google removed it for android 9. I will add a replacement in the future)
mkbootfs
mkbootimg
unpackbootimg (For android-wear-5, you can use the one in android-5)
sefcontext_compile
sefcontext_decompile
Usage
Check this post out for some use case. You'll need img2simg and make_ext4fs from my post.
sefcontext_compile and sefcontext_decompile:
ROMS since Android 7 (Nougat) come with a binary file_contexts but you need a text based file_contexts when you need to repackage the ROM. You'll need it for make_ext4fs. sefcontext_decompile converts the binary file_contexts into text version.
Code:
# file_contexts (human readable text file) -> file_contexts.bin (PCRE formatted binary file)
sefcontext_compile [-o <output_file>] <text_file>
# file_contexts.bin (PCRE formatted binary file) -> file_contexts (human readable text file)
sefcontext_decompile [-o <output_file>] <binary_file>
Source code
Repository
android-5
android-wear-5
android-6
android-7
android-8
android-9
Download links for Linux
Download page
android-5
android-wear-5
android-6
android-7
android-8
android-9
Change Log:
v3:
Added android-5 and android-wear-5 support
Added android-9 beta support
v2:
Added sefcontext_compile and sefcontext_decompile: converts between file_contexts.bin and file_contexts
Static linking to libc++: No need to install 3rd party libraries to use the binaries.
v1:
Added append2simg img2simg simg2img simg2simg make_ext4fs mkbootfs mkbootimg unpackbootimg
credits:
@A.S._id
android.googlesource
LineageOS
Created: 2018-03-16
Updated: 2018-08-18
[Placeholder]
[Placeholder2]
Can i extract a rom if i have only ssyetm. New. Dat??, i have file context. Bin in boot. Img can it be used?
I know usual extraction needs both these+system. Transfer. List but a rom which i m using have just this configuration.
what is simg2simg?
and how to make system.new.dat.br?
thanks for your work
zheshifandian said:
what is simg2simg?
and how to make system.new.dat.br?
thanks for your work
Click to expand...
Click to collapse
Use brtoli. Exe to make. Br from. Dat format
narshi shukla said:
Can i extract a rom if i have only ssyetm. New. Dat??, i have file context. Bin in boot. Img can it be used?
I know usual extraction needs both these+system. Transfer. List but a rom which i m using have just this configuration.
Click to expand...
Click to collapse
I believe this question is better suited in this thread. You'll need system.transfer.list in sdat2img.py which is provided over there. I haven't worked on a ROM that doesn't have system.transfer.list. Isn't system.transfer.list required for flashing the ROM?
Btw you need to convert file_context.bin to text format. There are a couple of closed source solutions here on xda. I am working on an open source version in my free time.
zheshifandian said:
what is simg2simg?
Click to expand...
Click to collapse
You can find answers to a lot of the questions you might have in the old project.
A.S._id said:
Yes, simg2simg can reduce file size by splitting into several parts, but it is usually not necessary, fastboot can flash and in this state
Click to expand...
Click to collapse
Awesomeness, easy and simple
hi bro i want extract oreo system.new.dat.br and also repack dat to .br in windows
please help me bro
and im unable to convert oreo file_context.bin to readable in windows
please help thanks in advance
New version available in Original Post.
Change log
v2:
Added sefcontext_compile and sefcontext_decompile: converts between file_contexts.bin and file_contexts
Static linking to libc++: No need to install 3rd party libraries to use the binaries.
marshharsha said:
hi bro i want extract oreo system.new.dat.br and also repack dat to .br in windows
please help me bro
and im unable to convert oreo file_context.bin to readable in windows
please help thanks in advance
Click to expand...
Click to collapse
Oreo ROMs come compressed by brotili. You can compile from source to get the executable or you can get the binaries directly from the release page (version 1.0). Use it to extract and repack .br.
I added a converter from file_context.bin to a readable format in the new version I just uploaded.
This project only supports Linux as of now. As for using it in Windows, you have 3 options,
Use a linux distro in VirtualBox (I currently use this option)
Install a linux bash shell in Windows 10
Build the project in Cygwin (hopefully someone can make a pull request and share it with the rest)
rkhat said:
Oreo ROMs come compressed by brotili. You can compile from source to get the executable or you can get the binaries directly from the release page (version 1.0). Use it to extract and repack .br.
I added a converter from file_context.bin to a readable format in the new version I just uploaded.
This project only supports Linux as of now. As for using it in Windows, you have 3 options,
Use a linux distro in VirtualBox (I currently use this option)
Install a linux bash shell in Windows 10
Build the project in Cygwin (hopefully someone can make a pull request and share it with the rest)
Click to expand...
Click to collapse
thanks brother for your kind reply can you give guide for make exe from brotli source? with java or c
thanks again
marshharsha said:
thanks brother for your kind reply can you give guide for make exe from brotli source? with java or c
thanks again
Click to expand...
Click to collapse
Just use a pre-built brotli from the release page (there is a window version). It doesn't matter that the executable is not the latest version as you only need to extract compress the .br file.
If you really need to build brotli for windows, just open scripts/appveyor.yml in the github repository. Decide which environment you want (I see they support 32-bit/64-bit versions for Visual Studio, Python, MinGW). Download the necessary software (python, mingw ...). Then run the commands in appveyor.yml using cmd in this order.
@rkhat
Hi and thanks for making the tools for us.
I am getting the below error when ./img2simg new-system.img news-system.img. I downloaded version for Nougat.
img2simg: /android-rom-repacker/external/platform/core/src/libsparse/sparse.c:153: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.
Aborted
I am running Ubuntu. Do you know what might be the problem ?
sdeft said:
@rkhat
Hi and thanks for making the tools for us.
I am getting the below error when ./img2simg new-system.img news-system.img. I downloaded version for Nougat.
img2simg: /android-rom-repacker/external/platform/core/src/libsparse/sparse.c:153: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.
Aborted
I am running Ubuntu. Do you know what might be the problem ?
Click to expand...
Click to collapse
Just tested a Nougat lineage ROM for Nexus 7 from here. No issues!
Are you sure you used this version for Nougat?
If you still have issues, can you link me the zipped ROM and more importantly the source you got it from so I can test it out? Thank you.
rkhat said:
Just tested a Nougat lineage ROM for Nexus 7 from here. No issues!
Are you sure you used this version for Nougat?
If you still have issues, can you link me the zipped ROM and more importantly the source you got it from so I can test it out? Thank you.
Click to expand...
Click to collapse
I think I found the issue. This is happening only when i perform it on the image created with
./make_ext4fs -s -l 3000M -a system new-system.img tmp/
If I just umount the image and then apply img2simg it works.
Is this strange or what ?
sdeft said:
I think I found the issue. This is happening only when i perform it on the image created with
./make_ext4fs -s -l 3000M -a system new-system.img tmp/
If I just umount the image and then apply img2simg it works.
Is this strange or what ?
Click to expand...
Click to collapse
Don't use "-s" (lowercase s) option. It only writes sparse headers in new-system.img. The file is only couple MBs instead of 3000MB you specified. I am curious how img2simg even worked.
Also, use "-S file_contexts" (uppercase S) option to apply the security contexts on files. The zipped ROM has file_contexts.bin (binary version) since Android Nougat. You'll need to convert it to text format. You can use the executable sefcontext_decompile included in my tools to convert file_contexts.bin to file_contexts.
rkhat said:
Don't use "-s" (lowercase s) option. It only writes sparse headers in new-system.img. The file is only couple MBs instead of 3000MB you specified. I am curious how img2simg even worked.
Also, use "-S file_contexts" (uppercase S) option to apply the security contexts on files. The zipped ROM has file_contexts.bin (binary version) since Android Nougat. You'll need to convert it to text format. You can use the executable sefcontext_decompile included in my tools to convert file_contexts.bin to file_contexts.
Click to expand...
Click to collapse
I am not using a zipped rom with file_contexts.bin, system.new.dat etc.
I am trying to mod a system.img from a fastboot rom for xiaomi. So far only managed to have the userdata.img working but system.img keeps giving me bootloops!. Will try your suggestion above...
build use cygwin window 7 x64
how build use cygwin on w7 x64? or can you make for windows too?
sorry for bad engglish
anggafzkdev99 said:
how build use cygwin on w7 x64? or can you make for windows too?
sorry for bad engglish
Click to expand...
Click to collapse
I don't use windows in this project. So you're on your own in building using cygwin
Alternatively, you can use Ubuntu on VirtualBox which is what I currently use.

[GUIDE] How to build an unsupported rom using sources from other roms

Hello all and welcome to my first how-to guide
I began the process of learning about ROM about 4 months ago (so excuse this post if there are any inaccuracies and please feel free to correct me in the comments - I will absolutely update this post to ensure it has the best information)
Whilst I was trying to learn, I noticed there was a lack of information regarding how the actual build process works. Many roms will provide instructions allowing you to build your own unofficial version for one of their official devices, but very rarely do they inform you as to how you may do this for a device not officially supported.
This is what I shall try and explain here.
Building for a newer version of android is another challenge, so this guide will focus on building an unsupported rom from device sources that support the same version of android (e.g building Lineage oreo from AOSCP oreo sources etc)
Requirements
A relatively fast PC with a least 4 cores (less may work but it will take a long time)
At least 8GB ram
A swap-file set up in the event that your ram is fully filled
A significant amount of storage (each build can take 150-200GB)
Set up your PC for building
Firstly, allocate Jack enough memory to complete the build process by running
Code:
export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4G"
And adding that line to your ~/.bashrc file
Also (optional) enable ccache by running
Code:
export USE_CCACHE=1
and adding that to your ~/.bashrc
If you choose to use ccache, also allocate a set amount of memory to use with
Code:
ccache -M $G
Where $ is a value of your choice between 50 and 100
First things first, we need to download the main source code for the target rom
Firstly you need to sync the sources from the manifest of your chosen rom. This will normally be called android, or manifest (or something similar) and will contain some xml files layed out like the example local manifest below
Find this repo and copy the link. Then move to the location you wish the entire android code to be stored, and then perform the following command
Code:
repo init -u <url of manifest repo>.git -b <branch you want to build>
e.g. for lineage 15.1 it would be
Code:
repo init -u https://github.com/LineageOS/android.git -b lineage-15.1
Finally, run "repo sync" to download the source code. It is very large (approximately 30GB) so it will take a while. Should you need to cancel this, a simple CTRL+C will stop it, and it will continue from where it stopped next time you run repo sync
Now we need to understand which components we need to build a custom rom.
We need (anything inside the <> needs to be replaced with relevant information for your device)
A device tree. This contains all the information needed to configure the rom build to your device's needs. Often this comes as more than one repo (one for your exact device and one for the general model - e.g. for my LG G4 H815, we have the h815 repo and the g4-common repo). The format for these repos is generally android_device_<vendor>_<device model>
A kernel. This contains all the drivers and more needed for your device to be able to run Android. Often these are named using your device's chipset name and follow the format android_kernel_<vendor>_<chipset>, although occasionally they can use your model name instead of the chipset.
Proprietary blobs. These are the closed source blobs that come bundled in your OEM software and contain the non-OSS (open source software) drivers for your device. They normally come in a repo labeled proprietary_vendor_<vendor> which normally contains blobs for all the devices released by that vendor (that are supported).
Any other repos specified by the dependencies file (more on that later)
All of the above repos go into the path specified in the name - for example, android_device_<vendor>_<device model> will go into the device/<vendor>/<device model> directory.
To sync these, you should create a local manifest in the <android source>/.repo/local_manifests/ folder. Name it anything you like (make sure it's an xml file) and fill it out like so
Code:
<manifest>
<remote name="<your chosen name for this url>"
fetch="<url to your git organisation>"
revision="<branch if different to the one used in repo init (otherwise, miss out revision)>"
<project name="<name of repo inside git org>" path="<destination of the repo>" remote="<remote name chosen earlier>" revision="<revision if different to one specified above>" />
</manifest>
After adding this manifest, re-run repo sync to pull the extra repos
Understanding the device tree.
Inside the device tree (model specific one if there are more than one) there will be a file with a naming scheme along the lines of <rom brand>.mk (e.g. lineage.mk). This is the starting file for your device and is detected when you begin a build for your device. (Pie roms are currently using AndroidProducts.mk as a placeholder containing a link to this file). It contains links to the common configuration of your device (phone, tablet etc) at the top, and also specifies the name of the product (normally <rom>_<device model>) which is part of the command used to build the device.
There will also be some build prop overrides - these contain information like the device name and the build fingerprint (used to verify to google what device you are - lots of devices leave this as the last stock fingerprint to pass google CTS)
In most device trees, there will also be a <rom>.dependencies file. This contains all the additional repos needed to build for your particular device. This file is parsed automatically if you use the official methods and use the breakfast command. If you do it manually, they must be added to a local manifest.
The <device model>.mk file is what defines what open source packages need to be built in the build. Devices either include everything in this file or they can link to a product folder in which every .mk file is included.
BoardConfig(Common).mk includes configuration options for the device, and often links to config files to inform the builder of certain flags that need to be applied for the build. Similarly to the <device model>.mk, this is often linked to a board folder containing configurations
The kernel
The kernel is a massive topic and one that I cannot explain in depth here. However, for rom building it is useful to know that the defconfigs used to build a kernel are located in kernel/<chipset/device model>/arch/<arm or arm64 depending on device>/configs and the one used is normally in the format <rom>_<device model>_defconfig (e.g my lineage one is lineageos_h815_defconfig). Should you wish to change the name, simply change the name and alter the defconfig name in the BoardConfig.mk for your particular device.
So...to the main part - how do you build a rom.
Essentially there are a few main commands that are spoken about
"source build/envsetup.sh". This runs the builder script and loads all the custom commands.
"breakfast". This simply pulls the device specific code from the official repos. You do not need this if you are building unofficially
"brunch". This effectively performs breakfast, but assuming everything is synced correctly, it will finish without an issue. Then it will go on to begin the build. Normally brunch is run as brunch <rom name>_<device model>-userdebug (or eng if you are developing). User is used for OEM releases but most roms use userdebug as it is slightly more relaxed on conditions
To build a rom from unsupported sources requires a bit of thought. Firstly, ensure you have all the dependencies synced (hopefully from the target rom) as well as the device sources.
Then you need to go into the device tree and modify
The <rom>.mk file to now be renamed to your new rom.
You need to enter that file and modify any stuff relating to your old ROM look for your new rom instead (device type configurations are normally the main one here).
You need to remove any stuff inside your device tree relating to features not in your new rom.
Then run "source build/envsetup.sh"
"brunch <rom>_<device model>-userdebug"
This will hopefully begin the build and assuming everything is setup correctly, should continue through to finish building the rom of your choice
If you have any questions/issues with this process, I will be happy to answer to the best of my ability
Also, big thanks to the LineageOS guide for giving me a basis upon which to base this guide on
PRODUCT_COMPATIBILITY_MATRIX_LEVEL_OVERRIDE directly
Specify Framework Compatibility Matrix Version in device manifest by adding a target-level attribute to the root element <manifest>. If PRODUCT_COMPATIBILITY_MATRIX_LEVEL_OVERRIDE is 26 or 27, you can add "target-level"="1" to your device manifest instead.
how to implement this?
nadeem_naddy said:
PRODUCT_COMPATIBILITY_MATRIX_LEVEL_OVERRIDE directly
Specify Framework Compatibility Matrix Version in device manifest by adding a target-level attribute to the root element <manifest>. If PRODUCT_COMPATIBILITY_MATRIX_LEVEL_OVERRIDE is 26 or 27, you can add "target-level"="1" to your device manifest instead.
how to implement this?
Click to expand...
Click to collapse
Sorry for the late reply
What Android version are you building (this determines the api level). Also, what rom and device (links are helpful as I can see what it going on)
I would imagine you need something like https://github.com/LineageOS/androi...mmit/c24f0fff1fb1fc46d638e91777281ec7efc3e239
ThePiGuy said:
Sorry for the late reply
What Android version are you building (this determines the api level). Also, what rom and device (links are helpful as I can see what it going on)
I would imagine you need something like https://github.com/LineageOS/androi...mmit/c24f0fff1fb1fc46d638e91777281ec7efc3e239
Click to expand...
Click to collapse
i did not get the way to override or more precisely i dont know where to put the code to over ride this flag so i simply commented this in BoardConfig.mk itself. as it says its deprecated.
now i encounter this -
66% 2/3] glob frameworks/base/core/java/**/*.java
ninja: error: unknown target 'nitrogen_X00TD'
01:34:03 ninja failed with: exit status 1
it would be great help if you let me know from where does frameworks pick the device info in device tree. where do we need to set path.. i am building nitrogen pie for my device X00TD. thanks
the latest issue am facing is -
ninja: error: '/home/matin1117/nitrogen/out/target/common/obj/java_libraries/qcrilhook_intermediates/classes.jar', needed by '/home/matin1117/nitrogen/out/target/common/obj/packaging/boot-jars-package-check_intermediates/stamp', missing and no known rule to make it.
please suggest a fix.
thanks,
Nadeem
nadeem_naddy said:
the latest issue am facing is -
ninja: error: '/home/matin1117/nitrogen/out/target/common/obj/java_libraries/qcrilhook_intermediates/classes.jar', needed by '/home/matin1117/nitrogen/out/target/common/obj/packaging/boot-jars-package-check_intermediates/stamp', missing and no known rule to make it.
please suggest a fix.
thanks,
Nadeem
Click to expand...
Click to collapse
Is Pie ready for your device. For most ROMs it requires a lot of cherry-picking etc before it will build
ThePiGuy said:
Is Pie ready for your device. For most ROMs it requires a lot of cherry-picking etc before it will build
Click to expand...
Click to collapse
yes the device have many pie roms but i want to build nitrogen. i
can see niteogen os pie built for many other phones using sd636.
nadeem_naddy said:
yes the device have many pie roms but i want to build nitrogen. i
can see niteogen os pie built for many other phones using sd636.
Click to expand...
Click to collapse
Pie is an oddball case at the moment. Many ROMs work if you cherry-picking fixes off Gerrit (I built Pie Lineage for my G4 but it required about 20 cherry-picks off the lineage Gerrit before it built)
In your case, it looks like you are possibly missing a ril-caf repo (look in the nos.xml and you will see only the non-caf repo is being synced). You can add the caf one but it's possible it isn't ready yet
thanks a lot, i can see one ril related entry in nos.xml. let me do some research on it.
thanks a lot for all your help buddy.
iam facing this error ? can u help please..... ?
see attachment ! 
 @ThePiGuy
Thanks in advance
vignesh95 said:
iam facing this error ? can u help please..... ?
see attachment !
@ThePiGuy
Thanks in advance
Click to expand...
Click to collapse
Ok can you show me the result of
Code:
ls device/oneplus
here u have it (see attachment)
ThePiGuy said:
Ok can you show me the result of
Code:
ls device/oneplus
Click to expand...
Click to collapse
Hi @ThePiGuy
vignesh95 said:
Hi @ThePiGuy
Click to expand...
Click to collapse
ok. And now
Code:
ls device/oneplus/oneplus2
here u have it (see attachment)
ThePiGuy said:
ok. And now
Code:
ls device/oneplus/oneplus2
Click to expand...
Click to collapse
revised 
 @ThePiGuy
vignesh95 said:
revised
@ThePiGuy
Click to expand...
Click to collapse
Ok. Sorry for the late reply.
You need to open the AndroidProducts.mk file and rename the lineage_oneplus2.mk line to aosp_oneplus2.mk.
You also need to change the lineage_oneplus2.mk file so it is called aosp_oneplus2.mk, and inside it you need to change any occurrences to aosp (basically you are rebranding the device tree to use the aosp versions rather than the lineage branded ones)
ThePiGuy said:
Ok. Sorry for the late reply.
You need to open the AndroidProducts.mk file and rename the lineage_oneplus2.mk line to aosp_oneplus2.mk.
You also need to change the lineage_oneplus2.mk file so it is called aosp_oneplus2.mk, and inside it you need to change any occurrences to aosp (basically you are rebranding the device tree to use the aosp versions rather than the lineage branded ones)
Click to expand...
Click to collapse
thanks! @ThePiGuy
now i am getting this error
[944/944] including vendor/qcom/opensource/dataservices/Android.mk ...
device/oppo/common/configpanel/Android.mk: error: ConfigPanel (APPS android-arm64) missing org.lineageos.platform.internal (JAVA_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
build/make/core/main.mk:837: error: exiting from previous errors.
20:05:06 ckati failed with: exit status 1
#### failed to build some targets (03:05 (mm:ss)) ####
Please help !
vignesh95 said:
thanks! @ThePiGuy
now i am getting this error
[944/944] including vendor/qcom/opensource/dataservices/Android.mk ...
device/oppo/common/configpanel/Android.mk: error: ConfigPanel (APPS android-arm64) missing org.lineageos.platform.internal (JAVA_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
build/make/core/main.mk:837: error: exiting from previous errors.
20:05:06 ckati failed with: exit status 1
#### failed to build some targets (03:05 (mm:ss)) ####
Please help !
Click to expand...
Click to collapse
Sorry, I don't think I can help with that
Make sure your build environment is set up correctly (wiki.lineageos.org/devices/oneplus2/build will help with that) and also ensure you are using Pie device sources (from what I have gathered you are trying to build Pie, but if you are using device trees and kernel from Oreo or anything else then it will require much more than this guide details)
Hi bro, i want to build lineage OS for unsupported device(Xiaomi Vince), please give me the step
---------- Post added at 08:57 AM ---------- Previous post was at 07:58 AM ----------
iam get error like this
including vendor/lineage/vendorsetup.sh
build/make/core/envsetup.mk:264: error: TARGET_ARCH not defined by board config: device/xiaomi/vince/BoardConfig.mk.
15:41:16 dumpvars failed with: exit status 1
Device vince not found. Attempting to retrieve device repository from LineageOS Github (http://github.com/LineageOS).
Repository for vince not found in the LineageOS Github repository list. If this is in error, you may need to manually add it to your local_manifests/roomservice.xml.
build/make/core/envsetup.mk:264: error: TARGET_ARCH not defined by board config: device/xiaomi/vince/BoardConfig.mk.
15:41:18 dumpvars failed with: exit status 1
build/make/core/envsetup.mk:264: error: TARGET_ARCH not defined by board config: device/xiaomi/vince/BoardConfig.mk.
15:41:19 dumpvars failed with: exit status 1
** Don't have a product spec for: 'aosp_vince'
** Do you have the right repo manifest?
No such item in brunch menu. Try 'breakfast'
Click to expand...
Click to collapse
Help me
Hey
I have a common device source, which has linked my device to 3 more configuration files. I tried to change lineage to other rom in every possible location I can find but on building this error comes into action.
The error is same for every AOSP based rom
[email protected]:~/AEX$ mka aex -j4
vendor/aosp/config/bootanimation.mk:32: warning: Target bootanimation res is undefined, using generic bootanimation
============================================
▄▄▄ ▓█████ ▒██ ██▒
▒████▄ ▓█ ▀ ▒▒ █ █ ▒░
▒██ ▀█▄ ▒███ ░░ █ ░
░██▄▄▄▄██ ▒▓█ ▄ ░ █ █ ▒
▓█ ▓██▒░▒████▒▒██▒ ▒██▒
▒▒ ▓▒█░░░ ▒░ ░▒▒ ░ ░▓ ░
▒ ▒▒ ░ ░ ░ ░░░ ░▒ ░
░ ▒ ░ ░ ░
░ ░ ░ ░ ░ ░
AospExtended-v6.3 9
============================================
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=9
EXTENDED_MOD_VERSION=AospExtended-v6.3-20190311-0935-UNOFFICIAL
TARGET_PRODUCT=aosp_fortuna3g
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=cortex-a53
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.15.0-20-generic-x86_64-Linux-Mint-19
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=PQ2A.190205.001
OUT_DIR=/home/jmpfbmx/AEX/out
PRODUCT_SOONG_NAMESPACES= hardware/qcom/audio-caf/msm8916 hardware/qcom/display-caf/msm8916 hardware/qcom/media-caf/msm8916
============================================
[1/1] /home/jmpfbmx/AEX/out/soong/.minibootstrap/minibp /home/jmpfbmx/AEX/out/soong/.bootstrap/build.ninja
[55/56] glob prebuilts/ndk/stl.bp
[80/80] /home/jmpfbmx/AEX/out/soong/.bootstrap/bin/soong_build /home/jmpfbmx/AEX/out/soong/build.ninja
/home/jmpfbmx/AEX/out/build-aosp_fortuna3g-cleanspec.ninja is missing, regenerating...
vendor/aosp/config/bootanimation.mk:32: warning: Target bootanimation res is undefined, using generic bootanimation
/home/jmpfbmx/AEX/out/build-aosp_fortuna3g.ninja is missing, regenerating...
vendor/aosp/config/bootanimation.mk:32: warning: Target bootanimation res is undefined, using generic bootanimation
[25/1110] including development/build/Android.mk ...
development/build/build_android_stubs.mk:43: warning: android_stubs_current
development/build/build_android_stubs.mk:43: warning: metalava_android_stubs_current metalava_android_stubs_current
development/build/build_android_stubs.mk:43: warning: android_system_stubs_current
development/build/build_android_stubs.mk:43: warning: android_test_stubs_current
development/build/build_android_stubs.mk:43: warning: metalava_android_system_stubs_current metalava_android_system_stubs_current
development/build/build_android_stubs.mk:43: warning: metalava_android_test_stubs_current metalava_android_test_stubs_current
[271/1110] including frameworks/av/camera/Android.mk ...
frameworks/av/camera/cameraserver/Android.mk:18: warning: Target has integrated cameraserver into mediaserver. This is weakening security measures introduced in 7.0
[607/1110] including system/sepolicy/Android.mk ...
system/sepolicy/Android.mk:88: warning: Be careful when using the SELINUX_IGNORE_NEVERALLOWS flag. It does not work in user builds and using it will not stop you from failing CTS.
[1110/1110] including vendor/samsung/serranovexx-common/Android.mk ...
bootable/recovery/Android.mk: error: recovery (EXECUTABLES android-arm) missing libhealthd.lineage (STATIC_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
device/samsung/qcom-common/doze/Android.mk: error: SamsungDoze (APPS android-arm) missing org.lineageos.platform.internal (JAVA_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
hardware/interfaces/health/1.0/default/Android.mk: error: [email protected] (SHARED_LIBRARIES android-arm) missing libhealthd.lineage (STATIC_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
hardware/samsung/AdvancedDisplay/Android.mk: error: AdvancedDisplay (APPS android-arm) missing org.lineageos.platform.internal (JAVA_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/core/healthd/Android.mk: error: charger (EXECUTABLES android-arm) missing libhealthd.lineage (STATIC_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
build/make/core/main.mk:850: error: exiting from previous errors.
10:40:35 ckati failed with: exit status 1
build/make/core/main.mk:21: recipe for target 'run_soong_ui' failed
make: *** [run_soong_ui] Error 1
#### failed to build some targets (05:24 (mm:ss)) ####
itexpert.120 said:
Hey
I have a common device source, which has linked my device to 3 more configuration files. I tried to change lineage to other rom in every possible location I can find but on building this error comes into action.
The error is same for every AOSP based rom
[email protected]:~/AEX$ mka aex -j4
vendor/aosp/config/bootanimation.mk:32: warning: Target bootanimation res is undefined, using generic bootanimation
Click to expand...
Click to collapse
Ok so what it looks like - did you sync only the device trees and any common ones and then use the "brunch" or "breakfast" command to download the rest of the repos. If so, then it's still pulled the repos from lineage (in all the dependency files, you can see where they come from)
If you did, try finding the AEX equivalent repo and replacing that in the .dependency file that it is referred to in.
If this is not what you did, please detail what you did to get your environment

[ROM] Unofficial LineageOS 16.0 PQ3A.190801.002] for ZTE Blade S6 (P839F30)

Code:
[I]DISCLAIMER[/I]
[COLOR="red"]Do not mirror my builds![/COLOR] Please post a link to this thread instead.
All information and files — both in source and compiled form — are provided on an as is basis.
No guarantees or warranties are given or implied. The user assumes all risks of any damages
that may occur, including but not limited to loss of data, damages to hardware, or loss of
business profits. Please use at your own risk. Note that unless explicitly allowed by the
warranty covering your device, it should be assumed that any warranty accompanying your
device will be voided if you tamper with either the system software or the hardware.
Introduction
This is my unofficial build of LineageOS 16.0 for the ZTE Blade S6 aka P839f30.
This is the first alpha release, so be aware that issues could arise.
I have tested this version with my AS variant device. Other variants have to be tested.
Click to expand...
Click to collapse
Features
working:
phone: calls, sms, data.
wifi
bluetooth
sensors
gps: mostly I have used the energy saving mode
sound
camera: rear with flash and front.
torch
headphone detection
swap back and menu button
light: button backlight, brightness control and adaptive brightness, breath light (notification and/or battery)
not working:
SELinux is permissive.
We have to test to find out.
Click to expand...
Click to collapse
Installation instructions
It is best to have installed the latest stock rom beforehand, so modem and all other vendor stuff is up to date.
If you like you can use this mod to have a unified data partition, please proceed with caution.
You will need TWRP or any other custom recovery.
Reboot into recovery and do a nand backup.
Do a factory format.
Download Rom and put it on your phone or use adb sideload.
Install the rom and then clear cache and dalvik cache.
optional: install su and/or gapps (preferable pico).
Click to expand...
Click to collapse
Changelog:
25.05.2021 - new release:
los security patch level 05.05.2021
revert some kernel changes from the last release
add some cpu governors and cpu hotplug
now with Boeffla WakeLock Blocker and other things
wireguard kernel support
22.12.2019 - 1st beta release:
los security patch level 05.12.
kernel supports EU device variant
add autosmp hotplug
add cpu governors blu_active, darkness, lionfish and relaxed
Revert CwMcu sensor driver from SU6 kernel release
24.10.2019 - 2nd alpha release:
los security patch level 05.10.
CwMcu sensor driver from SU6 kernel release, with wake lock disabled
wifi mac is loaded anyway, remove the loading in the wifi driver
give bluetooth a null mac address, to overcome force close error
kang gps from oppo
04.10.2019 - 1st alpha release:
los security patch level 05.09.
initial release of pie
Click to expand...
Click to collapse
Downloads
new release - 25.05.2021:
Google Drive.
first beta release - 22.12.2019:
Google Drive or here.
second alpha release - 24.10.2019:
Google Drive or here.
first alpha release - 04.10.2019:
Google Drive or here.
If you want root use the lineage addon package found here - download arm version.
Install it after flashing the rom or download your favourite root package and install it.
Click to expand...
Click to collapse
Sources
device
msm8916-common
vendor
kernel
Click to expand...
Click to collapse
FAQ
Here you will find some answers to common question which could arise.
Q: How to give root access to an app or adb?
A: First install the su extra package from Lineage OS or any other su tool you like. Then go into settings and about device, click there multiple times on the build number until you unlocked the developer options. Go to developer options and look for root access.
Q: I thing I found an issue, what to do now?
A: Do a logcat or grab a dmesg while having the issue, otherwise we can't say what is happening. Report as much info as possible. Quote your stock rom your device shipped with or which device variant you possess.
Click to expand...
Click to collapse
Thanks To/Credits
Code:
*aquaris-dev team
*aymende7
*PacMM79
*LineageOS team
*many others
XDA:DevDB Information
Unofficial LineageOS 16.0 [PQ3A.190801.002] P839F30, ROM for the ZTE Blade S6
Contributors
lightwars
ROM OS Version: 9.x Pie
ROM Kernel: Linux 3.10.x
Based On: LineageOS 16.0
Version Information
Status: Beta
Current Beta Version: 20191213
Beta Release Date: 2019-12-22
Created 2019-10-04
Last Updated 2019-12-22
many thanks for the new version, i will tested later :good: :highfive:
Hello, works on my ZTE Blade S6 Plus (p839f50)
but only with a fixed updater-script
from Folder: lineage-16.0-20191002-UNOFFICIAL-p839f30.zip\META-INF\com\google\android
the bold text must delete and than save the file
after the start my phone , i have a error message with bluetooth is deactivated
updater-script - original
https://filehorst.de/d/crqjwnjI
updater-script - fixed
https://filehorst.de/d/cbmctorj
new update is in the op.
just small changes and updated security patch level.
Anybody tested with EU device?
... at the moment no time to test myself (to much effort to keep my other devices up-to-date ), just wanted to ask if anybody already tested on EU device (and forgot to post ).
Gtz
Kurt
Kurt Krummbein said:
... at the moment no time to test myself (to much effort to keep my other devices up-to-date ), just wanted to ask if anybody already tested on EU device (and forgot to post ).
Click to expand...
Click to collapse
Answer my own request, gave it a try, didn't boot, screen stayed black and device went into fastboot-mode ... restored my nandroid-backup of stock-EU-B15 .
Next time, i format system and just install rom without gapps and addon-su.
Gtz
Kurt
Kurt Krummbein said:
Answer my own request, gave it a try, didn't boot, screen stayed black and device went into fastboot-mode ... restored my nandroid-backup of stock-EU-B15 .
Next time, i format system and just install rom without gapps and addon-su.
Gtz
Kurt
Click to expand...
Click to collapse
Hello Kurt,
please, if you find the time to do another test. Download the attached zip extract the boot.img and copy it to your device, flash it with twrp right after installing the lineage zip through twrp. report back if something different happens.
I splited the dtb from the zImage and attached the almost stock eu dtb, so maybe we are lucky. But I have not find any big differences in analyzing the dts of EU vs AS and kernel defconfigs EU vs AS.
I can show this files too, if somebody has a better understanding of this.
lightwars said:
Hello Kurt,
please, if you find the time to do another test. Download the attached zip extract the boot.img and copy it to your device, flash it with twrp right after installing the lineage zip through twrp. report back if something different happens.
I splited the dtb from the zImage and attached the almost stock eu dtb, so maybe we are lucky. But I have not find any big differences in analyzing the dts of EU vs AS and kernel defconfigs EU vs AS.
I can show this files too, if somebody has a better understanding of this.
Click to expand...
Click to collapse
Hi!
Well, i loaded the def's and config's into WinMerge and did a compare ... in the def's there are some different addresses, but i have now clue what the meaning of that all is :angel:. The config files look like beeing from different kernel versions, there are some options which don't exist in both, one is modularised, the other is not ... all in all quite strange.
Ok, i made a try with the boot_eu.img:
- Made a factory reset
- Flashed the LOS.zip
- Wiped caches
- unzipped the boot.img
- copied it to boot partition with dd if=boot_eu.img of=/dev/block/bootdevice/by-name/boot
- reboot
... screen goes black, one buzz .... nothing. One the PC the fastboot device appears and that's it. I was looking for tombstones, but couldn't find any ... they are stored to /data/tombstones, are they? I'm not sure, the kernel i getting up high enough to mount /data.
Cheers
Kurt
P.S.: one thing i forgot to mention ... i coulnd't find the "OEM unlock" swich in the stock system anywhere and the bootloader seems to be quite dumb, many commands from fastboot just end in a "command unknown", perhaps there's something left to do on my side (tweak in build.prop etc ... googleed for it no result ).
Kurt Krummbein said:
Ok, i made a try with the boot_eu.img:
- Made a factory reset
- Flashed the LOS.zip
- Wiped caches
- unzipped the boot.img
- copied it to boot partition with dd if=boot_eu.img of=/dev/block/bootdevice/by-name/boot
- reboot
... screen goes black, one buzz .... nothing. One the PC the fastboot device appears and that's it. I was looking for tombstones, but couldn't find any ... they are stored to /data/tombstones, are they? I'm not sure, the kernel i getting up high enough to mount /data.
Click to expand...
Click to collapse
Thanks for testing. You used the reboot system button of twrp I guess. Have you tried to reboot by pressing the power button?
I can think of two things: There is some flag in the kernel source which is called download_mode. I have seen that some devices have different default values! At the moment the value is 0, devices like the ones from bq with msm8916/msm8939 used this too, but devices from oppo with msm8939 uses a value of 1 as default. We can try this one.
Or there is a mask, which defines the restart reason so to speak says the device which mode to boot to. Here we have some differences in the meaning of the bits, a different bit shifting is used.
I can not really think that one of these causes your device to boot into download mode, because the recovery uses the same kernel on both region variants...
lightwars said:
Thanks for testing. You used the reboot system button of twrp I guess. Have you tried to reboot by pressing the power button?
I'll give that one a try .
Hope my device is not "going over the Wupper" LOL (this one has to come somewhen ...)
Click to expand...
Click to collapse
Ok, tried it ... same result. Then did a (perhaps a bit wired) test, just restored boot from my nandroid-backup. With this, the white ZTE bootscreen comes up and after some seconds it reboots to twrp.
Perhaps the dumb-bootloader refuses to boot with AS keys ... otherwise it wouldn't boot recovery. Strange puzzle.
Cheers
Kurt
Kurt Krummbein said:
Ok, tried it ... same result. Then did a (perhaps a bit wired) test, just restored boot from my nandroid-backup. With this, the white ZTE bootscreen comes up and after some seconds it reboots to twrp.
Perhaps the dumb-bootloader refuses to boot with AS keys ... otherwise it wouldn't boot recovery. Strange puzzle.
Cheers
Kurt
Click to expand...
Click to collapse
It is okay to do some unusual testings. I was doing this sort of things also, back then.
I'm not sure I get you, when you write about AS keys. Do you mean the fingerprint in the build.prop? I think I used the ones from the eu version. Maybe they build in some kind of kernel version check inside the bootloader, but only for the eu and other versions.
The cause is, that android needs an advanced kernel, so we can not use the stock kernel to boot newer android version like nougat, oreo or pie.
Sorry, I can not be of much help here, because I do not have a device with eu or some other region version. But we can try do some changes, if you like to do some more testing and maybe get something like a log, last_kmseg or ramoops. We should look to activate some of them.
Hello @Kurt Krummbein,
if you find the time please post the info you get by issuing this commands in the adb shell or on your phone in a terminal:
Code:
su
cat /sys/zte_board_id/board_id
cat /proc/device-tree/model
cat /proc/device-tree/compatible
Do this on your rom or stock rom you are using a the moment. Thank you.
For reference mine output is this:
Code:
Blade-S6:/ # cat /sys/zte_board_id/board_id
wrbA
Blade-S6:/ # cat /proc/device-tree/model
Qualcomm Technologies, Inc. MSM 8939 MTP
Blade-S6:/ # cat /proc/device-tree/compatible
qcom,msm8939-mtp qcom,msm8939 qcom,mtp
It could be that the eu variant uses another device tree inside the kernel, because the bootloader request that, but we have only this model available.
lightwars said:
Hello @Kurt Krummbein,
if you find the time please post the info you get by issuing this commands in the adb shell or on your phone in a terminal:
Code:
su
cat /sys/zte_board_id/board_id
cat /proc/device-tree/model
cat /proc/device-tree/compatible
Do this on your rom or stock rom you are using a the moment. Thank you.
For reference mine output is this:
Code:
Blade-S6:/ # cat /sys/zte_board_id/board_id
wrbA
Blade-S6:/ # cat /proc/device-tree/model
Qualcomm Technologies, Inc. MSM 8939 MTP
Blade-S6:/ # cat /proc/device-tree/compatible
qcom,msm8939-mtp qcom,msm8939 qcom,mtp
It could be that the eu variant uses another device tree inside the kernel, because the bootloader request that, but we have only this model available.
Click to expand...
Click to collapse
Mine is:
cat /sys/zte_board_id/board_id
wrbA-EUROPE
cat: /proc/device-tree/model: No such file or directory
cat: /proc/device-tree/compatible: No such file or directory
ls /proc/device-tree
/proc/device-tree: No such file or directory
Attached my build.prop ... perhaps this sheds some light .
Thx
Kurt
Kurt Krummbein said:
Mine is:
cat /sys/zte_board_id/board_id
wrbA-EUROPE
cat: /proc/device-tree/model: No such file or directory
cat: /proc/device-tree/compatible: No such file or directory
ls /proc/device-tree
/proc/device-tree: No such file or directory
Attached my build.prop ... perhaps this sheds some light .
Thx
Kurt
Click to expand...
Click to collapse
Sorry for that, I forgot that the stock kernel did not expose the device tree.
But I think I remeber the info about the model is in the logcat after boot up...
Please try this ones in a terminal on the phone or via adb shell, they should work.
Code:
su
Blade-S6:/ # cat /sys/devices/soc0/hw_platform
MTP
Blade-S6:/ # cat /sys/devices/soc0/soc_id
239
lightwars said:
Sorry for that, I forgot that the stock kernel did not expose the device tree.
But I think I remeber the info about the model is in the logcat after boot up...
Please try this ones in a terminal on the phone or via adb shell, they should work.
Code:
su
Blade-S6:/ # cat /sys/devices/soc0/hw_platform
MTP
Blade-S6:/ # cat /sys/devices/soc0/soc_id
239
Click to expand...
Click to collapse
mine is:
cat /sys/devices/soc0/hw_platform
MTP
cat /sys/devices/soc0/soc_id
268
cat /sys/devices/soc0/image_version
10:LRX22G:eng.root.20150808.123811
Gtz
Kurt
Kurt Krummbein said:
mine is:
cat /sys/devices/soc0/hw_platform
MTP
cat /sys/devices/soc0/soc_id
268
cat /sys/devices/soc0/image_version
10:LRX22G:eng.root.20150808.123811
Gtz
Kurt
Click to expand...
Click to collapse
Fantastic! Here we have an explanation. Your device reports 268 as id which equals to msm8929 and I have a device with id 239 which is msm8939. The kernel only holds a device tree blob (dtb) for the id 239. I thought that the variant were very similar, so last time I used a dtb from the eu release but only for id 239. Attached I have added a dtb for id 268. Please test this rom with that boot image.
Again, just unpack the bootASEU.img and copy it to your device, flash it after installing the lineageos zip.
Please make a backup beforehand and report back, when you have time. Happy trying out.
lightwars said:
Fantastic! Here we have an explanation. Your device reports 268 as id which equals to msm8929 and I have a device with id 239 which is msm8939. The kernel only holds a device tree blob (dtb) for the id 239. I thought that the variant were very similar, so last time I used a dtb from the eu release but only for id 239. Attached I have added a dtb for id 268. Please test this rom with that boot image.
Again, just unpack the bootASEU.img and copy it to your device, flash it after installing the lineageos zip.
Please make a backup beforehand and report back, when you have time. Happy trying out.
Click to expand...
Click to collapse
One step ahead ! Phone is booting with the new boot.img ... but ends with a bootloop.
Highest was one boot with start of the setup-wizard, but after setting language to "Deutsch (Deutschland)" (and several "Bluetooth is not working" messages) it went around again. Couldn't get logs yet ... well see :
Cheers
Kurt
Kurt Krummbein said:
One step ahead ! Phone is booting with the new boot.img ... but ends with a bootloop.
Highest was one boot with start of the setup-wizard, but after setting language to "Deutsch (Deutschland)" (and several "Bluetooth is not working" messages) it went around again. Couldn't get logs yet ... well see :
Cheers
Kurt
Click to expand...
Click to collapse
Yeah! Would be best to build the dtb from source, rather than attaching just the right one to the kernel...
The bluetooth message can be made silent, by the way what build you are using? I think the first build has not the fix for the message. The build.prop should contain this line:
Code:
ro.boot.btmacaddr=00:00:00:00:00:00
and the message should not appear.
I hope there are not any preferences with could only be applied to msm8939 and not to msm8929.
@Kurt Krummbein
Here is my latest build or just grab the boot.img from the attachment. Which has a dtb for msm8929 build from source.
Maybe this will boot without any bootloop.
lightwars said:
@Kurt Krummbein
Here is my latest build or just grab the boot.img from the attachment. Which has a dtb for msm8929 build from source.
Maybe this will boot without any bootloop.
Click to expand...
Click to collapse
For which version is your latest build? the eu?
Thanks
BR Slawo
slawoko said:
For which version is your latest build? the eu?
Thanks
BR Slawo
Click to expand...
Click to collapse
AS and hopefully EU.

[Guide] Re-locking the bootloader on the Google Pixel 5 with a self-signed build of LOS 19.1

What is this tutorial?
This tutorial will:
Creating an unofficial build of LineageOS 19.1 suitable for using to re-lock the bootloader on a Google Pixel 5
Take you through the process of re-locking your bootloader after installing the above
This tutorial will NOT:
Remove *all* warning messages during boot (the yellow "Custom OS" message will be present though the orange "Unlocked bootloader" message will not)
Allow you to use official builds of LineageOS 19.1 on your device with a re-locked bootloader (more details near the end of the tutorial)
This tutorial will assume you are working on an Ubuntu 20.04 installation, if you are using Windows or another Linux distro, the commands may be different or not work at all.
Supported devices:
The following devices have been tested and confirmed to work:
OnePlus 5T (dumpling)
OnePlus 6 (enchilada)
OnePlus 6T (fajita)
OnePlus 7 (guacamoleb)
OnePlus 7 Pro (guacamole)
Google Pixel 4 (flame)
Google Pixel 5 (redfin)
Note: As of OxygenOS 12, OnePlus no longer supports bootloader relocking with custom keys, as such, any OnePlus device that receives official Android 12 and has LineageOS 19.1 based on it (which include the 8/8T/9 models) cannot be supported.
For simplicities sake, all further references will only be to the Google Pixel 5 (redfin).
Pre-requisites:
a mid level knowledge of terminal commands and features
a supported phone
a PC with enough CPU/RAM to build LineageOS 19.1 (recommended 8 cores, 32g of RAM)
a working USB cable
fastboot/adb installed and functional
LineageOS 19.1 source code downloaded
at least one successful build of LineageOS
at least one successful signing of your build with your own keys
Misc. notes:
the basics of building/signing of LineageOS is outside the scope of this tutorial, refer to the LineageOS Wiki (https://wiki.lineageos.org/devices/redfin/build) for details on how to complete these tasks
if you have generated your signing keys at some significant time in the past, you may have generated 2048 bit keys. 4096 bit keys are now supported and recommended, so you may want to generate new keys for LineageOS 19.1. If you decided to continue to use the 2048 bit keys make sure to make the appropriate changes in step 2 and 3 below.
signing with keys that have passwords set can cause problems, the easiest way around this is to *not* set a password when you generate your signing keys, however this does add risk that if your key files are stolen, no password is required to use them.
you'll be modifying some code in LineageOS, so if you are not comfortable using basic editing utilities as well as patch, do not proceed any further
the path to your LineageOS source code is going to be assumed to be ~/android/lineageos, if it is somewhere else, substitute the correct path in the tutorial
the path to your private certificate files is going to be assumed to be ~/.android-certs, if it is somewhere else, substitute the correct path in the tutorial
*** WARNING ****
This process may brick your device. Do not proceed unless you are comfortable taking this risk.
*** WARNING ****
This process will delete all data on your phone! Do not proceed unless you have backed up your data!
*** WARNING ****
Make sure you have read through this entire process at least once before attempting, if you are uncomfortable with any steps include in this guide, do not continue.
And now on with the show!
Step 1: Basic setup
You need a few places to store things, so create some working directories:
Code:
mkdir ~/android/redfin
mkdir ~/android/redfin/patches
mkdir ~/android/redfin/pkmd
You also need to add "~/android/lineageos/out/host/linux-x86/bin" to your shell's profile path. Make sure to close and restart your session afterwards otherwise the signing will fail later on with a "file not found" error message (this may no longer be required).
Step 2: Update the signing keys to use & enable AVB
The Pixel 5 device files are mostly contained in the shared "redbull" device for the Pixel 5 and 5 Pro. You will need to add a few parameters to the shared make file found here: ~/android/lineageos/device/google/redbull/BoardConfigLineage.mk, they are:
Code:
BOARD_AVB_ALGORITHM := SHA256_RSA4096
BOARD_AVB_KEY_PATH := /home/<userid>/.android-certs/releasekey.key
Note you cannot use "~" in the path names above to signify your home directory, so give the full absolute path to make sure the files are found.
LineageOS by default disables Android Verified Boot's partition verification, but you can enable it now as all the required parts will be in place.
To enable partition verification do the following:
Code:
cd ~/android/lineageos/device/google/redbull
sed -i 's/^BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flags 3/#BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flags 3/' BoardConfigLineage.mk
Step 3: Set the AVB key to use
To set the correct signing key to use for AVB, do the following:
Code:
cd ~/android/lineageos/device/google/redbull
sed -i 's/external\/avb\/test\/data\/testkey_rsa2048.pem/\/home\/<userid>\/.android-certs\/releasekey.key/' BoardConfig-common.mk
sed -i 's/SHA256_RSA2048/SHA256_RSA4096/' BoardConfig-common.mk
Don't forget to replace your <userid> in the first sed command above with your current logged in user id.
Step 4: Patch the AOSP and Device Makefile
You also need to patch the Makefile included with AOSP as it will otherwise fail during the build.
The required patch can be found here:
https://raw.githubusercontent.com/Wunderment/build_tasks/master/source/core_Makefile-19.1.patch
Download it and store in ~/android/redfin/patches.
Now apply it with the following command:
Code:
cd ~/android/lineageos/build/core
patch Makefile ~/android/redfin/patches/core-Makefile-fix-19.1.patch
If you would like to know more about this patch, see the additional info at the bottom of this post.
Step 5: Build LineageOS
You are now ready to build:
Code:
cd ~/android/lineageos
source build/envsetup.sh
breakfast redfin
croot
mka target-files-package otatools
Step 6: Sign the APKs
You are now ready to sign the apks with sign_target_files_apks:
Code:
./build/tools/releasetools/sign_target_files_apks -o -d ~/.android-certs $OUT/obj/PACKAGING/target_files_intermediates/*-target_files-*.zip signed-target_files.zip
Step 7: Build the OTA
Now it is time to complete the OTA package:
Code:
./build/tools/releasetools/ota_from_target_files -k ~/.android-certs/releasekey --block signed-target_files.zip lineage-19.1-[date]-UNOFFICIAL-redfin-signed.zip
Note, replace [date] with today's date in YYYYMMDD format.
Step 8: Create pkmd.bin for your phone
Before you can lock your phone, you have to tell it what your public key is so it knows it can trust your build.
To do this you need to create a pkmd.bin file:
Code:
~/android/lineageos/external/avb/avbtool extract_public_key --key ~/.android-certs/releasekey.key --output ~/android/redfin/pkmd/pkmd.bin
Note: if you don't have a releasekey.key file in your certificate directory, use the following command to generate one:
Code:
openssl pkcs8 -in releasekey.pk8 -inform DER -out releasekey.key -nocrypt
Step 9: Flashing your LineageOS build
It's time to flash your build to your phone. The following steps assume you have already unlocked your phone and have flashed an official version of LineageOS to it. You don't need to have flashed LineageOS yet, you could use TWRP through "fastboot boot" if you prefer. Or, if you want to use the recovery that was just created, it is located in ~/android/lineageos/out/target/product/redfin and is called vendor_boot.img.
Reboot your phone in to recovery mode
In LineageOS Recovery return to the main menu and select "Apply update", then "Apply from ADB".
From your PC, run:
Code:
adb sideload ~/android/lineageos/lineage-19.1-[date]-UNOFFICIAL-redfin-signed.zip
When the sideload is complete, reboot into LineageOS. Make sure everything looks good with your build.
You may also need to format your data partition at this time depending on what you had installed on your phone previously, it's best to do so anyway. In LineageOS Recovery return to the main menu and select "Factory reset", then "Format data/factory reset", then confirm with "Format data".
Step 10: Flashing your signing key
Now it's time to add your signing key to the Android Verified Boot process. To do so, do the following:
Reboot your phone in to fastboot mode
From your PC, run:
Code:
fastboot flash avb_custom_key ~/android/redfin/pkmd/pkmd.bin
fastboot reboot bootloader
fastboot flashing lock
On your phone, confirm you want to re-lock and it will reboot
Note: If you have already flashed a custom avb key you must erase it before flashing the new one, use "fastboot erase avb_custom_key" to do so.
Your phone will then factory reset and then reboot in to LineageOS.
Which of course means you have to go through the first time setup wizard, so do so now.
Step 11: Disable OEM unlock
Congratulations! Your boot loader is now locked, but you can still unlock it again using fastboot, so it's time to disable that as well.
Unlock you phone and go to Settings->About phone
Scroll to the bottom and find "Build number"
Tap on it you enable the developer options
Go to Settings->System->Advanced->Developer options
Disable the "OEM unlocking" slider
Reboot
Step 12: Profit!
Other things
The above will build a standard USERDEBUG version of LineageOS, however this will still allow LineageOS Recovery to sideload non-signed files as well as give you root shell access through ADB. Step 3/4 above protects your system/vendor/boot/dtbo/etc. partitions, but none of the others. Likewise USERDEBUG builds will allow for rolling back to a previous builds/versions of LineageOS. To increase security and disallow both of these scenarios you may want to build a USER version of LineageOS to install. However this brings in other issues, such as flashing newer firmware from OnePlus so make sure you understand the implications of both choices. For more details on build types, see https://source.android.com/setup/develop/new-device#build-variants.
The above build will not include other items like GAPPS or Magisk. Those are outside the scope of this tutorial.
If you want to remove you signing key from your phone, you can do it by running "fastboot erase avb_custom_key".
The changes you made to the AOSP Makefile may conflict with future updates that you pull from LineageOS through repo sync, if you have to reset the file to get repo sync to complete successfully, you'll have to reapply the changes afterwards.
So why can't I do this with official LineageOS builds?
You can! See https://forum.xda-developers.com/t/...ustom-rom-such-as-lineageos-official.4260825/ for more details.
For Android Verified Boot (AVB) to work, it must have the hash values for each of the system/vendor/boot/dtbo/etc. partitions stored in vbmeta. Official LineageOS builds for redfin do include the vendor.img in them along with everything else that is needed, however that is not true for all phones.
An "issue" that might stop someone from using the official redfin builds is that AVB is enabled in the official LineageOS builds but does not validate the hash trees during boot which limits the protection offered.
Ok, what messages do I see during the boot process then?
During a boot you will of course see the standard OnePlus power up screen, followed by the yellow "custom os" message and then the standard LineageOS boot animation.
For more details on AVB boot messages, see https://source.android.com/security/verifiedboot/boot-flow
So what does that patch to the Makefile do?
AOSP's default Makefile makes an assumption that when AVB is enabled, that all the img files will be available well before vbmeta.img is created. This is simply NOT true and AOSP seems to know this as well from the following comment in the Makefile:
Code:
# Not using INSTALLED_VBMETA_SYSTEMIMAGE_TARGET as it won't be set yet.
ifdef BOARD_AVB_VBMETA_SYSTEM
$(eval $(call check-and-set-avb-args,vbmeta_system))
endif
ifdef BOARD_AVB_VBMETA_VENDOR
$(eval $(call check-and-set-avb-args,vbmeta_vendor))
endif
These two calls eventual evaluate to returning the path to the partitions based upon the INSTALLED_*IMAGE_TARGET variable, which isn't created until later in the build process.
Because of this, the command to build vbmeta.img gets corrupted due to the missing make variable being empty and an invalid command line is passed to avbtool near the end of the build.
The corruption happens due to the fact that the following line from the original Makefile:
Code:
--include_descriptors_from_image $(call images-for-partitions,$(1))))))
Gets added to the avbtool call even if "$(call images-for-partitions,$(1))" turns out to be an empty string. Avbtool then throws an error message as it is expecting a parameter after the "--include_descriptors_from_image" flag that is added for the "empty" partition path.
The fix is to call "$(call images-for-partitions,$(1))" earlier, set it to a variable and check to make sure it isn't an empty string before letting the "--include_descriptors_from_image" be added to the avbtool command line to be used later.
This technically generates an incomplete vbmeta.img file during the build process, but since the signing process recreates it from scratch anyway; no harm, no foul.
Thank-Yous
Obviously to all of the members of the LineageOS team!
aleasto & mikeioannina for supporting redfin
optimumpro for the OnePlus 5/5t re-locking guide which inspired this one
Quark.23 for helping with the process and testing on enchilada
Related guides
OnePlus 5/5t re-locking guide (https://forum.xda-developers.com/oneplus-5/how-to/guide-relock-bootloader-custom-rom-t3849299)
Re-locking the bootloader with a pre-built custom ROM, such as LineageOS official (https://forum.xda-developers.com/t/...ustom-rom-such-as-lineageos-official.4260825/)
Re-locking the bootloader on the OnePlus 6t with a self-signed build of LOS 17.1 (https://forum.xda-developers.com/t/...s-6t-with-a-self-signed-build-of-los.4113743/)
Re-locking the bootloader on the OnePlus 8t with a self-signed build of LOS 18.1 (https://forum.xda-developers.com/t/...with-a-self-signed-build-of-los-18-1.4259409/)
A discussion about bootloader locking/unlocking... AKA I want to relock my bootloader, should I? (over on [reddit]/ r/LineageOS/comments/n7yo7u/a_discussion_about_bootloader_lockingunlocking/) (link broken on purpose to avoid the linked post being embedded here)
Thank you for your guides on bootloader relocking. They have helped to enable bootloader relocking on other devices.
After "all further references will only be to the Google Pixel 5 (redfin)" but before the "Thank-Yous", there are a few (typos?) that refer to the oneplus. In particular, beneath "Other things" and "under what messages do I see during the boot process then?"
HTH
If anyone is interested, I made a tool to automate all this using Hetzner Cloud. This tool's client can pretty much run on anything, including android itself on Termux(since it's a terminal app). You can make the tool upload the finished builds to your private repo so no need to worry about letters from Google for using GAPPS.
Bash:
wget -O ham "https://github.com/antony-jr/ham/releases/download/stable/ham-linux-amd64"
chmod a+x ham
./ham init # Init with your Hetzner Cloud API (Only Once)
./ham get [email protected]/enchilada-los19.1:gapps
# Without gapps
./ham get [email protected]/enchilada-los19.1
# You can close the terminal app after it starts tracking remote build
# the build continues to run on the cloud until finishes or errors out,
# in both cases the server destroys itself to save you a lot of cost.
# It cost me 0.30 euros for single build which ran for about 3 hours.
Thanks for the OP though, I copied a lot of scripts from WundermintOS.
Now the output of the build can be flashed like the OP described for OnePlus 6 and the pkmd.bin file will be included in the recovery zip file along with the boot/recovery image. The tool will ask you question before it starts the build for the variables, like the path to Android Certs in a zip file which will be used for signing.
For anyone that is interested, I've posted an updated guide for LineageOS 20.0 on the Pixel 6 here.

Categories

Resources