* The current logic does not suit for multiple block devices case,
it generates split images hence output dir shall be specified
* Multiple block devices is possible with non-RDAP too, and it could
work for RDAP with single block device, so it's incorrect to depend
on RDAP flag
Change-Id: I8563b96b35351ef0a3b40ae172c2e904ee57f85e
Signed-off-by: RITEFANG <1721985272@qq.com>
* Makes logical partitions writable when flashed to the device
Change-Id: Id473acaedab9400870700bc317a140fd73a58456
Signed-off-by: RITEFANG <1721985272@qq.com>
It seems like switching from minigzip to toybox gzip (bug: 288169261)
makes imgdiff fail in in this way:
* W imgdiff : imgdiff.cpp:1435 Failed to reconstruct target deflate chunk 3 []; treating as normal
* E imgdiff : imgdiff.cpp:1390 Failed to set bonus data
Test: Sign non-AB target files package
Change-Id: I29f1d8f1168347141d80860e8ed02e19b0031447
Signed-off-by: RITEFANG <1721985272@qq.com>
Currently, an extra '/vendor' is appended in target_files_dir of
make_recovery_patch.py, which will yield an erroneous path when
attempting to build full recovery image on vendorimage-leas devices:
SYSTEM/vendor/vendor/etc/recovery.img
This patch addresses the issue by removing the extra '/vendor' of
target_files_dir, and add checks for whether the target builds
vendor image in MakeRecoveryPatch() as well. This ensures no
recovery image will be generated with prebuilt vendor.
Signed-off-by: Ricky Cheung <rcheung844@gmail.com>
Change-Id: I2dc6e43537deb606dd01fb090add2595502055c1
Signed-off-by: RITEFANG <1721985272@qq.com>
This allows one to build *__auto_generated_rro_(product|vendor).apk
under $(PRODUCT_OUT)/(product|vendor)/overlay/ without having to
build the full partition image or do full android build.
Change-Id: I0c215ed7968e0cba348d344e00a014470ac37b6e
Signed-off-by: RITEFANG <1721985272@qq.com>
Not all devices inherit these makefiles, which results in missing files
Change-Id: Icd257d47230308db8f1c87b3b7df588a100b635e
Signed-off-by: RITEFANG <1721985272@qq.com>
If _FindAndLoadRecoveryFstab() is called with a path to target files zip
file, then it'll always attempt to read the fallback recovery.fstab
path. By making sure to pass zipfile.ZipFile(), it'll be able to read
the zip file ToC and use the correct path instead.
Test: Generate signed ota package for gts4lv
Change-Id: I4f3b975c677b7928999d0fe4fb137c868d7a206e
Signed-off-by: RITEFANG <1721985272@qq.com>
If vendor model props are blacklisted, a/b zips fail to generate.
This uses a non-partition specific prop if the partition specific
variant does not exist.
Change-Id: I96f583ceb3ccebee21211b964e2ea66217ffd41f
Signed-off-by: RITEFANG <1721985272@qq.com>
This allows adding android-info-extra.txt to OTA packaging folder
in case it exists in the target device tree, so that it can then
be used in conjunction with custom releasetools. Historically, devices
used to do assertions based on the modem version or even trusted zone
version in order to prevent flashing builds if certain conditions were
not met. That however, breaks `fastboot flashall` command since it looks
for the requirements set in board-info.txt.
With this, targets can define whatever non-standard requirements
in the newly introduced android-info extra file, keeping OTA assertions
in place and `fastboot flashall` command working without having to pass
`--force` argument.
Change-Id: I029d778b44be4d9d877701d05124451052a4b73c
Signed-off-by: RITEFANG <1721985272@qq.com>
In past, brillo_update_payload was unsparsing all images before putting
them in payload.bin, now we ought to unsparse them ourselves here.
Change-Id: I69baa71678f8116ed8e256bd629a1af9bad13ba8
Signed-off-by: RITEFANG <1721985272@qq.com>
Fixes: [ERROR]: recovery: [libfs_mgr]Unable to enable ext4 verity on
/dev/block/by-name/metadata because /system/bin/tune2fs is missing
in recovery.
Test: e2fsck/resize2fs/tune2fs are present in ramdisks.
Change-Id: I83223f48e4df8b89ff9b27b0912174360c053617
Signed-off-by: RITEFANG <1721985272@qq.com>
Previously the key mapping in releasetool/sign_target_files_apks.py
is missing the aforementioned keys that introduced in Android 13, so
it's writing corrupted signatures in plat_mac_permissions.xml.
Test: make target-files-package otatools
sign_target_files_apks -o -d <CERT_ROOT> ...
Change-Id: If42907cffbd500281876f8f822cbb645583d06ed
Signed-off-by: RITEFANG <1721985272@qq.com>
* This is a required dependency of target-files-package
so that it can be built from a clean build.
Test: rm -rf out/target/product && m target-files-package
Change-Id: I89e60f47e3e2cd6029a92b1aca505acd9cf4645b
Signed-off-by: RITEFANG <1721985272@qq.com>
This is a squash of the following commits:
Author: Chris Soyars <ctso@ctso.me>
Date: Thu Dec 23 00:44:33 2010 +0100
Add otapackage support for backuptool
Change-Id: I512554c579d444067cd3ccbb0e6946a5eb6bc964a
Modular backuptool.sh. Executes backup and restore methods defined in arbitrary /system/addon.d/*.sh scripts.
* Copy backuptool.functions alongside backuptool.sh.
* Delete both from /system/bin as they are not useful there.
Patch Series
============
http://review.cyanogenmod.com/#change,13265
CyanogenMod/android_build
* edify generator
http://review.cyanogenmod.com/#change,13266
CyanogenMod/android_system_core
* permissions on /system/addon.d
http://review.cyanogenmod.com/#change,13267
CyanogenMod/android_vendor_cm
* 50-cm.sh reference backup script
* modular backuptool.sh
* support backuptool.functions used by /system/addon.d/*.sh scripts
Change-Id: I26b4907d28f49c69627699d2accd2f0fa2d1b112
update ota_from_target_files to handle mounting/unmounting for backupscript
backupscript should not be mounting/unmounting itself as it makes other
scripts have unexpected results (such as modelid_cfg, which expects /system
to be mounted)
instead have the ota script handle the mounting/unmounting
Change-Id: I94511f4147c624d975cb3ecbeaa8b0e98f63437c
build: Don't run backuptool on GMS builds
Change-Id: I5dde27f9d16b88049171db9805221d92e67f3e5d
Author: Tom Marshall <tdm@cyngn.com>
Date: Wed Apr 9 16:14:07 2014 -0700
build: edify: use set_metadata for backuptool
Also use saner permissions on backuptool.sh
Change-Id: I50742b51867aa358f5924b8dc208833092a35bd9
Author: Ricardo Cerqueira <ricardo@cyngn.com>
Date: Wed Nov 5 18:16:43 2014 +0000
ota: Include copies of the recovery scripts even if shipping in block mode
Author: Ricardo Cerqueira <ricardo@cyngn.com>
Date: Wed Nov 5 19:58:59 2014 +0000
ota: Fix recovery-script cleanups in block mode
Change-Id: Iadb480f8062cfb7a0e6c9024e32ac0d71a7481d7
Author: Arian <arian.kulmer@web.de>
Date: Wed Jun 17 12:35:16 2020 +0200
build: Disable backuptool on user instead of GMS builds
* Backuptool is not exclusively used for GApps but
also used by other things (i.e. Magisk), hence
it shouldn't be disabled on all GMS builds.
Change-Id: Ia95c6fed21d7bed5e2e0610aa94264edc1d02c80
Author: Davide Garberi <dade.garberi@gmail.com>
Date: Tue Sep 24 18:45:17 2019 +0200
releasetools: Move system mount handling to backuptool
* This allows the ROM to be flashed on any recovery, whether it mounts
system to /system, /system_root or /mnt/system like Q recovery
* Remove any type of system mount with static paths from updater-script
to figure out the path dinamically through backuptool
Change-Id: I7b33726305cb6f3eec146d26135f0081002a25dc
Author: Jesse Chan <jc@lineageos.org>
Date: Fri Jun 12 21:53:18 2020 +0800
releasetools: support dynamic partitions for backuptool
Change-Id: I4a04e52f64e307a9852d786aabf17975a020b4b8
Signed-off-by: Jesse Chan <jc@lineageos.org>
Author: Jesse Chan <jc@lineageos.org>
Date: Tue Jul 7 23:50:10 2020 +0800
backuptool: do not unmap dynamic partition after finished
Keep partitions mapped so users can install addons.
Change-Id: Ic70621986bf136775e686dc8cc690ce076485907
Signed-off-by: Jesse Chan <jc@lineageos.org>
Author: Alessandro Astone <ales.astone@gmail.com>
Date: Mon Apr 12 18:40:10 2021 +0200
backuptool: Map extra dynamic partitions for Addon.d V3
Change-Id: Ia8fa1963c722c5aa2987b947e4e919e19909a9a8
Change-Id: I2401d334d8e16d18d3770b339ec2c787dd8e477c
* Anything in OUT/install gets packaged up into the zip and extracted
to /tmp/install immediately after FullOTA_InstallBegin.
* Use /tmp/install in edify scripts and remove code related to using
and manipulating /system for install tools.
* Modified to support signing steps being split from build steps.
Package install files into target-files INSTALL path
Read from target-files for OTA package creation
From Change-Id: I64f919c2a757b5474f6cc5f82bd6c33c2a8b558a
* This also fully reverts commit 6a324ba and partially reverts
commit f388104 as the functions are still needed here.
From Change-Ids: I4911244ec9945d197d2b56d0d11eab6d2f7b6d3e
I4943e2e89ee5c810a63746c570dc5e31e95b8c53
Squashed with the following:
Author: LuK1337 <priv.luk@gmail.com>
Date: Wed Feb 19 02:14:59 2020 +0100
releasetools: Use 0oXXX instead of 0XXX for octal
* Fixes py3 syntax error.
Change-Id: Ia9ca6e392f43694ddf4c952b07bf159e8dead36e
Author: LuK1337 <priv.luk@gmail.com>
Date: Fri Nov 13 15:27:24 2020 +0100
Add $(PRODUCT_OUT)/install to INTERNAL_RECOVERYIMAGE_FILES
* Fixes $(PRODUCT_OUT)/install not being included on targets
not providing their own /vendor || /system/vendor.
Change-Id: I15b8305bb7efacfcf3018708bf7ff8b8500744fb
Change-Id: I315a3238e36c8d15e26f935e272f7e27dd59c320
This happens when the fingerprint property is blacklisted for the
purposes of unified device builds.
Change-Id: I9f8a5041248c3f73fce7a16da73cb8f68c06c8e2
Without the -d $(TARGET_OUT) option for mkbootfs, only the
compiled-in fs_config (from AOSP) is used for the generated
ramdisk image. Device-specific additions are ignored.
This is why AOSP sets this option for both the boot- and recovery
ramdisk [1]. However, the option was removed for the recovery ramdisk
in review.lineageos.org/c/LineageOS/android_build/+/222722
This causes device-specific fs_config additions to be ignored when
generating the recovery ramdisk, potentially setting the wrong
permissions.
[1]: android.googlesource.com/platform/build/+/refs/tags/android-9.0.0_r37/core/Makefile#1388
Change-Id: I0f77a49d8b2f08791e60b34ddbb6f3b32bc2f0bc
Add support for optional device tree image (dt.img)
to boot and recovery images. Some devices use kernel device
tree and this adds the device tree image as a section within
the boot/recovery images.
Change-Id: I91431ef2f4b86485895678916e39a8572be878eb
Build: add DT image variable to Makefile
DT image variable is currently present in
generate_extra_images.mk.This file is moved to
build/tasks to support persist image generation
during parallel make. As build/tasks is called
at the end of Makefile, DT image variable is not
available for other images generation like boot and
recovery. Adding this variable in Makefile ensures
the variable is defined before usage
Change-Id: I21f675d8ce648dc1cf1f4f3aede33278300e08c9
CRs-fixed: 548299
Fix case where boot/recovery.img were being built with wrong params.
The boot and recovery images now get built using the same params during ota package
generation as during a normal build.
Change-Id: I93d46e11a4245288f0e87c87a2e4bf45ac5aff69
Fix the extra dt.img compilation issue.
Add support for optional device tree image (dt.img)
for device that doesnt have TARGET_BOOTIMAGE_USE_EXT2
Change-Id: I6e07b3ca6d049a8ebdad7ea304b4f39e7c846151
releasetools: Store and use the dt image file through target files
Target files packages may be used for signing images separate from the
build process. Store the device tree image file in the target files
package so it can be used during the signing process.
Change-Id: Ie8507121fa9c4ba57ecffeab05bd859ae5f5b788
This is a combination of 2 commits.
This is the 1st commit message:
Add BOARD_CUSTOM_BOOTIMG_MK support
Simplified version of the previous implementation. Recovery's ramdisk
is spun off from the main recovery target again to allow overriding
just the image-generation step
[mikeioannina]: Squash cm-13.0 changes and adapt to N
Change-Id: I058d214f0cf2d05b7621b369ef1f8a983c3ac258
This is the commit message #2:
build: Handle custom boot images properly
When a pre-built image should be used, it should be stored in the
target files zip so that it can be used with external signing
processes.
Original-Change-Id: I2661af9ac58af30bb9314b552775046d3abf44e0
Change-Id: I10b3bd0bb33489b8ffb26d16d002f8dd6ff405ad
[aleasto]
Rewritten for R, where the recovery ramdisk is created via
make dependencies, rather than $(call)s
[mainey]
Adapt to new flag INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP
Change-Id: I058d214f0cf2d05b7621b369ef1f8a983c3ac258
Author: Ricardo Cerqueira <cyanogenmod@cerqueira.org>
Date: 2011-04-12 10:57:22 +0100
Allow a device to generically define its own headers
We have a few cases of devices including specific versions of projects
just because of modified headers (msm_mdp.h comes to mind), and I just
had enough of ifdeffing header files for specific cases (the P990 needs
a lot of these).
Now... if a target defines a TARGET_SPECIFIC_HEADER_PATH, any headers in
there will take precedence over the standard ones; for example, on the
p990, I have
TARGET_SPECIFIC_HEADER_PATH := device/lge/p990/include
which makes, for example, the
device/lge/p990/include/hardware_legacy/AudioHardwareInterface.h be
used instead of
hardware/libhardware_legacy/include/hardware_legacy/AudioHardwareInterface.h
whenever a source file uses <hardware_legacy/AudioHardwareInterface.h>
Change-Id: I41b62668b60e3f62a6ebd3738d8d2675103a81e6a
build: fix target header overlay
LOCAL_C_INCLUDES as defined by the makefile should be put AFTER
the overlay includes so the overlay always takes precedence.
Change-Id: I489b2aab6dbacd9122d834f85e07b63ed1271f07
Author: Jan Altensen <info@stricted.net>
Date: 2020-09-10 15:18:49 +0200
soong: add TARGET_SPECIFIC_HEADER_PATH
Change-Id: I582ae8e6e010016b33fd9b020b723e5fc2dc442b
Change-Id: I3c885fe504ce4f646001697119cffd674db9ec49
key passphrases may live in some sort of secure storage, support running
an arbitrary command to retrieve them.
Change-Id: I49862cf60f1b73a2356e0c492e1038beef28a95f
(cherry picked from commit 9caf8603575aecf51761feaeac6db619be76cfd3)
* Before this commit, the generated `dynamic_partitions_op_list` in
FullOTA packages always tries to remove all partitions and recreate
them upon flashing. This makes it impossible to have a system-only
"FullOTA" because vendor partition(s) are always removed.
* This commit detects if a build is vendor-less and disables every
dynamic partition operation except `resize`, in order to keep the
original content around after the flash. The change should not affect
non-dynamic-partition or builds with vendor image included.
Change-Id: I0cded7f3b2958f35103d73d19b7fb5f292f6c17f
Signed-off-by: Jesse Chan <jc@lineageos.org>
* This allows us to remount ext4 partitions read-write
on devices with dynamic partitions.
This reverts the following commits:
Revert "Move BOARD_EXT4_SHARE_DUP_BLOCKS to BoardConfigMainlineCommon.mk"
This reverts commit I0eb035ba6edf44719d5de4f09fd97b5783537597.
Revert "enable BOARD_EXT4_SHARE_DUP_BLOCKS for generic_arm64"
This reverts commit 125b6d6eea.
Change-Id: I3768374d6da59f969ea44c1965f75c934edf3b57
This allows us to skip custom inode count calculation by setting
BOARD_*IMAGE_EXTFS_INODE_COUNT to -1, this will end up letting
mke2fs calculate appropriate inode count on its own.
While build_image only allocates exact number of needed inodes
plus 4% spare with .2% margin, mke2fs will allocate as many
inodes as it thinks is appropriate given the filesystem size.
Change-Id: If03d5edae8378be3b305346176067b01163f6f3d
AOSP wants to show localized menus for rescue party and
format data. To achieve that, they produce at compile time a big
PNG file with rows of localized text. The runtime would then pick
the correct row to draw.
In order to customize our recovery UI we cannot draw pregenerated
text. Avoid generating these files to shrink recovery size.
(Saving 2.3MB on xxhdpi!)
Change-Id: Id38d239254f17eeed5491621865c747a8496ed83
There may be multiple entries in fstab for a mount point. Use the first
value found so the entries are prioritized in order.
Change-Id: Ibd2631413d3e00507d3a0ec84fb91755f1c7993c
Ticket: OPO-326
* If a bootloader assert is not satisfied, print the
versions that are supported by the package as well as the version
on the device.
Change-Id: I958d49281c51bd4e60d596a727bb94cfc4a21909
The foreach loops output a space separated list, not necessarily one
command per line. Separate commands with semicolons. Notably, this
fixes an issue with multiple device directories included in
TARGET_RECOVERY_DEVICE_DIRS.
Change-Id: I5ebdc84ecaaacabaea77b8b752141e2041622480
Squashed with the following commits:
Author: Scott Mertz <scott@cyngn.com>
Date: Thu Feb 26 10:51:44 2015 -0800
Enable ADB by default when ro.adb.secure is not 1
* Property ro.build.type is not part of the default.prop we can't
use this to decide how to apply adb by default within this function
Change-Id: Ib3eb24c655353966d64c7148d7530244b628ce94
Author: LibXZR <i@xzr.moe>
Date: Sat Apr 30 16:29:35 2022 +0800
tools: Let adb secure check depend on "==0" rather than "!=1"
We are using PRODUCT_SYSTEM_DEFAULT_PROPERTIES to set
`ro.adb.secure` property. But unfortunately this flag only
affect system partition, which means in other partitions
e.g. vendor and system_ext `ro.adb.secure` stays empty.
Thus `persist.sys.usb.config=adb` is unconditionally set
in partitions other than system, which lead to adb enabled
by default even on user build.
Change-Id: I1f8b463b3ec645309369f36014bed556e75ed210
Signed-off-by: LibXZR <i@xzr.moe>
Change-Id: I33ae5c6f2787017a62e679aa0c28d4b909d45935
The file was missed when moving recovery resources, but the assertion
path was changed, as a result non-Treble devices failed to build.
Fixes: Ia4045bd67ffb3d899efa8d20dab4c4299b87ee5f
Change-Id: Ib7822a9bd5b1a2ab7e762e9fb35dbb22291a3a76