Commit graph

41908 commits

Author SHA1 Message Date
David Anderson
21671eda3e liblp: Refactor the partition table update API.
This change separates the WritePartitionTable function into two separate
functions: FlashPartitionTable and UpdatePartitionTable. This will be
cleaner than having extra unnecessary parameters and makes it clearer
when to call each one.

The motivation for this change is to improve the reliability of
UpdatePartitionTable() and to be able to simulate I/O failures for
testing.

Bug: 79173901
Test: liblp_test gtest
Change-Id: Iee5eb2e99fb76aef0b93a65bf85a89907e7cd9bf
2018-07-11 13:05:09 -07:00
Josh Gao
8cba284079 Merge "adb: work around adbd push bug."
am: 3eb5d77913

Change-Id: Icd6d88c26322c5bc4b18bfb1848b8dce98c4dd91
2018-07-11 12:10:23 -07:00
Treehugger Robot
3eb5d77913 Merge "adb: work around adbd push bug." 2018-07-11 18:37:39 +00:00
Elliott Hughes
cd0f5c33fa Remove unused #include.
Bug: N/A
Test: builds
Change-Id: I792bfdb38672f7a51991c19a9838dd12500036c7
2018-07-11 11:21:36 -07:00
Luis Hector Chavez
81c97bc46f Merge "init.rc: Remount / with MS_REMOUNT|MS_BIND|MS_NODEV"
am: 19ef02ef42

Change-Id: I94c5641308b7b2760bdc4734158011d9cb7146aa
2018-07-11 10:49:41 -07:00
Treehugger Robot
19ef02ef42 Merge "init.rc: Remount / with MS_REMOUNT|MS_BIND|MS_NODEV" 2018-07-11 17:38:13 +00:00
Luis Hector Chavez
d07d0942c6 init.rc: Remount / with MS_REMOUNT|MS_BIND|MS_NODEV
/ should not have any character/block devices, so might as well pass in
the nodev flag.

Bug: 73255020
Test: aosp_sailfish still boots
Test: sailfish:/ # find / -xdev -a \( -type b -o -type c -o -type p -o -type s \)
      sailfish:/ #
Test: rootfs on / type rootfs (rw,seclabel)
      /dev/root on / type ext4 (ro,seclabel,nodevrelatime)

Change-Id: Ia73e04b53a47506892d9d3cb61b471b81bb72dc3
2018-07-11 08:36:00 -07:00
Ryan Prichard
6065c03a5f Merge "adb: fix escape_arg for multiple quotes"
am: bcfc8a2ab0

Change-Id: I6f8ad50434a5891e4da943435b308ae8af7a6d6a
2018-07-11 01:53:02 -07:00
Treehugger Robot
bcfc8a2ab0 Merge "adb: fix escape_arg for multiple quotes" 2018-07-11 08:46:11 +00:00
Ryan Prichard
e4fded2c48 adb: fix escape_arg for multiple quotes
escape_arg reuses the same index for the source (s) and the destination
(result), so it breaks on strings containing more than one quote, e.g:

 * a'b'c    ==> 'a'\''b'c'
 * a'bcde'f ==> 'a'\''b'\'cde'f'

Also make the function more efficient by doing fewer string copies. This
code is based on the android::base::Split code.

Use EXPECT_EQ because the tests can keep going if one fails.

Bug: none
Test: adb_test --gtest_filter=adb_utils.escape_arg
Change-Id: I6ca6e905fa53cc61b9a87276cb7116a5df7e8017
2018-07-10 23:32:09 -07:00
Pawin Vongmasa
7a865669b6 Merge "Fix build breakage on non-linux"
am: 348878391a

Change-Id: I2de8147849bb26aba91976046affd53201dc8f1f
2018-07-10 18:59:32 -07:00
Eric Laurent
fa6255a81e Merge "add event log range for audioserver"
am: 6f5d464fb9

Change-Id: I0bbeb315c87f22770477f557e6f7d2541ef0039f
2018-07-10 18:58:42 -07:00
Treehugger Robot
348878391a Merge "Fix build breakage on non-linux" 2018-07-11 01:43:24 +00:00
Treehugger Robot
6f5d464fb9 Merge "add event log range for audioserver" 2018-07-11 00:48:59 +00:00
Pawin Vongmasa
2b67f0b85b Fix build breakage on non-linux
Bug: 79173901

Test: liblp_test gtest
Change-Id: I846e99f636ed05f97e44d05a617dc17b5f127d2e
2018-07-10 16:46:44 -07:00
Eric Laurent
ab2ced57f1 add event log range for audioserver
Test: make.
Change-Id: I32a198b075a4c07f000ae311188ea61f71a69dab
2018-07-10 14:21:38 -07:00
Josh Gao
0cee7ccc59 adb: work around adbd push bug.
We shipped (well, are about to ship) an adbd that spuriously fails to
create directories upon push. Work around this in the adb client by
running a mkdir on all of the directories we would have otherwise
created.

