yashsingh1/xdaforums huggingface dataset:
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
You guys need to calm down. I never said anything about it working.
[Treble-Enabled Device Guides, News, & Discussion] :
Hopefully you will managed to make it happens;);)
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
Well I still get the error with missing resources even with a subtractive approach (99% original MIUI files) so something else is missing. No SELinux errors in dmesg. Might be related to missing stuff in /cust so that's my next task. But if that doesn't fix it then I'll be stuck for a while.
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
Yeah, I officially give up. I've banged my head against a wall for too long on this, I have many other projects I want to work on.

I have no idea why any of the framework resources won't be loaded. It must be a red herring - but I can't find any errors nor do I have any more ideas.

I'm attaching my WIP scripts directory in case anybody smarter than me ever wants to take a crack and wants a head start.
[Treble-Enabled Device Guides, News, & Discussion] fxsheep:
no ,believe me ,cust isn't important that related to boot,since I killed my cust many times , and I didn't reflash it,but MIUI still working fine.
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
Yes I know that now, see the last post.
[Treble-Enabled Device Guides, News, & Discussion] kiran G.:
Thx for your efforts...?
[Treble-Enabled Device Guides, News, & Discussion] :
Thank you for your time
[Treble-Enabled Device Guides, News, & Discussion] t0per666:
Atleast share your none gsi rom to Mi A1 forum? If not thats ok too. Thank you!
[Treble-Enabled Device Guides, News, & Discussion] aureliomilitao:
is possible create Miui 10 GSI for install with Fastboot ???
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
I replied to the thread in A1 forum.

Please move all A1 related discussion to that A1 thread.
[Treble-Enabled Device Guides, News, & Discussion] :
The Problem is that Xiaomi didnt release the patchrom
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
PatchROM is abandoned.

But I never used PatchROM in all my old ports ;) it's not the problem.
[Treble-Enabled Device Guides, News, & Discussion] erfanoabdi:
remove RRO apk from vendor/overlay ;)
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
Holy crap are you serious xD

I even saw that in the logcat, I had no idea it could be interfering.

If that solves it and I eventually get it booting, you're getting #1 spot on the credits/thanks!
[Treble-Enabled Device Guides, News, & Discussion] erfanoabdi:
lol, yep i had to remove it for my miui port on griffin

because of exactly same error
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
Thanks so much man, I honestly didn't expect any existing porter to notice or give advice.

So hopefully work has resumed people, I have an exam in a few hours but I'll be getting back to this as soon as I'm home :D
[Treble-Enabled Device Guides, News, & Discussion] aureliomilitao:
is possible create Miui 10 GSI ?
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
Maybe. But I refuse to try until stable comes out. Otherwise I can't be sure if it's a bug with base ROM or the port.
[Treble-Enabled Device Guides, News, & Discussion] Killuminati91:
MIUI 9 / 10 for the Galaxy S9 would be absolutely incredible. Really hoping that someone can figure this out.
[Treble-Enabled Device Guides, News, & Discussion] :
Yes:good:
[Treble-Enabled Device Guides, News, & Discussion] fxsheep:
[MENTION=1844875]CosmicDan[/MENTION] sup?
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
Taking some R&R from Android stuff for a while. I'm on mid-semester break for the next few weeks so I'll get back to it soon.
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
I am slowly working on it. The reason why it's taking so long is because I don't want to just release a ROM - I am making a kitchen for it, effectively open-sourcing all the work. This means I need to write scripts to:

1) Convert and unpack the images (MIUI and GSI)

2) Combine the firmwares to a new target

3) Automate the smali and initramfs patching

4) Some other minor things, e.g. collate file_contexts.

#3 is a bit of work; but I've done this kind of thing before.

The initial version will be A/B only because it's easier - initramfs is on the system image. But supporting A-only devices will be tough because of these reasons:

1) I don't havean A-only device, so I will be working blind

2) It will need to pull the boot.img from you device and modify it

I will ignore A-only devices at first because that is not a true GSI if I have to automate modding the boot.img for every device.

.... maybe. The init service entries in initramfs might be able to be moved to system/etc/init. I hope so.

