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

Created on 20 Aug 2020  路  9Comments  路  Source: opengapps/opengapps

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.

enhancement help wanted

Most helpful comment

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

All 9 comments

/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.

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.

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! 馃檪

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.

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.. 馃槙

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 ?

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

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jsbax picture jsbax  路  10Comments

mahmud2011 picture mahmud2011  路  5Comments

cryptommer picture cryptommer  路  7Comments

mrjayviper picture mrjayviper  路  6Comments

nephilin82 picture nephilin82  路  7Comments