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

Bad 2SI checking logic for Android 11 devices? #2994

Closed
simonsmh opened this issue Jul 17, 2020 · 13 comments
Closed

Bad 2SI checking logic for Android 11 devices? #2994

simonsmh opened this issue Jul 17, 2020 · 13 comments
Labels
confirmed Issue confirmed to exist and the reason is known

Comments

@simonsmh
Copy link
Contributor

simonsmh commented Jul 17, 2020

#2979

My device is Mi 10 with MIUI12 based on Android 11 Beta 1-3. After patching boot, the phone boots but magisk seems not working.

For my device, which is using Android 11 SAR A-only, Magisk is jumping into RootFSInit instead of FirstStageInit because of the /apex dir is missing in the ramdisk.

However, this device is definitely 2SI as it is necessary for dynamic partition device, right? With Android 10, It is working because the ramdisk contains /apex dir.

boot.tar.gz
new-boot.tar.gz
dmesg.log
logcat.log
patchboot.log

bool two_stage = access("/apex", F_OK) == 0;
if (cmd.skip_initramfs) {
if (two_stage)
init = new SARFirstStageInit(argv, &cmd);
else
init = new SARInit(argv, &cmd);
} else {
decompress_ramdisk();
if (cmd.force_normal_boot)
init = new FirstStageInit(argv, &cmd);
else if (access("/sbin/recovery", F_OK) == 0 || access("/system/bin/recovery", F_OK) == 0)
init = new RecoveryInit(argv, &cmd);
else if (two_stage)
init = new FirstStageInit(argv, &cmd);
else
init = new RootFSInit(argv, &cmd);
}

And with FirstStageInit I still got bootloop instead, but let's track it on #3093

@osm0sis
Copy link
Collaborator

osm0sis commented Jul 17, 2020

Noticed the same with OnePlus Android 11 Beta 1 but hadn't identified the reason. You're right, no /apex in the ramdisk!

Screenshot_20200717-130749

Pixel devices on the Beta must still have /apex or something.

@osm0sis osm0sis added the confirmed Issue confirmed to exist and the reason is known label Jul 17, 2020
@simonsmh
Copy link
Contributor Author

@osm0sis As your device is A/B, magisk should work again with patching boot.img with creating apex folder and switch to SARFirstStageInit .

@osm0sis
Copy link
Collaborator

osm0sis commented Jul 17, 2020

Yep, that's a viable workaround, but as you say, detection will need to be fixed.

This is likely another case of Google not following their own OEM specs, just as with adding recovery_a/recovery_b partitions back is the current standard everywhere except on Pixels where it's still boot-as-recovery.

@osm0sis
Copy link
Collaborator

osm0sis commented Jul 18, 2020

@topjohnwu I'm thinking looking for /apex OR /avb OR /debug_ramdisk might be the way to go

@topjohnwu
Copy link
Owner

I would personally choose a more definite way, maybe parsing the init binary directly.

@Potat0000
Copy link

@osm0sis @topjohnwu Is there any progress? I need Magisk on Oxygen OS DP3 urgently. Thanks!

@antnyhills
Copy link

antnyhills commented Aug 12, 2020

@osm0sis @topjohnwu Is there any progress? I need Magisk on Oxygen OS DP3 urgently. Thanks!

https://androidfilehost.com/?fid=8889791610682913299

Use this boot.img to get root working on OOS 11 DP3

I'm personally using it and its working correctly.

This is for the International OnePlus 8 Pro I should specify.

@simonsmh
Copy link
Contributor Author

@antnyhills Could you provide a dmesg log for your boot.img?

@Potat0000
Copy link

https://androidfilehost.com/?fid=8889791610682913299

Use this boot.img to get root working on OOS 11 DP3

I'm personally using it and its working correctly.

This is for the International OnePlus 8 Pro I should specify.

Thank you so much! I'm using exactly International OnePlus 8 Pro and that what I need!

Also, I wonder how you made it and hope it would be merge into Magisk.

BTW, you're using a wrong Markdown url pattern so that the url link to the Magisk Issue page.

@antnyhills
Copy link

antnyhills commented Aug 12, 2020

Thank you so much! I'm using exactly International OnePlus 8 Pro and that what I need!

Also, I wonder how you made it and hope it would be merge into Magisk.

BTW, you're using a wrong Markdown url pattern so that the url link to the Magisk Issue page.

Thanks, should be fixed. This is not my work, so I'm unsure of what was done to make it work, sorry! :/

@stetorIT
Copy link

@osm0sis @topjohnwu Is there any progress? I need Magisk on Oxygen OS DP3 urgently. Thanks!

https://androidfilehost.com/?fid=8889791610682913299

Use this boot.img to get root working on OOS 11 DP3

there is something similar for the MI10 with MIUI12 ?

or any news on fixing this problem with android 11?

thx

@mrmazakblu
Copy link

I have similar issue. Appears magisk.init is not run at boot time. So device boots without having root.
But the connection to Android 11 and the missing apex folder from boot.img ramdisk do not seem to be the only factor. My device is Android 10 and has the apex folder, and still has the issue of magisk.Init not active when booted.

@osm0sis
Copy link
Collaborator

osm0sis commented Aug 19, 2020

I have similar issue. Appears magisk.init is not run at boot time. So device boots without having root.
But the connection to Android 11 and the missing apex folder from boot.img ramdisk do not seem to be the only factor. My device is Android 10 and has the apex folder, and still has the issue of magisk.Init not active when booted.

Then it's not the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed Issue confirmed to exist and the reason is known
Projects
None yet
Development

No branches or pull requests

8 participants
@osm0sis @topjohnwu @simonsmh @antnyhills @Potat0000 @mrmazakblu @stetorIT and others