FriendlyNeighborhoodShane / MinMicroG

Sources and scripts for MinMicroG installers. You shall find no prebuilt releases here.
GNU General Public License v3.0
316 stars 32 forks source link

Installation with dynamic system partition fails #19

Closed duude21 closed 2 years ago

duude21 commented 3 years ago

Hi, thank you for your work!!

Using a Pixel 4a with LineageOS 18.1 (Android 11) there is no twrp available. So I used LOS recovery.

When System is not mounted in Recovery, it says no ROM found at /

If System is mounted it says:

Cleaning up etc..

than: Installing MinMicroG to /mnt/system... !!!FATAL ERROR: Could not install /mnt/system//system/priv-app/AuroraServices.apk

Stopping installation etc.

To me (not knowing much) it seems there is one "/" to much, right? Would be thankfull for an answer! Lukas

FriendlyNeighborhoodShane commented 3 years ago

Hi!

Huh, interesting. The LOS recovery is not actually something that proper support can be offered for (it is never guaranteed to have all the stuff we need, like TWRP and other recoveries do; it is only made for LOS updates). But we could try seeing what's going on here and if it can be fixed.

The actual errors and other debug output are in the recovery logs. We'll need those to know what's going on.

Go to your recovery, mount system, try to flash minmicroG, then try to find an option in your recovery to save or view recovery logs. Or if that doesn't work, look for an option to enable adb, connect your computer and use adb to pull /cache/recovery/log or /cache/recovery/last_log.

(The doubles slashes are not a problem, Linux doesn't mind. a/b, a//b or a///b are all the same for it.)

duude21 commented 3 years ago

recovery.log Ok. Thanks for looking into it. I managed to boot a temporary twrp but the result was the same. The recovery log is attached.

FriendlyNeighborhoodShane commented 3 years ago

Ah, here's the problem.

Doing size checks...
Pack size is 3
Free system space is 11

(The values are in MBs, and are only a rough approximation. 11MB is already very little free space but it probably has much less in reality.)

mkdir: '/system_root//system/priv-app/AuroraServices': No space left on device
cp: /system_root//system/priv-app/AuroraServices/AuroraServices.apk: No such file or directory

So I looked it up and apparently the Pixel 4a uses dynamic partitions. That means your 'logical' partitions of system, vendor and some others are actually just one real partition, each only taking as much space as they need. Which leaves them with very little free space to be able to install extra stuff like microG.

I think I've heard of ways to manually expand the system dynamic partition so you'll be able to use things like minmicroG. But even if you did that apparently OTAs are going to resize them again back to the original size, so you'd have to redo that on each and every update...

Probably the only way for devices like yours to use microG without it being a major PITA is to use a ROM that comes with it prebuilt e.g. LOS for microG, Calyx, etc.

duude21 commented 3 years ago

HI, Thank you! So I did some research, asking myself how gapps would be installed under these circumstances and it seems in the changelog of nikgapps that they try to flash to system_ext/ partition to avoid the no space problem. I could not find the commits though.. Edit: I will look into the repos of other gapps packages to maybe find out how they do it

duude21 commented 3 years ago

Hi, so I ran into some problems trying to make a backup to experiment a little more, but I found a solution.

I could installt AuroraServices by pushing them manually to /system/priv-app using adb root (following this guide)

FriendlyNeighborhoodShane commented 3 years ago

Interesting. Not sure how this piece of information can be used however, since we don't know how or why this is possible through ADB when Android is booted.

Did you find any GApps package (or anything else atleast as large as MinMicroG) that works on your device yet? If that is possible at all, I could try looking into its code and doing whatever it is doing to avoid this problem.

Sorry I can't be much help here as I don't have a dynamic partition device to try things on (I actually do have one, but I haven't unlocked it and started using it for development yet).

FriendlyNeighborhoodShane commented 3 years ago

I came across something that might be useful. Try flashing the "Recovery SLAM Script" from the attachments here, and then flashing MinMicroG: https://forum.xda-developers.com/t/tools-zips-scripts-osm0sis-odds-and-ends-multiple-devices-platforms.2239421

(direct link to that zip: https://forum.xda-developers.com/attachments/00-recovery-slam-script-zip.5355129)

FriendlyNeighborhoodShane commented 2 years ago

Well I did find something relevant.

It is true that packages like minmicrog and opengapps can work on dynamic partition devices. But it's not something that they can do anything about.

Rather, your ROM needs to reserve extra space in the system partition for this. Lineage does: https://review.lineageos.org/c/LineageOS/android_device_google_crosshatch/+/267672 https://review.lineageos.org/c/LineageOS/android_device_google_crosshatch/+/284093

You can ask your maintainer to look into this.

FriendlyNeighborhoodShane commented 2 years ago

Closing because inactivity and because I think it has been resolved. Feel free to reopen if you need.

staticnotdynamic commented 1 year ago

Hello,

As per https://github.com/crdroidandroid/issue_tracker/issues/164#event-8958125772, I tried using the Recovery SLAM script with no use. My ROM developer is not planning to expand the partition. Is there any other way for the MinMicroG installer to work ? I am open to suggestions

FriendlyNeighborhoodShane commented 1 year ago

@staticnotdynamic Hi,

sorry for the late reply, I haven't really been able to spend time on the project. If neither of those options are possible, you'll just have to resort to installing MinMicroG as a Magisk module.

MinMicroG installs itself as a module automaticlaly if it detects magisk is installed (to detect that, /data has to be decrypted). You can also flash it through the Magisk app, but that isn't my first recommendation because there could be permission issues with doing a non-clean flash.

staticnotdynamic commented 1 year ago

Gotcha. I will try it with Magisk instead. Thanks a bunch for all of your work. Truly appreciated!