Help building Mi 9 SE ROM

Hi all!

As this is my first topic (and comment), let my say before anything else: I am glad that this community and project exists, thank you!

Now: being a selfish bastard, I cannot compromise on my choice of Mi 9 SE for my next phone - there is simply no decent spec’d phone in compact size AND affordable price - maybe the Samsung A40, but neither that phone has /e/ support.

I tried to follow the guide for non LineageOS supported devices

I could not even build the supported Mi 8 (dipper) as a test, with the non-docker script.
Nevertheless, I tried the Mi 9 SE with supplied git repos, unfortunately it wasn’t a success.

I would appreciate some pointers.
If it would work out, I could even maintain the image for others, but I still have to learn a lot - I am a C++ dev :grinning:

My roomservice.xml

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
    <projet name="Samonitari/kernel_xiaomi_sdm710" path="kernel/xiaomi/sdm710" remote="github" />
    <projet name="Samonitari/vendor_xiaomi_sdm710-common" path="vendor/xiaomi/sdm710-common" remote="github" />
    <projet name="Samonitari/device_xiaomi_sdm710-common" path="device/xiaomi/sdm710-common" remote="github" />
    <projet name="Samonitari/android_device_xiaomi_grus" path="device/xiaomi/grus" remote="github" />
    <projet name="LineageOS/android_packages_resources_devicesettings" path="packages/resources/devicesettings" remote="github" />
</manifest>

My log:

