Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emulate magisk boot process wrong #6

Open
HuskyDG opened this issue Jan 12, 2022 · 6 comments
Open

emulate magisk boot process wrong #6

HuskyDG opened this issue Jan 12, 2022 · 6 comments

Comments

@HuskyDG
Copy link

HuskyDG commented Jan 12, 2022

Rusty-magisk don't stop boot process if magisk in post-fs-data are not completed

Follow topjohnwu's Magisk Documentation, in post-fs-data stage, boot process must be stopped until all Magisk jobs are completed or 40 seconds timeout is reached.

Also the road from post-fs-data to late_start happened in very short time and magisk post-fs-data jobs may not be completed yet, maybe there are processing post-fs-data module script but late_start was triggered.
That can make some modules cannot be working well if the user install many module

Compare init.rc between Magisk on my phone and init.rc in rusty-magisk.

IMG_20220112_115230_903

IMG_20220112_115156_749

@HuskyDG
Copy link
Author

HuskyDG commented Jan 12, 2022

@axonasif
Copy link
Owner

Thanks for sharing your insights, I will look into it when I can.

@hmtheboy154
Copy link

This was koushsu init.rc implementation and @axonasif use it back in Magisk 21.x days, it used to work but now isn't anymore. He can't check because he don't have a device to test so I'll modify the init and see if it boot on my PS-x86 build when I have time.
Thanks for reminding us about this

@HuskyDG
Copy link
Author

HuskyDG commented Jan 12, 2022

Find a way (Use u:r:su:s0) to patch sepolicy and allow magisk domain to be permissive (do all thing). Then launch magisk in u:r:magisk:s0 selinux context

In Topjohnwu's emulator.sh:

ln -sf ./magiskinit magiskpolicy
if [ -f /vendor/etc/selinux/precompiled_sepolicy ]; then
  ./magiskpolicy --load /vendor/etc/selinux/precompiled_sepolicy --live --magisk 2>&1
elif [ -f /sepolicy ]; then
  ./magiskpolicy --load /sepolicy --live --magisk 2>&1
else
  ./magiskpolicy --live --magisk 2>&1
fi

@hmtheboy154
Copy link

There's already one
Also we already in permissive, just need to patch Magisk in.

@HuskyDG
Copy link
Author

HuskyDG commented Jan 12, 2022

There's already one Also we already in permissive, just need to patch Magisk in.

Oh i noticed that almost emulator has Permissive Selinux mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants