Commit Graph

55429 Commits

Author SHA1 Message Date
Tom Cherry 4b4154be30 logcat: remove unused enum and #def
Test: build
Change-Id: Ie43b4eb39c85b2a8edad4a5a73696dc97f43be68
2019-12-09 13:29:39 -08:00
Tom Cherry 401d0013cc Merge "init: add missing O_CLOEXEC"
am: 687b55261c

Change-Id: I439e986ff89e837ce6a0e8c468a8c16d12f933fa
2019-12-09 09:55:39 -08:00
Tom Cherry 687b55261c Merge "init: add missing O_CLOEXEC" 2019-12-09 17:47:21 +00:00
Tom Cherry cbeaca541c init: clarify a comment
We do not need to set up all directories from system.img for the first
stage ramdisk, only those which first stage init mounts on.

Test: n/a
Change-Id: I877c623bac0b6dd2927ebdefa20da929ff98b341
2019-12-09 07:09:32 -08:00
Tom Cherry c99d60cbc7 init: add missing O_CLOEXEC
Test: (hopefully) no more denials at boot
Change-Id: I7c20a9bbf27210e0ee5f1bbe69db36bb47c38892
2019-12-09 06:48:37 -08:00
Tom Cherry 423ce930f6 Merge "Cleanup package_string() and its users"
am: ca7fbd546c

Change-Id: I25902a58a6fb7c3866c19d939647174552d99673
2019-12-09 06:40:21 -08:00
Tom Cherry ca7fbd546c Merge "Cleanup package_string() and its users" 2019-12-09 14:35:41 +00:00
Oli Lan 4370ff58ae Create directory for snapshots of DE_sys apex data.
This creates the /data/misc/apexrollback directory which will
hold snapshots of DE_sys apex data directories (i.e. it will
hold backups of data from /data/misc/apexdata for particular
apexes).

See go/apex-data-directories for details.

Bug: 141148175
Test: Built and flashed, checked directory was created.
Change-Id: If45377a9b29cc1f52dd08ea1339829e3bb3032e9
2019-12-09 11:12:53 +00:00
Oli Lan 13e51e7f0b Create DE_sys APEX data directories.
This creates the directory /data/misc/apexdata, at the same time as other
directories under /data/misc. Then, when apexd has finished activating
APEXes, a directory is created under /data/misc/apexdata for every
APEX, with the same name as the APEX module name.

See go/apex-data-directories.

APEXes are discovered by scanning the /apex directory. It may be better
to delegate this process to a library, but it is proposed to defer that
change to a future CL.

Bug: 141148175
Test: Built and flashed, checked directories were created.
Change-Id: I639d6f490ae0b97f116ce38ff3ac348bd73aa20e
2019-12-09 11:10:42 +00:00
Kiyoung Kim 99df54be93 Move linker config under /linkerconfig
Currently linker config locates under /dev, but this makes some problem
in case of using two system partitions with chroot. To match system
image and configuration, linker config better stays under /linkerconfig

Bug: 144966380
Test: m -j passed && tested from cuttelfish
Change-Id: Iaae5af65721eee8106311c1efb4760a9db13564a
2019-12-09 19:45:11 +09:00
Bowgo Tsai acaa95dc44 Allowing the fs_mgr flag of avb_keys to be a dir
Hard coding multiple keys in the avb_keys flag isn't flexible and
causes some pains when upgrading an Android codebase.
e.g., from Android 10 to Android 11.

This CL supports specifying a directory for the avb_keys
for fs_mgr to list then use the avb keys under the directory.

Bug: 144399552
Test: config a fstab using avb_keys as a dir to boot
Test: atest libfs_avb_test
Test: atest libfs_avb_internal_test
Change-Id: Ie74845d8c8e4aa45e8a9e3b862424cec641f8090
2019-12-09 14:29:52 +08:00
Elliott Hughes 3af236c693 Be more careful about symlinking a file that actually exists on the host.
Avoids this error on later runs:

  ln: cannot create symbolic link from '/sys/kernel/debug' to 'out/target/product/walleye/root/d/debug': Permission denied

Bug: http://b/145148158
Test: touch * ; mm -j32 -k
Change-Id: I0c1c0c6e7666c0bc3373687d8c1c7bdf0847913f
2019-12-06 17:43:23 -08:00
Yifan Hong 0daaa72b0f libsnapshot: add library for test helpers
Add libsnapshot_test_helpers for update engine tests
to properly set up depended modules.

Test: update_engine_unittests
Test: libsnapshot_test
Change-Id: Idd90a74cd6fb489f6ae14f44493b2288205c4a94
2019-12-06 17:42:40 -08:00
Nikita Ioffe 6d4f59eccb Merge "libdm: add an api to unwind dm stack"
am: 1fd9c55689

