[ROM][Treble][microG]LineageOS 16.0 for HUAWEI P9

Search This thread
Thanks for great rom! I realized, that without google goes too.
Thanks for the positive feedback :)

My bank app claimed that weren't installed from playstore and therefore it closed for that reason. How bad, ugly bank!
Then I change the install method in Aurora store to Native installer (for older android versions) (Setting/Instalation/Instalation method). After reinstall bank app works for now.
What if maybe will need the playstore in future app versions?
Depends on "how" the app is bound to the PS. Right now, it only seems to be an installer flag, so you have worked around it. Some apps however use PS license verification - as explained in the Aurora FAQ, in such a case, you're lost. Same applies, if e.g. the "Safety net" api is used; this isn't related to the play sore, but the genuine Google Play services (I always call then "Spy services").

Some noob qustion. If some custom rom has latest security patches and updates like this one, does android version matter?
Phew... That's a complex question. The "short & easy" answer would be "no, it does not matter!", but that answer deserves some further elaboration, as it in fact is not that easy:

A ROM has got in fact four "components":
  • The device-independent android platform
  • The Linux-Kernel
  • The device hardware drivers (aka "vendor blobs"), which are closed source vendor delivered
  • The device configuration, which glues the above three together

Whilst the device-independent android-platform is usually very well maintained (or back-ported), the maintenance of the kernel and the updates of the vendor blobs is a different question and depends on the device maintainer / ROM builder.

The older the android version, the harder the backport and the bigger the "unknowns". Android 9 isn't officially supported any longer by Google, but so far, it has been pretty straight-forward to backport the ASB patches, so Android 9 I would still consider 'safe'. But I am also providing Android 7 based ROMs, where it starts to become very difficult and also a "grey area"...

This ROM here for the P9 of this thread is a "treble build", so only the device-independent android platform is updated, whilst kernel and device blobs stay "as is". (Unless Huawei surprisingly delivers another EMUI 8 update, which I severely doubt...)

So I would split the question into two different situations:

A.)
Q: For my device "ABC", there is only an Android 'n' build available, whilst the most recent Android release is meanwhile 'n + x'. Do I need to worry?
A: The available ROM is the "best", you can get for your device and for sure better than using the outdated stock ROM. So in the absence of a true alternative (other than getting a different, newer device) there is nothing to worry. I think that would describe the situation of the P9 quite well, I think. Having said so, if you fear being "professionally targeted", seek professional advice and aim at least for an "original" GrapheneOS device...

