Commit graph

47952 commits

Author SHA1 Message Date
Justin Yun
5d0ac62995 Rename product_services to system_ext
Update adb, fastboot and mount point

Bug: 134359158
Test: build and check if system_ext.img can be flashed
Change-Id: I6219f72242c5fe42a508008c0b1fd218d74da5b6
2019-07-09 08:56:53 +00:00
Treehugger Robot
c7fe1552d5 Merge "logcat: add 'kernel' to defaults" 2019-07-09 02:09:31 +00:00
Treehugger Robot
747aa9a49b Merge "Fix unsigned type sub overflow issue when isntall DSU" 2019-07-09 01:54:43 +00:00
Treehugger Robot
3d3f24bc22 Merge "init: fix to avoid loading apex *.rc files twice" 2019-07-09 00:37:31 +00:00
Steven Moreland
fe535f5e68 logcat: add 'kernel' to defaults
I'm asked at least once a week or more why a new service isn't starting.
Usually, the reason is that "File ... has incorrect label or no domain
transition from ... to another SELinux domain defined. ..." from init.
Even in permissive mode, this is required.

Bug: 63014404
Test: boot, check logcat
Change-Id: I7244a56fc46f84e9592e1eccf2d23461691965b3
2019-07-08 15:59:25 -07:00
Treehugger Robot
463773b733 Merge "Refactorings to match adb_abb to adb_shell code." 2019-07-08 22:17:42 +00:00
Treehugger Robot
ee148dd9c1 Merge "first_stage_init: add console" 2019-07-08 22:14:52 +00:00
Christopher Ferris
b0c5cd27a1 Merge "Fix error printing code." 2019-07-08 21:46:44 +00:00
Alex Buynytskyy
cc2f124070 Refactorings to match adb_abb to adb_shell code.
Test: Build, flash and boot, use `adb abb` to verify

Change-Id: I30eb6e8a4fd43b1548a9398376c72e2cb31223a4
2019-07-08 18:30:26 +00:00
Steven Moreland
4e6275ddaf Merge "Remove utf32 functions." 2019-07-08 17:02:10 +00:00
Steve Muckle
d75f30a4f0 first_stage_init: add console
Start and wait on a console if androidboot.first_stage_console=1 is
present on the kernel command line. This only works on eng and
userdebug builds.

Change-Id: I978e9390a89509431b399ea58b284736b27eeb1b
2019-07-08 09:33:24 -07:00
Jooyung Han
9c4fa66706 init: fix to avoid loading apex *.rc files twice
Test: adb shell dmesg | grep "init: Parsing file /apex"
 shows a single entry for each APEX'es *rc file

Change-Id: I9006cc3d0cb7bdfe7532279f29d8095b7d16a807
2019-07-05 11:22:18 +09:00
liyong
089941c800 Fix unsigned type sub overflow issue when isntall DSU
writer->size() is block size aligned and could be bigger than remaining_bytes
If remaining_bytes is bigger, set remaining_bytes to 0 to avoid sub overflow error.

Bug: 136727859
Test: Successfully install a DSU
Change-Id: If493b0f206561239caec2ee234f7cfd70bf927a7
2019-07-04 11:29:19 +00:00
Steven Moreland
0e19f3b4cc Remove utf32 functions.
These don't appear to be used by anything.

Bug: N/A
Test: binary inspection + code inspection
Change-Id: I6c12db26c320a66bcf6e28618c6e9f61b40d985e
2019-07-02 18:15:03 -07:00
Tom Cherry
c538656d7d Merge "Add android::base::GetPids() function to return all pids" 2019-07-02 17:04:08 +00:00
David Anderson
e5815ca19a Merge "fastboot: add a wipe-super command." 2019-07-02 00:54:17 +00:00
Tom Cherry
ab80b02493 Merge "Revert "Modularize logd."" 2019-07-01 23:28:29 +00:00
Daniel Norman
e33e1a8242 Merge "Checks each interface in an init_rc file is a known hidl_interface." 2019-07-01 21:15:38 +00:00
Tom Cherry
13b1f34279 Add android::base::GetPids() function to return all pids
We loop over /proc to iterate through pids in a lot of code, so let's
consolidate this into a single function in libbase.

Test: new unit test
Change-Id: I908fab90b603546d0e3e8b8acdc8dadfc3552d62
2019-07-01 13:55:46 -07:00
Tom Cherry
c3c598134f Merge "Revert "logd: validate and fill in socket credentials"" 2019-07-01 17:30:28 +00:00
Sandeep Patil
581f45892c Merge "dmabuf_dump: Change the default view to per-process stats" 2019-07-01 15:36:02 +00:00
Christopher Ferris
d943301990 Fix error printing code.
Test: Induced error and verified the errors print properly in logcat.
Change-Id: Ie0e6e71671a8a3e26b4632f93bb2af089a20e2e0
2019-06-28 18:11:12 -07:00
Tom Cherry
3096818c8e Revert "Modularize logd."
logd isn't meant to be modularized.  The previous user was using a
small subset of LogListener.cpp, which is now copied into their
project.

