Skip to content

Commit

Permalink
aries-common: use releasetools extensions
Browse files Browse the repository at this point in the history
releasetools extensions is an AOSP-supported method of extending
releasetools which is better than duplicating the way we have now.

Change-Id: I7d81b2713226f89e93df983c3e365415ae6e9f8f
  • Loading branch information
pawitp authored and Gerrit Code Review committed Dec 19, 2012
1 parent 9872ab2 commit cec6604
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 432 deletions.
3 changes: 1 addition & 2 deletions BoardConfigCommon.mk
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ BOARD_UMS_LUNFILE := /sys/class/android_usb/android0/f_mass_storage/lun/file
TARGET_KERNEL_SOURCE := kernel/samsung/aries

# Releasetools
TARGET_RELEASETOOL_OTA_FROM_TARGET_SCRIPT := ./device/samsung/aries-common/releasetools/aries_ota_from_target_files
TARGET_RELEASETOOL_IMG_FROM_TARGET_SCRIPT := ./device/samsung/aries-common/releasetools/aries_img_from_target_files
TARGET_RELEASETOOLS_EXTENSIONS := device/samsung/aries-common

# Camera
USE_CAMERA_STUB := false
Expand Down
74 changes: 74 additions & 0 deletions releasetools.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Copyright (C) 2012 The Android Open Source Project
# Copyright (C) 2012 The CyanogenMod 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.

"""Custom OTA commands for aries"""

import common
import os
import shutil

LOCAL_DIR = os.path.dirname(os.path.abspath(__file__))
TARGET_DIR = os.getenv('OUT')
UTILITIES_DIR = os.path.join(TARGET_DIR, 'utilities')

def FullOTA_Assertions(info):
info.output_zip.write(os.path.join(TARGET_DIR, "modem.bin"), "modem.bin")
info.output_zip.write(os.path.join(TARGET_DIR, "updater.sh"), "updater.sh")
info.output_zip.write(os.path.join(UTILITIES_DIR, "make_ext4fs"), "make_ext4fs")
info.output_zip.write(os.path.join(UTILITIES_DIR, "busybox"), "busybox")
info.output_zip.write(os.path.join(UTILITIES_DIR, "flash_image"), "flash_image")
info.output_zip.write(os.path.join(UTILITIES_DIR, "erase_image"), "erase_image")
info.output_zip.write(os.path.join(UTILITIES_DIR, "bml_over_mtd"), "bml_over_mtd")
info.output_zip.write(os.path.join(LOCAL_DIR, "bml_over_mtd.sh"), "bml_over_mtd.sh")

info.script.AppendExtra(
('package_extract_file("modem.bin", "/tmp/modem.bin");\n'
'set_perm(0, 0, 0777, "/tmp/modem.bin");'))
info.script.AppendExtra(
('package_extract_file("updater.sh", "/tmp/updater.sh");\n'
'set_perm(0, 0, 0777, "/tmp/updater.sh");'))
info.script.AppendExtra(
('package_extract_file("make_ext4fs", "/tmp/make_ext4fs");\n'
'set_perm(0, 0, 0777, "/tmp/make_ext4fs");'))
info.script.AppendExtra(
('package_extract_file("busybox", "/tmp/busybox");\n'
'set_perm(0, 0, 0777, "/tmp/busybox");'))
info.script.AppendExtra(
('package_extract_file("flash_image", "/tmp/flash_image");\n'
'set_perm(0, 0, 0777, "/tmp/flash_image");'))
info.script.AppendExtra(
('package_extract_file("erase_image", "/tmp/erase_image");\n'
'set_perm(0, 0, 0777, "/tmp/erase_image");'))
info.script.AppendExtra(
('package_extract_file("bml_over_mtd", "/tmp/bml_over_mtd");\n'
'set_perm(0, 0, 0777, "/tmp/bml_over_mtd");'))
info.script.AppendExtra(
('package_extract_file("bml_over_mtd.sh", "/tmp/bml_over_mtd.sh");\n'
'set_perm(0, 0, 0777, "/tmp/bml_over_mtd.sh");'))

info.script.AppendExtra('package_extract_file("boot.img", "/tmp/boot.img");')
info.script.AppendExtra('assert(run_program("/tmp/updater.sh") == 0);')

# Make common releasetools copy boot.img verbatim
kernel_path = os.path.join(info.input_tmp, "BOOT", "kernel")
prebuilt_dir = os.path.join(info.input_tmp, "BOOTABLE_IMAGES")
prebuilt_path = os.path.join(prebuilt_dir, "boot.img")
os.mkdir(prebuilt_dir)
shutil.copyfile(kernel_path, prebuilt_path)


def FullOTA_InstallEnd(info):
# Remove writing boot.img from script (we do it in updater.sh)
info.script.script = [cmd for cmd in info.script.script if not "write_raw_image" in cmd]
31 changes: 0 additions & 31 deletions releasetools/aries_common.py

This file was deleted.

74 changes: 0 additions & 74 deletions releasetools/aries_edify_generator.py

This file was deleted.

187 changes: 0 additions & 187 deletions releasetools/aries_img_from_target_files

This file was deleted.

Loading

0 comments on commit cec6604

Please sign in to comment.