[help]trying to build chroma rom - ONE Q&A, Help & Troubleshooting

Please be patient as i am new in building roms[built 3-official roms], now am building chroma rom but bacon is an unsupported device. i have cloned all the proprietary blobs and kernel. but on 'lunch' i do not see my device.
any advice?
Code:
Lunch menu... pick a combo:
1. aosp_arm-eng
2. aosp_arm64-eng
3. aosp_mips-eng
4. aosp_mips64-eng
5. aosp_x86-eng
6. aosp_x86_64-eng
7. full_fugu-userdebug
8. aosp_fugu-userdebug
9. mini_emulator_arm64-userdebug
10. m_e_arm-userdebug
11. m_e_mips64-eng
12. m_e_mips-userdebug
13. mini_emulator_x86_64-userdebug
14. mini_emulator_x86-userdebug
15. aosp_dragon-userdebug
16. aosp_dragon-eng
17. aosp_flounder-userdebug
18. aosp_angler-userdebug
19. aosp_bullhead-userdebug
20. hikey-userdebug
21. aosp_shamu-userdebug

You have modify device tree for building ROM
Take reference of other device's tree
Sent from my OnePlus One using XDA Labs

nathsagar96 said:
You have modify device tree for building ROM
Take reference of other device's tree
Sent from my OnePlus One using XDA Labs
Click to expand...
Click to collapse
I am trying to do that, but i am finding it very difficult, as i am starting building roms. And there aren't any latest guides about building unofficial roms.

This would help you
https://www.youtube.com/shared?ci=XJk1GDuh9gg
Sent from my OnePlus One using XDA Labs

I guess you are missing a file called vendorsetup.sh in your device tree.

Bongofriend said:
I guess you are missing a file called vendorsetup.sh in your device tree.
Click to expand...
Click to collapse
i set it up...noe the device shows in lunch menu...but on compiling i get errors....
Code:
No private recovery resources for TARGET_DEVICE bacon
Checking API: checkpublicapi-last
out/target/common/obj/PACKAGING/public_api.txt:1966: error 17: Field android.R.style.TextAppearance_Material_Wi
dget_Button_Inverse has changed value from 16974548 to 16974565
out/target/common/obj/PACKAGING/public_api.txt:2011: error 17: Field android.R.style.ThemeOverlay_Material_Dial
og has changed value from 16974550 to 16974564
out/target/common/obj/PACKAGING/public_api.txt:2012: error 17: Field android.R.style.ThemeOverlay_Material_Dial
og_Alert has changed value from 16974551 to 16974566
out/target/common/obj/PACKAGING/public_api.txt:2120: error 17: Field android.R.style.Theme_Material_Light_Light
StatusBar has changed value from 16974549 to 16974563
******************************
You have tried to change the API from what has been previously released in
an SDK. Please fix the errors listed above.

Related

Problem AOSP compiling

I get this error when compiling AOSP using device tree from CM7. Please any help is appreciated.
[email protected] ~/WORKING_DIRECTORY $ lunch
You're building on Linux
Lunch menu... pick a combo:
1. full-eng
2. full_x86-eng
3. vbox_x86-eng
4. htc_ace-userdebug
5. htc_ace-eng
6. full_passion-userdebug
7. full_crespo4g-userdebug
8. full_crespo-userdebug
Which would you like? [full-eng] 5
build/core/product_config.mk:194: *** _nic.PRODUCTS.[[device/htc/ace/ace.mk]]: "device/htc/msm7x30-common/msm7x30.mk" does not exist. Stop.
** Don't have a product spec for: 'htc_ace'
** Do you have the right repo manifest?

[Sony] Xperia Open Devices Project