Lastly, the MIUI build will require SELinux permissive. This may require a custom kernel for your device. At least in the Mi A1; if you set permissive flag on stock kernel it doesn't actually work and just stays enforcing (maybe because it's a user build and/or has secure boot enabled).
[Treble-Enabled Device Guides, News, & Discussion] Jax:
Excellent, hope we will see miui gsi in future
[Treble-Enabled Device Guides, News, & Discussion] aingerunn:
We will have patience. Waiting for creation.
[Treble-Enabled Device Guides, News, & Discussion] Shavi_Suri:
u r working on miui 9 or miui 10 ?
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
9 because I will only work on stable releases.
[Treble-Enabled Device Guides, News, & Discussion] luckydeveloper:
What news?
[Treble-Enabled Device Guides, News, & Discussion] EMJI79:
I would be happy with Miui 9.
[Treble-Enabled Device Guides, News, & Discussion] prashantxpe:
Miui 10 wont be difficult as we get miui 9
[Treble-Enabled Device Guides, News, & Discussion] Dadud:
32 bit planned? i see someones got miui 9 for treble enabled moto G5+
[Treble-Enabled Device Guides, News, & Discussion] fxsheep:
Amazing! So we can also have chance to build other ROM GSIs like EMUI ones later?
[Treble-Enabled Device Guides, News, & Discussion] rakee:
Here:

https://xdaforums.com/g5-plus/development/treble-miui-9-6-moto-g5-plus-t3807308

---------- Post added at 04:00 AM ---------- Previous post was at 03:59 AM ----------

Here

https://xdaforums.com/g5-plus/development/treble-miui-9-6-moto-g5-plus-t3807308
[Treble-Enabled Device Guides, News, & Discussion] 源稚生:
i use my mix2s flashed the lineage

as the title
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
Exactly. It's a maintainability choice; I don't want to be updating the kitchen and uploading ROM's every single week.

Is there a 32-bit GSI? If so, the order of importance is:

1) A/B ARM64 first (main focus as it's the only Treble device k personally have)

2) A-only ARM64 devices next (might be a while unless someone helps me after A/B is done, or I get another device)

3) Everything else

---------- Post added at 04:09 AM ---------- Previous post was at 03:15 AM ----------

Not by my hand. I'm not making a magical "port any ROM to GSI" tool - this is very specific to MIUI.
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
Small progress update -

An additive approach (using GSI base and modifying for MIUI) is a mess and seems a dead end.

Moving to a subtractive approach (MIUI base and trying to generify it) as I had more luck in that regard.

Downside of this approach is that I only have one device to test and it's similar hardware; I effectively need to re-engineer the generic process. May not even be possible on vastly different hardware (e.g. MTK) depending on how Xiaomi did things.

I do plan to get a cheap MTK device one day though for that.
[Treble-Enabled Device Guides, News, & Discussion] aingerunn:
I have the sharp aquos s2. Sure, when you create the Rom Miui, I'll try it. I love Miui.
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
Ok, so another small update.

MIUI 9 for 6X based on 8.1 is successfully booting on my Treble Mi A1. There are issues though - first major one is no sound, and the MIUI theme system is a bit broken (e.g. no icon overlays). Some other things like Wifi and VoLTE (apparently, according to status bar text) were working, though.

I think many of the outstanding issues can't be fixed until I create a new selinux policy - and this will be hard, I will need to write some fancy stuff to rebuild it. I also want to do this because not everybody has SELinux permissive kernels anyway.

This might all just be lucky for me because I have a Qualcomm 6xx device already, other SoC's might not even boot for all I know.

At this rate I should be able to post the alpha kitchen and ROM within a week at most.
[Treble-Enabled Device Guides, News, & Discussion] aureliomilitao:
no possible create GSI miui10 fot install with fastboot???
[Treble-Enabled Device Guides, News, & Discussion] phhusson:
It's annoying, but you can just append commands to system/etc/selinux/plat_sepolicy.cil, instead of rebuilding

Also, even if you can't have fully permissive kernels, you can set some whole contexts as permissive, that should make things easier
[Treble-Enabled Device Guides, News, & Discussion] fxsheep:
have you tried to boot with a selinux fully-disabled custom kernel?
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
Oh really? I was thinking I'd have to inject them into existing entries, otherwise it'd fail with duplicate entries (like contexts definitions does).

The main problem I was having until now was that I didn't know what the sha256 was generated from, but I figured that out now.

Regardless I still need to parse the policy and add necessary (unique) things, but it's way easier to automate that than try and script adding dummy labels to all the extra MIUI services.

I'll still have to tokenize every entry and eliminate duplicates, hope I can find a fast way to do that in bash (without too much piping and avoiding `while read` lol...) I'll figure it out.

Cheers!

Yeah I already have, but you still need seclabels defined for services even in SELinux permissive or init will refuse to start them.

