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

Installation with dynamic system partition fails #19

Closed
duude21 opened this issue Jul 28, 2021 · 12 comments
Closed

Installation with dynamic system partition fails #19

duude21 opened this issue Jul 28, 2021 · 12 comments

Comments

@duude21
Copy link

duude21 commented Jul 28, 2021

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
Copy link
Owner

FriendlyNeighborhoodShane commented Jul 28, 2021

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
Copy link
Author

duude21 commented Jul 29, 2021

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
Copy link
Owner

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
Copy link
Author

duude21 commented Jul 30, 2021

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 duude21 changed the title Installation with LineageOS recovery fails Installation with dynamic system partition fails Jul 30, 2021
@duude21
Copy link
Author

duude21 commented Jul 31, 2021

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
Copy link
Owner

FriendlyNeighborhoodShane commented Aug 1, 2021

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
Copy link
Owner

FriendlyNeighborhoodShane commented Aug 3, 2021

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
Copy link
Owner

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
Copy link
Owner

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

@staticnotdynamic
Copy link

Hello,

As per crdroidandroid/issue_tracker#164 (comment), 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
Copy link
Owner

@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
Copy link

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

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