Commit graph

73414 commits

Author SHA1 Message Date
Jiyong Park
e060580c31 Merge changes from topic "or_return"
* changes:
  Sort exported headers of libutils
  OR_RETURN supports status_t
2022-01-12 07:27:41 +00:00
Treehugger Robot
da0756b575 Merge "healthd: remove hridya@ from OWNERS file" 2022-01-12 02:34:11 +00:00
Jiyong Park
8b196a7336 Sort exported headers of libutils
Bug: N/A
Test: build

Change-Id: I658155371ca32a7e9ba7e82f8e43780c515df77b
2022-01-12 09:23:46 +09:00
Jiyong Park
705abe2d30 OR_RETURN supports status_t
This change provide a specialization of android::base::OkOrFail for
status_t. As a result, a statement whose type is status_t can be used
with OR_RETURN.

The specialization also provides conversion operators to Result<T,
StatusT> where StatusT is a wrapper type for status_t. This allows
OR_RETURN macro to be used in newer functions that returns Result<T,
StatusT>.

Example usage:

\#include <utils/ErrorsMacros.h>

status_t legacy_inner();

status_t legacy_outer() {
  OR_RETURN(legacy_inner());
  return OK;
}

Result<T, StatusT> new_outer() {
  OR_RETURN(legacy_inner()); // the same macro
  return T{...};
}

Bug: 209929099
Test: atest libutils_test
Change-Id: I0def0e84ce3f0c4ff6d508c202bd51902dfc9618
2022-01-12 09:20:27 +09:00
Ken Chen
67b528f521 Merge "Delete legacy library libqtaguid" 2022-01-11 17:30:41 +00:00
Yi-yo Chiang
1eeee3db1a Merge "Remove unused rootdir/avb/*-gsi.avbpubkey modules" 2022-01-11 06:57:25 +00:00
Yi-yo Chiang
c126ad8214 Merge "libfs_avb: Export more utilities to facilitate VTS" 2022-01-11 05:36:25 +00:00
Bowgo Tsai
f452a42db2 Merge "libfs_avb: updating run_tests.sh" 2022-01-11 04:01:39 +00:00
Treehugger Robot
0b5bfdce7d Merge "fastboot: make init_boot.img optional" 2022-01-11 03:54:31 +00:00
Jaegeuk Kim
8b7e76962e Merge "Allow to run fsck.f2fs in first_stage_ramdisk" 2022-01-11 02:30:14 +00:00
Devin Moore
60bd33ffd5 fastboot: make init_boot.img optional
Older devices don't build this image because they don't have a partition
for it.

Bug: N/A
Test: m
Change-Id: I56b58c1bc137ce25e426aa4ec6d2303fa7d77ccc
2022-01-11 02:02:59 +00:00
Treehugger Robot
e0fa2905d0 Merge changes from topic "adb-remount-f2fs"
* changes:
  Mount /mnt/scracth with -o sync,nodiscard
  Run check_fs only /data is mounted
  Don't use FSCK_LOG_FILE used for ext4 only
  Don't try to mount if the disk has no FS magic
  Retry to unmount /data
2022-01-11 00:27:35 +00:00
Pirama Arumuga Nainar
f9a54a86ec Merge "Enable continuous coverage: use '%c' specifier in LLVM_PROFILE_FILE" 2022-01-10 22:36:57 +00:00
Jaegeuk Kim
b783310e71 Allow to run fsck.f2fs in first_stage_ramdisk
[   23.065933][    T1] init: [libfs_mgr]Running /system/bin/fsck.f2fs -a -c 10000 --debug-cache /dev/block/sda8
[   23.067470][    T1] logwrapper: Cannot log to file /dev/fscklogs/log
[   23.067829][    T1] logwrapper:
[   23.068997][  T332] logwrapper: executing /system/bin/fsck.f2fs failed: Permission denied
[   23.069759][    T1] fsck.f2fs: executing /system/bin/fsck.f2fs failed: Permission denied
[   23.071659][  T332] logwrapper:
[   23.083283][    T1] fsck.f2fs: fsck.f2fs terminated by exit(255)
[   23.083283][    T1]
[   23.111166][    T1] F2FS-fs (sda8): Found nat_bits in checkpoint
[   23.121242][    T1] F2FS-fs (sda8): Mounted with checkpoint version = 6a65cb64
[   23.121831][    T1] init: [libfs_mgr]__mount(source=/dev/block/platform/14700000.ufs/by-name/metadata,target=/metadata,type=f2fs)=0: Success

