opengapps icon indicating copy to clipboard operation
opengapps copied to clipboard

Proper addon.d support for the /vendor and /product partitions for A/B devices

Open nezorflame opened this issue 5 years ago • 10 comments

Thanks to @merothh users who have custom /product partition are now able to properly remove stock apps during the installation process: https://github.com/opengapps/opengapps/pull/868

The addon.d script though requires more work and stil needs to be fixed. Let's track this issue here.

nezorflame avatar Aug 20 '20 08:08 nezorflame

/vendor will also need some consideration.. for addon.d (v1) they can be mounted to /vendor and /product, but for addon.d-v2 it'll need to be /postinstall/vendor and /postinstall/product, but only if e.g. /postinstall/product is a directory and /postinstall/system/product is a symlink.

Then the normal addon.d lists should work fine, since they're all based in /system, and things are symlinked.

Main problem is I'm not sure that's possible when booted without root. That'll require some investigation.

osm0sis avatar Aug 20 '20 09:08 osm0sis

https://github.com/merothh/opengapps/commit/334628a4df26d7bfd401eda7511324cf12d749fe

I have just verified the above commit to work on an A only dynamic device. If it's looks fine, i shall extend the mount support in the function for vendor as well, and verify it on my A only non dynamic device too.

If so, we could gurantee proper addon functionality on A devices and leave A/B as pending.

Looking forward to you guys opinion on this.

merothh avatar Aug 27 '20 12:08 merothh

Nice work!!

A couple minor notes:

  1. Please make the mount_product function mount_generic so that we can just supply the word product or vendor and it'll do the setup.
  2. It will need to mount to /postinstall/product or /postinstall/vendor for dynamic and/or addon.d-v2.

If you could fix those up and submit as PR I think we're good! 🙂

osm0sis avatar Aug 27 '20 14:08 osm0sis

Nice work!!

A couple minor notes:

  1. Please make the mount_product function mount_generic so that we can just supply the word product or vendor and it'll do the setup.
  2. It will need to mount to /postinstall/product or /postinstall/vendor for dynamic and/or addon.d-v2.

If you could fix those up and submit as PR I think we're good! 🙂

Awesome.

As for:

1: That's what I wanted to do. Just wanted to see if this initial approach was feasible. I'll do it as you suggested.

2: I thought I'd leave that since I don't have an A/B device to test on. Hence I just left checks to skip it on A/B.

I'll see to both and open a PR then.

merothh avatar Aug 27 '20 14:08 merothh

Hmm there might still be a complication with A/B.. I think addon.d using $SYS or /postinstall/system as a base will cause issues, since the /system/vendor and /system/product symlinks aren't relative.. so would point to actual /vendor and /product, and mounting over those would be kinda haphazard to do in a global mount namespace on a booted device.. 😕

osm0sis avatar Aug 28 '20 03:08 osm0sis

Hmm there might still be a complication with A/B.. I think addon.d using $SYS or /postinstall/system as a base will cause issues, since the /system/vendor and /system/product symlinks aren't relative.. so would point to actual /vendor and /product, and mounting over those would be kinda haphazard to do in a global mount namespace on a booted device..

There is also the question of mounts happening while booted, without root (as you mentioned earlier above). Even then /postinstall is ro.

https://github.com/merothh/opengapps/commit/ed946841fb4749efbdab89872a9159eba48183c8

I have made the mount function generic and added vendor to the mounts as well. Tested on A only Dynamic ( Poco X2 ) / A only Non Dynamic ( Redmi Note 7 Pro ). Both have a separate product partition.

However as we dont have a clear methodology figured out for A/B (Dynamic / Non Dynamic), i still left the A/B checks in the mount_generic function, so that it skips the mounts and retains the current behaviour of not mounting product, vendor on A/B.

Keeping that in mind. I would say that the current commit is good to go ?

merothh avatar Aug 28 '20 17:08 merothh

I'm OK with fixing only the A devices for now, that's better than nothing anyway and will help some of the users.

nezorflame avatar Sep 04 '20 08:09 nezorflame

We should still be tracking the issue for A/B devices.

merothh avatar Sep 05 '20 08:09 merothh

Seems like this could be resolved by addon.d-v3 once it's merged and widely rolls out to other ROMs: https://review.lineageos.org/c/LineageOS/android_vendor_lineage/+/299059

osm0sis avatar Jan 13 '21 17:01 osm0sis

Has there been any update to this? I'm sitting here with a oneplus 8t that has a 500MB system partition, and a 450MB product partition that opengapps doesn't seem to be using, which sucks because it mean i can install half as many apps, essentially. In fact, looking at it, it seems flashing the biggest package i could (modified stock) filled up system so it has 16MB left, and it deleted the stock apps that were in product, so now it has 719MB that i can't use.

DrymarchonShaun avatar Apr 06 '22 03:04 DrymarchonShaun