>> [Tue Dec 10 10:53:07 CET 2019] Starting build for grus, v1-pie branch
including vendor/lineage/vendorsetup.sh
build/make/core/product_config.mk:234: error: Can not locate config makefile for product "lineage_grus".
10:53:33 dumpvars failed with: exit status 1
Device grus not found. Attempting to retrieve device repository from LineageOS Github (http://github.com/LineageOS).
Repository for grus not found in the LineageOS Github repository list. If this is in error, you may need to manually add it to your local_manifests/roomservice.xml.
build/make/core/product_config.mk:234: error: Can not locate config makefile for product "lineage_grus".
10:53:37 dumpvars failed with: exit status 1
build/make/core/product_config.mk:234: error: Can not locate config makefile for product "lineage_grus".
10:53:39 dumpvars failed with: exit status 1

** Don't have a product spec for: 'lineage_grus'
** Do you have the right repo manifest?

No such item in brunch menu. Try 'breakfast'
>> [Tue Dec 10 10:53:39 CET 2019] Failed build for grus
>> [Tue Dec 10 10:53:39 CET 2019] Finishing build for grus
>> [Tue Dec 10 10:53:39 CET 2019] Cleaning source dir for device grus
10:53:41 Entire build directory removed.

e[0;32m#### build completed successfully (2 seconds) ####e[00m

In you own sources all file names must fit lineage rules.
For example, you must have a 'lineage_grus.mk" in your device sources. Also inside the make files several names must follow the lineage rules.

Best you will compare your device / vendor tree with a official lineage device tree / vendor tree

Example:

Try forking from this repo https://github.com/faust93/android_device_xiaomi_grus

Thanks for the help!

I ripgrep’d for “xenonhd” (“brand” of projects I forked, they also build on top of LineageOS) in the source projects, and replaced all of them in path variables with lineage.

However, error stayed the same.
I was in the process of asking “When, and to where should build script download repos supplied in roomservice.xml?” and ranting a bit about what a chaotic heap of fun building android (LineageOS) ROM is, when:
I noticed that I had a typo in roomservice.xml - projet name - :sweat_smile:
But, I still hold some of my gripes… :stuck_out_tongue:

Build is running currently (Xenon W-2133, Win 10 WSL-OpenSUSE 15.1).
(Yes, I cannot force myself to install any apt using distro, unless I have absolutely ZERO choice, which is - fortunately - a very rare thing. zypper (and more recently dnf) is so much better.)
I’ll report back!
I will still have questions…

Is it a repo for GSI build - I have no experience in android building, but it seems so.
That is not what I want to accomplish.
As I understand GSI image have drawbacks, but maybe I am misinformed.
Could you elaborate on what are the pros and cons of GSI vs Full ROM?

GSI is a generic system image and you need a device with treble support. A GSI has a big advantages. You can flash it on EVERY treble device. A GSI doesn’t include the vendor partition. The vendor partition will stay as it is. That’s why you can flash the GSI on every device.

On XDA you can find a e-GSI (there is a discussion of 'it is a full e-OS GSI or not) , but is you device a treble device ? You can check it with an app from aurora. One s named ‘TrebleChecker’. It will show you if your device is trelbe enable and if you can flash a GSI

Yes, that part I know - the consequences are unclear though.
What drawbacks does it have? Shouldn’t the deGoogling (or deChinaSpying) have modifications in vendor partition? A half-privacy-conscious ROM is no-good.
Also, will OTA /e/ updates come to GSI image using phones? Or is there a plan to do it? If I maintain the full ROM, at least others could have OTA updates…

I haven’t bought it - yet. I wanted to at least build /e/ successfully before commiting the money. But I’m pretty sure it is treble compatible, considering it’s release date of 2019 May… Also, if GSI is a good option, Samsung A40 - which works with GSI, but don’t have all the sources available - is a cheaper option :wink:

Status update: Build at 50%

My builds are always failing at around 99% :pensive:

The vendor partition isn’t changed by GSI, that’S the main difference to ‘normal’ rom.
But all custom roms are using the stock vendor blobs (OK, librem and so are using no stock vendor blobs). So there will be no difference between ǹormal’ and GSI.

In the moment, no one really knows the GSI planning at e.foundation. As fa as I know, GAEL has never given a statement about GSI. I think (personal thoughts) it will come, but when … ??? Could be, sometimes in 2020.

But you can build it for your own. As far as I know, there are some scripts to include all e-OS changes into the LOS GSI, but when I have tried some month ago, he scripts never worked. I think you have seen the discussion about GSI here in forum.

In the moment, no one knows

On the official GSI plans for e.foundation :
For now there are no plans. The reason is the build team is stretched out thin. We already have delays in the Pie rollout or the updates for Oreo for most devices. The build team will focus on getting that out first.
Users with experience in GSI building are welcome to volunteer their services and put out a GSI for /e/ which works and also share steps on how they went about building it.

2 Likes

Well, I understand that the /e/ team has to ration its build team and infrastructure.

What is confusing is that: If GSI is as advantageous as proclaimed, and can be installed on ANY phone that supports treble, then: why not build it instead of several “classic ROM”?
You would have to build only one image for multiple phones - although current lineup consists of several non-treble phones, even 1 instead of 2 is a save…
The sooner you switch to treble, the more resource you save.

So, could anybody care to solve this contradiction?
This contradiction is one of the reasons I started a classic build - is GSI somehow fishy?

Status update: Build at 50% again (First failed at 84%, because clang was missing)

That’s easy answered. e-OS should run on as much devices as possible. And as now most devices don’t have treble, the ‘normal’ rom is the best choice,

It still didn’t manage to convince me, but that’s another topic…

OTOH kernel doesn’t build.
Maybe, the source is broken

:+1::+1::+1:

I stuck since one week with around 60 build tries while kernel build.

what kind of error ?

I tried two branches of the source I’ve found for Mi 9 SE kernel (technically it is for SD710 family, and Mi 9 SE has overclocked 712)

Both of them had assembler error messages around arch/arm64/kernel/vdso

why don’t use the standard lineage kernel sources ? Are there none ? Which kernel is it ?

Blockquote
why don’t use the standard lineage kernel sources ? Are there none ?

Because as far as I know, there isn’t any LineageOS supported device with SD710 family chipset
Quite a bummer, because as far as I’m concerned, SD 71Xs are the current best if you don’t want flagship performance - quite visible in the numbers, it is.

Although Team Horizon also use LineageOS as a fork base, thier XenonHD ROM uses their own maintained kernel source for Mi 9 SE.
I probably should contact them…

1 Like

I’m glad you had started this topic nowadays @Samonitari. Because my device a MI A3 is not currently supported by LOS. So I was wondering how I could build a compatible /e/ Rom by myself. This thread is really instructive to me.
I wish you the best and hope this community find whatever works for your phone. It will be a reference topic for sure!

Yeah, MI A3 is a nice phone, the only con (for me) is it doesn’t have an NFC - would it have one, I’ve definitely bought that one already!

There are other topics about building, but I will make a new instructional thread when successful - at least for OpenSuse, that current one is inadequate.

I’ve tried three kernel versions already. I’ve found out the compiler (version) was at fault. I’ll report back soon!

1 Like

It will be great for sure. Thanks in advance for the upcoming feedback :wrench:

Hi, that’s a very good idea.
I shared it on the Telegram Mi9se group, where you can find the best devs for it (they built few P and Q roms).
You may find some help on this channel: t.me/grusfamily
I do not have skills to help you direclty, but would be happy to test your biulds if you need.
Thanks.