common.mk 11.7 KB
Newer Older
1
2
3
# Allow vendor/extra to override any property by setting it first
$(call inherit-product-if-exists, vendor/extra/product.mk)

Dan Pasanen's avatar
Dan Pasanen committed
4
PRODUCT_BRAND ?= LineageOS
Ricardo Cerqueira's avatar
Ricardo Cerqueira committed
5

6
7
PRODUCT_BUILD_PROP_OVERRIDES += BUILD_UTC_DATE=0

8
ifeq ($(PRODUCT_GMS_CLIENTID_BASE),)
9
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
10
11
    ro.com.google.clientidbase=android-google
else
12
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
13
14
15
    ro.com.google.clientidbase=$(PRODUCT_GMS_CLIENTID_BASE)
endif

16
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
17
    ro.build.selinux=1
18

19
20
21
22
ifeq ($(TARGET_BUILD_VARIANT),eng)
# Disable ADB authentication
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += ro.adb.secure=0
else
23
# Enable ADB authentication
24
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += ro.adb.secure=1
25
endif
26

27
# Backup Tool
28
PRODUCT_COPY_FILES += \
Dan Pasanen's avatar
Dan Pasanen committed
29
30
    vendor/lineage/prebuilt/common/bin/backuptool.sh:install/bin/backuptool.sh \
    vendor/lineage/prebuilt/common/bin/backuptool.functions:install/bin/backuptool.functions \
Luca Stefani's avatar
Luca Stefani committed
31
    vendor/lineage/prebuilt/common/bin/50-lineage.sh:system/addon.d/50-lineage.sh \
Dan Pasanen's avatar
Dan Pasanen committed
32
    vendor/lineage/prebuilt/common/bin/blacklist:system/addon.d/blacklist
33

34
35
36
37
38
39
40
ifeq ($(AB_OTA_UPDATER),true)
PRODUCT_COPY_FILES += \
    vendor/lineage/prebuilt/common/bin/backuptool_ab.sh:system/bin/backuptool_ab.sh \
    vendor/lineage/prebuilt/common/bin/backuptool_ab.functions:system/bin/backuptool_ab.functions \
    vendor/lineage/prebuilt/common/bin/backuptool_postinstall.sh:system/bin/backuptool_postinstall.sh
endif

41
42
# Backup Services whitelist
PRODUCT_COPY_FILES += \
Dan Pasanen's avatar
Dan Pasanen committed
43
    vendor/lineage/config/permissions/backup.xml:system/etc/sysconfig/backup.xml
44

45
46
47
48
# Lineage-specific broadcast actions whitelist
PRODUCT_COPY_FILES += \
    vendor/lineage/config/permissions/lineage-sysconfig.xml:system/etc/sysconfig/lineage-sysconfig.xml

49
50
# init.d support
PRODUCT_COPY_FILES += \
Dan Pasanen's avatar
Dan Pasanen committed
51
52
    vendor/lineage/prebuilt/common/etc/init.d/00banner:system/etc/init.d/00banner \
    vendor/lineage/prebuilt/common/bin/sysinit:system/bin/sysinit
53

54
ifneq ($(TARGET_BUILD_VARIANT),user)
James Sullins's avatar
James Sullins committed
55
56
# userinit support
PRODUCT_COPY_FILES += \
Dan Pasanen's avatar
Dan Pasanen committed
57
    vendor/lineage/prebuilt/common/etc/init.d/90userinit:system/etc/init.d/90userinit
58
endif
James Sullins's avatar
James Sullins committed
59