I also want to do this to reduce the denied log spam since I'm at the stage where I have to slog through every warning and error in logcat.

Anyway, that's progress. Back to it!
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
Alright, so I tried just appending every unique line from MIUI's plat_sepolicy.cil, regenerated the sha256, and I still get a kick to fastboot.

At this stage I'd just be happy to figure out where/how the seclabel is applied to init services, it doesn't look like the .cil files do this and I can freely modify the others without problem.

EDIT: e.g. I get this in dmesg:

[ 10.713016] SELinux: Context u:object_r:shelld_exec:s0 is not valid (left unmapped).
[ 10.713215] init: could not get context while starting 'shelld'

...and the only way I can fix that seems to be to modify the cil's, which I can't figure out, or just add any other dummy seclabel (e.g. shell) which will be denied but is fine for permissive.

I just really want to try to avoid having to add dummy seclabel's to every MIUI service.

EDIT2: So I just tried to add these two lines, which I think is what gives the seclabel to shelld:

echo "(type shelld_service)" >> "./target_system/${SRC_GSI_SYSTEM}/etc/selinux/plat_sepolicy.cil"
echo "(roletype object_r shelld_service)" >> "./target_system/${SRC_GSI_SYSTEM}/etc/selinux/plat_sepolicy.cil"

...then regen the sha256...

cat \
"./target_system/${SRC_GSI_SYSTEM}/etc/selinux/plat_sepolicy.cil" \
"./target_system/${SRC_GSI_SYSTEM}/etc/selinux/mapping/27.0.cil" \
| sha256sum | cut -d' ' -f1 > "./target_system/${SRC_GSI_SYSTEM}/etc/selinux/plat_and_mapping_sepolicy.cil.sha256"

... and that works, at least - no fastboot kick. But that doesn't apply the seclabel.

At least now I know I *can* modify the cil's, but I just need to find how to inject the changes without it throwing a tantrum.
[Treble-Enabled Device Guides, News, & Discussion] fxsheep:
a piece of advice: You can put everything in public (e.g. github) and others test if it can boot on other platforms,as for me I have a 4xx and a 8xx device.
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
I have said multiple times that I will be releasing the kitchen along with the ROM; that's why it's taking so long (so the full build can be automated).

But initial versions will be A/B devices only.
[Treble-Enabled Device Guides, News, & Discussion] sharky172:
It seems Android SDK Emulator is compatible with Treble, so you should be able to boot a GSI system.img. I haven't try yet, but if it work you could save time :D
[Treble-Enabled Device Guides, News, & Discussion] aureliomilitao:
is possible create miui10 Oreo Gsi for Mido ???
[Treble-Enabled Device Guides, News, & Discussion] Mirdeusz:
GSI is not device specific. Your device must support treble in order to flash system image.

Wysłane z mojego Mi A1 przy użyciu Tapatalka
[Treble-Enabled Device Guides, News, & Discussion] aureliomilitao:
but...have GSI miui 10 for install??
[Treble-Enabled Device Guides, News, & Discussion] sharky172:
GSI MIUI9 CosmicDan is working on, will be compatible with Mido if your phone is compatible with Treble.

Until MIUI 10 stable is out, CosmicDan said he won't work on it.
[Treble-Enabled Device Guides, News, & Discussion] aureliomilitao:
have link for GSI miui9 ???
[Treble-Enabled Device Guides, News, & Discussion] sharky172:
No, It hasn't been released yet.

Read previous messages...
[Treble-Enabled Device Guides, News, & Discussion] aureliomilitao:
ok....thanks

but this is soon to be released ??
[Treble-Enabled Device Guides, News, & Discussion] DeMaCr:
Hello! Can anyone help me with port miui Oreo on the redmi 3s?
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
This is the Treble devices subforum. If you're going to hijack a thread, at least do it in a section that's relevant.
[Treble-Enabled Device Guides, News, & Discussion] rakee:
Any news??
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
MIUI is booting but most things are broken (no sound, themes are broken, Wifi WPA broken, probably more).