Change-Id: I0f87ade0c4d09c505c1f6197d702003bcf7e50ee
2019-12-06 15:54:14 -08:00
Nikita Ioffe 1fd9c55689 Merge "libdm: add an api to unwind dm stack" 2019-12-06 23:44:11 +00:00
Josh Gao 3360201a57 Merge "base: steal Chromium's NoDestructor."
am: 9e6ac64871

Change-Id: Ib2dff83e1873e829eedf7487481ec0ffcecb6568
2019-12-06 15:09:34 -08:00
Josh Gao 9e6ac64871 Merge "base: steal Chromium's NoDestructor." 2019-12-06 23:03:39 +00:00
Tom Cherry bbfa69f0d8 Merge "Make android_logger_set_prune_list() sane"
am: d1ac612879

Change-Id: I2531b963788321ddb4f69f250f12d62eb76a7c54
2019-12-06 14:47:16 -08:00
Tom Cherry d1ac612879 Merge "Make android_logger_set_prune_list() sane" 2019-12-06 22:39:58 +00:00
Nikita Ioffe 9fb63038f7 libdm: add an api to unwind dm stack
This API is an attempt to consolidate dm-stack unwinding logic
re-implemented in several different places (libfsmgr, libfstab,
libfiemap, etc.).

Test: libdm_test
Bug: 135984674
Change-Id: I9672d4c1e882824ef980667818d4c3aabcb82e1f
2019-12-06 22:10:45 +00:00
Tom Cherry b60599dff2 Merge "init: fsync() persistent properties directory after rename()"
am: 1022f0de11

Change-Id: I9ee05b5bd0fe6619a77baf1315cebbb517f144cb
2019-12-06 14:08:00 -08:00
Jaegeuk Kim 0fe0ae2e2c Merge "rootdir: init.rc to limit discard size to 128MB"
am: 7bf14bb932

Change-Id: I214c5845367bc2719782535e67520b3021d36a9d
2019-12-06 14:07:01 -08:00
Tom Cherry 1022f0de11 Merge "init: fsync() persistent properties directory after rename()" 2019-12-06 22:01:29 +00:00
Jaegeuk Kim 7bf14bb932 Merge "rootdir: init.rc to limit discard size to 128MB" 2019-12-06 21:59:19 +00:00
Tom Cherry e17b4f62df Cleanup package_string() and its users
package_string() isn't readable in its current form and a loop is
unnecessary, so let's replace that with the direct calculations.  The
new and old functions are identical in results except an edge case
where the old function incorrectly believes it needs to round up to
'10' for the size prefix, when '9' would be ok, specifically:
10\naaaaa\n\f vs 9\naaaaa\n\f.  This is true for all powers of 10.

Clean up the calling side in logcat as well.

Test: printing log statistics and prune list works
Change-Id: Ib62ab2badab59040215b130ec9e3efbc7c95af3f
2019-12-06 13:55:08 -08:00
Josh Gao efc9a63bde base: steal Chromium's NoDestructor.
Pillage from Chromium a wrapper type that skips destruction of its
wrapped type, to avoid problems with premature destruction of
variables with static lifetime.

Test: libbase_test on host
Change-Id: I7d4541f7b59f467b232d5c4f8250dc1ea45e28fa
2019-12-06 13:23:05 -08:00
Tom Cherry 7f7264bce8 Merge "logcat: more error printing clean-up"
am: 238eae1738

Change-Id: I1f4da8d1cb4c9ec9fd86aa487ac5d8a8bf27aa07
2019-12-06 12:02:18 -08:00
Tom Cherry 238eae1738 Merge "logcat: more error printing clean-up" 2019-12-06 19:56:55 +00:00
Tom Cherry ed860ff4bf Make android_logger_set_prune_list() sane
The current version requires callers to supply a string with 32 extra
bytes for liblog to internally prepend "setPruneList ", and to have
enough space to parse logd's return string.  That is an unacceptable
requirement on callers.

This change removes that requirement by having liblog allocate the
needed std::string in any case.

It also stops writing back the 'success' or 'Invalid' string to the
caller's buffer, since that is redundant as well.

Test: changing prune settings works.
Change-Id: Ic0f03a229f0b9a77d03adcb91288370c3bd42903
2019-12-06 11:23:58 -08:00
Tom Cherry 97437a7aae init: fsync() persistent properties directory after rename()
See the inline comment on why this is necessary.

Test: persistent properties work without errors
Change-Id: I820a193fb032a1845791a55a76390d396678f151
2019-12-06 11:16:50 -08:00
Tom Cherry 72a4e08864 logcat: more error printing clean-up
* The --help text is way too long to print after each error, so simply
  print the errors and exit.
* Report errno in a few cases where it was previously not reported
* Fix more punctuation
* Fix '?' and ':' getopt_long() return cases for long options.