On devices where we perform the workaround, this coincidentally fixes
a historic bug where we failed to push empty directories.

Bug: http://b/25566053
Bug: http://b/110953234
Test: python test_device.py
Change-Id: I690ec356c206fed4e5ab2c681c5570c8b231e26b
2018-07-10 13:20:40 -07:00
Yabin Cui
329e12fb57 Merge "Add debug system properties to control profiling limits."
am: 1db3789252

Change-Id: I32d3d93bc97aab5a9c21be0f0af5191b581aa32a
2018-07-10 11:11:09 -07:00
Yabin Cui
1db3789252 Merge "Add debug system properties to control profiling limits." 2018-07-10 18:03:54 +00:00
David Anderson
a1e2f225b2 Merge "liblp: Implement support for request queue alignment."
am: 6a288d8128

Change-Id: Ide9cd597c9682b0b835510894c7224a90bbfe82c
2018-07-10 09:25:01 -07:00
Treehugger Robot
6a288d8128 Merge "liblp: Implement support for request queue alignment." 2018-07-10 15:48:17 +00:00
David Anderson
2332afb31f liblp: Implement support for request queue alignment.
Block devices in the Linux kernel have a "minimum I/O request" size. The
minimum size is usually acquired by the block driver and can change
from device to device. When stacking devices (such as with
device-mapper), the kernel goes through great lengths to make sure this
alignment is respected for optimal I/O. In device-mapper's case,
misalignment can lead to kernel warnings and performance issues.

While this is unlikely to matter with a few targets, it could become
problematic on a large number of targets, and so we would prefer to
align all partition extents to the minimum I/O size.

We now support two new properties in the partition table geometry: an
"alignment", which is the minimum I/O size, and an "alignment offset",
which is an offset that when applied to sector 0, causes the sector to
be properly aligned within its parent device (for example, if a
physical partition is misaligned). All partition extents now begin on a
sector that respects this alignment.

One major caveat is that it is difficult for the initial partition table
to have the correct alignment without build system and/or flash tool
support. To accomodate this, all alignment is optional, and the lpmake
tool will support a default alignment of 1MiB as a failsafe.

Bug: 79173901
Test: liblp_test gtest
Change-Id: I5bc41b90aa085f4f30393951af0d2b37c4ac2a72
2018-07-09 18:50:28 -07:00
Josh Gao
3193f97ffd Merge "adbd: fix spurious failure to create dirs when pushing."
am: de1d06ef0c

Change-Id: I145bc0e1cd4a2df8e4a9d3a3cc3c54c32ceb21d0
2018-07-09 17:05:43 -07:00
Treehugger Robot
de1d06ef0c Merge "adbd: fix spurious failure to create dirs when pushing." 2018-07-09 23:47:41 +00:00
Yabin Cui
4f0da7cb82 Add debug system properties to control profiling limits.
When security.perf_harden is disabled through adb, use some debug
system properties to set profiling limits in the kernel, including
cpu percentage, memory, and max sample rate.

Bug: 110706031
Test: boot hikey960 and manually set system properties to make
Test: sure it works.