Bug: 210589189
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I720e2aa4b1ab845af96610cd0d9c6e3c9b4cae03
2022-01-10 21:35:21 +00:00
Jaegeuk Kim
bbad87aeee Mount /mnt/scracth with -o sync,nodiscard
"-o discard" issues UNMAP commands to loopback resulting in punch_hole
on the pinned file in /data. That will break the pinned block map.

Bug: 210589189
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: Ia927c43fc75164ce5929173f5740737eac4de484
2022-01-10 21:34:00 +00:00
Jaegeuk Kim
06db803f32 Run check_fs only /data is mounted
After switching to /system from ramdisk, first_stage_init has no required
libraries for check_fs.

[   20.838811][    T1] init: [libfs_mgr]Created logical partition scratch on device /dev/block/dm-6
[   20.972704][    T1] init: [libfs_mgr]Running /system/bin/fsck.f2fs -a -c 10000 --debug-cache /dev/block/dm-6
[   20.977879][  T345] logwrapper: executing /system/bin/fsck.f2fs failed: No such file or directory
[   20.978470][    T1] fsck.f2fs: executing /system/bin/fsck.f2fs failed: No such file or directory
[   20.981137][    T1] fsck.f2fs: fsck.f2fs terminated by exit(255)
[   21.002958][    T1] init: [libfs_mgr]__mount(source=/dev/block/dm-6,target=/mnt/scratch,type=f2fs)=0: Success
[   21.017748][    T1] init: [libfs_mgr]umount(/mnt/scratch)
[   21.021028][    T1] init: [libfs_mgr]Running /system/bin/fsck.f2fs -a -c 10000 --debug-cache /dev/block/dm-6
[   21.028759][  T347] logwrapper: executing /system/bin/fsck.f2fs failed: No such file or directory
[   21.028793][    T1] fsck.f2fs: executing /system/bin/fsck.f2fs failed: No such file or directory
[   21.049100][    T1] fsck.f2fs: fsck.f2fs terminated by exit(255)
[   21.068101][    T1] init: [libfs_mgr]__mount(source=/dev/block/dm-6,target=/mnt/scratch,type=f2fs)=0: Success

Bug: 210589189
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: Ie41cba4e7553860fdb48996d9b58a34093f0b723
2022-01-10 21:33:50 +00:00
Jaegeuk Kim
d595de5139 Don't use FSCK_LOG_FILE used for ext4 only
Bug: 210589189
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: Iaf7a61c6c9c6cd557f953b1a665e7a1640d357ae
2022-01-10 21:31:46 +00:00
Treehugger Robot
afd4ccd70b Merge "Remove win_sdk" 2022-01-10 20:18:16 +00:00
Jaegeuk Kim
9547726f4a Don't try to mount if the disk has no FS magic
This avoids:
[   22.932529][    T1] init: [libfs_mgr]Invalid f2fs superblock on '/dev/block/platform/14700000.ufs/by-name/metadata'
[   22.934609][    T1] F2FS-fs (sda8): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[   22.935061][    T1] F2FS-fs (sda8): Can't find valid F2FS filesystem in 1th superblock
[   22.937306][    T1] F2FS-fs (sda8): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[   22.943700][    T1] F2FS-fs (sda8): Can't find valid F2FS filesystem in 2th superblock
[   22.951937][    T1] init: [libfs_mgr]__mount(source=/dev/block/platform/14700000.ufs/by-name/metadata,target=/metadata,type=f2fs)=-1: Invalid argument

Bug: 210589189
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I27989b25769eae83eb06ac86146f27baf288b7e1
2022-01-10 18:02:03 +00:00
Jaegeuk Kim
bdb981d113 Retry to unmount /data
If we fail to umount /data, device won't boot up at all.

