Commit graph

73391 commits

Author SHA1 Message Date
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
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
28d7b767a9 Merge "Move *-gsi_avbpubkey filegroup to vts directory" 2022-01-10 08:19:43 +00: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
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
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
David Anderson
58e554e7ed Merge "Remove support for AVB 1.0." 2022-01-05 03:57:20 +00:00
David Anderson
a216080a63 Merge changes I219f956b,I281937e2
* changes:
  libsnapshot: Fix libsnapshot_fuzzer_test.
  libsnapshot: Fix checks for compression to work with new snapuserd.
2022-01-05 00:02:06 +00:00
Keith Mok
3724bbcbe9 Fix userspace fastboot with fuzzy test
Add more checking for fastboot to detect malformed
requests.
Such as checking no control characters in the command
send from host.
Make sure the download command length is eight bytes.
And report FAIL if download length is zero.

Test: adb reboot fastboot
      fuzzy_fastboot --gtest_filter=Fuzz.DownloadInvalid1
      fuzzy_fastboot --gtest_filter=Fuzz.DownloadInvalid2
      fuzzy_fastboot --gtest_filter=Fuzz.DownloadInvalid7
      fuzzy_fastboot --gtest_filter=Fuzz.DownloadInvalid8
Bug: 212628476
Change-Id: I750174205377395b5328923fb00462d078f3310d
2022-01-04 19:24:23 +00:00
Keith Mok
921ad28a30 Fix fuzzy test on too large command
Device might return I/O error instead of FAIL message
if command send to device is too large.
Since maximum command size in fastboto protocol is 64 bytes.
The device might only try to read 64 bytes for the bulk transfer,
sending data more than that might result in USB I/O error.

Do proper handler for that in fuzzy_fastboot and reset the USB
if I/O error encounter during the Comman.dTooLarge test

Test: adb reboot fastboot
      fuzzy_fastboot --gtest_filter=Fuzz.CommandTooLarge
      fuzzy_fastboot --gtest_filter=Fuzz.BadCommandTooLarge
Bug: 212628476
Change-Id: I3612e131de02435ee3ed7d18f2b2d20b50ae6c3f
2022-01-04 19:24:05 +00:00
Treehugger Robot
5785297922 Merge "fastboot: Add system_dlkm flashing support" 2022-01-04 00:28:41 +00:00
Keith Mok
66f6e63731 Fix typo in fuzzy_fastboot README
The fuzzy_fastboot does not output error
with invalid command line argument.

Fix typo in README for running with gtest_filter

Bug: 212628476
Test: N/A
Change-Id: I4a67a84807b59db50f063f1b9cf60dc964c1df20
2021-12-30 20:33:05 +00:00
David Anderson
34b726ddbe libsnapshot: Fix libsnapshot_fuzzer_test.
Rather than fix this up to work in all configurations, just
force-disable snapuserd testing for these tests.

This patch also adds a "UseUserspaceSnapshots" helper to IDeviceInfo so
we can simplify some checks in snapshot.cpp.

Bug: 208944665
Test: libsnapshot_fuzzer_test
Change-Id: I219f956ba09b090158d5ac757ef1f1d137d512e0
2021-12-29 22:17:26 -08:00
David Anderson
1637899632 libsnapshot: Fix checks for compression to work with new snapuserd.
Most checks for compression are used as a gate to decide whether dm-user
is enabled. However, dm-user can now be enabled without compression, so
these checks have to be audited and adjusted.

Once the "old" compression path is removed, these checks will become
simpler.

Bug: 208944665
Test: vts_libsnapshot_test -force_config vab
Change-Id: I281937e26427044f1ef2e1164d86d67e4170163a
2021-12-29 22:17:25 -08:00
Ramji Jiyani
b3ddb534c3 fastboot: Add system_dlkm flashing support
Bug: 200082547
Test: TreeHugger
Signed-off-by: Ramji Jiyani <ramjiyani@google.com>
Change-Id: I35e081bbe8674c102324d22d440dcc38493ec25b
2021-12-29 21:00:25 +00:00
Josh Yang
ef76c8103d Create /data/bootanim folder in init.rc.
This folder is used to host bootanim data files.