Test: liblog, logd unit tests

This reverts commit fafea32468.

Change-Id: I05ec764db2d9395f2d5b69a1a610c9c55240ab3a
2019-06-28 14:16:13 -07:00
Tom Cherry
40da03b742 Revert "logd: validate and fill in socket credentials"
We don't want to fake socket credentials if they were not provided by
the kernel.  If there is a bug preventing us from reading the
credentials then it must be solved directly.

Test: logd, liblog unit tests
Test: boot and ensure overflow uid doesn't show up

This reverts commit c4e4823b00.

Change-Id: I683129a8a214637635f163ae25c39bb8a47cd50f
2019-06-28 14:16:00 -07:00
David Anderson
7c84b9fea2 fastboot: add a wipe-super command.
Usage: fastboot wipe-super [super_empty.img]

This command will read the given super_empty.img (using the default one
in ANDROID_PRODUCT_OUT if not specified), and flash by generating a
temporary super.img with no partition data. This command will even work
on retrofit devices.

This command is intended to be used either during device bringup or with
scripts that will manually flash individual dynamic partitions, in place
of using "fastboot flashall".

Bug: 136282057
Test: fastboot wipe-super on retrofit and non-retrofit device
Change-Id: Icab368a63ff36fcce9ac9304eb3966dd38bd78c4
2019-06-28 21:09:03 +00:00
Daniel Norman
3df8dc58b2 Checks each interface in an init_rc file is a known hidl_interface.
Test: Adding a misspelling to an init_rc's interface line and observing
build failure.
Bug: 77646540
Change-Id: I58f66d73f0bd9b4203e8259161843b56ad428d73
2019-06-28 13:31:54 -07:00
Josh Gao
d194013097 Merge "adbd: move jdwp listening logic into ART." 2019-06-28 19:01:38 +00:00
Sandeep Patil
725e0a048b dmabuf_dump: Change the default view to per-process stats
Add '-a' commandline option to show the old complete table that shows
dmabuf x process grid.

Bug: 135668399
Test: dmabuf_dump
Test: dmabuf_dump -h
Test: dmabuf_dump -a
Test: dmabuf_dump -a 123
Test: dmabuf_dump 123 456
Test: dmabuf_dump <pid>

Change-Id: If228c97baa375c515d94baf3b5be674cfcc09919
Signed-off-by: Sandeep Patil <sspatil@google.com>
2019-06-28 14:05:42 +08:00
Janis Danisevskis
e180ec52a2 Merge changes from topic "gatekeeper_maintenance"
* changes:
  Replace legacy trusty gatekeeper HAL with HIDLized version
  Gatekeeperd maintenance
2019-06-28 00:43:10 +00:00
Tom Cherry
c4117afdc9 Merge "init: switch host_init_verifier to getopt()" 2019-06-27 21:09:07 +00:00
Treehugger Robot
99ae1d943b Merge "Make ext4 userdata checkpoints work with metadata encryption" 2019-06-27 17:29:03 +00:00
Tom Cherry
3f1bce870b init: switch host_init_verifier to getopt()
Test: host init verifier works

Change-Id: Ia0fe5994079e6e182a64b14a15fdb36328080168
2019-06-27 10:09:12 -07:00
Tom Cherry
52f617176e Merge "init: clean up host_init_stubs a bit" 2019-06-27 15:55:44 +00:00
Tom Cherry
90381baf2b Merge "init: remove last init.cpp global" 2019-06-27 15:41:01 +00:00
Tom Cherry
21d98807bd Merge changes I9248fbaf,Ifd795776,I201109b5
* changes:
  init: remove console_init_action
  Move actual parsing from Service to ServiceParser
  Split out ServiceList and ServiceParser from service.cpp/.h
2019-06-27 15:40:41 +00:00
Tiger Huang
91913677c3 Merge "dmabuf_dump: Fix aosp_x86-eng builds" 2019-06-27 08:37:08 +00:00
Sandeep Patil
3dc456ee57 dmabuf_dump: Fix aosp_x86-eng builds
Test: lunch aosp_x86-eng; mma -j
Test: lunch aosp_blueline-eng; mma -j
Bug: 136136199

Change-Id: Ie6f90c967b356a55db09acee7b3596661e001166
Signed-off-by: Sandeep Patil <sspatil@google.com>
2019-06-27 01:21:11 -07:00
Christopher Ferris
037d025aa5 Merge "Cache only a small portion of page map data." 2019-06-27 06:46:54 +00:00
Treehugger Robot
bb56ba8b34 Merge "dmabuf_dump: Make output more readable and debug friendly" 2019-06-27 06:21:57 +00:00
Sandeep Patil
6347749ae9 dmabuf_dump: Make output more readable and debug friendly
- Get rid of the PSS number that didn't make sense.
- Fix double counting in per-process size when buffers had file
  descriptors and mmap'ed
