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

Search This thread
Bad luck for those who stayed on Huawei

Btw, do you have Magisk installed and which vdrsion?
No, I don't use Magisk.

Bcs, I've seen a report in XDA General Magisk thread that only Magisk v20.4 (the latest is now v23) or older work for P10 with EMUI 8 (same case, patching to its ramdisk.img) - if so, that's the reason Huawei was removed from Magisk Wiki
Thanks for the information - it may be worth to put a section about Magisk into my "Tips & Tricks" post . . .

(I don't have P9 anymore or any Huawei). When I did have, it was b540 and Magisk v20 4 and the Magisk procedure I commented above perfectly worked.
I can still find on my PC the ramdisk.img from b540 and its patched by Magisk b540 counterpart, and I can share - but only for those who did not upgrade from b540 to b55x (and who are willing to stay on old Magisk)
That would indeed be kind for those in need. I'll (but only in 10 days) also upload the ramdisk.img files to SF for B540, B550 and B552.
 
you just edited the post, @MSe1969 is working on a patched Ramdisk that work with magisk v22? am i right?
No, I am not using Magisk myself. All I said is, that I can offer the "original" unpatched RAMDISK.img from B540, B550 and B552 firmware, so people can restore things to have a clean start in case of Magisk issues or for whatever purpose.
 
  • Like
Reactions: Nezus3301 and zgfg

zgfg

Senior Member
  • Oct 10, 2016
    5,306
    2,606
    btw I have b540 with magisk v22.1
    there's an update but just because that happened, i still didn't update magisk
    Sorry, I lost the point - you do have (LOS flashed over b540) and you already have (working) Magisk v22.1 and you are asking for Magisk installation and ramdisk?

    I misunderstood that @MSe1969 had Magisk since he offered his files - sorry

    Edit, I've seen now the previous convo above and realized that @Nezus331 did update Magisk from v20 4 to v22.1 (but later scr... up) - if you backed up patched ramdisk (in TWRP) when it was operational, you could restore and use it again
    That would indeed be kind for those in need. I'll (but only in 10 days) also upload the ramdisk.img files to SF for B540, B550 and B552.
    Link to my Mega is in the post #375 above - if you extract your b540 ramdisk.img again, compare the checksum with my ramdisk.img from b540 Patch02 - I believe, they had the same ramdisk.img files and the same recovery_ramdisk.img files (I think OTA Patch02 patched something only in Vendor or so)
     
    Last edited:
    will worth the wait.
    Thanks in advice
    There is maybe an easier solution for you, again - you do at your own risk - opinions from others welcome:

    You stated, that in fact all you need is the deletion of the su binaries, as mentioned by you some posts before.

    You could download the '8.0 TWRP.img' from the "Rebranding" thread, get into fastboot mode and try fastboot boot twrp.img (IMPORTANT: don't flash, only boot, indeed it's 'fastboot boot ...' - adapt the filename accordingly).
    This should boot TWRP, so you can mount the system partition in rw mode and then delete the files you wish to delete. Make sure, when you are done and reboot, that you don't follow any proposal of installing the TWRP app. Also, don't mess around with any other TRWP function
     

    zgfg

    Senior Member
  • Oct 10, 2016
    5,306
    2,606
    There is maybe an easier solution for you, again - you do at your own risk - opinions from others welcome:

    You stated, that in fact all you need is the deletion of the su binaries, as mentioned by you some posts before.

    You could download the '8.0 TWRP.img' from the "Rebranding" thread, get into fastboot mode and try fastboot boot twrp.img (IMPORTANT: don't flash, only boot, indeed it's 'fastboot boot ...' - adapt the filename accordingly).
    This should boot TWRP, so you can mount the system partition in rw mode and then delete the files you wish to delete. Make sure, when you are done and reboot, that you don't follow any proposal of installing the TWRP app. Also, don't mess around with any other TRWP function
    Have you tested that fastboot boot TWRP would work (on some phones / some TWRP it doesn't)

    Anyway, if he really flashes TWRP (not just boots to), here was my original b540 recovery_ramdisk.img (and ramdisk.img)
     
    • Like
    Reactions: MSe1969
    Have you tested that fastboot boot TWRP would work (on some phones / some TWRP it doesn't)
    I haven't tested.
    @Nezus3301 - if 'fastboot boot ...' doesn't work, flash the TWRP with fastboot flash recovery_ramdisk twrp.img (adapt the file name accordingly). . .
    Anyway, if he really flashes TWRP (not just boots to), here was my original b540 recovery_ramdisk.img (and ramdisk.img)
    . . . and go back to Stock recovery via fastboot flash recovery_ramdisk recovery_ramdis.img (adapt file name), once finished
     

    Nezus3301

    Member
  • Aug 14, 2020
    26
    4
    28
    Samsung Galaxy S3 Neo
    Huawei P9
    I haven't tested.
    @Nezus3301 - if 'fastboot boot ...' doesn't work, flash the TWRP with fastboot flash recovery_ramdisk twrp.img (adapt the file name accordingly). . .

    . . . and go back to Stock recovery via fastboot flash recovery_ramdisk recovery_ramdis.img (adapt file name), once finished
    i was thinking of that, that could be an idea, but i have to be very carefoul, i mustn't boot in system in the entire work, last time i did, the phone went in bootloop, that was when i did the rebrand
    i should give it a try, is everything on the mega repository?

    edit: just fastboot boot doesn't work, i have to flash twrp
    latest edit: i'm going to explain step by step by quoting what you suggest me to do

    " if 'fastboot boot ...' doesn't work, flash the TWRP with fastboot flash recovery_ramdisk twrp.img (adapt the file name accordingly). . . "
    " . . . and go back to Stock recovery via fastboot flash recovery_ramdisk recovery_ramdis.img (adapt file name), once finished "
    as @MSe1969 and @zgfg told me to do, I did everithyng right, the system boot successfully and updated magisk, everything works just fine.

    If you want i can try to repack for you the latest ramdisk with magisk v23 on b540
     
    Last edited:
    • Like
    Reactions: MSe1969
    If you want i can try to repack for you the latest ramdisk with magisk v23 on b540
    Thanks for the offer, but as there are in fact different firmware versions out, everybody should install Magisk on his own.
    I will upload the original RAMDISK firmware images for B540, B550 and B552 after my return (to allow going back, if something went wrong)

    The rebranding thread mentioned in the OP links to the B540 firmware from 2018. In 2020, surprisingly, B550 and later B552 were published by Huawei (later in the thread, this is mentioned).
     

    zgfg

    Senior Member
  • Oct 10, 2016
    5,306
    2,606
    I will upload the original RAMDISK firmware images for B540, B550 and B552 after my return
    Still,all those AL10-c00 firmwares: b399SP17 (needed for HWOTA7 rebranding from c432 or another Nougat to Chinese Nougat), b528 (first Oreo that HWOTA7 thread was originally developped for), b535, b540 (OP posts were later adapted to), b550 and b552 are available for download from:
    https://www.firmfinder.ml/

    Open the page, fill in Eva-Al10 c00 as on the screenshot 1. Scroll down and find the firmwares (not only for AL10 but also for AL00, CL00, DL00 and TL00 - all Chinese)

    For any of them, scroll to the right to find File List button - screenshot 2. Open and copy the URL for that filelist.xml.

    E.g., for b552 it will be:
    http://update.dbankcdn.com/download...d62a4ae400eaf8f451c81c2d32f/full/filelist.xml

    Scroll through the opened xml to find the 3 filenames exactly as below - screenshots 3,4:
    update.zip
    update_full_EVA-AL10_all_cn.zip
    update_data_full_public.zip

    Now, remove filelist.xml from its URL as above and combine with subpath= and package= values for those filenames

    E.g., for b552:
    package="update_full_EVA-AL10_all_cn.zip"
    subpath="EVA-AL10_all_cn"/>
    it makes:
    http://update.dbankcdn.com/download...9/f6/v3/1afd1d62a4ae400eaf8f451c81c2d32f/full/
    +
    EVA-AL10_all_cn/
    +
    update_full_EVA-AL10_all_cn.zip
    =
    http://update.dbankcdn.com/download...A-AL10_all_cn/update_full_EVA-AL10_all_cn.zip

    That way it gives all three URLs for the EVA-AL10 c00 b552 firmware:
    http://update.dbankcdn.com/download...d1d62a4ae400eaf8f451c81c2d32f/full/update.zip

    http://update.dbankcdn.com/download...2d32f/full/public/update_data_full_public.zip

    http://update.dbankcdn.com/download...A-AL10_all_cn/update_full_EVA-AL10_all_cn.zip
     

    Attachments

    • IMG_20210514_225715.jpg
      IMG_20210514_225715.jpg
      390.3 KB · Views: 15
    • IMG_20210514_231310.jpg
      IMG_20210514_231310.jpg
      301 KB · Views: 16
    • IMG_20210514_230049.jpg
      IMG_20210514_230049.jpg
      593.3 KB · Views: 12
    • IMG_20210514_225857.jpg
      IMG_20210514_225857.jpg
      580.8 KB · Views: 16
    Last edited:
    Still,all those AL10-c00 firmwares: b399SP17 (needed for HWOTA7 rebranding from c432 or another Nougat to Chinese Nougat), b528 (first Oreo that HWOTA7 thread was originally developped for), b535, b540 (OP posts were later adapted to), b550 and b552 are available for download from:
    https://www.firmfinder.ml/
    Many thanks for this info - I have linked your post into the OP.
     
    • Like
    Reactions: zgfg

    zgfg

    Senior Member
  • Oct 10, 2016
    5,306
    2,606
    Many thanks for this info - I have linked your post into the OP.
    Btw, there is also a method to force firmware updates by using HiSuite and Firm (for more info read the Complete Guide there):
     
    • Like
    Reactions: MSe1969

    Nezus3301

    Member
  • Aug 14, 2020
    26
    4
    28
    Samsung Galaxy S3 Neo
    Huawei P9
    Hi there, @MSe1969 I have a question, is it possible to put in your rom (or as an official feature in one of the next update) some quality of life that I found useful when using emui? let me explain, I remember that when on emui 5, if you long press the vol - button when display's off, it does a sound, you say a name from your contacts and it calls it for you if the vocal search understood what you said, another thing if you can put the stock music app, because it was very cooler than the music app on lineage.

    Here's a problem with the songs of every type I have in my phone: when the phone restarts, my clock alarms set the song on the default alarm, overwriting the songs i set as alarm.
    Another strange thing is the ringtone, when someone calls me, even this if I set a song as my phone ringtone, it always plays the default one.
    The strangest and the most annoying one is the music app, I don't know if it's a bad flash that does this thing but when I play some music with bluetooth earphones, everything works just fine, when I try with the speakers, it's a 75% that the song doesn't even play, the minute counter goes forward but I can't hear it, the other 25% works or it does work but it suddently stops and refuses to skip to the next song

    Let me know if it's a known problem and if I can fix this
     
    let me explain, I remember that when on emui 5, if you long press the vol - button when display's off, it does a sound, you say a name from your contacts and it calls it for you if the vocal search understood what you said,
    EMUI in general is a whole proprietary software on system level with UI and many features provided - seems that the feature you have described is or was part of it - however, not an AOSP / LineageOS feature. So I can't do anything about it.

    another thing if you can put the stock music app, because it was very cooler than the music app on lineage.
    There are many good music apps out there, (e.g. I use VLC) - I don't see the benefit of trying to get the Huawei Stock Music app running, which is most probably deeply integrated into EMUI (which does not exist on the /system partition). . .
    I know that the LineageOS Eleven app has some issues in LineageOS 16.0, but e.g. VLC really works flawlessly for me.

    Here's a problem with the songs of every type I have in my phone: when the phone restarts, my clock alarms set the song on the default alarm, overwriting the songs i set as alarm. Another strange thing is the ringtone, when someone calls me, even this if I set a song as my phone ringtone, it always plays the default one.
    I can't observe this behavior on my device. Can you produce some logs?

    The strangest and the most annoying one is the music app, I don't know if it's a bad flash that does this thing but when I play some music with bluetooth earphones, everything works just fine, when I try with the speakers, it's a 75% that the song doesn't even play, the minute counter goes forward but I can't hear it, the other 25% works or it does work but it suddently stops and refuses to skip to the next song
    Whilst I was a happy user of the LineageOS Eleven app in LineageOS 15.1, I have stopped using it in LineageOS 16.0 due to various reasons, I could solve some by backporting commits from LineageOS 17.1, but eventually, I have started to use VLC and I really recommend it. One annoying thing I have recently detected is, that it won't play songs downloaded from NewPipe (maybe because of new codecs?); maybe a similar thing as you observed - VLC works fine for me, as mentioned already.
     
    • Like
    Reactions: Nezus3301

    Nezus3301

    Member
  • Aug 14, 2020
    26
    4
    28
    Samsung Galaxy S3 Neo
    Huawei P9
    EMUI in general is a whole proprietary software on system level with UI and many features provided - seems that the feature you have described is or was part of it - however, not an AOSP / LineageOS feature. So I can't do anything about it.


    There are many good music apps out there, (e.g. I use VLC) - I don't see the benefit of trying to get the Huawei Stock Music app running, which is most probably deeply integrated into EMUI (which does not exist on the /system partition). . .
    I know that the LineageOS Eleven app has some issues in LineageOS 16.0, but e.g. VLC really works flawlessly for me.


    I can't observe this behavior on my device. Can you produce some logs?


    Whilst I was a happy user of the LineageOS Eleven app in LineageOS 15.1, I have stopped using it in LineageOS 16.0 due to various reasons, I could solve some by backporting commits from LineageOS 17.1, but eventually, I have started to use VLC and I really recommend it. One annoying thing I have recently detected is, that it won't play songs downloaded from NewPipe (maybe because of new codecs?); maybe a similar thing as you observed - VLC works fine for me, as mentioned already.
    infact it was Music Eleven the problem, VLC apparently fixed the problem, and i used that app to set my ringtone so... problem kinda solved, if anything else happens I'll let you know
     
    • Like
    Reactions: MSe1969

    kkgodygah

    Member
    Feb 12, 2019
    6
    0
    New build with June 2021 ASB patches available

    Hi all,
    a new build is available for download (install instructions in OP):

    • ASB Security String 2021-06-01
    • Bromite Webview updated to 91.0.4472.102
    • microG 0.2.19211515-9
    Happy flashing!
    Regards, M.
    thank you for your greast iob.
    the rom works so good.
    but i havea question did it have volte?i couldnt find it .
     

    Top Liked Posts

    • There are no posts matching your filters.
    • 2
      New build with June 2021 ASB patches available

      Hi all,
      a new build is available for download (install instructions in OP):

      • ASB Security String 2021-06-01
      • Bromite Webview updated to 91.0.4472.102
      • microG 0.2.19211515-9
      Happy flashing!
      Regards, M.
      1
      let me explain, I remember that when on emui 5, if you long press the vol - button when display's off, it does a sound, you say a name from your contacts and it calls it for you if the vocal search understood what you said,
      EMUI in general is a whole proprietary software on system level with UI and many features provided - seems that the feature you have described is or was part of it - however, not an AOSP / LineageOS feature. So I can't do anything about it.

      another thing if you can put the stock music app, because it was very cooler than the music app on lineage.
      There are many good music apps out there, (e.g. I use VLC) - I don't see the benefit of trying to get the Huawei Stock Music app running, which is most probably deeply integrated into EMUI (which does not exist on the /system partition). . .
      I know that the LineageOS Eleven app has some issues in LineageOS 16.0, but e.g. VLC really works flawlessly for me.

      Here's a problem with the songs of every type I have in my phone: when the phone restarts, my clock alarms set the song on the default alarm, overwriting the songs i set as alarm. Another strange thing is the ringtone, when someone calls me, even this if I set a song as my phone ringtone, it always plays the default one.
      I can't observe this behavior on my device. Can you produce some logs?

      The strangest and the most annoying one is the music app, I don't know if it's a bad flash that does this thing but when I play some music with bluetooth earphones, everything works just fine, when I try with the speakers, it's a 75% that the song doesn't even play, the minute counter goes forward but I can't hear it, the other 25% works or it does work but it suddently stops and refuses to skip to the next song
      Whilst I was a happy user of the LineageOS Eleven app in LineageOS 15.1, I have stopped using it in LineageOS 16.0 due to various reasons, I could solve some by backporting commits from LineageOS 17.1, but eventually, I have started to use VLC and I really recommend it. One annoying thing I have recently detected is, that it won't play songs downloaded from NewPipe (maybe because of new codecs?); maybe a similar thing as you observed - VLC works fine for me, as mentioned already.
      1
      EMUI in general is a whole proprietary software on system level with UI and many features provided - seems that the feature you have described is or was part of it - however, not an AOSP / LineageOS feature. So I can't do anything about it.


      There are many good music apps out there, (e.g. I use VLC) - I don't see the benefit of trying to get the Huawei Stock Music app running, which is most probably deeply integrated into EMUI (which does not exist on the /system partition). . .
      I know that the LineageOS Eleven app has some issues in LineageOS 16.0, but e.g. VLC really works flawlessly for me.


      I can't observe this behavior on my device. Can you produce some logs?


      Whilst I was a happy user of the LineageOS Eleven app in LineageOS 15.1, I have stopped using it in LineageOS 16.0 due to various reasons, I could solve some by backporting commits from LineageOS 17.1, but eventually, I have started to use VLC and I really recommend it. One annoying thing I have recently detected is, that it won't play songs downloaded from NewPipe (maybe because of new codecs?); maybe a similar thing as you observed - VLC works fine for me, as mentioned already.
      infact it was Music Eleven the problem, VLC apparently fixed the problem, and i used that app to set my ringtone so... problem kinda solved, if anything else happens I'll let you know
    • 14
      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!

      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)
      • 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
      Security string: 2021-06-01
      AOSP tag: 9.0.0_r46
      Bromite System Webview: M91


      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
      • An unlocked bootloader
      • EMUI 8.0 firmware

      ONLY, If the above pre-requisites are met, download and unpack the linked ZIP file, and flash the .img file via fastboot.
      The OpenKirin installation instructions describe this in a very good way, I could not really explain it better (please note, that I have no relation to them, but they are really doing an amazing job!)
      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
      • 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 and 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.
      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 ready 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!

      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').



      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)


      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: 2021-06-12

      Created 2020-04-06
      Last Updated 2021-06-13
      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.
      4
      New build with July ASB patches

      Hi all,
      a new build is available for download (install instructions, see OP):
      https://sourceforge.net/projects/li..._a_lineage16_20200708_system.img.zip/download

      • ASB Security string 2020-07-01
      • microG: updated prebuilt GmsCore fom /e/ project (fixed FCM registration issues)
      • F-Droid updated to 1.8 / F-Droid privileged extension updated to 0.2.11
      • Aurorastore updated to 3.2.9 / AuroraServices updated to 1.0.6
      • Bromite Webview on 83.0.4103.101
      • Sepolicy: Netmonitor exception f. "Tracker Control" app

      Happy flashing - regards, M.
      3
      Kernel

      Just gave a try to the ECO Kernel, which seems to run really fine on the P9.
      Instructions in the linked thread (I flashed the "04.05.20 build with Linaro").

      Advantages:
      - Up to date with current patches (Stock kernel is from December 2018)
      - Hopefully better battery behavior

      I'll report my impressions soon, after using the device for some time.
      3
      Do you plan to provide regular updates with the latest security patches in the future?
      Yes, I do - April ASB is "already in the pipeline"...