Sony Mobile is committed to supporting the open developer community, and one way to show this is by publishing parts of our code as well as selected tools developed by our internal developers.
For some of the Xperia™ devices, we provide Android™ Open Source Project (AOSP) device configurations on GitHub. This means that the software will be open for you as a developer to use and contribute to. This is a way for us to support the open Android community, and it is also a tool for us to facilitate and verify contributions to AOSP.
If you want to build AOSP for your unlocked Xperia device, you find all the resources you need in the sections below.
http://developer.sonymobile.com/knowledge-base/open-source/open-devices/
Unified 3.10 kernel sources
https://github.com/sonyxperiadev/kernel
Project git
https://github.com/sonyxperiadev/
jerpelea,
This is for android-5.1.1_r12
Do you know how to fix the issue of when you type
fastboot flash system system.img
that it just hangs on "sending". I left it for over an hour and it never seemed to finish sending.
Otherwise everything seemed to build properly.
edit: was able to get it on the system properly but am getting errors when booting:
(attached full logcat)
which is resulting in a bootloop
Thanks,
Chris
sorry for forgetting this info
i have updated the build guide
to flash system you have to use
fastboot -S 256M flash system system.img
br
J
ChrisJ951 said:
jerpelea,
This is for android-5.1.1_r12
Do you know how to fix the issue of when you type
fastboot flash system system.img
that it just hangs on "sending". I left it for over an hour and it never seemed to finish sending.
Otherwise everything seemed to build properly.
edit: was able to get it on the system properly but am getting errors when booting:
(attached full logcat)
which is resulting in a bootloop
Thanks,
Chris
Click to expand...
Click to collapse
no touchscreen on karin_windy
jerpelea,
the sparse option is also needed for karin_windy.
It boots but the touchscreen does not work at all. Powering OFF/ON does not help.
OK, I did:
Code:
repo init -u https://android.googlesource.com/platform/manifest -b android-5.1.1_r1[COLOR="Red"]3[/COLOR]
I'll try again with android-5.1.1_r12
DHGE said:
jerpelea,
the sparse option is also needed for karin_windy.
It boots but the touchscreen does not work at all. Powering OFF/ON does not help.
OK, I did:
Code:
repo init -u https://android.googlesource.com/platform/manifest -b android-5.1.1_r1[COLOR=Red]3[/COLOR]
I'll try again with android-5.1.1_r12
Click to expand...
Click to collapse
ok
i will look into it
br
J
jerpelea said:
sorry for forgetting this info
i have updated the build guide
to flash system you have to use
fastboot -S 256M flash system system.img
br
J
Click to expand...
Click to collapse
I was able to get it to boot (it seems the thermal manager was stopping it, I set it in front of a fan to get it to).
But now it says baseband version Unknown and it also appears to be unable to turn on wi-fi as well.
(See attached image)
22 the right choice?
hi jerpelea,
second try (following your HowTo verbatim) same result - no touchscreen only the keys do work.
I am building for my xperia Z4 Tablet Wifi (SGP712).
I chose option 22. I could think of option 2.
Anything wrong with my choice?
Code:
You're building on Linux
Lunch menu... pick a combo:
1. aosp_arm-eng
2. aosp_arm64-eng
3. aosp_mips-eng
4. aosp_mips64-eng
5. aosp_x86-eng
6. aosp_x86_64-eng
7. aosp_hammerhead-userdebug
8. aosp_mako-userdebug
9. aosp_grouper-userdebug
10. aosp_flo-userdebug
11. full_fugu-userdebug
12. aosp_fugu-userdebug
13. aosp_tilapia-userdebug
14. aosp_deb-userdebug
15. aosp_manta-userdebug
16. mini_emulator_mips-userdebug
17. mini_emulator_x86-userdebug
18. mini_emulator_x86_64-userdebug
19. mini_emulator_arm64-userdebug
20. m_e_arm-userdebug
21. aosp_sgp771-userdebug
[COLOR="Red"] 22. aosp_sgp712_windy-userdebug[/COLOR]
23. aosp_e6553-userdebug
24. aosp_shamu-userdebug
25. aosp_flounder-userdebug
Which would you like? [aosp_arm-eng]
edit:
I think the choice is right.
there is no /system/lib64/touchfilter directory or tfsw.so
I can adb shell with root rights.
your choice is fine (22)
i am debugging it as we speak
br
J
DHGE said:
hi jerpelea,
second try (following your HowTo verbatim) same result - no touchscreen only the keys do work.
I am building for my xperia Z4 Tablet Wifi (SGP712).
I chose option 22. I could think of option 2.
Anything wrong with my choice?
Code:
You're building on Linux
Lunch menu... pick a combo:
1. aosp_arm-eng
2. aosp_arm64-eng
3. aosp_mips-eng
4. aosp_mips64-eng
5. aosp_x86-eng
6. aosp_x86_64-eng
7. aosp_hammerhead-userdebug
8. aosp_mako-userdebug
9. aosp_grouper-userdebug
10. aosp_flo-userdebug
11. full_fugu-userdebug
12. aosp_fugu-userdebug
13. aosp_tilapia-userdebug
14. aosp_deb-userdebug
15. aosp_manta-userdebug
16. mini_emulator_mips-userdebug
17. mini_emulator_x86-userdebug
18. mini_emulator_x86_64-userdebug
19. mini_emulator_arm64-userdebug
20. m_e_arm-userdebug
21. aosp_sgp771-userdebug
[COLOR=Red] 22. aosp_sgp712_windy-userdebug[/COLOR]
23. aosp_e6553-userdebug
24. aosp_shamu-userdebug
25. aosp_flounder-userdebug
Which would you like? [aosp_arm-eng]
Click to expand...
Click to collapse
ChrisJ951 said:
I was able to get it to boot (it seems the thermal manager was stopping it, I set it in front of a fan to get it to).
But now it says baseband version Unknown and it also appears to be unable to turn on wi-fi as well.
(See attached image)
Click to expand...
Click to collapse
This is normal for an initial release
We have not added yet kernel wireless driver or GSM
Br
J
Hi
There is no need to add touch filter in AOSP
I have published new zip (v11) that fixes touch on our website and added patches to buildguide to enable audio on Z3+/4 devices
Br
J
DHGE said:
hi jerpelea,
second try (following your HowTo verbatim) same result - no touchscreen only the keys do work.
I am building for my xperia Z4 Tablet Wifi (SGP712).
I chose option 22. I could think of option 2.
Anything wrong with my choice?
Code:
You're building on Linux
Lunch menu... pick a combo:
1. aosp_arm-eng
2. aosp_arm64-eng
3. aosp_mips-eng
4. aosp_mips64-eng
5. aosp_x86-eng
6. aosp_x86_64-eng
7. aosp_hammerhead-userdebug
8. aosp_mako-userdebug
9. aosp_grouper-userdebug
10. aosp_flo-userdebug
11. full_fugu-userdebug
12. aosp_fugu-userdebug
13. aosp_tilapia-userdebug
14. aosp_deb-userdebug
15. aosp_manta-userdebug
16. mini_emulator_mips-userdebug
17. mini_emulator_x86-userdebug
18. mini_emulator_x86_64-userdebug
19. mini_emulator_arm64-userdebug
20. m_e_arm-userdebug
21. aosp_sgp771-userdebug
[COLOR=Red] 22. aosp_sgp712_windy-userdebug[/COLOR]
23. aosp_e6553-userdebug
24. aosp_shamu-userdebug
25. aosp_flounder-userdebug
Which would you like? [aosp_arm-eng]
edit:
I think the choice is right.
there is no /system/lib64/touchfilter directory or tfsw.so
I can adb shell with root rights.
Click to expand...
Click to collapse
jerpelea said:
This is normal for an initial release
We have not added yet kernel wireless driver or GSM
Br
J
Click to expand...
Click to collapse
Do you know when the kernel wireless driver or GSM will be released?
ChrisJ951 said:
Do you know when the kernel wireless driver or GSM will be released?
Click to expand...
Click to collapse
I have just updated kernel driver to support 4356/58 wifi, now all that is needed is to use it
Feel free to join dev
Br
J
jerpelea said:
I have just updated kernel driver to support 4356/58 wifi, now all that is needed is to use it
Feel free to join dev
Br
J
Click to expand...
Click to collapse
So that means working Wifi but no GSM? or does it include GSM as well?
Also what do you mean by join dev? (If it's a website/forum please add a link )
Also latest build still seems to have wifi not working properly
Thanks,
Chris
How to turn on the LED at the bottom of Sony Phone and Change the colour accordingly?
Sorry guys for disturbing. I was looking for a way to control the LED right at the bottom of the Sony phone which I don't see in Samsung or Motorola. I want it to change colour according to my image gallery. Like: when the background is mostly white, then the LED will change to white and so on. Anyone deal with it before?
LED mods
Anyone deal with it before?
Click to expand...
Click to collapse
I would start looking in the xperia cross devices forum.
I was able to mount the /modem partition and pull out all the modem.b## files and add them to the Android.mk but am still getting baseband not found. Anyone have any other ideas? (From what I could tell of Z3 (leo) that is how people got the baseband working in aosp)
ChrisJ951 said:
I was able to mount the /modem partition and pull out all the modem.b## files and add them to the Android.mk but am still getting baseband not found. Anyone have any other ideas? (From what I could tell of Z3 (leo) that is how people got the baseband working in aosp)
Click to expand...
Click to collapse
on kitakami devices there is no reason to touch those partitions
firmware is loaded from those partitions when is enabled
br
J
jerpelea said:
on kitakami devices there is no reason to touch those partitions
firmware is loaded from those partitions when is enabled
br
J
Click to expand...
Click to collapse
How do we get them enabled and baseband working?
ChrisJ951 said:
How do we get them enabled and baseband working?
Click to expand...
Click to collapse
Would updating the defconfig be of any use or are we waiting for the actual libs from sony?
i.e.
Would adding:
CONFIG_MSM_MODEM_SUBSYSTEM_RESTART_MONITOR=y
and
CONFIG_MSM_PIL_SSR_GENERIC=y
be of any use?
jerpelea said:
I have just updated kernel driver to support 4356/58 wifi, now all that is needed is to use it
Feel free to join dev
Br
J
Click to expand...
Click to collapse
Was the driver for the Z3+ also included or just the z4 tablet?
The comment seems to imply it is just for the Z4 tablet?
2015-08-19: AOSP Lollipop binaries for Android 5.1 updated with improved support for Xperia Z4 Tablet WiFi, Xperia Z3 Tablet Compact WiFi and Xperia Z2 Tablet WiFi. In addition, the AOSP Lollipop 5.1 build guide is updated with added audio patches for Xperia Z3+, Xperia Z4 Tablet, and Xperia Z4 Tablet WiFi.

[Q] Build error building Chroma ROM

I'm working on building Chroma ROM for the Moto X Pure and have gotten to an error that looks to be too broad to get past.
Code:
[email protected]:~/android/chroma-clark$ lunch
You're building on Linux
Lunch menu... pick a combo:
1. aosp_deb-userdebug 6. chroma_hammerhead-userdebug
2. mini_emulator_arm64-userdebug 7. chroma_mako-userdebug
3. m_e_arm-userdebug 8. chroma_shamu-user
4. chroma_angler-userdebug 9. chroma_clark-userdebug
5. chroma_bullhead-userdebug
Which would you like? [aosp_arm-eng] 9
make: *** build/target/board/generic: Is a directory. Stop.
** Don't have a product spec for: 'chroma_clark'
** Do you have the right repo manifest?
[email protected]:~/android/chroma-clark$
I've made several modifications to the source to get to this point. If nobody can suggest without seeing my modded repos, let me know.
So... any ideas?
Thanks!
-B
bradym512 said:
I'm working on building Chroma ROM for the Moto X Pure and have gotten to an error that looks to be too broad to get past.
Code:
[email protected]:~/android/chroma-clark$ lunch
You're building on Linux
Lunch menu... pick a combo:
1. aosp_deb-userdebug 6. chroma_hammerhead-userdebug
2. mini_emulator_arm64-userdebug 7. chroma_mako-userdebug
3. m_e_arm-userdebug 8. chroma_shamu-user
4. chroma_angler-userdebug 9. chroma_clark-userdebug
5. chroma_bullhead-userdebug
Which would you like? [aosp_arm-eng] 9
make: *** build/target/board/generic: Is a directory. Stop.
** Don't have a product spec for: 'chroma_clark'
** Do you have the right repo manifest?
[email protected]:~/android/chroma-clark$
I've made several modifications to the source to get to this point. If nobody can suggest without seeing my modded repos, let me know.
So... any ideas?
Thanks!
-B
Click to expand...
Click to collapse
It's too late to reply, but replying so that it will help the people who are redirected here by Mr. Google.
I was getting similar error on Nitrogen OS for Taimen, and it is solved by adding following in the make file:
PRODUCT_DEVICE := taimen
Click to expand...
Click to collapse
Nitin

Issue to build a correct image for Pixel sailfish from AOSP

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?

[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