Test: errors look better
Change-Id: I57058a2250e9f3c3431f104e43f0eb5ec60d8c8a
2019-12-06 10:27:07 -08:00
Tom Cherry 38a53d25e0 Merge "logcat: clean up handling of logd control commands with -f and -L"
am: 1dd1056f5d

Change-Id: I4b5e3c09127423603f9c16f8705bd370b0788bfd
2019-12-06 08:23:49 -08:00
Tom Cherry 1dd1056f5d Merge "logcat: clean up handling of logd control commands with -f and -L" 2019-12-06 16:16:13 +00:00
Anton Hansson 9a66404045 Merge "Run the derive_sdk service"
am: 38ad736944

Change-Id: I724f18f4712beb556f9db81f82dfc11c5e271d7d
2019-12-06 05:34:39 -08:00
Anton Hansson 38ad736944 Merge "Run the derive_sdk service" 2019-12-06 13:28:21 +00:00
Josh Gao b00f9e088e Merge "unwindstack: fix dangling pointer in LocalUpdatableMaps."
am: 6e0a0dad52

Change-Id: Ia4a79c5b1120175b3176edb750722c5743bc1f05
2019-12-05 19:23:45 -08:00
Treehugger Robot 6e0a0dad52 Merge "unwindstack: fix dangling pointer in LocalUpdatableMaps." 2019-12-06 03:16:07 +00:00
Nikita Ioffe 29f1311635 Merge "Remove service defined in an APEX during userspace reboot"
am: abd504611b

Change-Id: I8978296b42e6a809543fd92fc08a853ec910c084
2019-12-05 18:47:58 -08:00
Nikita Ioffe 4c68fef444 Merge "libdm: add an overload of DeleteDevice accepting a timeout_ms"
am: dde59c32ac

Change-Id: I8bc733abd74b7587cfcddbac8e20156b41822b99
2019-12-05 18:47:08 -08:00
Nikita Ioffe abd504611b Merge "Remove service defined in an APEX during userspace reboot" 2019-12-06 02:35:41 +00:00
Nikita Ioffe dde59c32ac Merge "libdm: add an overload of DeleteDevice accepting a timeout_ms" 2019-12-06 02:35:23 +00:00
Jaegeuk Kim fe9e8a3fa5 rootdir: init.rc to limit discard size to 128MB
In any case, UFS storage suffers from long discard latency.

Change-Id: Iaa8ef6eb862934af43254bd10873a12c3d34e926
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2019-12-05 15:58:18 -08:00
Tom Cherry c30a3eede5 logcat: clean up handling of logd control commands with -f and -L
* Print an error if -c is provided with -f and -L since it is ambiguous
* Move the clear operation when -f is provided to a stand alone
  location, since there is no need to loop
* Prevent -g/-G, -S, and -p/-P with -f, since that combination doesn't
  make sense

Test: logpersist works
Change-Id: I6d8709bd61c898c47835470e99b0acff8c2692e4
2019-12-05 13:39:34 -08:00
Yifan Hong 421715c72a Merge changes from topic "libsnapshot_write_atomic"
am: ab0b17c081

Change-Id: I6f57f188d9e0c7f746cd0c2001bfac8d0288045b
2019-12-05 12:22:41 -08:00
Yifan Hong ab0b17c081 Merge changes from topic "libsnapshot_write_atomic"
* changes:
  libsnapshot: write files atomically
  libsnapshot: lock on /metadata/ota
2019-12-05 20:13:21 +00:00
Tom Cherry 9a07a07e1a Merge "liblog: accept log messages with hdr_size greater than known headers"
am: d596ed66aa

Change-Id: I1b5b7b737f7c0dec9394fc6bd83f3fa2bd1b22f5
2019-12-05 09:57:40 -08:00
Tom Cherry d596ed66aa Merge "liblog: accept log messages with hdr_size greater than known headers" 2019-12-05 17:54:54 +00:00
Nikita Ioffe 091c4d1439 Remove service defined in an APEX during userspace reboot
Such services will be re-parsed and added back to the service list
during post-fs-data stage.

Test: adb reboot userspace
Test: atest CtsInitTestCases
Bug: 145669993
Bug: 135984674
Change-Id: Ibb393dfe0f101c4ebe37bc763733fd5d981d3691
2019-12-05 17:51:43 +00:00
Tom Cherry 77fb48d990 Merge "init: Replace property_set() with android::base::SetProperty()"
am: 759240289b

Change-Id: I1117a815bd30550a3d245bacbab23436e609280b
2019-12-05 09:28:39 -08:00
Tom Cherry 759240289b Merge "init: Replace property_set() with android::base::SetProperty()" 2019-12-05 17:26:30 +00:00