Skip to content
steadfasterX edited this page Aug 30, 2023 · 22 revisions

Requirements

The following packages are needed on your build system (where extendrom will run):

  • git
  • curl
  • python v3
  • python v3 requests module (mainly: sudo python3 -m pip install requests)

Setup

create .repo/local_manifest/extendrom.xml and add:

<?xml version="1.0" encoding="UTF-8"?>
  <manifest>

     <!-- extendrom -->
     <remote name="sfX" fetch="https://github.com/sfX-Android/" />
     <project path="vendor/extendrom" name="android_vendor_extendrom" remote="sfX" revision="main" />

</manifest>

Now sync this repo with e.g: repo sync -j4 vendor/extendrom (this will happen automatically during a normal repo sync as well as long as you keep it in your local manifests).

activate and configure

You have 3 options to do that, choose the one you like more ;)

option 1: use an Android makefile

add the following in your device/<vendor>/<model>/device.mk (or any other existing device mk file):

# Enable extendrom
ENABLE_EXTENDROM := true

<add-any-EXTENDROM-flag> := <EXTENDROM-flag-value>

$(call inherit-product-if-exists, vendor/extendrom/config/common.mk)

obviously change <add-any-EXTENDROM-flag> := <EXTENDROM-flag-value> with the extendrom feature(s) you want to add.

Example:

EXTENDROM_PREROOT_BOOT := true
EXTENDROM_PACKAGES := "Magisk AuroraStore Lawnchair-latest"

remove any legacy entries within device/<vendor>/<model>/vendorsetup.sh:

$PWD/vendor/extendrom/er.sh
or
$PWD/vendor/extendrom/get_prebuilts.sh

If it contains just that single line you can remove the complete file, of course.

option 2: use vendorsetup.sh

add the following in your device/<vendor>/<model>/device.mk (or any other existing device mk file):

# Enable extendrom
$(call inherit-product-if-exists, vendor/extendrom/config/common.mk)

add the following section to your device/<vendor>/<model>/vendorsetup.sh:

########### extendrom section ###########
export ENABLE_EXTENDROM=true
export EXTENDROM_PACKAGES="noEOSappstore F-Droid F-DroidPrivilegedExtension additional_repos.xml AuroraStore"

$PWD/vendor/extendrom/er.sh

option 3: mix Makefile & vendorsetup.sh

extendrom is flexible enough to also mix both options above.

Just be aware that vendorsetup.sh will take precedence - so always wins when a flag has been defined with both options.

Adding NEW(!) public GPG keys for verifying signatures

extendrom comes with a list of gpg keys which get auto-imported but sometimes you might need to extend that list.

extendrom will then verify signatures (if available) fully automatically for regular F-Droid packages. There is no need to do anything if you do not plan to use other repos for downloading packages.

If you plan to add non-standard repositories though:

You need to know the key id first which you can usually find beneath the package you want to add.
Another option is to find it by searching: gpg --keyserver pgp.mit.edu --search-keys f-droid.org
Of course there are other keyservers if pgp.mit.edu fails for you.

Once you got the id just add it to the variable GPG_KEYS in vendor/extendrom/er.sh (separate by a space from the others).

More information and the current F-Droid fingerprint can be verified here

building / changes in behavior

whenever you change something in device/<vendor>/<model>/vendorsetup.sh you HAVE TO use: source build/envsetup.sh && <lunch or brunch> to apply these changes first. This is not needed when using an Android makefile though.

best practice is to use the 2 commands before building always - regardless what method you use.

The regular build process should always be like:

source build/envsetup.sh
lunch lineage_j5y17lte-user
mka otapackage (or mka eos when buildin /e/)

(instead of lunch a: brunch <device> will do as well ofc)

Clone this wiki locally