summaryrefslogtreecommitdiff
path: root/cppreopts
AgeCommit message (Collapse)Author
2022-07-28Add postinstall entry for erofsKelvin Zhang
In VABC, system partitions are mapped under /dev/block/mapper, therefore add entries for these paths. Test: th, partner verification Bug: 240098665 Change-Id: Ia60346e33409179a81f896019786e23a85741959
2022-04-28Add an fstab entry for erofs postinstallKelvin Zhang
Test: th Bug: 222218770 Change-Id: I387ad9f5d4988da1232c37804269193016edc9c1
2021-06-23Replace writepid with task_profiles command for cgroup migrationSuren Baghdasaryan
writepid command usage to join a cgroup has been deprecated in favor of a more flexible approach using task_profiles. This way cgroup path is not hardcoded and cgroup changes can be easily made. Replace writepid with task_profiles command to migrate between cgroups. Bug: 191283136 Test: build and boot Signed-off-by: Suren Baghdasaryan <surenb@google.com> Change-Id: I031082aaf469e30320f89fd320991318384fc48b
2021-02-19[LSC] Add LOCAL_LICENSE_KINDS to system/extrasBob Badour
Added SPDX-license-identifier-Apache-2.0 to: alloc-stress/Android.bp app-launcher/Android.bp boot_control_copy/Android.bp bootctl/Android.bp boottime_tools/bootanalyze/stressfs/Android.bp boottime_tools/bootio/Android.bp brillo_config/Android.mk checkpoint_gc/Android.bp cppreopts/Android.bp crypto-perf/Android.bp ext4_utils/Android.bp ext4_utils/Android.mk f2fs_utils/Android.bp ioblame/Android.bp ioshark/Android.bp iotop/Android.bp kexec_tools/Android.bp latencytop/Android.bp libfec/Android.bp libfec/test/Android.bp libfscrypt/Android.bp libfscrypt/tests/Android.bp libjsonpb/parse/Android.bp libjsonpb/verify/Android.bp memory_replay/Android.bp memtrack/Android.bp mmap-perf/Android.bp module_ndk_libs/libnativehelper/Android.bp multinetwork/Android.bp pagecache/Android.bp partition_tools/Android.bp partition_tools/aidl/Android.bp perf2cfg/Android.bp postinst/Android.bp preopt2cachename/Android.bp profcollectd/Android.bp profcollectd/libprofcollectd/Android.bp profcollectd/libprofcollectd/bindings/libflags/Android.bp pssbench/Android.mk puncture_fs/Android.bp runconuid/Android.bp sane_schedstat/Android.bp showslab/Android.bp simpleperf/Android.bp simpleperf/runtest/Android.bp simpleperf/scripts/inferno/Android.bp simpleperf/simpleperf_app_runner/Android.bp slideshow/Android.mk sound/Android.bp squashfs_utils/Android.bp su/Android.mk taskstats/Android.bp tests/Android.bp tests/audio/alsa/Android.bp tests/binder/benchmarks/Android.bp tests/bootloader/Android.mk tests/cpueater/Android.bp tests/crypto/Android.bp tests/directiotest/Android.bp tests/ext4/Android.mk tests/framebuffer/Android.bp tests/fstest/Android.bp tests/icachetest/Android.bp tests/iptables/qtaguid/Android.bp tests/kernel.config/Android.mk tests/lib/Android.bp tests/lib/testUtil/Android.bp tests/memeater/Android.mk tests/pagingtest/Android.mk tests/pftest/Android.bp tests/schedtest/Android.bp tests/storage/Android.bp tests/suspend_stress/Android.bp tests/tcp_nuke_addr/Android.bp tests/timetest/Android.bp tests/uevents/Android.bp toolchain-extras/Android.bp vbmeta_tools/Android.bp verity/Android.bp verity/fec/Android.bp zram-perf/Android.bp Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to: cpustats/Android.bp Added SPDX-license-identifier-BSD to: ANRdaemon/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Exempt-From-Owner-Approval: janitorial work Change-Id: Ia559848af903a7b6746d9b12b7de8b83bc57f99d
2021-02-16Revert "[LSC] Add LOCAL_LICENSE_KINDS to system/extras"Bob Badour
This reverts commit 044d055c842a5750359ed71dfe50a6a4bf5f4cc3. Reason for revert: Needs to run as multiple roots. Change-Id: I8e06e7eb19e0f634f52fbd8a1c6662f43e347dd5
2021-02-12[LSC] Add LOCAL_LICENSE_KINDS to system/extrasBob Badour
Added SPDX-license-identifier-Apache-2.0 to: boot_control_copy/Android.bp bootctl/Android.bp boottime_tools/bootanalyze/stressfs/Android.bp boottime_tools/bootio/Android.bp checkpoint_gc/Android.bp cppreopts/Android.bp crypto-perf/Android.bp ext4_utils/Android.bp ext4_utils/Android.mk f2fs_utils/Android.bp ioshark/Android.bp iotop/Android.bp kexec_tools/Android.bp latencytop/Android.bp libfec/Android.bp libfec/test/Android.bp libfscrypt/Android.bp libfscrypt/tests/Android.bp libjsonpb/parse/Android.bp libjsonpb/verify/Android.bp memory_replay/Android.bp memtrack/Android.bp mmap-perf/Android.bp module_ndk_libs/libnativehelper/Android.bp multinetwork/Android.bp pagecache/Android.bp partition_tools/Android.bp perf2cfg/Android.bp postinst/Android.bp preopt2cachename/Android.bp profcollectd/Android.bp profcollectd/libprofcollectd/Android.bp profcollectd/libprofcollectd/bindings/libflags/Android.bp puncture_fs/Android.bp runconuid/Android.bp sane_schedstat/Android.bp showslab/Android.bp simpleperf/Android.bp simpleperf/runtest/Android.bp simpleperf/scripts/inferno/Android.bp simpleperf/simpleperf_app_runner/Android.bp slideshow/Android.mk sound/Android.bp squashfs_utils/Android.bp su/Android.mk taskstats/Android.bp tests/Android.bp tests/audio/alsa/Android.bp tests/binder/benchmarks/Android.bp tests/bootloader/Android.mk tests/cpueater/Android.bp tests/crypto/Android.bp tests/directiotest/Android.bp tests/ext4/Android.mk tests/framebuffer/Android.bp tests/fstest/Android.bp tests/icachetest/Android.bp tests/iptables/qtaguid/Android.bp tests/kernel.config/Android.mk tests/lib/Android.bp tests/lib/testUtil/Android.bp tests/memeater/Android.mk tests/pagingtest/Android.mk tests/pftest/Android.bp tests/schedtest/Android.bp tests/storage/Android.bp tests/suspend_stress/Android.bp tests/tcp_nuke_addr/Android.bp tests/timetest/Android.bp tests/uevents/Android.bp toolchain-extras/Android.bp vbmeta_tools/Android.bp verity/Android.bp verity/fec/Android.bp Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to: cpustats/Android.bp Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD legacy_notice to: Android.bp Added SPDX-license-identifier-BSD to: ANRdaemon/Android.bp Added legacy_notice to: alloc-stress/Android.bp app-launcher/Android.bp brillo_config/Android.mk ioblame/Android.bp partition_tools/aidl/Android.bp pssbench/Android.mk zram-perf/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Exempt-From-Owner-Approval: janitorial work Change-Id: Ie7c022a4d7f828a89d0cda663684a497af37006e
2019-10-03Make cppreopts.sh deal with new layoutAnton Hansson
.odex and .vdex files on system_other are being moved to a subdir with the name of their source partition. Update cppreopts to recognize this and pass the right source path to preopt2cachename. Bug: 141707536 Test: manually verify name of dalvik-cache files post boot Test: dumpsys package [system-package]; verify reason=prebuilt Change-Id: Icb5b5307ad42b7c899e11212843ce4b96b015958
2019-04-16cppreopts: umount_all fstab.postinstallYifan Hong
- Change 'umount /postinstall' to a full umount_all so that postinstall-verity device get destroyed. - No longer set sys.cppreopt=mounted because that incurs even more code. Just duplicate the two procedures. Test: flash, boot, then check `dmctl list devices`, then OTA Fixes: 129988285 Change-Id: Ic0cdf55b3639632dc5f2659c8bf36b8c3deea92d Merged-In: Ic0cdf55b3639632dc5f2659c8bf36b8c3deea92d
2019-04-01Use fsync instead of sync during first bootWei Wang
1) fsync the specific copied file instead of sync whole file system 2) boost prio/ioprio for CFQ since cpppreopt is on critical path 3) change to foreground group Before CL: 03-29 21:49:31.450 1 1 I init : Service 'cppreopts' (pid 1662) exited with status 0 waiting took 55.175999 seconds 03-29 21:49:31.808 1440 1440 I PackageManager: cppreopts took 55591 ms After CL: 04-01 15:47:43.841 1 1 I init : Service 'cppreopts' (pid 1871) exited with status 0 waiting took 2.007000 seconds 04-01 15:47:45.343 1549 1549 I PackageManager: cppreopts took 3709 ms Bug: 129542240 Test: boot Change-Id: Ia9bacabe798764084790b077abc80ae60401f9c1
2019-03-07Allowing product-specific fstab.postinstallBowgo Tsai
To allow mount system_other with different file systems, mount options, or verity settings, we need to put the fstab into /product and keep the /system/etc/fstab.postinstall generic. Device can add the following into device/*/BoardConfig.mk to use the fstab from /product: PRODUCT_PRODUCT_PROPERTIES += \ ro.postinstall.fstab.prefix=/product PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/fstab.postinstall:$(TARGET_COPY_OUT_PRODUCT)/etc/fstab.postinstall In the $(LOCAL_PATH)/fstab.postinstall: /dev/block/by-name/system /postinstall ext4 ro,nosuid,nodev,noexec slotselect_other,avb_keys=/product/etc/avb/system_other.avbpubkey [serial log]: init: Overriding previous 'ro.' property' ro.postinstall.fstab.prefix':'/system' with new value '/product' init: processing action (ro.postinstall.fstab.prefix=/product && sys.cppreopt=requested) from (/system/etc/init/cppreopts.rc:27) init: [libfs_avb]Returning avb_handle for '/postinstall' with status: Success init: [libfs_avb]Built verity table: '1 /dev/block/by-name/system_a /dev/block/by-name/system_a 4096 4096 709501 709501 sha1 71941953c7b61238a1779e55f8dbba2eab6c702a 0b7840796a7be 6ecadffaf6fc2f085400c9a0c78 10 use_fec_from_device /dev/block/by-name/system_a fec_roots 2 fec_blocks 715089 fec_start 715089 restart_on_corruption ignore_zero_blocks ... init: Command 'mount_all /product/etc/fstab.postinstall' action=ro.postinstall.fstab.prefix=/product && sys.cppreopt=requested (/system/etc/init/cppreopts.rc:28) took 109ms and succeeded [logcat log]: cppreopts: Copied file from /postinstall/priv-app/... to /data/dalvik-cache/arm64/... ... 1750 1750 I PackageManager: cppreopts took 21976 ms Bug: 112103720 Test: factory reset and boot device, checks cppreopt logs Change-Id: If826ac45804be085b48a50cab6741960658dc09f
2019-02-25cppreopts: remove DAC capabilitiesJeff Vander Stoep
Define service for cppreopts.sh in order to drop DAC capabilities for for it and its children. Capabilities were already blocked by SELinux so this does not cause a functional change, but rather shifts the blocking mechanism to the DAC capability check which fails less noisily. Otherwise, this change is intended to preserve the previous behavior and uses "exec_start" to presever the blocking behavior of "exec". This prevents an selinux denial which is causing occasional presubmit failures: avc: denied { sys_resource } for comm="preopt2cachenam" capability=24 scontext=u:r:preopt2cachename:s0 tcontext=u:r:preopt2cachename:s0 tclass=capability permissive=0 Bug: 79414024 Test: Boot a phone with the cppreopts feature. Verify no logcat errors and all the files are copied to the location given by preopt2cachename. Change-Id: If630b53d32c3c0414939b1f8db8d486406003567
2019-02-02cppreopts: Move to sh_binaryLuca Stefani
Change-Id: Ie2b1401aa750a1a445daf80b13944a2ca0549c50
2019-01-03Mount fstab.postinstallYifan Hong
Instead of using the 'mount' built-in, do a mount_all /system/etc/fstab.postinstall which mounts system_other to postinstall properly. This works for devices with and without dynamic partitions. - retrofit and non DAP devices mount the physical system_other partition - launch devices mount the logical system_other partition Fixes: 113182233 Test: boot the first time and look at cppreopt results (on retrofit and launch DAP devices) Change-Id: I70aef55235a5b8be34a521774c4e9dc8461b84de
2019-01-02cppreopts: Android.mk -> bpYifan Hong
Test: builds Change-Id: I4143a3c5a88cad289d805b137ec480097c8c60d3
2018-11-13Make preloads_copy.sh a moduleAnton Hansson
Make this new module required by cppreopts.sh. This allows removing the duplicated PRODUCT_COPY_FILES directive for a bunch of devices that import both. Also fix some comments in the script. Bug: 80508492 Test: lunch aosp_blueline-userdebug; m Change-Id: I804fc17c43274683716a8c9bb3360ac624a80882
2018-10-24Add preloads_copy scriptAnton Hansson
Copied from device/google/crosshatch, to serve as the canonical location for this script to be shared between devices. Bug: 80508492 Test: make Change-Id: I567c785af0a690fbbba3df0553922735b96f7390
2018-05-18cppreopts: using /dev/block/by-name/system_{ab} for postinstallBowgo Tsai
/dev/block/bootdevice/by-name/system_{ab} should not be used because there is no requirement of a single boot device. Replace it with /dev/block/by-name/system_{ab}. Bug: 78613232 Test: factory wipe, reboot device to check logcat Change-Id: Ia3a476ef7a4b271eff90f44ef4e04fdbee17052b
2017-08-23Merge "Make cppreopts cleanup if it fails" am: 9711713241Alex Light
am: ac9b39c5ed Change-Id: Iaff3d835bc30e5434d0f075293fdb48060edb3e2
2017-08-23Make cppreopts cleanup if it failsAlex Light
Previously we would simply leave temporary files lying around if we failed to rename them for some reason. This change makes us attempt to clean the temporary files up. Test: Phone boots. Bug: 63995897 Change-Id: Ib876a626904bec090fe4f3bd228335feadb6a7c7
2017-05-05Add art files support to cppreopt copyMathieu Chartier
Preopted art files are now copied to classes.dex. Test: adb shell rm /data/system/packages.xml Test: adb shell rm -rf /data/dalvik-cache Test: adb reboot Test: adb shell ls -l /data/dalvik-cache/*/* | grep Calc Bug: 38033055 Change-Id: Ib7d1c65ff47cdb4ebb1829f6a87a885381aded15
2016-10-21Also move vdex files from system_b.Nicolas Geoffray
Both .odex and .vdex files are needed to avoid doing dexopt at first boot. bug:32224338 bug:29278988 Test: flash pixel device, check no dex2oat of prebuilts is done. Change-Id: Iafaeae64efd4e044590ef23d813aa0e2642c1226
2016-07-27Run preloads_copy.sh as system:systemFyodor Kupolov
Root is not required, and most importantly system_server won't be able delete preloads folder during cleanup. Bug: 30280710 Change-Id: I41890834467cc51b7b4ebd9c2918a47904f0b377
2016-07-26Optional script to copy preloads to data directoryFyodor Kupolov
Bug: 29940807 Change-Id: Iba4deaecb5a4055ad10b92829f37ecd3cf8a5ee0
2016-07-19cppreopts: parallel cppreopts to improve performanceWei Wang
Bug: 30118894 Bug: 30189706 Change-Id: I0ed0c69873313a3bfaf2e1ff217da59b0f8929c1
2016-06-29Copy preopted files from B partition.Alex Light
This translates from the preopted files in the system_other partition into the main dalvik-cache. This also has init scripts to allow this to run. We first copy to a temporary file before renaming them in order to make the copy atomic. Bug: 29278988 Change-Id: I8bf1b2d021998949fd9996a923be7db9691e6a1e