summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2017-02-11 22:38:54 +0100
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2017-02-11 22:38:54 +0100
commit530288f5a725848bb899636665ea3f14f9398fad (patch)
tree097879192b3926c5c6503b058d3582d680110bfc
parent34b65b9553c9395846ae1bbe186be2667139db79 (diff)
parentfafb7e2a14706f75bd76aca21c1c7d695f938ed3 (diff)
downloadbuild-530288f5a725848bb899636665ea3f14f9398fad.zip
build-530288f5a725848bb899636665ea3f14f9398fad.tar.gz
build-530288f5a725848bb899636665ea3f14f9398fad.tar.bz2
Merge branch 'cm-13.0' of https://github.com/LineageOS/android_build into replicant-6.0
Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
-rw-r--r--core/Makefile17
-rw-r--r--core/dumpvar.mk11
-rw-r--r--core/main.mk6
-rw-r--r--core/mtk_target.mk3
-rw-r--r--core/product.mk1
-rw-r--r--core/product_config.mk12
-rw-r--r--core/qcom_target.mk62
-rw-r--r--core/tasks/kernel.mk13
-rw-r--r--core/version_defaults.mk2
-rw-r--r--envsetup.sh37
-rw-r--r--tools/releasetools/common.py17
-rw-r--r--tools/releasetools/edify_generator.py2
-rwxr-xr-xtools/releasetools/ota_from_target_files.py23
-rwxr-xr-xtools/releasetools/sign_zip.py69
-rwxr-xr-xtools/repopick.py7
-rwxr-xr-xtools/roomservice.py46
16 files changed, 201 insertions, 127 deletions
diff --git a/core/Makefile b/core/Makefile
index 5475edc..16eb5a1 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -1540,7 +1540,9 @@ DISTTOOLS := $(HOST_OUT_EXECUTABLES)/minigzip \
$(HOST_OUT_JAVA_LIBRARIES)/signapk.jar \
$(HOST_OUT_JAVA_LIBRARIES)/BootSignature.jar \
$(HOST_OUT_EXECUTABLES)/mkuserimg.sh \
+ $(HOST_OUT_EXECUTABLES)/mkf2fsuserimg.sh \
$(HOST_OUT_EXECUTABLES)/make_ext4fs \
+ $(HOST_OUT_EXECUTABLES)/make_f2fs \
$(HOST_OUT_EXECUTABLES)/simg2img \
$(HOST_OUT_EXECUTABLES)/e2fsck \
$(HOST_OUT_EXECUTABLES)/build_verity_tree \
@@ -1562,7 +1564,8 @@ DISTTOOLS += \
$(HOST_LIBRARY_PATH)/libext2_e2p_host$(HOST_SHLIB_SUFFIX) \
$(HOST_LIBRARY_PATH)/libext2_profile_host$(HOST_SHLIB_SUFFIX) \
$(HOST_LIBRARY_PATH)/libext2_quota_host$(HOST_SHLIB_SUFFIX) \
- $(HOST_LIBRARY_PATH)/libext2_uuid_host$(HOST_SHLIB_SUFFIX)
+ $(HOST_LIBRARY_PATH)/libext2_uuid_host$(HOST_SHLIB_SUFFIX) \
+ $(HOST_LIBRARY_PATH)/libf2fs_fmt_host_dyn$(HOST_SHLIB_SUFFIX)
OTATOOLS := $(DISTTOOLS) \
$(HOST_OUT_EXECUTABLES)/aapt
@@ -1843,6 +1846,8 @@ ifdef PRODUCT_DEFAULT_DEV_CERTIFICATE
else
$(hide) build/tools/getb64key.py $(DEFAULT_SYSTEM_DEV_CERTIFICATE).x509.pem > $(zip_root)/META/releasekey.txt
endif
+ $(hide) echo "ota_override_device=$(OTA_SCRIPT_OVERRIDE_DEVICE)" >> $(zip_root)/META/misc_info.txt
+ $(hide) echo "ota_override_prop=$(OTA_SCRIPT_OVERRIDE_PROP)" >> $(zip_root)/META/misc_info.txt
@# Zip everything up, preserving symlinks
$(hide) (cd $(zip_root) && zip -qry ../$(notdir $@) .)
@# Run fs_config on all the system, vendor, boot ramdisk,
@@ -1897,15 +1902,15 @@ endif
endif
ifeq ($(TARGET_OTA_ASSERT_DEVICE),)
- $(INTERNAL_OTA_PACKAGE_TARGET): override_device := auto
+ OTA_SCRIPT_OVERRIDE_DEVICE := auto
else
- $(INTERNAL_OTA_PACKAGE_TARGET): override_device := $(TARGET_OTA_ASSERT_DEVICE)
+ OTA_SCRIPT_OVERRIDE_DEVICE := $(TARGET_OTA_ASSERT_DEVICE)
endif
ifneq ($(TARGET_UNIFIED_DEVICE),)
- $(INTERNAL_OTA_PACKAGE_TARGET): override_prop := --override_prop=true
+ OTA_SCRIPT_OVERRIDE_PROP := true
ifeq ($(TARGET_OTA_ASSERT_DEVICE),)
- $(INTERNAL_OTA_PACKAGE_TARGET): override_device := $(TARGET_DEVICE)
+ OTA_SCRIPT_OVERRIDE_DEVICE := $(TARGET_DEVICE)
endif
endif
@@ -1915,7 +1920,6 @@ endif
$(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(DISTTOOLS)
@echo "$(OTA_FROM_TARGET_SCRIPT)" > $(PRODUCT_OUT)/ota_script_path
- @echo "$(override_device)" > $(PRODUCT_OUT)/ota_override_device
@echo -e ${CL_YLW}"Package OTA:"${CL_RST}" $@"
$(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH MKBOOTIMG=$(MKBOOTIMG) \
$(OTA_FROM_TARGET_SCRIPT) -v \
@@ -1923,7 +1927,6 @@ $(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(DISTTOOLS)
-p $(HOST_OUT) \
-k $(KEY_CERT_PAIR) \
--backup=$(backuptool) \
- --override_device=$(override_device) $(override_prop) \
$(if $(OEM_OTA_CONFIG), -o $(OEM_OTA_CONFIG)) \
$(BUILT_TARGET_FILES_PACKAGE) $@
diff --git a/core/dumpvar.mk b/core/dumpvar.mk
index fb30ed4..d7056ef 100644
--- a/core/dumpvar.mk
+++ b/core/dumpvar.mk
@@ -84,9 +84,14 @@ $(info HOST_OS_EXTRA=$(HOST_OS_EXTRA))
$(info HOST_BUILD_TYPE=$(HOST_BUILD_TYPE))
$(info BUILD_ID=$(BUILD_ID))
$(info OUT_DIR=$(OUT_DIR))
-ifeq ($(CYNGN_TARGET),true)
-$(info CYNGN_TARGET=$(CYNGN_TARGET))
-$(info CYNGN_FEATURES=$(CYNGN_FEATURES))
+ifneq ($(RECOVERY_VARIANT),)
+$(info RECOVERY_VARIANT=$(RECOVERY_VARIANT))
+endif
+ifeq ($(WITH_SU),true)
+$(info WITH_SU=$(WITH_SU))
+endif
+ifeq ($(WITH_GMS),true)
+$(info WITH_GMS=$(WITH_GMS))
endif
$(info ============================================)
endif
diff --git a/core/main.mk b/core/main.mk
index 139fa46..3eb2d47 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -107,12 +107,6 @@ include $(BUILD_SYSTEM)/config.mk
# be generated correctly
include $(BUILD_SYSTEM)/cleanbuild.mk
-# Bring in Qualcomm helper macros
-include $(BUILD_SYSTEM)/qcom_utils.mk
-
-# Bring in Mediatek helper macros too
-include $(BUILD_SYSTEM)/mtk_utils.mk
-
# Include the google-specific config
-include vendor/google/build/config.mk
diff --git a/core/mtk_target.mk b/core/mtk_target.mk
index 7c3ba1f..bc03eba 100644
--- a/core/mtk_target.mk
+++ b/core/mtk_target.mk
@@ -1,3 +1,6 @@
+# Bring in Mediatek helper macros
+include $(BUILD_SYSTEM)/mtk_utils.mk
+
ifeq ($(BOARD_USES_MTK_HARDWARE),true)
mtk_flags := -DMTK_HARDWARE
diff --git a/core/product.mk b/core/product.mk
index cced554..24af0f2 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -65,7 +65,6 @@ endef
#
_product_var_list := \
- PRODUCT_BOOTANIMATION \
PRODUCT_BUILD_PROP_OVERRIDES \
PRODUCT_NAME \
PRODUCT_MODEL \
diff --git a/core/product_config.mk b/core/product_config.mk
index 259d983..58b03e9 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -181,7 +181,11 @@ include $(BUILD_SYSTEM)/device.mk
# A CM build needs only the CM product makefiles.
ifneq ($(CM_BUILD),)
- all_product_configs := $(shell find device -path "*/$(CM_BUILD)/cm.mk")
+ all_product_configs := $(shell find device -path "*/$(CM_BUILD)/lineage.mk")
+ ifeq ($(all_product_configs),)
+ # Fall back to cm.mk
+ all_product_configs := $(shell find device -path "*/$(CM_BUILD)/cm.mk")
+ endif
else
ifneq ($(strip $(TARGET_BUILD_APPS)),)
# An unbundled app build needs only the core product makefiles.
@@ -343,12 +347,6 @@ endif
# The optional :<owner> is used to indicate the owner of a vendor file.
PRODUCT_COPY_FILES := \
$(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_COPY_FILES))
-_boot_animation := $(strip $(lastword $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_BOOTANIMATION)))
-ifneq ($(_boot_animation),)
-PRODUCT_COPY_FILES += \
- $(_boot_animation):system/media/bootanimation.zip
-endif
-_boot_animation :=
# We might want to skip items listed in PRODUCT_COPY_FILES for
# various reasons. This is useful for replacing a binary module with one
diff --git a/core/qcom_target.mk b/core/qcom_target.mk
index 9b8d6bb..40b1775 100644
--- a/core/qcom_target.mk
+++ b/core/qcom_target.mk
@@ -1,5 +1,8 @@
# Target-specific configuration
+# Bring in Qualcomm helper macros
+include $(BUILD_SYSTEM)/qcom_utils.mk
+
# Populate the qcom hardware variants in the project pathmap.
define ril-set-path-variant
$(call project-set-path-variant,ril,TARGET_RIL_VARIANT,hardware/$(1))
@@ -22,6 +25,10 @@ $(call project-set-path,qcom-$(2),$(strip $(path)))
endef
ifeq ($(BOARD_USES_QCOM_HARDWARE),true)
+ B_FAMILY := msm8226 msm8610 msm8974
+ B64_FAMILY := msm8992 msm8994
+ BR_FAMILY := msm8909 msm8916
+ UM_FAMILY := msm8937 msm8953
qcom_flags := -DQCOM_HARDWARE
qcom_flags += -DQCOM_BSP
@@ -55,41 +62,29 @@ ifeq ($(BOARD_USES_QCOM_HARDWARE),true)
2ND_CLANG_TARGET_GLOBAL_CFLAGS += $(qcom_flags)
2ND_CLANG_TARGET_GLOBAL_CPPFLAGS += $(qcom_flags)
- ifeq ($(QCOM_HARDWARE_VARIANT),)
- ifneq ($(filter msm8610 msm8226 msm8974,$(TARGET_BOARD_PLATFORM)),)
- QCOM_HARDWARE_VARIANT := msm8974
- else
- ifneq ($(filter msm8909 msm8916,$(TARGET_BOARD_PLATFORM)),)
- QCOM_HARDWARE_VARIANT := msm8916
- else
- ifneq ($(filter msm8953 msm8937,$(TARGET_BOARD_PLATFORM)),)
- QCOM_HARDWARE_VARIANT := msm8937
- else
- ifneq ($(filter msm8992 msm8994,$(TARGET_BOARD_PLATFORM)),)
- QCOM_HARDWARE_VARIANT := msm8994
- else
- QCOM_HARDWARE_VARIANT := $(TARGET_BOARD_PLATFORM)
- endif
- endif
- endif
- endif
+ ifeq ($(call is-board-platform-in-list, $(B_FAMILY)),true)
+ MSM_VIDC_TARGET_LIST := $(B_FAMILY)
+ QCOM_HARDWARE_VARIANT := msm8974
+ else
+ ifeq ($(call is-board-platform-in-list, $(B64_FAMILY)),true)
+ MSM_VIDC_TARGET_LIST := $(B64_FAMILY)
+ QCOM_HARDWARE_VARIANT := msm8994
+ else
+ ifeq ($(call is-board-platform-in-list, $(BR_FAMILY)),true)
+ MSM_VIDC_TARGET_LIST := $(BR_FAMILY)
+ QCOM_HARDWARE_VARIANT := msm8916
+ else
+ ifeq ($(call is-board-platform-in-list, $(UM_FAMILY)),true)
+ MSM_VIDC_TARGET_LIST := $(UM_FAMILY)
+ QCOM_HARDWARE_VARIANT := msm8937
+ else
+ MSM_VIDC_TARGET_LIST := $(TARGET_BOARD_PLATFORM)
+ QCOM_HARDWARE_VARIANT := $(TARGET_BOARD_PLATFORM)
+ endif
+ endif
+ endif
endif
-# HACK: check to see if build uses standard QC HAL paths by checking for CM path structure
-AOSP_VARIANT_MAKEFILE := $(wildcard hardware/qcom/audio/default/Android.mk)
-ifeq ("$(AOSP_VARIANT_MAKEFILE)","")
-$(call project-set-path,qcom-audio,hardware/qcom/audio)
-$(call project-set-path,qcom-display,hardware/qcom/display)
-$(call project-set-path,qcom-media,hardware/qcom/media)
-$(call set-device-specific-path,CAMERA,camera,hardware/qcom/camera)
-$(call set-device-specific-path,GPS,gps,hardware/qcom/gps)
-$(call set-device-specific-path,SENSORS,sensors,hardware/qcom/sensors)
-$(call set-device-specific-path,LOC_API,loc-api,vendor/qcom/opensource/location)
-$(call set-device-specific-path,DATASERVICES,dataservices,vendor/qcom/opensource/dataservices)
-$(call project-set-path,ril,hardware/ril)
-$(call project-set-path,wlan,hardware/qcom/wlan)
-$(call project-set-path,bt-vendor,hardware/qcom/bt)
-else
$(call project-set-path,qcom-audio,hardware/qcom/audio-caf/$(QCOM_HARDWARE_VARIANT))
$(call project-set-path,qcom-display,hardware/qcom/display-caf/$(QCOM_HARDWARE_VARIANT))
$(call project-set-path,qcom-media,hardware/qcom/media-caf/$(QCOM_HARDWARE_VARIANT))
@@ -103,7 +98,6 @@ $(call set-device-specific-path,DATASERVICES,dataservices,vendor/qcom/opensource
$(call ril-set-path-variant,ril)
$(call wlan-set-path-variant,wlan-caf)
$(call bt-vendor-set-path-variant,bt-caf)
-endif # AOSP_VARIANT_MAKEFILE
else
diff --git a/core/tasks/kernel.mk b/core/tasks/kernel.mk
index eb7bc12..4f98fe2 100644
--- a/core/tasks/kernel.mk
+++ b/core/tasks/kernel.mk
@@ -1,4 +1,5 @@
# Copyright (C) 2012 The CyanogenMod Project
+# (C) 2017 The LineageOS Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -140,16 +141,6 @@ else
KERNEL_ADDITIONAL_CONFIG_SRC := /dev/null
endif
-## Do be discontinued in a future version. Notify builder about target
-## kernel format requirement
-ifeq ($(BOARD_KERNEL_IMAGE_NAME),)
-ifeq ($(BOARD_USES_UBOOT),true)
- $(error "Please set BOARD_KERNEL_IMAGE_NAME to uImage")
-else ifeq ($(BOARD_USES_UNCOMPRESSED_BOOT),true)
- $(error "Please set BOARD_KERNEL_IMAGE_NAME to Image")
-endif
-endif
-
ifeq "$(wildcard $(KERNEL_SRC) )" ""
ifneq ($(TARGET_PREBUILT_KERNEL),)
HAS_PREBUILT_KERNEL := true
@@ -168,7 +159,7 @@ ifeq "$(wildcard $(KERNEL_SRC) )" ""
$(warning * THIS IS DEPRECATED, AND WILL BE DISCONTINUED *)
$(warning * Please configure your device to download the kernel *)
$(warning * source repository to $(KERNEL_SRC))
- $(warning * See http://wiki.cyanogenmod.org/w/Doc:_integrated_kernel_building)
+ $(warning * See http://wiki.lineageos.org/w/Doc:_integrated_kernel_building)
$(warning * for more information *)
$(warning ***************************************************************)
FULL_KERNEL_BUILD := false
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index e30ea21..65bbf74 100644
--- a/core/version_defaults.mk
+++ b/core/version_defaults.mk
@@ -105,7 +105,7 @@ ifeq "" "$(PLATFORM_SECURITY_PATCH)"
# It must match one of the Android Security Patch Level strings of the Public Security Bulletins.
#
# If there is no $PLATFORM_SECURITY_PATCH set, keep it empty.
- PLATFORM_SECURITY_PATCH := 2016-12-01
+ PLATFORM_SECURITY_PATCH := 2017-01-01
endif
ifeq "" "$(PLATFORM_BASE_OS)"
diff --git a/envsetup.sh b/envsetup.sh
index f8ec4ed..becedef 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -24,8 +24,8 @@ Invoke ". build/envsetup.sh" from your shell to add the following functions to y
- sepgrep: Greps on all local sepolicy files.
- sgrep: Greps on all local source files.
- godir: Go to the directory containing a file.
-- cmremote: Add git remote for CM Gerrit Review
-- cmgerrit: A Git wrapper that fetches/pushes patch from/to CM Gerrit Review
+- cmremote: Add git remote for LineageOS Gerrit Review
+- cmgerrit: A Git wrapper that fetches/pushes patch from/to LineageOS Gerrit Review
- cmrebase: Rebase a Gerrit change and push it again
- aospremote: Add git remote for matching AOSP repository
- cafremote: Add git remote for matching CodeAurora repository.
@@ -84,9 +84,9 @@ function check_product()
return
fi
- if (echo -n $1 | grep -q -e "^cm_") ; then
- CM_BUILD=$(echo -n $1 | sed -e 's/^cm_//g')
- export BUILD_NUMBER=$((date +%s%N ; echo $CM_BUILD; hostname) | openssl sha1 | sed -e 's/.*=//g; s/ //g' | cut -c1-10)
+ if (echo -n $1 | grep -q -e "^lineage_") ; then
+ CM_BUILD=$(echo -n $1 | sed -e 's/^lineage_//g')
+ export BUILD_NUMBER=$((date +%s%N ; echo $CM_BUILD; hostname) | openssl sha1 | sed -e 's/.*=//g; s/ //g' | cut -c1-10)
else
if (echo -n $1 | grep -q -e "^replicant_") ; then
CM_BUILD=$(echo -n $1 | sed -e 's/^replicant_//g')
@@ -570,11 +570,16 @@ function breakfast()
# A buildtype was specified, assume a full device name
lunch $target
else
- # This is probably just the CM model name
+ # This is probably just the Lineage model name
if [ -z "$variant" ]; then
variant="userdebug"
fi
- lunch cm_$target-$variant
+ lunch lineage_$target-$variant
+ if [ $? -ne 0 ]; then
+ # try CM
+ echo "** Warning: '$target' is using CM-based makefiles. This will be deprecated in the next major release."
+ lunch cm_$target-$variant
+ fi
fi
fi
return $?
@@ -725,8 +730,8 @@ function tapas()
function eat()
{
if [ "$OUT" ] ; then
- MODVERSION=$(get_build_var CM_VERSION)
- ZIPFILE=cm-$MODVERSION.zip
+ MODVERSION=$(get_build_var LINEAGE_VERSION)
+ ZIPFILE=lineage-$MODVERSION.zip
ZIPPATH=$OUT/$ZIPFILE
if [ ! -f $ZIPPATH ] ; then
echo "Nothing to eat"
@@ -1683,12 +1688,12 @@ function cmremote()
fi
git remote rm cmremote 2> /dev/null
GERRIT_REMOTE=$(git config --get remote.github.projectname)
- CMUSER=$(git config --get review.review.cyanogenmod.org.username)
+ CMUSER=$(git config --get review.review.lineageos.org.username)
if [ -z "$CMUSER" ]
then
- git remote add cmremote ssh://review.cyanogenmod.org:29418/$GERRIT_REMOTE
+ git remote add cmremote ssh://review.lineageos.org:29418/$GERRIT_REMOTE
else
- git remote add cmremote ssh://$CMUSER@review.cyanogenmod.org:29418/$GERRIT_REMOTE
+ git remote add cmremote ssh://$CMUSER@review.lineageos.org:29418/$GERRIT_REMOTE
fi
echo "Remote 'cmremote' created"
}
@@ -1723,7 +1728,7 @@ function cafremote()
then
PFX="platform/"
fi
- git remote add caf git://codeaurora.org/$PFX$PROJECT
+ git remote add caf https://source.codeaurora.org/quic/la/$PFX$PROJECT
echo "Remote 'caf' created"
}
@@ -1845,7 +1850,7 @@ function cmgerrit() {
$FUNCNAME help
return 1
fi
- local user=`git config --get review.review.cyanogenmod.org.username`
+ local user=`git config --get review.review.lineageos.org.username`
local review=`git config --get remote.github.review`
local project=`git config --get remote.github.projectname`
local command=$1
@@ -2080,7 +2085,7 @@ function cmrebase() {
local dir="$(gettop)/$repo"
if [ -z $repo ] || [ -z $refs ]; then
- echo "CyanogenMod Gerrit Rebase Usage: "
+ echo "LineageOS Gerrit Rebase Usage: "
echo " cmrebase <path to project> <patch IDs on Gerrit>"
echo " The patch IDs appear on the Gerrit commands that are offered."
echo " They consist on a series of numbers and slashes, after the text"
@@ -2102,7 +2107,7 @@ function cmrebase() {
echo "Bringing it up to date..."
repo sync .
echo "Fetching change..."
- git fetch "http://review.cyanogenmod.org/p/$repo" "refs/changes/$refs" && git cherry-pick FETCH_HEAD
+ git fetch "http://review.lineageos.org/p/$repo" "refs/changes/$refs" && git cherry-pick FETCH_HEAD
if [ "$?" != "0" ]; then
echo "Error cherry-picking. Not uploading!"
return
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index 32bbc68..ea7312a 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -863,6 +863,7 @@ class PasswordManager(object):
def __init__(self):
self.editor = os.getenv("EDITOR", None)
self.pwfile = os.getenv("ANDROID_PW_FILE", None)
+ self.secure_storage_cmd = os.getenv("ANDROID_SECURE_STORAGE_CMD", None)
def GetPasswords(self, items):
"""Get passwords corresponding to each string in 'items',
@@ -882,9 +883,23 @@ class PasswordManager(object):
missing = []
for i in items:
if i not in current or not current[i]:
- missing.append(i)
+ #Attempt to load using ANDROID_SECURE_STORAGE_CMD
+ if self.secure_storage_cmd:
+ try:
+ os.environ["TMP__KEY_FILE_NAME"] = str(i)
+ ps = subprocess.Popen(self.secure_storage_cmd, shell=True, stdout=subprocess.PIPE)
+ output = ps.communicate()[0]
+ if ps.returncode == 0:
+ current[i] = output
+ except Exception as e:
+ print(e)
+ pass
+ if i not in current or not current[i]:
+ missing.append(i)
# Are all the passwords already in the file?
if not missing:
+ if "ANDROID_SECURE_STORAGE_CMD" in os.environ:
+ del os.environ["ANDROID_SECURE_STORAGE_CMD"]
return current
for i in missing:
diff --git a/tools/releasetools/edify_generator.py b/tools/releasetools/edify_generator.py
index 825a7eb..8025235 100644
--- a/tools/releasetools/edify_generator.py
+++ b/tools/releasetools/edify_generator.py
@@ -151,7 +151,7 @@ class EdifyGenerator(object):
self.script.append(('run_program("/tmp/install/bin/backuptool.sh", "%s");' % command))
def ValidateSignatures(self, command):
- self.script.append('package_extract_file("META-INF/org/cyanogenmod/releasekey", "/tmp/releasekey");')
+ self.script.append('package_extract_file("META-INF/org/lineageos/releasekey", "/tmp/releasekey");')
# Exit code 124 == abort. run_program returns raw, so left-shift 8bit
self.script.append('run_program("/tmp/install/bin/otasigcheck.sh") != "31744" || abort("Can\'t install this package on top of incompatible data. Please try another package or run a factory reset");')
diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py
index bc40873..66db227 100755
--- a/tools/releasetools/ota_from_target_files.py
+++ b/tools/releasetools/ota_from_target_files.py
@@ -96,14 +96,6 @@ Usage: ota_from_target_files [flags] input_target_files output_ota_package
--backup <boolean>
Enable or disable the execution of backuptool.sh.
Disabled by default.
-
- --override_device <device>
- Override device-specific asserts. Can be a comma-separated list.
-
- --override_prop <boolean>
- Override build.prop items with custom vendor init.
- Enabled when TARGET_UNIFIED_DEVICE is defined in BoardConfig
-
"""
from __future__ import print_function
@@ -753,7 +745,7 @@ endif;
common.ZipWriteStr(output_zip, "system/build.prop",
""+input_zip.read("SYSTEM/build.prop"))
- common.ZipWriteStr(output_zip, "META-INF/org/cyanogenmod/releasekey",
+ common.ZipWriteStr(output_zip, "META-INF/org/lineageos/releasekey",
""+input_zip.read("META/releasekey.txt"))
def WritePolicyConfig(file_name, output_zip):
@@ -1629,10 +1621,6 @@ def main(argv):
"a float" % (a, o))
elif o in ("--backup",):
OPTIONS.backuptool = bool(a.lower() == 'true')
- elif o in ("--override_device",):
- OPTIONS.override_device = a
- elif o in ("--override_prop",):
- OPTIONS.override_prop = bool(a.lower() == 'true')
else:
return False
return True
@@ -1658,9 +1646,7 @@ def main(argv):
"verify",
"no_fallback_to_full",
"stash_threshold=",
- "backup=",
- "override_device=",
- "override_prop="
+ "backup="
], extra_option_handler=option_handler)
if len(args) != 2:
@@ -1676,6 +1662,11 @@ def main(argv):
OPTIONS.target_tmp = OPTIONS.input_tmp
OPTIONS.info_dict = common.LoadInfoDict(input_zip)
+ if "ota_override_device" in OPTIONS.info_dict:
+ OPTIONS.override_device = OPTIONS.info_dict.get("ota_override_device")
+ if "ota_override_prop" in OPTIONS.info_dict:
+ OPTIONS.override_prop = OPTIONS.info_dict.get("ota_override_prop") == "true"
+
# If this image was originally labelled with SELinux contexts, make sure we
# also apply the labels in our new image. During building, the "file_contexts"
# is in the out/ directory tree, but for repacking from target-files.zip it's
diff --git a/tools/releasetools/sign_zip.py b/tools/releasetools/sign_zip.py
new file mode 100755
index 0000000..c40b1b4
--- /dev/null
+++ b/tools/releasetools/sign_zip.py
@@ -0,0 +1,69 @@
+#!/usr/bin/env python
+#
+# Copyright (C) 2017 The LineageOS Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+Signs the given zip with the given key producing a new zip.
+
+Usage: sign_release_zip [flags] input_zip output_zip
+
+ -k (--package_key) <key> Key to use to sign the package (default is
+ "build/target/product/security/testkey").
+"""
+import sys
+
+import common
+
+OPTIONS = common.OPTIONS
+
+OPTIONS.package_key = "build/target/product/security/testkey"
+
+def SignOutput(input_zip_name, output_zip_name):
+ key_passwords = common.GetKeyPasswords([OPTIONS.package_key])
+ pw = key_passwords[OPTIONS.package_key]
+
+ common.SignFile(input_zip_name, output_zip_name, OPTIONS.package_key, pw,
+ whole_file=True)
+
+
+def main(argv):
+
+ def option_handler(o, a):
+ if o in ("-k", "--package_key"):
+ OPTIONS.package_key = a
+ else:
+ return False
+ return True
+
+ args = common.ParseOptions(argv, __doc__,
+ extra_opts="k:",
+ extra_long_opts=[
+ "package_key=",
+ ], extra_option_handler=option_handler)
+ if len(args) != 2:
+ common.Usage(__doc__)
+ sys.exit(1)
+
+ SignOutput(args[0], args[1])
+
+
+if __name__ == '__main__':
+ try:
+ main(sys.argv[1:])
+ except common.ExternalError as e:
+ print()
+ print(" ERROR: %s" % e)
+ print()
+ sys.exit(1)
diff --git a/tools/repopick.py b/tools/repopick.py
index cfbb8a8..9bb39aa 100755
--- a/tools/repopick.py
+++ b/tools/repopick.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
#
# Copyright (C) 2013-15 The CyanogenMod Project
+# (C) 2017 The LineageOS Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -121,12 +122,12 @@ def fetch_query(remote_url, query):
raise Exception('Gerrit URL should be in the form http[s]://hostname/ or ssh://[user@]host[:port]')
if __name__ == '__main__':
- # Default to CyanogenMod Gerrit
- default_gerrit = 'http://review.cyanogenmod.org'
+ # Default to LineageOS Gerrit
+ default_gerrit = 'http://review.lineageos.org'
parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter, description=textwrap.dedent('''\
repopick.py is a utility to simplify the process of cherry picking
- patches from CyanogenMod's Gerrit instance (or any gerrit instance of your choosing)
+ patches from LineageOS's Gerrit instance (or any gerrit instance of your choosing)
Given a list of change numbers, repopick will cd into the project path
and cherry pick the latest patch available.
diff --git a/tools/roomservice.py b/tools/roomservice.py
index a1b69cd..691456e 100755
--- a/tools/roomservice.py
+++ b/tools/roomservice.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python
# Copyright (C) 2012-2013, The CyanogenMod Project
+# (C) 2017, The LineageOS Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -51,7 +52,7 @@ except:
device = product
if not depsonly:
- print("Device %s not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod)." % device)
+ print("Device %s not found. Attempting to retrieve device repository from LineageOS Github (http://github.com/LineageOS)." % device)
repositories = []
@@ -71,7 +72,7 @@ def add_auth(githubreq):
githubreq.add_header("Authorization","Basic %s" % githubauth)
if not depsonly:
- githubreq = urllib.request.Request("https://api.github.com/search/repositories?q=%s+user:CyanogenMod+in:name+fork:true" % device)
+ githubreq = urllib.request.Request("https://api.github.com/search/repositories?q=%s+user:LineageOS+in:name+fork:true" % device)
add_auth(githubreq)
try:
result = json.loads(urllib.request.urlopen(githubreq).read().decode())
@@ -175,12 +176,12 @@ def add_to_manifest(repositories, fallback_branch = None):
repo_target = repository['target_path']
print('Checking if %s is fetched from %s' % (repo_target, repo_name))
if is_in_manifest(repo_target):
- print('CyanogenMod/%s already fetched to %s' % (repo_name, repo_target))
+ print('LineageOS/%s already fetched to %s' % (repo_name, repo_target))
continue
- print('Adding dependency: CyanogenMod/%s -> %s' % (repo_name, repo_target))
+ print('Adding dependency: LineageOS/%s -> %s' % (repo_name, repo_target))
project = ElementTree.Element("project", attrib = { "path": repo_target,
- "remote": "github", "name": "CyanogenMod/%s" % repo_name })
+ "remote": "github", "name": "LineageOS/%s" % repo_name })
if 'branch' in repository:
project.set('revision',repository['branch'])
@@ -202,25 +203,30 @@ def add_to_manifest(repositories, fallback_branch = None):
def fetch_dependencies(repo_path, fallback_branch = None):
print('Looking for dependencies')
- dependencies_path = repo_path + '/cm.dependencies'
+ dependencies_paths = [repo_path + '/lineage.dependencies', repo_path + '/cm.dependencies']
+ found_dependencies = False
syncable_repos = []
- if os.path.exists(dependencies_path):
- dependencies_file = open(dependencies_path, 'r')
- dependencies = json.loads(dependencies_file.read())
- fetch_list = []
+ for dependencies_path in dependencies_paths:
+ if os.path.exists(dependencies_path):
+ dependencies_file = open(dependencies_path, 'r')
+ dependencies = json.loads(dependencies_file.read())
+ fetch_list = []
- for dependency in dependencies:
- if not is_in_manifest(dependency['target_path']):
- fetch_list.append(dependency)
- syncable_repos.append(dependency['target_path'])
+ for dependency in dependencies:
+ if not is_in_manifest(dependency['target_path']):
+ fetch_list.append(dependency)
+ syncable_repos.append(dependency['target_path'])
- dependencies_file.close()
+ dependencies_file.close()
+ found_dependencies = True
- if len(fetch_list) > 0:
- print('Adding dependencies to manifest')
- add_to_manifest(fetch_list, fallback_branch)
- else:
+ if len(fetch_list) > 0:
+ print('Adding dependencies to manifest')
+ add_to_manifest(fetch_list, fallback_branch)
+ break
+
+ if not found_dependencies:
print('Dependencies file not found, bailing out.')
if len(syncable_repos) > 0:
@@ -294,4 +300,4 @@ else:
print("Done")
sys.exit()
-print("Repository for %s not found in the CyanogenMod Github repository list. If this is in error, you may need to manually add it to your local_manifests/roomservice.xml." % device)
+print("Repository for %s not found in the LineageOS Github repository list. If this is in error, you may need to manually add it to your local_manifests/roomservice.xml." % device)