Bug: 208161227
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I92d34a253039eb677d4df9fad8a0821fbc684f57
2022-01-10 09:50:23 -08:00
Yi-Yo Chiang
0c99f93351 Remove unused rootdir/avb/*-gsi.avbpubkey modules
They were moved to test/vts-testcase

Bug: 176869478
Test: presubmit
Change-Id: I4f4f1c50e624125c839161d83e28f051099e6ec0
2022-01-10 14:25:42 +00:00
Yi-Yo Chiang
d543bebbf7 libfs_avb: Export more utilities to facilitate VTS
Change should be no-op, it just export some private methods.

Bug: 211741246
Test: ./run_tests.sh
Test: presubmit
Change-Id: Ia4ac739018f188a0154625ec574fc4bebf7c62ee
2022-01-10 16:36:51 +08:00
Bowgo Tsai
68c97406a2 libfs_avb: updating run_tests.sh
Adding `--host` for host-side test cases with atest, so we
still can run the test when there is no device connected.

Otherwise, TradeFed will emit the follow error:
  TradeFed subprocess exited early with exit code=7(NO_DEVICE_ALLOCATED).

Bug: None
Test: ./system/core/fs_mgr/libfs_avb/run_tests.sh
Change-Id: I0a593e6dc42861c2dc9cfff308cd7fd76b39ef2c
2022-01-10 16:26:58 +08:00
Yi-yo Chiang
28d7b767a9 Merge "Move *-gsi_avbpubkey filegroup to vts directory" 2022-01-10 08:19:43 +00:00
Cole Faust
eea1dadba8 Remove win_sdk
win_sdk is deprecated, if given on the command line
sdk will be build instead.

Bug: 212724080
Test: Presubmits
Change-Id: Ia92b879fe08f0a1d9ebefc90e369adf1d4aa4112
2022-01-07 14:55:54 -08:00
Devin Moore
f56e0dbf33 Merge "fastboot: make copy_boot_avb_footer more generic" 2022-01-07 22:13:19 +00:00
Treehugger Robot
e664e8fb72 Merge "Use insert() with ranges instead of reserve" 2022-01-07 20:25:00 +00:00
Devin Moore
cb5098f547 fastboot: make copy_boot_avb_footer more generic
The funciton is now used for init_boot and boot partitions, so the name
and the error messages should be more generic.

Bug: 203698939
Test: m
Change-Id: I168fdcb08accb11b2c9cfc402168744274f59665
2022-01-07 18:03:33 +00:00
Kelvin Zhang
500ed210e0 Use insert() with ranges instead of reserve
STL implementation of insert() is generally smart enough to reserve
storage before hand. No need to do reserve() followed by for each loop

Test: th
Change-Id: I36e88c121868b97ea525b292a67b36983c530e56
2022-01-07 09:55:38 -08:00
Devin Moore
12e5f038a9 Merge changes Ib5a63a7b,If00f581a
* changes:
  fastboot: copy AVB footer from init_boot.img to end of partition
  fastboot: Support flashing init_boot.img into init_boot partition
2022-01-07 16:24:13 +00:00
Hridya Valsaraju
cecdf78a1f Merge "fastboot: Add elsk@ to OWNERS file" 2022-01-07 13:15:41 +00:00
Yi-Yo Chiang
88e0f4abdb Move *-gsi_avbpubkey filegroup to vts directory
Bug: 176869478
Test: presubmit
Change-Id: I41cf85bb2f3b5270fcb848fc07e9145d26adcc18
2022-01-07 18:27:15 +08:00
Ken Chen
c3904fd372 Delete legacy library libqtaguid
The library has been replaced by BPF solution. No any valid user is
using this.

Bug: N/A
Test: m
Change-Id: If14ff29859b06feb5cd7d4ebed9f83ab146ea9e4
2022-01-07 18:26:25 +08:00
Treehugger Robot
836eed37fb Merge "healthd: remove hridya@ from OWNERS file" 2022-01-07 03:13:44 +00:00
Hridya Valsaraju
dcdb160411 healthd: remove hridya@ from OWNERS file
Test: N/A
Bug: N/A
Change-Id: Iffa783ea22d278c50df0c7a87f7f265c26a5c7c1
2022-01-06 16:56:57 -08:00
David Anderson
856f69bead Merge "libsnapshot: Fix CHECK failure during second phase merge" 2022-01-06 23:54:42 +00:00
Hridya Valsaraju
8fb1aa982b fastboot: Add elsk@ to OWNERS file
Also, remove hridya@ from the OWNERS file

Test: N/A
Bug: N/A
Change-Id: I1d5a03ebf9e2e93f555474a6a654e16879b8e96a
2022-01-06 15:29:17 -08:00
Devin Moore
1af1202fbd fastboot: copy AVB footer from init_boot.img to end of partition
Similar to GKI boot.img, init_boot.img is released as a specific size
and should be able to be flashed into partitions that have different
sizes. So the AVB footer is moved from the end of the init_boot.img to
the end of the partition in the case that the partition is larger than
the image.

Bug: 203698939
Test: m
Change-Id: Ib5a63a7bf1b4be4eba4941972750f12e3edb3a17
2022-01-06 22:33:19 +00:00
Devin Moore
dd1eb8733d fastboot: Support flashing init_boot.img into init_boot partition
init_boot_a and init_boot_b partitions are used in A/B devices.

Bug: 203698939
Test: m

Change-Id: If00f581ab7ae340d78d7d55eebafd92ac15d2bc1
2022-01-06 22:32:28 +00:00
Hridya Valsaraju
b910961c16 Merge "libsync: remove hridya@ from OWNERS file" 2022-01-06 18:49:55 +00:00
David Anderson
dd620ccf24 libsnapshot: Fix CHECK failure during second phase merge
This CHECK prevents a release build from resuming a two-phase merge if
the merge initially failed in the first pass.

Bug: 213031779
Test: vts_libsnapshot_test
Test: update_engine_unittests
Change-Id: I8bf00e3016546ef7039bb0b18eb977cc3dc1066a
2022-01-06 04:32:39 +00:00
Josh Yang
30981724d0 Merge "Create /data/bootanim folder in init.rc." 2022-01-06 03:17:58 +00:00
Hridya Valsaraju
555f96580a healthd: remove hridya@ from OWNERS file
Test: N/A
Bug: N/A
Change-Id: I4a8d87a7c6d9ca288afefbd5c8c9b97d6848af3f
2022-01-05 16:59:20 -08:00
Hridya Valsaraju
9e6842258a libsync: remove hridya@ from OWNERS file
Test: N/A
Bug: N/A
Change-Id: I3f816efad4520507cacc635457d363d65bc7942e
2022-01-05 16:59:03 -08:00
Keith Mok
e3f4b84468 Merge changes I75017420,I3612e131
* changes:
  Fix userspace fastboot with fuzzy test
  Fix fuzzy test on too large command
2022-01-05 23:50:12 +00:00
Keith Mok
ba31ce8655 Merge "Fix typo in fuzzy_fastboot README" 2022-01-05 18:43:16 +00:00
Rafay Kamran
416cda9bc7 Merge changes from topic "revert-1935201-OUHHJQVSHH"
* changes:
  Revert "libsnapshot: Fix checks for compression to work with new..."
  Revert "libsnapshot: Fix libsnapshot_fuzzer_test."
2022-01-05 15:38:53 +00:00
Rafay Kamran
146f07e07b Revert "libsnapshot: Fix checks for compression to work with new..."
Revert submission 1935201

Reason for revert: DroidMonitor: Potential culprit for Bug http://b/213259099 - verifying through Forrest before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.
Reverted Changes:
I219f956ba:libsnapshot: Fix libsnapshot_fuzzer_test.
I281937e26:libsnapshot: Fix checks for compression to work wi...

Change-Id: I88955a533ce7103111509785ed5bb40e1779b130
2022-01-05 14:55:37 +00:00
Rafay Kamran
f140d4d584 Revert "libsnapshot: Fix libsnapshot_fuzzer_test."
Revert submission 1935201

Reason for revert: DroidMonitor: Potential culprit for Bug http://b/213259099 - verifying through Forrest before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.
Reverted Changes:
I219f956ba:libsnapshot: Fix libsnapshot_fuzzer_test.
I281937e26:libsnapshot: Fix checks for compression to work wi...

Change-Id: I33731556761cbdf603424fda94117973d3f21e21
2022-01-05 14:55:29 +00:00
Yi Kong
fe9b4ed7b8 Merge "Enable afdo for libutils" 2022-01-05 06:00:25 +00:00