Change-Id: I44c0adf3a000bb393905233f2a097c97b5fe91ec
2018-07-09 16:03:30 -07:00
Josh Gao
4c0078d67a adbd: fix spurious failure to create dirs when pushing.
When pushing to a path, we first try to ensure the directory path
exists and has the permissions expected by fs_config. Due to a change
that changed the fs_config check from a blacklist to a whitelist, we
started doing this for /data (which doesn't begin with /data/), and the
UID/GID for that path was accidentally being reused for following path
segments that didn't exist, leading to a failed attempt to chown
/data/local/tmp/foo to be owned by system.

Bug: http://b/110953234
Test: python test_device.py
Change-Id: Ie798eec48bcf54aea40f6d90cc03bb2170280ee8
2018-07-09 14:25:51 -07:00
Christopher Ferris
9ef07987dd Merge "Add support for new defines in v4.17.3 headers."
am: 4251739928

Change-Id: Ia1a34502fac438a663ea680c7506fbdc88090106
2018-07-09 12:33:30 -07:00
Christopher Ferris
4251739928 Merge "Add support for new defines in v4.17.3 headers." 2018-07-09 19:23:00 +00:00
David Anderson
3e2ff2d2ed Merge "liblp: Fix incorrect get_block_device_size usage."
am: a04058ea48

Change-Id: I17bca8e10f4d5039b8aaa632989fcb46763e13c6
2018-07-09 10:24:04 -07:00
Treehugger Robot
a04058ea48 Merge "liblp: Fix incorrect get_block_device_size usage." 2018-07-09 17:14:14 +00:00
David Anderson
839a818221 liblp: Fix incorrect get_block_device_size usage.
Bug: 79173901
Test: N/A
Change-Id: I22a3e86153830782453a47e460800f3cb4c26958
2018-07-06 16:01:27 -07:00
Bowgo Tsai
7c4bb66d83 Merge "Add /mnt/product rw mount point for product partitions."
am: 35f2704226

Change-Id: I631decdbb3549d72478279da83ec4a5f99023b24
2018-07-02 19:03:38 -07:00
Treehugger Robot
35f2704226 Merge "Add /mnt/product rw mount point for product partitions." 2018-07-03 00:21:01 +00:00
Mark Salyzyn
0e78b13226 Merge "bootstat: record reboot reason history in persist.sys.boot.reason.history"
am: 70025585ff

Change-Id: Ife1200808d84f198441821f0af9d0b11e22780fa
2018-07-02 13:34:25 -07:00
Treehugger Robot
70025585ff Merge "bootstat: record reboot reason history in persist.sys.boot.reason.history" 2018-07-02 20:28:49 +00:00
Elliott Hughes
4eaa94a6c8 Merge "libbase: assume clang."
am: 8a0b46e1e6

Change-Id: Ia8800478c7435675520c3cfea3ae26d9442796b3
2018-07-02 13:28:24 -07:00
Elliott Hughes
8a0b46e1e6 Merge "libbase: assume clang." 2018-07-02 20:16:40 +00:00
Mark Salyzyn
c858df30a7 Merge "bootstat: kpdpwr actually means reboot,longkey"
am: 50d874b873

Change-Id: Ic8e4655df0d55a8a3a356e3ca72ea3e7680cfdad
2018-07-02 11:14:50 -07:00
Treehugger Robot
50d874b873 Merge "bootstat: kpdpwr actually means reboot,longkey" 2018-07-02 18:03:49 +00:00
Elliott Hughes
98c76496be libbase: assume clang.
Bug: N/A
Test: builds
Change-Id: Ic3d3bee26496025324a3d070e3fcbf6d7b917709
2018-07-02 10:53:22 -07:00
Christopher Ferris
432791e0dc Add support for new defines in v4.17.3 headers.
Test: Builds and unit tests pass.
Change-Id: Ibd5711effb1e599d3239d45124383fe91e0f573d
2018-06-29 16:43:21 -07:00
Mark Salyzyn
fbe32e723b Merge "rootdir: access to pstore denied to bootstat"
am: 8b80960417

Change-Id: I02884961f2b782e57a9dcac028c2bd6ae7b33f48
2018-06-29 15:20:57 -07:00
Treehugger Robot
8b80960417 Merge "rootdir: access to pstore denied to bootstat" 2018-06-29 22:03:20 +00:00
Mark Salyzyn
5c58c9d566 bootstat: record reboot reason history in persist.sys.boot.reason.history
Retain the last four reboot reasons from latest to oldest, adding a
detail of UTC epoch time for each.  Beef up boot_reason_test.sh to
deal with multi-line content.

Test: boot_reason_test.sh
Bug: 110925971
Change-Id: Ie2600434b95a885693f005a363ee38d9eba18ee7
2018-06-29 13:54:07 -07:00
Mark Salyzyn
7ab805ea1d rootdir: access to pstore denied to bootstat
Test: boot_reason_test.sh
Bug: 110925971
Change-Id: Iba7b7325fe8c9ad18a7f8dbda550d6008400693e
2018-06-29 13:10:08 -07:00
Inseob Kim
814299c5a3 Merge "Fix misleading comments"
am: 384a6820cb

Change-Id: Id18dcbdc62738fcbd35a8f493d4fa662c7b2b16b
2018-06-29 09:20:20 -07:00
Treehugger Robot
384a6820cb Merge "Fix misleading comments" 2018-06-29 16:08:46 +00:00
Inseob Kim
ad9f6b12e2 Fix misleading comments
Bug: N/A
Test: N/A
Change-Id: I714a0f523eb803cb619acaddff4f769622cfc8b6
2018-06-29 18:09:55 +09:00
Bowgo Tsai
acc31cee1b Add /mnt/product rw mount point for product partitions.
1. init creates /mnt/product used to mount product-specific rw partitions.
2. If a device tree fstab entry for early mount specifies a mount point
   under /mnt/product e.g. /mnt/product/foo, init will create
   /mnt/product/foo mount point.

Bug: 110808288
Test: change dt fstab entry to mount /mnt/product/foo; mount point is
      created correctly, and partition is mounted in early mount.

Change-Id: I321e314992abe1084fd67a382c205f5c0c92bf3d
2018-06-29 10:36:03 +08:00
Christopher Ferris
26128c09b5 Merge "Refactor the DwarfSection classes."
am: f9b879fd05

Change-Id: I9b8bac71b3e85a7b49fe207a12fac55e0ee76c1c
2018-06-28 19:07:00 -07:00