Sam Mortimer's avatar
Sam Mortimer committed
60
61
62
# Copy all Lineage-specific init rc files
$(foreach f,$(wildcard vendor/lineage/prebuilt/common/etc/init/*.rc),\
	$(eval PRODUCT_COPY_FILES += $(f):system/etc/init/$(notdir $f)))
63

herriojr's avatar
herriojr committed
64
65
# Copy over added mimetype supported in libcore.net.MimeUtils
PRODUCT_COPY_FILES += \
Dan Pasanen's avatar
Dan Pasanen committed
66
    vendor/lineage/prebuilt/common/lib/content-types.properties:system/lib/content-types.properties
herriojr's avatar
herriojr committed
67

68
69
# Enable SIP+VoIP on all targets
PRODUCT_COPY_FILES += \
70
    frameworks/native/data/etc/android.software.sip.voip.xml:system/etc/permissions/android.software.sip.voip.xml
71

72
73
74
75
# Enable wireless Xbox 360 controller support
PRODUCT_COPY_FILES += \
    frameworks/base/data/keyboards/Vendor_045e_Product_028e.kl:system/usr/keylayout/Vendor_045e_Product_0719.kl

Luca Stefani's avatar
Luca Stefani committed
76
# This is Lineage!
Steve Kondik's avatar
Steve Kondik committed
77
PRODUCT_COPY_FILES += \
78
    vendor/lineage/config/permissions/org.lineageos.android.xml:system/etc/permissions/org.lineageos.android.xml \
79
80
    vendor/lineage/config/permissions/privapp-permissions-lineage.xml:system/etc/permissions/privapp-permissions-lineage.xml \
    vendor/lineage/config/permissions/privapp-permissions-cm-legacy.xml:system/etc/permissions/privapp-permissions-cm-legacy.xml
Steve Kondik's avatar
Steve Kondik committed
81

82
83
84
85
# Enforce privapp-permissions whitelist
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
    ro.control_privapp_permissions=enforce

86
87
88
89
# Hidden API whitelist
PRODUCT_COPY_FILES += \
    vendor/lineage/config/permissions/lineage-hiddenapi-package-whitelist.xml:system/etc/permissions/lineage-hiddenapi-package-whitelist.xml

90
91
92
93
# Power whitelist
PRODUCT_COPY_FILES += \
    vendor/lineage/config/permissions/lineage-power-whitelist.xml:system/etc/sysconfig/lineage-power-whitelist.xml

94
95
96
# Include AOSP audio files
include vendor/lineage/config/aosp_audio.mk

Luca Stefani's avatar
Luca Stefani committed
97
98
# Include Lineage audio files
include vendor/lineage/config/lineage_audio.mk
99

100
101
102
ifneq ($(TARGET_DISABLE_LINEAGE_SDK), true)
# Lineage SDK
include vendor/lineage/config/lineage_sdk_common.mk
103
endif
104

105
106
# TWRP
ifeq ($(WITH_TWRP),true)
Dan Pasanen's avatar
Dan Pasanen committed
107
include vendor/lineage/config/twrp.mk
108
109
endif

110
111
112
113
114
115
116
117
# Do not include art debug targets
PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD := false

# Strip the local variable table and the local variable type table to reduce
# the size of the system image. This has no bearing on stack traces, but will
# leave less information available via JDWP.
PRODUCT_MINIMIZE_JAVA_DEBUG_INFO := true

118
# Bootanimation
Asher Simonds's avatar
Asher Simonds committed
119
120
PRODUCT_PACKAGES += \
    bootanimation.zip
121

122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# Required /e/ packages
PRODUCT_PACKAGES += \
    GmsCore \
		GsfProxy \
		FakeStore \
		com.google.android.maps.jar \
		Mail \
		BlissLauncher \
		BlissIconPack \
		MozillaNlpBackend \
		OpenWeatherMapWeatherProvider \
		AccountManager \
		MagicEarth \
		PdfViewer \
		Camera \
		eDrive \
		Weather \
		Notes \
		Tasks \
		NominatimNlpBackend \
		DroidGuard \
		LibreOfficeViewer \
		OpenKeychain \
		Message \
		Browser \
		BrowserWebView \
		Apps

Luca Stefani's avatar
Luca Stefani committed
150
# Required Lineage packages
151
PRODUCT_PACKAGES += \
152
    LineageParts \
Steve Kondik's avatar
Steve Kondik committed
153
    Development \
154
    Profiles
155

Luca Stefani's avatar
Luca Stefani committed
156
# Optional packages
157
PRODUCT_PACKAGES += \
Steve Kondik's avatar
Steve Kondik committed
158
    Terminal
159

Luca Stefani's avatar
Luca Stefani committed
160
# Custom Lineage packages
Steve Kondik's avatar
Steve Kondik committed
161
PRODUCT_PACKAGES += \
162
    LineageSettingsProvider \
163
    LineageSetupWizard \
Aaron Kling's avatar
Aaron Kling committed
164
    Updater
Joey's avatar
Joey committed
165

Luca Stefani's avatar
Luca Stefani committed
166
# Extra tools in Lineage
Sebastian Schmidt's avatar
Sebastian Schmidt committed
167
PRODUCT_PACKAGES += \
Steve Kondik's avatar
Steve Kondik committed
168
    7z \
Tom Marshall's avatar
Tom Marshall committed
169
    awk \
Steve Kondik's avatar
Steve Kondik committed
170
171
172
    bash \
    bzip2 \
    curl \
173
    getcap \
Steve Kondik's avatar
Steve Kondik committed
174
175
    htop \
    lib7z \
176
    libsepol \
177
178
    pigz \
    powertop \
179
    setcap \
180
181
182
183
184
    unrar \
    unzip \
    vim \
    wget \
    zip
Sebastian Schmidt's avatar
Sebastian Schmidt committed
185

186
187
188
189
190
# Custom packages
ifdef CUSTOM_PACKAGES
PRODUCT_PACKAGES += $(CUSTOM_PACKAGES)
endif

191
# Filesystems tools
Scott Mertz's avatar
Scott Mertz committed
192
193
PRODUCT_PACKAGES += \
    fsck.exfat \
194
195
196
197
198
    fsck.ntfs \
    mke2fs \
    mkfs.exfat \
    mkfs.ntfs \
    mount.ntfs
Scott Mertz's avatar
Scott Mertz committed
199

Chirayu Desai's avatar
Chirayu Desai committed
200
201
202
203
204
205
206
207
# Openssh
PRODUCT_PACKAGES += \
    scp \
    sftp \
    ssh \
    sshd \
    sshd_config \
    ssh-keygen \
Chirayu Desai's avatar
Chirayu Desai committed
208
209
210
211
212
    start-ssh

# rsync
PRODUCT_PACKAGES += \
    rsync
Chirayu Desai's avatar
Chirayu Desai committed
213

214
# Storage manager
215
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
216
217
    ro.storage_manager.enabled=true

218
# These packages are excluded from user builds
219
220
PRODUCT_PACKAGES_DEBUG += \
    micro_bench \
221
    procmem \
222
223
    procrank \
    strace
Abhisek Devkota's avatar
Abhisek Devkota committed
224
225

# Conditionally build in su
226
ifneq ($(TARGET_BUILD_VARIANT),user)
Abhisek Devkota's avatar
Abhisek Devkota committed
227
228
ifeq ($(WITH_SU),true)
PRODUCT_PACKAGES += \
229
    su
repo Shareef Ali's avatar
repo Shareef Ali committed
230
endif
Abhisek Devkota's avatar
Abhisek Devkota committed
231
endif
232

233
234
PRODUCT_PACKAGE_OVERLAYS := vendor/lineage/overlay/microg

235
PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS += vendor/lineage/overlay
Dan Pasanen's avatar
Dan Pasanen committed
236
DEVICE_PACKAGE_OVERLAYS += vendor/lineage/overlay/common
237

Romain Hunault's avatar
Romain Hunault committed
238
PRODUCT_VERSION_MAJOR = 0
Romain Hunault's avatar
Romain Hunault committed
239
PRODUCT_VERSION_MINOR = 9
Dan Pasanen's avatar
Dan Pasanen committed
240
PRODUCT_VERSION_MAINTENANCE := 0
241

242
ifeq ($(TARGET_VENDOR_SHOW_MAINTENANCE_VERSION),true)
Luca Stefani's avatar
Luca Stefani committed
243
    LINEAGE_VERSION_MAINTENANCE := $(PRODUCT_VERSION_MAINTENANCE)
244
else
Luca Stefani's avatar
Luca Stefani committed
245
    LINEAGE_VERSION_MAINTENANCE := 0
246
endif
247

Luca Stefani's avatar
Luca Stefani committed
248
# Set LINEAGE_BUILDTYPE from the env RELEASE_TYPE, for jenkins compat
Ricardo Cerqueira's avatar
Ricardo Cerqueira committed
249

Luca Stefani's avatar
Luca Stefani committed
250
ifndef LINEAGE_BUILDTYPE
Ricardo Cerqueira's avatar
Ricardo Cerqueira committed
251
    ifdef RELEASE_TYPE
Luca Stefani's avatar
Luca Stefani committed
252
253
254
        # Starting with "LINEAGE_" is optional
        RELEASE_TYPE := $(shell echo $(RELEASE_TYPE) | sed -e 's|^LINEAGE_||g')
        LINEAGE_BUILDTYPE := $(RELEASE_TYPE)
Ricardo Cerqueira's avatar
Ricardo Cerqueira committed
255
    endif
256
endif
Ricardo Cerqueira's avatar
Ricardo Cerqueira committed
257

Luca Stefani's avatar
Luca Stefani committed
258
259
260
ifdef LINEAGE_BUILDTYPE
    ifneq ($(LINEAGE_BUILDTYPE), SNAPSHOT)
        ifdef LINEAGE_EXTRAVERSION
Ricardo Cerqueira's avatar
Ricardo Cerqueira committed
261
            # Force build type to EXPERIMENTAL
Luca Stefani's avatar
Luca Stefani committed
262
263
264
265
266
            LINEAGE_BUILDTYPE := EXPERIMENTAL
            # Remove leading dash from LINEAGE_EXTRAVERSION
            LINEAGE_EXTRAVERSION := $(shell echo $(LINEAGE_EXTRAVERSION) | sed 's/-//')
            # Add leading dash to LINEAGE_EXTRAVERSION
            LINEAGE_EXTRAVERSION := -$(LINEAGE_EXTRAVERSION)
Ricardo Cerqueira's avatar
Ricardo Cerqueira committed
267
268
        endif
    else
Luca Stefani's avatar
Luca Stefani committed
269
        ifndef LINEAGE_EXTRAVERSION
Ricardo Cerqueira's avatar
Ricardo Cerqueira committed
270
            # Force build type to EXPERIMENTAL, SNAPSHOT mandates a tag
Luca Stefani's avatar
Luca Stefani committed
271
            LINEAGE_BUILDTYPE := EXPERIMENTAL
Ricardo Cerqueira's avatar
Ricardo Cerqueira committed
272
        else
Luca Stefani's avatar
Luca Stefani committed
273
274
275
276
            # Remove leading dash from LINEAGE_EXTRAVERSION
            LINEAGE_EXTRAVERSION := $(shell echo $(LINEAGE_EXTRAVERSION) | sed 's/-//')
            # Add leading dash to LINEAGE_EXTRAVERSION
            LINEAGE_EXTRAVERSION := -$(LINEAGE_EXTRAVERSION)
Ricardo Cerqueira's avatar
Ricardo Cerqueira committed
277
        endif
278
279
    endif
else
Luca Stefani's avatar
Luca Stefani committed
280
281
282
    # If LINEAGE_BUILDTYPE is not defined, set to UNOFFICIAL
    LINEAGE_BUILDTYPE := UNOFFICIAL
    LINEAGE_EXTRAVERSION :=
283
284
endif

Luca Stefani's avatar
Luca Stefani committed
285
ifeq ($(LINEAGE_BUILDTYPE), UNOFFICIAL)
286
    ifneq ($(TARGET_UNOFFICIAL_BUILD_ID),)
Luca Stefani's avatar
Luca Stefani committed
287
        LINEAGE_EXTRAVERSION := -$(TARGET_UNOFFICIAL_BUILD_ID)
288
289
290
    endif
endif

291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
ifdef PLATFORM_SDK_VERSION
  ifeq ($(PLATFORM_SDK_VERSION), 24)
		ANDROID_LETTER := n
  endif
  ifeq ($(PLATFORM_SDK_VERSION), 25)
		ANDROID_LETTER := n
  endif
  ifeq ($(PLATFORM_SDK_VERSION), 26)
		ANDROID_LETTER := o
  endif
  ifeq ($(PLATFORM_SDK_VERSION), 27)
		ANDROID_LETTER := o
  endif
  ifeq ($(PLATFORM_SDK_VERSION), 28)
		ANDROID_LETTER := p
  endif
endif

Luca Stefani's avatar
Luca Stefani committed
309
ifeq ($(LINEAGE_BUILDTYPE), RELEASE)
310
    ifndef TARGET_VENDOR_RELEASE_BUILD_ID
Luca Stefani's avatar
Luca Stefani committed
311
        LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(PRODUCT_VERSION_MAINTENANCE)$(PRODUCT_VERSION_DEVICE_SPECIFIC)-$(LINEAGE_BUILD)
312
313
    else
        ifeq ($(TARGET_BUILD_VARIANT),user)
Luca Stefani's avatar
Luca Stefani committed
314
315
            ifeq ($(LINEAGE_VERSION_MAINTENANCE),0)
                LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(TARGET_VENDOR_RELEASE_BUILD_ID)-$(LINEAGE_BUILD)
316
            else
Luca Stefani's avatar
Luca Stefani committed
317
                LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(LINEAGE_VERSION_MAINTENANCE)-$(TARGET_VENDOR_RELEASE_BUILD_ID)-$(LINEAGE_BUILD)
318
            endif
319
        else
Luca Stefani's avatar
Luca Stefani committed
320
            LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(PRODUCT_VERSION_MAINTENANCE)$(PRODUCT_VERSION_DEVICE_SPECIFIC)-$(LINEAGE_BUILD)
321
322
        endif
    endif
323
else
Luca Stefani's avatar
Luca Stefani committed
324
    ifeq ($(LINEAGE_VERSION_MAINTENANCE),0)
325
        ifeq ($(LINEAGE_VERSION_APPEND_TIME_OF_DAY),true)
326
            LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(ANDROID_LETTER)-$(shell date -u +%Y%m%d_%H%M%S)$(CI_PIPELINE_ID)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD)
327
        else
328
            LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(ANDROID_LETTER)-$(shell date -u +%Y%m%d)$(CI_PIPELINE_ID)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD)
329
        endif
330
    else
331
        ifeq ($(LINEAGE_VERSION_APPEND_TIME_OF_DAY),true)
332
            LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(LINEAGE_VERSION_MAINTENANCE)-$(ANDROID_LETTER)-$(shell date -u +%Y%m%d_%H%M%S)$(CI_PIPELINE_ID)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD)
333
        else
334
            LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(LINEAGE_VERSION_MAINTENANCE)-$(ANDROID_LETTER)-$(shell date -u +%Y%m%d)$(CI_PIPELINE_ID)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD)
335
        endif
336
    endif
337
endif
338

339
PRODUCT_EXTRA_RECOVERY_KEYS += \
Dan Pasanen's avatar
Dan Pasanen committed
340
    vendor/lineage/build/target/product/security/lineage
341

Luca Stefani's avatar
Luca Stefani committed
342
-include vendor/lineage-priv/keys/keys.mk
343

Luca Stefani's avatar
Luca Stefani committed
344
LINEAGE_DISPLAY_VERSION := $(LINEAGE_VERSION)
345

346
347
ifneq ($(PRODUCT_DEFAULT_DEV_CERTIFICATE),)
ifneq ($(PRODUCT_DEFAULT_DEV_CERTIFICATE),build/target/product/security/testkey)
Luca Stefani's avatar
Luca Stefani committed
348
    ifneq ($(LINEAGE_BUILDTYPE), UNOFFICIAL)
349
        ifndef TARGET_VENDOR_RELEASE_BUILD_ID
Luca Stefani's avatar
Luca Stefani committed
350
351
352
353
            ifneq ($(LINEAGE_EXTRAVERSION),)
                # Remove leading dash from LINEAGE_EXTRAVERSION
                LINEAGE_EXTRAVERSION := $(shell echo $(LINEAGE_EXTRAVERSION) | sed 's/-//')
                TARGET_VENDOR_RELEASE_BUILD_ID := $(LINEAGE_EXTRAVERSION)
354
355
356
357
358
359
            else
                TARGET_VENDOR_RELEASE_BUILD_ID := $(shell date -u +%Y%m%d)
            endif
        else
            TARGET_VENDOR_RELEASE_BUILD_ID := $(TARGET_VENDOR_RELEASE_BUILD_ID)
        endif
Luca Stefani's avatar
Luca Stefani committed
360
        ifeq ($(LINEAGE_VERSION_MAINTENANCE),0)
Romain Hunault's avatar
Romain Hunault committed
361
            LINEAGE_DISPLAY_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(TARGET_VENDOR_RELEASE_BUILD_ID)$(CI_PIPELINE_ID)
362
        else
Romain Hunault's avatar
Romain Hunault committed
363
            LINEAGE_DISPLAY_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(LINEAGE_VERSION_MAINTENANCE)-$(TARGET_VENDOR_RELEASE_BUILD_ID)$(CI_PIPELINE_ID)-$(LINEAGE_BUILD)
364
        endif
365
366
    endif
endif
367
368
endif

369
-include $(WORKSPACE)/build_env/image-auto-bits.mk
Dan Pasanen's avatar
Dan Pasanen committed
370
-include vendor/lineage/config/partner_gms.mk