Bug: 210757252
Test: /data/bootanim is correctly created.
Change-Id: I5019a92df4526865d53797bfd93cd68c3e6d2886
2021-12-23 14:55:40 -08:00
Yi Kong
6ee028f165 Enable afdo for libutils
Enable PGO (profile guided optimisation) for better performance.

Test: presubmit
Bug: 195134194
Change-Id: If9abecd830573946fc52b28afd7599800367aa09
2021-12-23 15:57:40 +08:00
Maciej Żenczykowski
fcf3fefe0b Merge "Move libipchecksum to frameworks/libs/net." 2021-12-17 06:34:42 +00:00
Treehugger Robot
e0461422e1 Merge changes Id0fe51d0,Ie3b3907b
* changes:
  Support building diagnose_usb against musl
  Support building fs_mgr against musl
2021-12-17 01:08:29 +00:00
Jiyong Park
f5caf5b2e1 Merge "android::base::ResultError/Error are template classes" 2021-12-16 23:54:16 +00:00
Jonglin Lee
8aa3bf90c9 Merge changes from topic "revert-1926977-NUIGVFOGKB"
* changes:
  Revert "libsnapshot: Fix checks for compression to work with new..."
  Revert "libsnapshot: Fix libsnapshot_fuzzer_test."
2021-12-16 22:37:25 +00:00
Colin Cross
9f0e6493e5 Support building diagnose_usb against musl
Support building diagnose_usb against musl by reimplementing
group_member, which doesn't exist in musl and isn't used anywhere
else in the tree.

Bug: 190084016
Test: m USE_HOST_MUSL=true host-native
Change-Id: Id0fe51d0bd8677561d0bbdb72d3b1a956127a11c
2021-12-16 14:04:06 -08:00
Jonglin Lee
21feb62ea0 Revert "libsnapshot: Fix checks for compression to work with new..."
Revert submission 1926977

Reason for revert: suspect cause of b/211025818
Reverted Changes:
I215635645:libsnapshot: Fix libsnapshot_fuzzer_test.
I2afd64446:libsnapshot: Fix checks for compression to work wi...

Bug: 211025818
Change-Id: I16741798f6e7409ee98a2cb58d070938811e1697
2021-12-16 21:36:56 +00:00
Jonglin Lee
ca00555865 Revert "libsnapshot: Fix libsnapshot_fuzzer_test."
Revert submission 1926977

Reason for revert: suspect cause of b/211025818
Reverted Changes:
I215635645:libsnapshot: Fix libsnapshot_fuzzer_test.
I2afd64446:libsnapshot: Fix checks for compression to work wi...

Bug: 211025818
Change-Id: Ic8b4b20812b13964a061c93a0193ef93b572a045
2021-12-16 21:36:56 +00:00
Colin Cross
5186681f58 Support building fs_mgr against musl
Support building fs_mgr against musl by including the missing
sys/types.h header.

Bug: 190084016
Test: m USE_HOST_MUSL=true host-native
Change-Id: Ie3b3907b1c60ba550c04e8780f11b7adf09a6471
2021-12-16 12:49:33 -08:00
Wei Wang
a5247158fb Merge "libprocessgroup: fall back to cpuset in get_sched_policy" 2021-12-16 19:38:54 +00:00
Lorenzo Colitti
ee1e35c1df Move libipchecksum to frameworks/libs/net.
Test: m
Change-Id: I7dfaef630a3415c30025e572a8981fadd44ee5e3
2021-12-16 19:38:01 +00:00
David Anderson
f3b02fc2db Merge changes I21563564,I2afd6444
* changes:
  libsnapshot: Fix libsnapshot_fuzzer_test.
  libsnapshot: Fix checks for compression to work with new snapuserd.
2021-12-16 18:35:46 +00:00