I've pushed some early commits of my kitchen to GitHub, but it's very rough and I have many local changes that aren't pushed yet. Experienced developers/hackers are free to take a gander and experiment/learn, but I won't pay attention to any bug reports or suggestions yet (there are still many many things on my schedule that I need to work out that may already fix any observed issues. In other words, I'm not actively seeking contributions yet because the job is still red hot and cooking on my end)
[Treble-Enabled Device Guides, News, & Discussion] Hyapatia:
I have A device , when needed ill be able to test it for you.
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
Won't be a for a while. I will only work on A once AB is stable for daily use, since I don't have an A device and will be developing blind.
[Treble-Enabled Device Guides, News, & Discussion] rowihel2012:
So p20 pro is A or A.B ?

So p20 pro is A or A.B ?
[Treble-Enabled Device Guides, News, & Discussion] rakee:
AB is stable for daily use,so will be released?:D:D
[Treble-Enabled Device Guides, News, & Discussion] Jax:
Will miui gsi support Kirin processors?
[Treble-Enabled Device Guides, News, & Discussion] fxsheep:
who knows
[Treble-Enabled Device Guides, News, & Discussion] Jax:
Please dont reply if dont know
[Treble-Enabled Device Guides, News, & Discussion] fxsheep:
Quite clear:
[Treble-Enabled Device Guides, News, & Discussion] Jax:
Okay,i take my words back☺️
[Treble-Enabled Device Guides, News, & Discussion] aureliomilitao:
i have A device...can test GSI miui 10..please
[Treble-Enabled Device Guides, News, & Discussion] chetchuakaka:
Please support treble for mimax 2 device ( oxygen ). Thanks.
[Treble-Enabled Device Guides, News, & Discussion] aureliomilitao:
i can test gsi miui10
[Treble-Enabled Device Guides, News, & Discussion] Andrea900:
STOP
[Treble-Enabled Device Guides, News, & Discussion] aureliomilitao:
wait so link miui 10 gsi

ok
[Treble-Enabled Device Guides, News, & Discussion] Jax:
Why u need miui gsi
[Treble-Enabled Device Guides, News, & Discussion] Andrea900:
MIUI with Oreo base.

That would be a solution even for 4 Pro users.
[Treble-Enabled Device Guides, News, & Discussion] Jax:
Oh
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
If you don't have Oreo then you can never use this.

Treble requires Oreo ROM. And your device then needs to support Treble, then also GSI's.
[Treble-Enabled Device Guides, News, & Discussion] sauru.660:
Any Update ?
[Treble-Enabled Device Guides, News, & Discussion] Andrea900:
We met all these requisites already (check "freemarkw" project on github, and the compatibility list on pphusson project at https://github.com/phhusson/treble_experimentations/wiki/Xiaomi-Redmi-4-Pro-Prime).

I'm running Los 15.1 Treble on 4 Pro at the moment.
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
Nope. This is a tough project.

If I don't make much progress soon then I will reach out for help.

Great. So what's the problem?
[Treble-Enabled Device Guides, News, & Discussion] Andrea900:
That i'm waiting for your release! :):svetius:
[Treble-Enabled Device Guides, News, & Discussion] MoistPicklez:
Patience, CosmicDan is working hard on it, give the dude some slack.
[Treble-Enabled Device Guides, News, & Discussion] aureliomilitao:
thanks
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
Just remember guys there is a chance that a fully working port may end up being impossible. If MIUI have tightly-knitted some native MIUI-related code with hardware-specific code, which is what I am fearing (why the **** is mediaextractor STILL segfaulting...) then it will be practically impossible :\

I'm hoping not, because it would really be stupid for them to do as it makes their own development harder, but it's possible they could do it *on purpose* to prevent people like me doing this xD
[Treble-Enabled Device Guides, News, & Discussion] :
We all believing in you CosmicDan, keep it up
[Treble-Enabled Device Guides, News, & Discussion] chetchuakaka:
I usually test rom. Once a day, i'm up 2 to 3 rom, and i need to test something news for my oxygen devices.
[Treble-Enabled Device Guides, News, & Discussion] Nibortjeh:
Hi Guys,

I am not a developer but I wanted to make you aware about the fact that the Moto G5 Plus is now also unofficially trebble and this came out recently: https://xdaforums.com/g5-plus/development/treble-miui-9-6-moto-g5-plus-t3807308

A Treble MIUI 9.6 rom.
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
Not a GSI, not relevant or helpful.
[Treble-Enabled Device Guides, News, & Discussion] sharky172:
In fact, comparing the source ROM (xiaomi.eu_multi_HMNote5Pro_8.5.3_v9-8.1) and the final MIUI ported ROM might help to see what need to be customized and modified to do a working port, no?
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
Why? How?

Knock yourself out if you think it will. I don't see how though, considering the 6X is already a Treble device and the MIUI is already Treble.

I don't like to make a habit out of copying other people's work. Even if I was that desperate, I don't see how porting an unofficial DSSI port would be beneficial vs an official original DSSI ROM. Especially since I already know how to port MIUI 9 to same hardware device as I already did with Mi A1 myself on Noughat.

So again; it's not a GSI so I don't see how it helps. The whole point of this is to get a GSI that works with any Vendor; not a specific device. It's a completely new set of challenges.

Heaps of MIUI ports exist already, throwing more ports in my face won't help because this is a completely new problem.
[Treble-Enabled Device Guides, News, & Discussion] sharky172:
I did a md5 comparison between files in system partition of theses 2 Roms. In fact both phones seems to have almost same hardware, so i found nohting relevant.

---------- Post added at 05:02 PM ---------- Previous post was at 04:59 PM ----------

Ok i didn't get it was so difficult
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
Yeah, they're the same SoC - now you understand :)

MIUI GSI is booting, but sound and Wifi still has issues on my device. It's all hardware related stuff now.

Well, themes are also not working (icon overlay is missing, they're just flat squares) and I'm not sure what that's about, butnill worry about that after sound and wifi.

Been trying to figure out sound issue for the moment, mediaextractor just crashes but it could be a red herring. It's the stage where I just have to experiment with swapping blobs.
[Treble-Enabled Device Guides, News, & Discussion] Jax:
Other SoCs like Kirin supported
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
Buy me one and I'll find out ;)

Wait until it's actually released and see for yourself.
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
I've had enough of ungrateful people harassing me in PM with demands.

Won't publicly shane anybody but stop. I'm not your freaking employee.

If it continues I'm going to just release my existing work and move on, and someone else can do it. I don't even care about MIUI personally, I just don't want to tarnish my reputation by abandoning it - but if the drama continues I won't give a crap about reputation.
[Treble-Enabled Device Guides, News, & Discussion] sauru.660:
Just ignore them bro and keep up your Hard Work...
[Treble-Enabled Device Guides, News, & Discussion] Jax:
?? If got that much money then i prefer buying a Xiaomi phone for myself
[Treble-Enabled Device Guides, News, & Discussion] vishalpal555@gmail.com:
redmi 4x got miui 10 pre beta so hoping for gsi soon
[Treble-Enabled Device Guides, News, & Discussion] ahagersr:
People can really be crappy sometimes. I appreciate all of your efforts and look forward to seeing the fruit of your work.

:)
[Treble-Enabled Device Guides, News, & Discussion] aureliomilitao:
resuming .....is not possible miui10 gsi create? correct
[Treble-Enabled Device Guides, News, & Discussion] sharky172:
No . Since Miui 10 is not stable yet, CosmicDan prefer to work on miui 9 GSI. If he success to port MIUI 9, porting MIUI 10 (once stable) to GSI should be quite easy.
[Treble-Enabled Device Guides, News, & Discussion] aureliomilitao:
ahhhh ok

works in GSI miui 9

ok thanks
[Treble-Enabled Device Guides, News, & Discussion] Mulham82:
Dear .. hope to see MIUI 10 on OP6 too.

Thanks.
[Treble-Enabled Device Guides, News, & Discussion] ajay9804:
Any update
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
Yes. I just chose to not share it because that benefits me for some reason.

(Sarcasm)
[Treble-Enabled Device Guides, News, & Discussion] lukee986:
lol
[Treble-Enabled Device Guides, News, & Discussion] Samboy007:
Great news
[Treble-Enabled Device Guides, News, & Discussion] rowihel2012:
wow no comment

so no miui 0 for me?
[Treble-Enabled Device Guides, News, & Discussion] Dil3mm4:
Miui 0 is available at /dev/null
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
Nope. Everybody is intentionally withholding MIUI because it's more fun that way.

(Sarcasm again)

Seriously guys, we're all people with our own commitments to worry about before indulging in charity development. Developers don't owe you anything.
[Treble-Enabled Device Guides, News, & Discussion] Dil3mm4:
So you're saying that we can't flash MIUI 0 from /dev/null ? So sed ser.
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
Topkek XDA memes xD
[Treble-Enabled Device Guides, News, & Discussion] ahagersr:
You need to learn patience. You're asking a lot of someone who is doing the work in his spare time, free of charge.
[Treble-Enabled Device Guides, News, & Discussion] Andrea900:
It was a joke... :facepalm:
[Treble-Enabled Device Guides, News, & Discussion] CosmicDan:
Why are you defending it? There's nothing funny about being ungrateful and entitled, even if it is pretending... It's just plain rude is what it is.

Thread is turning into sillyness, won't be surprised if it's locked.