B.)
Q: For my device, there are Android 'n' as well as 'n +1' or even 'n + 2' builds available. What should I do?
A: First of all, the functionality counts. Is the build with the latest Android release really stable, has acceptable performance (the newer the Android release, the higher the hardware demands) and is really daily-driver capable and also offers the features, which are important to me? If the answer is no, rather stick with the current stable, fast and daily-driver proven build.
(Just some thoughts: ROMs, where e.g. SELinux has been deactivated in the kernel are experimental and unsafe, applying ASB patches to such a ROM is close to useless - such stuff may be nice as a temporary test, if you are interested to see the look and feel of a new version, but don't use that as "daily driver". Further, some ROM developers apply heavy downporting modifications to a modern Android version just to get it "somehow" running on a very old device - also not what I would consider a "daily driver" use. Another example: I used to offer LineageOS 17.1 builds for the Osprey device, and finally decided to stop it and offer again LineageOS 16.0 builds with recent ASB backports for it, as 17.1 simply was too laggy and slow)
If however there is really no difference, the more modern Android version is to be preferred; especially, if the device manufacturer still delivers updates, which means that even the vendor blobs can be updated.

Hope that could give you a better view on that topic.
 

P9_User

Member
Oct 27, 2020
32
4
Hi there. Another user-question.

I am not shure if it has something to do with latest update, the 3D app fusion360 tells me WebGL is deactivated.
Now I dont know when it happened because I had that viewer working proppely for a while.

My P9 is running nice and only changes are weekly app-update and security patch once its released.

So I am not shure where this WebGl issue is coming from. Hope my request this is not too far away from this thread.
 

NPS-2750X

Member
Oct 17, 2021
16
3
This system image works well on my EVA-AL10(Chinese version), but there are still some bugs.

1. The most serious one is that I can't delete any photo in /DCIM/Camera , as the picture below shows. If I try to delete these photos in Gallery app , they would "disappear" but not really be deleted.

2. Sometimes , the device will immedietely turn black and then automatically reboot after taking a photo in stock camera.

3. When I use this system for the first time , it asked me for password . But I never set any password on this device and I used fastboot -w before flashing. In the end I ran factory reset in Recovery mode and it showed "Device is being encrypted" before booting into system.
Screenshot_20220805_151728.jpg
 

NPS-2750X

Member
Oct 17, 2021
16
3
Another problem is that if Magisk is installed , the CPU temperature would be really high (up to 64℃) and remain unchanged. At the same time , the internal Root settings would disappear. I had no choice but give up installing Magisk.

Besides , it seems that the camera problem can be solved by adjusting settings. If "Save photo to SD card" switch is turned on , camera will work normally. But I still can't delete any photo.

That's all the problems I've found until now.

Although there are bugs , this system is good and easy to use . Thanks to the developers , this old device comes to life again.
 
  • Like
Reactions: MSe1969
Hi there. Another user-question.

I am not shure if it has something to do with latest update, the 3D app fusion360 tells me WebGL is deactivated.
Now I dont know when it happened because I had that viewer working proppely for a while.

My P9 is running nice and only changes are weekly app-update and security patch once its released.

So I am not shure where this WebGl issue is coming from. Hope my request this is not too far away from this thread.
I have just installed this app for test purposes, but as you need an Autodesk account to start using that app, I didn't continue and de-installed it again. At least for the steps to get to the logon screen, there was no error...
Can you produce a log or so? Or, after updating to the next build (will be published soon), try again?
 
This system image works well on my EVA-AL10(Chinese version), but there are still some bugs.
Thanks for your feedback.

1. The most serious one is that I can't delete any photo in /DCIM/Camera , as the picture below shows. If I try to delete these photos in Gallery app , they would "disappear" but not really be deleted.
I can't reproduce this behavior on my own P9.

2. Sometimes , the device will immedietely turn black and then automatically reboot after taking a photo in stock camera.
Haven't experienced this so far on my own device. However, the P9 is not my primary device, so I am not a "power user" of it or its Camera...

3. When I use this system for the first time , it asked me for password . But I never set any password on this device and I used fastboot -w before flashing. In the end I ran factory reset in Recovery mode and it showed "Device is being encrypted" before booting into system.
As explained in the OP, when flashing this GSI the fisrt time (e.g. over stock EMUI 8.0), it is key to afterwards run a factory reset and afterwards a cache wipe in recovery. ('fastboot -w' may not be enough)
 
  • Like
Reactions: Tecalote
Another problem is that if Magisk is installed , the CPU temperature would be really high (up to 64℃) and remain unchanged. At the same time , the internal Root settings would disappear. I had no choice but give up installing Magisk.
In my tips & tricks section, there is also some information about Magisk. Please read that carefully - however, I don't use Magisk myself, so I can't give you any assurance, whether it works or not.
And yes, it is a "feature" of Magisk to remove/hide any other root solution...

Besides , it seems that the camera problem can be solved by adjusting settings. If "Save photo to SD card" switch is turned on , camera will work normally. But I still can't delete any photo.
Maybe something weird with your SD card? Have you tried deleting files via root shell, just to see, whether that would solve the issue or also throw any error? I has such a problem with a complete different device and SD card some years back, where at the end, I had to format the SD card to get rid of the issue...

That's all the problems I've found until now.

Although there are bugs , this system is good and easy to use . Thanks to the developers , this old device comes to life again.
Thanks again for your feedback.
 
  • Like
Reactions: Tecalote

NPS-2750X

Member
Oct 17, 2021
16
3
In my tips & tricks section, there is also some information about Magisk. Please read that carefully - however, I don't use Magisk myself, so I can't give you any assurance, whether it works or not.
And yes, it is a "feature" of Magisk to remove/hide any other root solution...


Maybe something weird with your SD card? Have you tried deleting files via root shell, just to see, whether that would solve the issue or also throw any error? I has such a problem with a complete different device and SD card some years back, where at the end, I had to format the SD card to get rid of the issue...


Thanks again for your feedback.
Thank you for answering my feedback.

In fact , whether the "Save photo to SD card" switch is turned on or not , photos are always saved to internal storage . And , of course , they can be deleted with Root , but can't be deleted by stock file manager and any kind of Gallery app. Besides , recently I found that screenshots can't be deleted , either .But if I copy the same photo or screenshot to external SD card , it can be deleted successfully .

I attached some videos here to show this problem . (p.s. I'm sorry for being nervous when recording these videos because speaking English is still a bit difficult for me. )
 

Attachments

  • VID_20220809_154317.mp4
    21.2 MB · Views: 0
  • VID_20220809_154402.mp4
    15.4 MB · Views: 0
  • VID_20220809_154429.mp4
    11.1 MB · Views: 0
  • VID_20220809_154523.mp4
    15 MB · Views: 0
Thank you for answering my feedback.

In fact , whether the "Save photo to SD card" switch is turned on or not , photos are always saved to internal storage .
That is true, I confirm this behavior. I am however not sure, what is the reason - in the German or English transaltion, it says "prefer saving to SD" (and not "save on SD" - so maybe there is some whatever kind of check in the stock camera app, which fails). I am afraid, I can't do anything here.

And , of course , they can be deleted with Root , but can't be deleted by stock file manager and any kind of Gallery app. Besides , recently I found that screenshots can't be deleted , either .But if I copy the same photo or screenshot to external SD card , it can be deleted successfully .
As explained before, I don't see this issue with my own phone, and I am sure, that if that was a general issue with the ROM, others would have complained as well. Is it possible for you to produce a log? Connect your phone via USB to your PC, enable debugging in the developer options, and call on your PC in a terminal/command window "adb logcat > mylogfile.txt". Now try to delete the file, and afterwards, stop the adb session with [Ctrl]+C key and provide me with the logfile. (You will find more information in the internet about the 'adb logcat' topic, if needed).

I attached some videos here to show this problem . (p.s. I'm sorry for being nervous when recording these videos because speaking English is still a bit difficult for me. )
No worries, the videos are very well understandable.
 

NPS-2750X

Member
Oct 17, 2021
16
3
That is true, I confirm this behavior. I am however not sure, what is the reason - in the German or English transaltion, it says "prefer saving to SD" (and not "save on SD" - so maybe there is some whatever kind of check in the stock camera app, which fails). I am afraid, I can't do anything here.


As explained before, I don't see this issue with my own phone, and I am sure, that if that was a general issue with the ROM, others would have complained as well. Is it possible for you to produce a log? Connect your phone via USB to your PC, enable debugging in the developer options, and call on your PC in a terminal/command window "adb logcat > mylogfile.txt". Now try to delete the file, and afterwards, stop the adb session with [Ctrl]+C key and provide me with the logfile. (You will find more information in the internet about the 'adb logcat' topic, if needed).


No worries, the videos are very well understandable.
Thank you again for your reply . Here's the logfile I got . I don't know if I did it correctly , but it does contain the "failed to delete" information .
-400325f239424b0b.jpg
 

Attachments

  • logfile.txt
    1.4 MB · Views: 5

P9_User

Member
Oct 27, 2020
32
4
I have just installed this app for test purposes, but as you need an Autodesk account to start using that app, I didn't continue and de-installed it again. At least for the steps to get to the logon screen, there was no error...
Can you produce a log or so? Or, after updating to the next build (will be published soon), try again?
Hi. So I made August update but fusion app still not working. Browser based WebGL demos do run nicely.

Now I wanted to provide you screenshots and logs but somehow I am not abel to create logs via adb. Once a few month ago it already worked, so I am curious again.

This is my result, I still think adb is working but something still not running well : (


Code:
G:\android\fastboot>adb logcat > lc.txt
- waiting for device -

G:\android\fastboot>adb devices
List of devices attached

G:\android\fastboot>adb kill-server

G:\android\fastboot>adb start-server
* daemon not running; starting now at tcp:5037
* daemon started successfully

G:\android\fastboot>adb devices
List of devices attached


G:\android\fastboot>adb logcat > lc.txt
- waiting for device -

G:\android\fastboot>adb logcat
- waiting for device -

G:\android\fastboot>adb kill-server

G:\android\fastboot>adb start-server
* daemon not running; starting now at tcp:5037
* daemon started successfully

G:\android\fastboot>adb devices
List of devices attached

G:\android\fastboot>fastboot devices
MWS7N(number)           fastboot

G:\android\fastboot>adb logcat
- waiting for device -

G:\android\fastboot>adb kill-server

G:\android\fastboot>adb start-server
* daemon not running; starting now at tcp:5037
* daemon started successfully

G:\android\fastboot>adb devices
List of devices attached


G:\android\fastboot>adb logcat > lc.txt
- waiting for device -
^C
G:\android\fastboot>fastboot reboot
rebooting...
 
Hi. So I made August update but fusion app still not working. Browser based WebGL demos do run nicely.

Now I wanted to provide you screenshots and logs but somehow I am not abel to create logs via adb. Once a few month ago it already worked, so I am curious again.

This is my result, I still think adb is working but something still not running well : (


Code:
G:\android\fastboot>adb logcat > lc.txt
- waiting for device -

G:\android\fastboot>adb devices
List of devices attached

G:\android\fastboot>adb kill-server

G:\android\fastboot>adb start-server
* daemon not running; starting now at tcp:5037
* daemon started successfully

G:\android\fastboot>adb devices
List of devices attached


G:\android\fastboot>adb logcat > lc.txt
- waiting for device -

G:\android\fastboot>adb logcat
- waiting for device -

G:\android\fastboot>adb kill-server

G:\android\fastboot>adb start-server
* daemon not running; starting now at tcp:5037
* daemon started successfully

G:\android\fastboot>adb devices
List of devices attached

G:\android\fastboot>fastboot devices
MWS7N(number)           fastboot

G:\android\fastboot>adb logcat
- waiting for device -

G:\android\fastboot>adb kill-server

G:\android\fastboot>adb start-server
* daemon not running; starting now at tcp:5037
* daemon started successfully

G:\android\fastboot>adb devices
List of devices attached


G:\android\fastboot>adb logcat > lc.txt
- waiting for device -
^C
G:\android\fastboot>fastboot reboot
rebooting...
Did you enable debugging in the developer options AND also enable MTP (file transfer) for your USB connection?
 

P9_User

Member
Oct 27, 2020
32
4
Yes, both are set on in developers optios.
Still no device number showing when adb devices

fastboot
do work, if it matters.

Could it be a driver issue? Any suggestion?


Edit: Did found something yesterday night. I can set USB to MTP (filetransfere) only within developers option. If I go to settings/search/usb the select screen is buggy and I can not set anything. Tried with deactivated developers options and still no chance to do changes.

Screenshots made here (sorry, did not switched to EN):

Screenshot_20220812-004445_Einstellungen.png
Screenshot_20220812-004504_Einstellungen.png
 
Last edited:

Eowieh

New member
Feb 14, 2020
3
0
Is the DynamicsProcessing library installed and configured with a commit (more info here)? If not, I kindly ask if you could do it, so that Wavelet can be used.

I enjoy the ROM. Gives new life to an older phone. I especially like that it already has root built in.
 
Thank you again for your reply . Here's the logfile I got . I don't know if I did it correctly , but it does contain the "failed to delete" information .
Thanks for the log. Unfortunately, the log does not tell any reason, so I guess it may come from the linux sub system. So could you please try the following:

Connect your phone via adb and type in a command window 'adb shell'. Let's take your example file IMG_20220807_155809.jpg from the log (feel free to use another file, if you like).
Within the shell, enter first cd /storage/emulated/0/DCIM/Camera/, then ls -la IMG_20220807_155809.jpg and show me the output. Afterwards ls -Z IMG_20220807_155809.jpg, then try to delete the file with
rm IMG_20220807_155809.jpg - does it work or do you get an error message ?
leave the adb shell session with exit
 
Yes, both are set on in developers optios.
Still no device number showing when adb devices

fastboot
do work, if it matters.

Could it be a driver issue? Any suggestion?


Edit: Did found something yesterday night. I can set USB to MTP (filetransfere) only within developers option. If I go to settings/search/usb the select screen is buggy and I can not set anything. Tried with deactivated developers options and still no chance to do changes.

Screenshots made here (sorry, did not switched to EN):
Normally, when you connect the phone via USB, you should have a message appearing, which you can "pull down", where you would jump into the screens, you were showing. And you would have to set "Dateiübertragung" as well to have a working adb.

If fastboot works, I don't think that you have a driver issue on your PC, but I don't want to exclude this, as adb is technically a different protocol compared to fastboot. When you say "driver issue' I would guess you have a Windows PC, so yes: try re-installing the USB drivers as a 1st step...
 
Is the DynamicsProcessing library installed and configured with a commit (more info here)? If not, I kindly ask if you could do it, so that Wavelet can be used.

I enjoy the ROM. Gives new life to an older phone. I especially like that it already has root built in.
I'll have a look next week... (need to see, from where the audio_effects. xml file is taken...)
 
  • Like
Reactions: kundifon and Eowieh

NPS-2750X

Member
Oct 17, 2021
16
3
Thanks for the log. Unfortunately, the log does not tell any reason, so I guess it may come from the linux sub system. So could you please try the following:

Connect your phone via adb and type in a command window 'adb shell'. Let's take your example file IMG_20220807_155809.jpg from the log (feel free to use another file, if you like).
Within the shell, enter first cd /storage/emulated/0/DCIM/Camera/, then ls -la IMG_20220807_155809.jpg and show me the output. Afterwards ls -Z IMG_20220807_155809.jpg, then try to delete the file with
rm IMG_20220807_155809.jpg - does it work or do you get an error message ?
leave the adb shell session with exit
Thank you. I tried this operation and it showed "owner died".
Screenshot_20220813-094020_.png
 

P9_User

Member
Oct 27, 2020
32
4
Normally, when you connect the phone via USB, you should have a message appearing, which you can "pull down", where you would jump into the screens, you were showing. And you would have to set "Dateiübertragung" as well to have a working adb.

If fastboot works, I don't think that you have a driver issue on your PC, but I don't want to exclude this, as adb is technically a different protocol compared to fastboot. When you say "driver issue' I would guess you have a Windows PC, so yes: try re-installing the USB drivers as a 1st step...

Yes, Win10 PC. Now I think I made a big mess and even fastboot is not working anymore. I tried to reinstall any Android related drivers with no success. I had both (fastboot & adb) working already a while ago, kept the drivers and tools and thought I can easily re-install everything.

Is there any simple step-by-step list of which drivers I need to make the P9 work fine with windows? Best how to clean all old drivers and which new ones (also tools) are needed after.

This is where I am lost now...

devices_android.jpg


In bootload mode showing this.
devices_android_bootloader.jpg

devices_android_bootloader_02.jpg
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 5
    New build with backported September '22 ASB patches available

    Hi all,
    a new build is available for download (update instructions, see OP):

    • Custom build release 2022-09-01
    • Bromite Webview 104.0.5112.91
    • microG 0.2.24.214816-30
    • Contacts app slightly 'de-Googled'
    Happy flashing!
    Regards, M.
    3
    So there is no contact sync, unreliable gmail notifications, google translate doesn't translate at all, google docks don't sync, you cannot buy apps in Aurora store
    Besides my technical answer in the previous post - Please let me know, if you are interested in some more information about how to solve the above topics while using my ROM with microG.


    EDIT: Thought it may be interesting also for others, hence some further input

    Contact sync
    Google (GMail account) is by far not the only service offering you contact / calendar sync. My recommendation would be to use other services in conjunction with the DAVx5 app - see e.g. here: https://www.davx5.com/tested-with/ - there are also free mailers amongst the services.
    If you absolutely want to store your contacts in GMail, the below links may provide helpful:

    GMail notifications
    You don't need the genuine GMail app to access your GMail account - you can configure your GMail account to allow IMAP and use then any E-Mail program, like e.g. the shipped LineageOS EMail app, K9 or FairEmail to name some. In general, I don't understand, why people even use GMail, as every e-mail is scanned by some shady AI for "suspicious activities". There are other freemailers around, which do not perform full scans of your mails - and if you are willing to pay as little as 1€ / 1$ per month, you get a truly private mail account with calendar/contact sync, cloud space and other nice features. (I in general do not recommend freemailers at all, but that is off-topic here)

    Buying apps from Aurora
    Extract from AuroraStore FAQ: "How do I purchase paid apps ? Purchase the apps from the PlayStore website, and login using your own account in Aurora Store to download them."

    Genuine G*Apps
    In general, microG aims at providing a compatibility layer to apps having built-in G* dependencies. The genuine Google apps are usually deeply integrated with the 'original' play services, so best is to use alternative apps. And for many (admittedly not all) use cases, the ordinary mobile browser does its job as well.
    1
    I used fastboot -w before flashing. In the end I ran factory reset in Recovery mode and it showed "Device is being encrypted" before booting into system.
    I guess that’s where things went wrong. The problems you described, storage issues after fastboot -w and overheating, are caused by some ancient magisk versions. According to the hi6250 telegram channel, formatting /data via twrp is supposed to fix the mess and to fix overheating get rid off or update magisk. These old versions cause the big cluster to run constantly at its 2.5 ghz maximum frequency on any gsi that runs on top of emui8 vendor


    @MSe1969
    One small thing that might be worth including in your build is the openkirin signal strength icon fix to be placed in /system/framework. Alternatively there have also been open source patches committed to Phhusson’s A11/12 branches, however these files seem quite different to the A9 file versions. https://github.com/phhusson/platfor...mmit/64fa7c61a0a4b41b9e40a37b673699a45eb88b8c
    In any case thanks a lot for the continued support. Very much appreciated(y)
    1
    @MSe1969
    One small thing that might be worth including in your build is the openkirin signal strength icon fix to be placed in /system/framework. Alternatively there have also been open source patches committed to Phhusson’s A11/12 branches, however these files seem quite different to the A9 file versions. https://github.com/phhusson/platfor...mmit/64fa7c61a0a4b41b9e40a37b673699a45eb88b8c
    In any case thanks a lot for the continued support. Very much appreciated(y)
    OK, it'll be part of my next build, I have extracted the file from an Openkirin build and made it part of it. However, I don't really see any difference... What exactly does it do?
    1
    OK, it'll be part of my next build, I have extracted the file from an Openkirin build and made it part of it. However, I don't really see any difference... What exactly does it do?
    Thanks! It brings the otherwise static mobile network signal indicator in the top notification bar to life
  • 20
    This thread is dedicated to provide Lineage-OS 16.0 builds with microG included for the HUAWEI P9 with current security patches.

    It is a treble build, therefore it could also work on other devices, but I haven't tested. And yes, the camera works!
    (Although it is based on the work of phhusson's GSI builds, some specific adaptations have been made, so I guess, it is worth a try for further Huawei devices based on EMUI 8, but that's it...)

    Features of this ROM
    Download here
    • Pre-installed microG and F-Droid like the LineageOS for microG project (own fork)
    • Pre-installed AuroraStore
    • Root included (switch on in dev. settings)
    • eSpeakTTS (FOSS TTS engine)
    • Backported Audio balance (accessibility settings) from Android 10
    • Additional security hardening features listed below
    • Access to /proc/net blocked for user apps
    • Bundled netmonitor app to allow network monitoring
    • Enhanced Privacy Guard: Switches for motion sensors and other sensors
    • Cloudflare as default DNS (instead of Google)
    • Privacy-preferred default settings
    • Optional blocking of Facebook- and Google-Tracking
    • Optional disabling of captive portal detection
    • Firewall UI
    • No submission of IMSI/phone number to Google/Sony when GPS is in use
    • Default hosts file with many blocked ad/tracking sites
    • Privacy-enhanced Bromite SystemWebView
    • Additional restrictions for secondary users
    • Increased password length
    • Hardened bionic lib and constified JNI method tables
    • Huawei Stock Camera

    Current release levels
    Custom build release 2022-09-01
    Security string: 2022-01-01
    AOSP tag: 9.0.0_r46
    Bromite System Webview: M104


    Source-code and build instructions
    Device config.: https://github.com/lin16-microg/device_phh_treble/tree/lin-16.0-eva-p9
    Build manifest: https://github.com/lin16-microg/local_manifests/tree/lin-16.0-treble


    Installation Instructions

    YOU ARE RESPONSIBLE SOLELY YOURSELF FOR ANY ACTIONS YOU DO WITH YOUR DEVICE !!!

    Please note - I won't explain any single aspect (e.g. how to install 'fastboot' on your PC or troubleshoot USB connectivity issues under Windows). Search the net and consult the search engine of your choice or look here in XDA, there is plenty of information available.

    Pre-Requisites
    • Have fastboot and adb installed on your PC and make sure, you can connect via USB to your device in fastboot mode and via adb
    • Know the key combinations to get your phone into fastboot mode and recovery mode
    • An unlocked bootloader
    • EMUI 8.0 firmware
    • Have the Huawei Stock recovery installed (not TWRP)

    ONLY, If the above pre-requisites are met, download and unpack the linked ZIP file, and flash the .img file via fastboot (EMUI 8.0 is the tricky pre-requisite - see further below).
    • Get your device into fastboot mode and connect to your PC via USB - the screen should look like below, indicating "PHONE Unlocked"
      P9_fastboot.png
    • Flash the ROM with the command fastboot flash system <name of the rom img file>.img
      fastboot-flash.png
    • Afterwards, enter the command fastboot reboot
    • Hold Power+Vol.Up to get into the Stock recovery:
      p9_stockRecovery.png
    • Choose the option "wipe data/factory reset"
      Don't 'panic' if the operation stops at a percentage significantly lower than 100% and you see a red exclamation mark, all is fine
    • Next, choose "wipe cache partition"
    • Finally choose "reboot system now"

    Some hints:
    • If you come from an EMUI 8.0 stock ROM or a different treble build (which means, you are already on EMUI 8.0), don't forget the factory reset as described.
    • If you update one of my builds from this thread, you don't need to wipe anything, so you can skip everything after the 'fastboot reboot' step!
    • On some (but not all) PCs, you may have to run fastboot as Admin (Windows) or root/sudo (Linux)

    If the above pre-requisites are NOT met, you will have some extra-rounds to perform, until you get there:
    Unlocked Bootloader
    Huawei has stopped providing unlock keys, so if you haven't got one, this thread, this link and/or of course the search-engine of your choice may be helpful. I was lucky enough to obtain an official unlock key on the last day of HUAWEI's unlock page, so I have no experience with the unofficial unlock methods - good luck!

    EMUI 8.0 firmware
    Get back to Stock ROM, if you use a Custom ROM. On Stock, if not yet done, apply all updates offered to you by the Stock ROM updater, until you are on the latest officially offered Android 7 (Nougat) EMUI 5.x release.
    Huawei has shut down however their update servers for older devices and older software releases, so this may become difficult, if you are e.g. still on Android 6 - I don't have a good advice for you in this case.
    Once you are on Android 7 (aka Nougat), please visit this thread, which really explains step-by-step, what needs to be done. Really carefully read everything and follow ALL the steps, especially, don't forget at the very end to flash the Stock EMUI recovery!
    IMPORTANT UPDATE:
    The linked thread, as well as the Openkirin documentation point - via a Russian firmware site - to the domain 'hicloud.com' for the firmware download, which seems to be down. As suggested by @zgfg you can try either
    his Mega link or e.g. https://androidhost.ru/search.html
    Update: See this post to obtain the firmware!
    Update 2: See also here

    You need your unlock key handy: During this process, the bootloader will be automatically locked several times, so you need the key a couple of times to unlock again!
    A hint for Linux users: The HWOTA tool is in fact a windows wrapper around Linux shell scripts, so there is no real need to use Windows, if you have a working Linux installation (however, make sure to replace the 'mkdir' commands in hwota_eng.sh with 'mkdir -p').


    Android 10, 11 or 12 builds?

    Simple answer: There won't be any coming from my end (my aim is to provide daily-driver capable builds and not to boot an experimental GSI with lots of issues and a non-working camera) - so stop wasting everybody's time by repeatedly asking!


    Bug reports:
    If you have a problem, please create a post with these informations:
    Build Date:
    And try to get log as described here
    Please note that I can't and won't support issues with builds using a different kernel or Xposed.
    In regards to microG, I will try my best to help when it is related to this ROM (I use it myself), but any questions of the type "the YXZ-app can't do <some sort of fancy xyz Google functionality> properly" are better asked in the respective microG forums.

    Credits
    AOSP project
    LineageOS project
    openkirin.net
    phhusson
    AndyYan
    Tecalote
    microG project
    Graphene OS project
    csagan5 (Bromite)
    WhyOrean (Aurora)
    zgfg (for very helpful contributions in this thread)


    XDA:DevDB Information
    [ROM][Treble][microG]LineageOS 16.0 for HUAWEI P9, ROM for the Huawei P9

    Contributors
    MSe1969
    Source Code: https://github.com/lin16-microg/device_phh_treble/tree/lin-16.0-eva-p9

    ROM OS Version: 9.x Pie
    ROM Kernel: Linux 4.x
    ROM Firmware Required: EMUI 8 firmware
    Based On: LineageOS

    Version Information
    Status:
    Stable
    Stable Release Date: 2022-09-10

    Created 2020-04-06
    Last Updated 2022-09-10
    8
    New build with backported July '22 ASB patches available

    Hi all,
    a new build is available for download (update instructions, see OP):
    • Custom build release 2022-07-01
    Happy flashing!
    Regards, M.
    5
    New build with April ASB patches available

    Hi all,
    a new build is available for download (update instructions, see OP):
    • Custom build release 2022-04-01
    • Bromite Webview 100.0.4896.57
    Happy flashing!
    Regards, M.
    5
    New build with May 2020 ASB

    Hi all, a new build is available for download:
    https://sourceforge.net/projects/li..._a_lineage16_20200508_system.img.zip/download

    To install, download, unzip and follow instructions as outlined in OP.
    The build has the following features:
    • Sec. string 2020-05-01
    • Bromite Webview on 81.0.4044.127
    • AuroraStore updated to 3.2.8
    • Fix of bundled 'netmonitor' app not starting

    Regards, M.
    5
    New build with backported September '22 ASB patches available

    Hi all,
    a new build is available for download (update instructions, see OP):

    • Custom build release 2022-09-01
    • Bromite Webview 104.0.5112.91
    • microG 0.2.24.214816-30
    • Contacts app slightly 'de-Googled'
    Happy flashing!
    Regards, M.