- Make the output much more readable
- Print totals where they make sense.
- Dont print per-process fd and map refs separately, total ref count per
  process is sufficient.

Bug: 135668399
Test: dmabuf_dump (on AOSP blueline)

Change-Id: I10dc0a332d49110dd68f0eaa94a326679361deea
Signed-off-by: Sandeep Patil <sspatil@google.com>
2019-06-26 18:50:45 -07:00
Christopher Ferris
a484817fc8 Merge "Increase timeout to avoid flaky tests." 2019-06-27 01:33:57 +00:00
Suren Baghdasaryan
7e473e262d Merge "Fix IsUsable to check for each controller separately" 2019-06-27 00:52:15 +00:00
Tom Cherry
f1a044bac4 init: clean up host_init_stubs a bit
In retrospect, these always should have been header only.  We don't
need setgroups() anymore either, since we have the right symbols now.

Test: build
Change-Id: If6fbf6f8ee288ed261576207d90a7ec5674853f9
2019-06-26 15:38:47 -07:00
Paul Lawrence
323959ea27 Make ext4 userdata checkpoints work with metadata encryption
When both ext4 user data checkpoints and metadata encryption are
enabled, we are creating two stacked dm devices. This had not been
properly thought through or debugged.

Test: Enable metadata encryption on taimen (add
keydirectory=/metadata/vold/metadata_encryption to flags for userdata in
fstab.hardware)
    Unfortunately metadata is not wiped by fastboot -w, so it is
    necessary to rm metadata/vold -rf whenever you wipe data.
    fastboot flashall -w works
    fastboot reboot -w works
    A normal boot works
    Disable checkpoint commits with
    setprop persist.vold.dont_commit_checkpoint 1
    vdc checkpoint startCheckpoint 10
    adb reboot
    wait for device to fully boot then
    adb reboot
    Wait for device to fully boot then
    adb logcat -d | grep Checkpoint shows the rollback in the logs

    This tests encryption on top of checkpoints with commit, encryption
    without checkpoints, and rollback, which seems to be the key cases.

Bug: 135905679
Change-Id: I24387a2943dce28b918c34894f24911b20429be7
2019-06-26 15:09:07 -07:00
Christopher Ferris
afc0ff7fe0 Increase timeout to avoid flaky tests.
Also, print extra information when an error occurs.

Test: Ran unit tests.
Change-Id: I3404549db0ac18a4a82a99b2620556db96376bca
2019-06-26 15:08:51 -07:00
Tom Cherry
172c83f972 init: remove last init.cpp global
By moving it into builtins.cpp..., but that's less bad than it is
now, especially since this is defunct in code targeting Q+.  Remove
the guards that init.h isn't being included by other files too as it's
not useful anymore.

Test: build
Change-Id: Ic564fcff9e8716ec924098b07a8c9d94ca25f960
2019-06-26 14:46:58 -07:00
Tom Cherry
ff88e30126 init: remove console_init_action
There's no fundamental reason to store this aside.  That property can
only be written by init, so it's not likely that we're going to
corrupt it.

Test: boot and use serial console
Change-Id: I9248fbaf959ea913d09add829d4cb509af99d570
2019-06-26 14:20:53 -07:00
Tom Cherry
b1ffb1ded5 Move actual parsing from Service to ServiceParser
This is how this should have been done since the beginning.

Test: build, boot
Change-Id: Ifd795776c71a2e666da7fab90cbb3f356af93d4f
2019-06-26 14:03:16 -07:00
Tom Cherry
2aeb1addee Split out ServiceList and ServiceParser from service.cpp/.h
These always should have been in their own files.

Test: build
Change-Id: I201109b5ee63016e78901bbfd404846d45e1d4e6
2019-06-26 13:45:07 -07:00
Suren Baghdasaryan
25eb1bfadf Fix IsUsable to check for each controller separately
CgroupController::IsUsable is using a global static variable to store the
existence of the controller. That means the first controller existence
check would affect all other controllers. Fix this by making this variable
to be a member of CgroupController class so that each controller can check
for its existence independently of other controllers.

Fixes: aa1d54f0cc ("Remove ACgroupController_getFlags to fix API breakage")
Bug: 136020193
Test: adb shell cat /proc/$pid/task/*/cgroup" prints "cpuset:/top-app"
Test: for new launched activity process
Change-Id: I4741a9126ea494122d5b2b1a0c4d7252bff6025c
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-06-26 11:35:11 -07:00