-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
SAR and A/B interactions break internal install on Nintendo Switch #3014
Comments
Proposed patch: |
Hi, thanks for the detailed report! Unfortunately, things aren't as simple as you assumed 😉, the comparison is explicitly case insensitive because on devices such as Samsung use full caps There is a recommendation to fix this: don't use legacy SAR and switch to use 2SI instead. In that case, Magisk will not do the mounting, but rather defer to the original But 2SI depends on Android 10+, and I'm not sure about whether Android 10 is supported on switchroot. |
I understand your point; however I guess the patch I proposed (the first approach) can't break anything. Unless the Tegra partition name might conflict with something else? |
Oh, so switchroot is using Tegra naming scheme for Android? |
Yes, since the Switch is a Tegra T210 device! |
Sure, I'll reopen this issue to keep track of this. |
I can attest this is working for me™ 😜 Now, if a more careful approach turns out necessary, I think it is possible to grab Switch-specific props or cmdline and adjust accordingly. But the simplest approach is the one in the patch and I'm not foreseeing conflicts with other devices. |
Submit the patch as a pull request? |
Thanks, gentlemen! |
This is quite peculiar but I believe is a legitimate case nevertheless.
As you may be aware, some hardware revisions of the Nintendo Switch are amenable to modding and Android ports have been created for it. Usually the port is installed to the SD card and it's straightforward. My particular setup, though, has Switchroot Pie installed to the eMMC, side by side with HorizonOS (and Ubuntu Linux, for the matter).
The HOS partitioning scheme is regular GPT, but it does reserve some partition names, of note:
Herein lies the problem.
mmcblk0p10
, that is,SYSTEM
, is being confused for an A/B system partition because of the case insensitive compare hereMagisk/native/jni/init/mount.cpp
Line 67 in f1fb740
Magisk/native/jni/init/mount.cpp
Line 246 in f1fb740
A solution would be to invert the tested scenario in
SARBase::mount_system_root
and look for the NVIDIA naming scheme first, then withsystem[+slot]
, andabort
in case that fails.Second possibility would be to attempt case sensitive first, then failing all that resort to case-insensitive. It would be more complicated though.
A third possibility is to completely split the code paths between A/B and non-AB SAR.
My vote goes to solution 1, for least impact.
The text was updated successfully, but these errors were encountered: