Skip to content

Commit

Permalink
Merge tag 'android-7.1.2_r2' into n7.1
Browse files Browse the repository at this point in the history
Android 7.1.2 Release 2 (N2G47E)

Change-Id: Ie3d3e9ea5c8dd67f44e43b2ed5a97e844c19888d
  • Loading branch information
invisiblek authored and LorDClockaN committed Apr 15, 2017
1 parent 16258a0 commit 83e8e73
Show file tree
Hide file tree
Showing 18 changed files with 439 additions and 87 deletions.
10 changes: 8 additions & 2 deletions core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,7 @@ define generate-userimage-prop-dictionary
$(if $(INTERNAL_USERIMAGES_EXT_VARIANT),$(hide) echo "fs_type=$(INTERNAL_USERIMAGES_EXT_VARIANT)" >> $(1))
$(if $(BOARD_SYSTEMIMAGE_PARTITION_SIZE),$(hide) echo "system_size=$(BOARD_SYSTEMIMAGE_PARTITION_SIZE)" >> $(1))
$(if $(BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "system_fs_type=$(BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE)" >> $(1))
$(if $(BOARD_SYSTEMIMAGE_EXTFS_INODE_COUNT),$(hide) echo "system_extfs_inode_count=$(BOARD_SYSTEMIMAGE_EXTFS_INODE_COUNT)" >> $(1))
$(if $(BOARD_SYSTEMIMAGE_JOURNAL_SIZE),$(hide) echo "system_journal_size=$(BOARD_SYSTEMIMAGE_JOURNAL_SIZE)" >> $(1))
$(if $(BOARD_HAS_EXT4_RESERVED_BLOCKS),$(hide) echo "has_ext4_reserved_blocks=$(BOARD_HAS_EXT4_RESERVED_BLOCKS)" >> $(1))
$(if $(BOARD_SYSTEMIMAGE_SQUASHFS_COMPRESSOR),$(hide) echo "system_squashfs_compressor=$(BOARD_SYSTEMIMAGE_SQUASHFS_COMPRESSOR)" >> $(1))
Expand All @@ -944,6 +945,7 @@ $(if $(BOARD_USERDATAEXTRAIMAGE_PARTITION_NAME),$(hide) echo "userdataextra_name
$(if $(BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "cache_fs_type=$(BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE)" >> $(1))
$(if $(BOARD_CACHEIMAGE_PARTITION_SIZE),$(hide) echo "cache_size=$(BOARD_CACHEIMAGE_PARTITION_SIZE)" >> $(1))
$(if $(BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "vendor_fs_type=$(BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE)" >> $(1))
$(if $(BOARD_VENDORIMAGE_EXTFS_INODE_COUNT),$(hide) echo "vendor_extfs_inode_count=$(BOARD_VENDORIMAGE_EXTFS_INODE_COUNT)" >> $(1))
$(if $(BOARD_VENDORIMAGE_PARTITION_SIZE),$(hide) echo "vendor_size=$(BOARD_VENDORIMAGE_PARTITION_SIZE)" >> $(1))
$(if $(BOARD_VENDORIMAGE_JOURNAL_SIZE),$(hide) echo "vendor_journal_size=$(BOARD_VENDORIMAGE_JOURNAL_SIZE)" >> $(1))
$(if $(BOARD_VENDORIMAGE_SQUASHFS_COMPRESSOR),$(hide) echo "vendor_squashfs_compressor=$(BOARD_VENDORIMAGE_SQUASHFS_COMPRESSOR)" >> $(1))
Expand All @@ -953,6 +955,7 @@ $(if $(BOARD_VENDORIMAGE_SQUASHFS_DISABLE_4K_ALIGN),$(hide) echo "vendor_squashf
$(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VENDOR_BASE_FS_PATH),$(hide) echo "vendor_base_fs_file=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VENDOR_BASE_FS_PATH)" >> $(1))
$(if $(BOARD_OEMIMAGE_PARTITION_SIZE),$(hide) echo "oem_size=$(BOARD_OEMIMAGE_PARTITION_SIZE)" >> $(1))
$(if $(BOARD_OEMIMAGE_JOURNAL_SIZE),$(hide) echo "oem_journal_size=$(BOARD_OEMIMAGE_JOURNAL_SIZE)" >> $(1))
$(if $(BOARD_OEMIMAGE_EXTFS_INODE_COUNT),$(hide) echo "oem_extfs_inode_count=$(BOARD_OEMIMAGE_EXTFS_INODE_COUNT)" >> $(1))
$(if $(INTERNAL_USERIMAGES_SPARSE_EXT_FLAG),$(hide) echo "extfs_sparse_flag=$(INTERNAL_USERIMAGES_SPARSE_EXT_FLAG)" >> $(1))
$(if $(mkyaffs2_extra_flags),$(hide) echo "mkyaffs2_extra_flags=$(mkyaffs2_extra_flags)" >> $(1))
$(if $(INTERNAL_USERIMAGES_SPARSE_SQUASHFS_FLAG),$(hide) echo "squashfs_sparse_flag=$(INTERNAL_USERIMAGES_SPARSE_SQUASHFS_FLAG)" >> $(1))
Expand Down Expand Up @@ -1372,7 +1375,8 @@ $(INSTALLED_FILES_FILE): $(FULL_SYSTEMIMAGE_DEPS)
@echo Installed file list: $@
@mkdir -p $(dir $@)
@rm -f $@
$(hide) build/tools/fileslist.py $(TARGET_OUT) > $@
$(hide) build/tools/fileslist.py $(TARGET_OUT) > $(@:.txt=.json)
$(hide) build/tools/fileslist_util.py -c $(@:.txt=.json) > $@

.PHONY: installed-file-list
installed-file-list: $(INSTALLED_FILES_FILE)
Expand Down Expand Up @@ -1774,7 +1778,8 @@ $(INSTALLED_FILES_FILE_VENDOR) : $(INTERNAL_VENDORIMAGE_FILES)
@echo Installed file list: $@
@mkdir -p $(dir $@)
@rm -f $@
$(hide) build/tools/fileslist.py $(TARGET_OUT_VENDOR) > $@
$(hide) build/tools/fileslist.py $(TARGET_OUT_VENDOR) > $(@:.txt=.json)
$(hide) build/tools/fileslist_util.py -c $(@:.txt=.json) > $@

vendorimage_intermediates := \
$(call intermediates-dir-for,PACKAGING,vendor)
Expand Down Expand Up @@ -1862,6 +1867,7 @@ OTATOOLS := $(HOST_OUT_EXECUTABLES)/minigzip \
$(HOST_OUT_EXECUTABLES)/e2fsck \
$(HOST_OUT_EXECUTABLES)/build_verity_tree \
$(HOST_OUT_EXECUTABLES)/verity_signer \
$(HOST_OUT_EXECUTABLES)/verity_verifier \
$(HOST_OUT_EXECUTABLES)/append2simg \
$(HOST_OUT_EXECUTABLES)/img2simg \
$(HOST_OUT_EXECUTABLES)/boot_signer \
Expand Down
6 changes: 5 additions & 1 deletion core/base_rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,11 @@ ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
# Apk and its attachments reside in its own subdir.
ifeq ($(LOCAL_MODULE_CLASS),APPS)
# framework-res.apk doesn't like the additional layer.
ifeq ($(filter true,$(LOCAL_NO_STANDARD_LIBRARIES) $(LOCAL_IGNORE_SUBDIR)),)
ifeq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
# Neither do Runtime Resource Overlay apks, which contain just the overlaid resources.
else ifeq ($(LOCAL_IS_RUNTIME_RESOURCE_OVERLAY),true)
else ifeq ($(LOCAL_IGNORE_SUBDIR),true)
else
my_module_path := $(my_module_path)/$(LOCAL_MODULE)
endif
endif
Expand Down
2 changes: 1 addition & 1 deletion core/build_id.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
# (like "CRB01"). It must be a single word, and is
# capitalized by convention.

export BUILD_ID=NOF27B
export BUILD_ID=N2G47E
25 changes: 25 additions & 0 deletions core/build_rro_package.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#############################################################################
## Standard rules for installing runtime resouce overlay APKs.
##
## Set LOCAL_RRO_THEME to the theme name if the package should apply only to
## a particular theme as set by ro.boot.vendor.overlay.theme system property.
##
## If LOCAL_RRO_THEME is not set, the package will apply always, independent
## of themes.
##
#############################################################################

LOCAL_IS_RUNTIME_RESOURCE_OVERLAY := true

ifneq ($(LOCAL_SRC_FILES),)
$(error runtime resource overlay package should not contain sources)
endif

ifeq (S(LOCAL_RRO_THEME),)
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/overlay
else
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/overlay/$(LOCAL_RRO_THEME)
endif

include $(BUILD_SYSTEM)/package.mk

2 changes: 2 additions & 0 deletions core/clear_vars.mk
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ LOCAL_CLANG_64:=
LOCAL_INIT_RC_32:=
LOCAL_INIT_RC_64:=
LOCAL_JAVA_LANGUAGE_VERSION:=
LOCAL_IS_RUNTIME_RESOURCE_OVERLAY:=
LOCAL_RRO_THEME:=

LOCAL_PROTOC_OUTPUT:=

Expand Down
1 change: 1 addition & 0 deletions core/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ BUILD_EXECUTABLE:= $(BUILD_SYSTEM)/executable.mk
BUILD_HOST_EXECUTABLE:= $(BUILD_SYSTEM)/host_executable.mk
BUILD_PACKAGE:= $(BUILD_SYSTEM)/package.mk
BUILD_PHONY_PACKAGE:= $(BUILD_SYSTEM)/phony_package.mk
BUILD_RRO_PACKAGE:= $(BUILD_SYSTEM)/build_rro_package.mk
BUILD_HOST_PREBUILT:= $(BUILD_SYSTEM)/host_prebuilt.mk
BUILD_PREBUILT:= $(BUILD_SYSTEM)/prebuilt.mk
BUILD_MULTI_PREBUILT:= $(BUILD_SYSTEM)/multi_prebuilt.mk
Expand Down
21 changes: 19 additions & 2 deletions core/version_defaults.mk
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,16 @@ ifeq "" "$(PLATFORM_VERSION)"
# which is the version that we reveal to the end user.
# Update this value when the platform version changes (rather
# than overriding it somewhere else). Can be an arbitrary string.
PLATFORM_VERSION := 7.1.1

# When you add a new PLATFORM_VERSION which will result in a new
# PLATFORM_SDK_VERSION please ensure you add a corresponding isAtLeast*
# method in the following java file:
# frameworks/support/compat/gingerbread/android/support/v4/os/BuildCompat.java

# When you change PLATFORM_VERSION for a given PLATFORM_SDK_VERSION
# please add that PLATFORM_VERSION to the following text file:
# cts/tests/tests/os/assets/platform_versions.txt
PLATFORM_VERSION := 7.1.2
endif

ifeq "" "$(PLATFORM_SDK_VERSION)"
Expand All @@ -55,6 +64,14 @@ ifeq "" "$(PLATFORM_SDK_VERSION)"
# intermediate builds). During development, this number remains at the
# SDK version the branch is based on and PLATFORM_VERSION_CODENAME holds
# the code-name of the new development work.

# When you change PLATFORM_SDK_VERSION please ensure you also update the
# corresponding methods for isAtLeast* in the following java file:
# frameworks/support/compat/gingerbread/android/support/v4/os/BuildCompat.java

# When you increment the PLATFORM_SDK_VERSION please ensure you also
# clear out the following text file of all older PLATFORM_VERSION's:
# cts/tests/tests/os/assets/platform_versions.txt
PLATFORM_SDK_VERSION := 25
endif

Expand Down Expand Up @@ -114,7 +131,7 @@ ifeq "" "$(PLATFORM_SECURITY_PATCH)"
# It must be of the form "YYYY-MM-DD" on production devices.
# 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 := 2017-03-05
PLATFORM_SECURITY_PATCH := 2017-04-05
endif

ifeq "" "$(PLATFORM_BASE_OS)"
Expand Down
1 change: 1 addition & 0 deletions target/product/emulator.mk
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ PRODUCT_COPY_FILES += \
device/generic/goldfish/init.ranchu.rc:root/init.ranchu.rc \
device/generic/goldfish/fstab.ranchu:root/fstab.ranchu \
device/generic/goldfish/ueventd.ranchu.rc:root/ueventd.ranchu.rc \
device/generic/goldfish/input/goldfish_rotary.idc:system/usr/idc/goldfish_rotary.idc \
frameworks/native/data/etc/android.hardware.usb.accessory.xml:system/etc/permissions/android.hardware.usb.accessory.xml

PRODUCT_PACKAGE_OVERLAYS := device/generic/goldfish/overlay
Expand Down
29 changes: 21 additions & 8 deletions tools/fileslist.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,24 @@

from __future__ import print_function

import operator, os, sys
import json, hashlib, operator, os, sys

def get_file_size(path):
st = os.lstat(path)
return st.st_size

def get_file_digest(path):
if os.path.isfile(path) == False:
return "----------------------------------------------------------------"
digest = hashlib.sha256()
with open(path, 'rb') as f:
while True:
buf = f.read(1024*1024)
if not buf:
break
digest.update(buf)
return digest.hexdigest();

def main(argv):
output = []
roots = argv[1:]
Expand All @@ -32,16 +44,17 @@ def main(argv):
relative = dir[base:]
for f in files:
try:
row = (
get_file_size(os.path.sep.join((dir, f))),
os.path.sep.join((relative, f)),
)
path = os.path.sep.join((dir, f))
row = {
"Size": get_file_size(path),
"Name": os.path.sep.join((relative, f)),
"SHA256": get_file_digest(path),
}
output.append(row)
except os.error:
pass
output.sort(key=operator.itemgetter(0), reverse=True)
for row in output:
print("%12d %s" % row)
output.sort(key=operator.itemgetter("Size", "Name"), reverse=True)
print json.dumps(output, indent=2, separators=(',',': '))

if __name__ == '__main__':
main(sys.argv)
68 changes: 68 additions & 0 deletions tools/fileslist_util.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/usr/bin/env python
#
# Copyright (C) 2016 The Android Open Source 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.
#

import getopt, json, sys

def PrintFileNames(path):
with open(path) as jf:
data = json.load(jf)
for line in data:
print(line["Name"])

def PrintCanonicalList(path):
with open(path) as jf:
data = json.load(jf)
for line in data:
print "{0:12d} {1}".format(line["Size"], line["Name"])

def PrintUsage(name):
print("""
Usage: %s -[nc] json_files_list
-n produces list of files only
-c produces classic installed-files.txt
""" % (name))

def main(argv):
try:
opts, args = getopt.getopt(argv[1:], "nc", "")
except getopt.GetoptError, err:
print(err)
PrintUsage(argv[0])
sys.exit(2)

if len(opts) == 0:
print("No conversion option specified")
PrintUsage(argv[0])
sys.exit(2)

if len(args) == 0:
print("No input file specified")
PrintUsage(argv[0])
sys.exit(2)

for o, a in opts:
if o == ("-n"):
PrintFileNames(args[0])
sys.exit()
elif o == ("-c"):
PrintCanonicalList(args[0])
sys.exit()
else:
assert False, "Unsupported option"

if __name__ == '__main__':
main(sys.argv)
51 changes: 44 additions & 7 deletions tools/releasetools/add_img_to_target_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,31 @@
not have an IMAGES/ top-level subdirectory), produce the images and
add them to the zipfile.
Usage: add_img_to_target_files target_files
Usage: add_img_to_target_files [flag] target_files
-a (--add_missing)
Build and add missing images to "IMAGES/". If this option is
not specified, this script will simply exit when "IMAGES/"
directory exists in the target file.
-r (--rebuild_recovery)
Rebuild the recovery patch and write it to the system image. Only
meaningful when system image needs to be rebuilt.
--replace_verity_private_key
Replace the private key used for verity signing. (same as the option
in sign_target_files_apks)
--replace_verity_public_key
Replace the certificate (public key) used for verity verification. (same
as the option in sign_target_files_apks)
--is_signing
Skip building & adding the images for "userdata" and "cache" if we
are signing the target files.
--verity_signer_path
Specify the signer path to build verity metadata.
"""

from __future__ import print_function
Expand Down Expand Up @@ -47,6 +71,7 @@
OPTIONS.rebuild_recovery = False
OPTIONS.replace_verity_public_key = False
OPTIONS.replace_verity_private_key = False
OPTIONS.is_signing = False
OPTIONS.verity_signer_path = None

def GetCareMap(which, imgname):
Expand Down Expand Up @@ -425,6 +450,14 @@ def banner(s):
if recovery_image:
recovery_image.AddToZip(output_zip)

banner("recovery (two-step image)")
# The special recovery.img for two-step package use.
recovery_two_step_image = common.GetBootableImage(
"IMAGES/recovery-two-step.img", "recovery-two-step.img",
OPTIONS.input_tmp, "RECOVERY", two_step_image=True)
if recovery_two_step_image:
recovery_two_step_image.AddToZip(output_zip)

banner("system")
system_imgname = AddSystem(output_zip, recovery_img=recovery_image,
boot_img=boot_image)
Expand All @@ -435,12 +468,13 @@ def banner(s):
if has_system_other:
banner("system_other")
AddSystemOther(output_zip)
banner("userdata")
AddUserdata(output_zip)
banner("extrauserdata")
AddUserdataExtra(output_zip)
banner("cache")
AddCache(output_zip)
if not OPTIONS.is_signing:
banner("userdata")
AddUserdata(output_zip)
banner("extrauserdata")
AddUserdataExtra(output_zip)
banner("cache")
AddCache(output_zip)
if has_oem:
banner("oem")
AddOem(output_zip)
Expand Down Expand Up @@ -491,6 +525,8 @@ def option_handler(o, a):
OPTIONS.replace_verity_private_key = (True, a)
elif o == "--replace_verity_public_key":
OPTIONS.replace_verity_public_key = (True, a)
elif o == "--is_signing":
OPTIONS.is_signing = True
elif o == "--verity_signer_path":
OPTIONS.verity_signer_path = a
else:
Expand All @@ -502,6 +538,7 @@ def option_handler(o, a):
extra_long_opts=["add_missing", "rebuild_recovery",
"replace_verity_public_key=",
"replace_verity_private_key=",
"is_signing",
"verity_signer_path="],
extra_option_handler=option_handler)

Expand Down
Loading

0 comments on commit 83e8e73

Please sign in to comment.