topjohnwu / Magisk

The Magic Mask for Android
GNU General Public License v3.0
48.29k stars 12.33k forks source link

"Requires Additional Setup" + "Unable to find preinit dir" #8219

Closed sn-o-w closed 3 months ago

sn-o-w commented 3 months ago

Device: Nexus 5 (hammerhead) Android version: 10 Magisk version name: Canary Magisk version code: 27004


I'm not sure what is wrong, but I get the prompt "Requires additional setup" every time, and I need to reflash Magisk.

In the installation window, I get at the end, "All done!" but the penultimate line says, "Unable to find preinit dir.".

I took some screenshots:

So even if it says that the installation went successfully, after I reboot the device and open Magisk Manager, I see again "Requires additional setup" and it tells me I need to reflash Magisk.

And given the fact I couldn't install the last 2-3 official Canary releases until this is merged https://github.com/topjohnwu/Magisk/pull/8174, I am forced to create my own Magisk builds with the fix included. I even tried to merge other recent PRs submitted by @yujincheng08, but no use.

I created my own Magisk APK, I even added my own signing key in order to have a working Magisk Manager, I patched the boot file on my Nexus 5 for my Nexus 5, and then I flashed the patched image via TWRP. And this problem persists.

I created my own Magisk APK via GitHub Actions here: https://github.com/sn-o-w/Magisk

And this is the patched boot file: magisk_patched-27004_pMmTd.zip

pndwal commented 3 months ago

Especially as you have custom ROM, what happens if you patch boot.img in Magisk app and flash w/ fastboot?

sn-o-w commented 3 months ago

Especially as you have custom ROM, what happens if you patch boot.img in Magisk app and flash w/ fastboot?

I haven't used fastboot in years. Is there any difference between fastboot and TWRP regarding flashing boot images?

pndwal commented 3 months ago

Yes... Only partial root w/ custom recovery installation:

In this release, a brand new pre-init partition detection mechanism has been designed to support even more devices. Due to complicated reasons, this detection mechanism cannot be performed in a custom recovery environment.

This means that any installation of Magisk v26+ using custom recovery will be incomplete; a subsequent re-installation through the Magisk app after booting up is required.

v26.0

... After booting and taking Direct from app, the selinux/module rule directory path should be set properly however...

yujincheng08 commented 3 months ago

send magisk log

sn-o-w commented 3 months ago

send magisk log

magisk_log_2024-07-15T13.12.59.log logcat-07-15-2024.txt

sn-o-w commented 3 months ago

By the way, I still see the same 'Unable to find preinit dir' message even when I install or update Magisk modules. 🤔

yujincheng08 commented 3 months ago

Try https://github.com/topjohnwu/Magisk/pull/8221

sn-o-w commented 3 months ago

Try #8221

At first glance, it seems to be okay:

EDIT: I've rebooted the device, and opened Magisk Manager, I no longer get the prompt "Requires additional setup."