Commit Graph

29559 Commits

Author SHA1 Message Date
Tom Cherry 53089aa25c init: Use std::string for write_file()
The content parameter of write_file() previously took a char* that was
then converted to a std::string in WriteStringToFd().  One unfortunate
effect of this, is that it is impossible to write data that contains
'\0' within it, as the new string will only contain characters up
until the '\0'.

This changes write_file() to take an std::string, such that
std::string::size() is used to determine the length of the string,
allowing it to contain null characters.

Also change the path parameter of read_file() and write_file() for
consistency.

Lastly, add a test for handling strings with '\0' in them.

Bug: 36726045
Test: Boot bullhead, run unit tests
Change-Id: Idad60e4228ee2de741ab3ab6a4917065b5e63cd8
2017-04-03 16:41:22 -07:00
Christopher Desjardins 7d3e2c4d4e Make ueventd error messages indicate where the error is in ueventd script
Test: Boot bullhead
Test: Observe errors with file and line number with faulty ueventd.rc

Change-Id: Ieae6151e253f1e6437dfdebd14da4e1e04a45fae
2017-04-03 22:20:55 +00:00
Vineeta Srivastava 0bba8acf3f Merge "Add vbmeta image support for verified boot" am: 8bc5c8521a
am: 5e3590e81e

Change-Id: I5902098ef05423e18e06480de4f2b9eee8d70e0f
2017-04-03 20:27:07 +00:00
Vineeta Srivastava 5e3590e81e Merge "Add vbmeta image support for verified boot"
am: 8bc5c8521a

Change-Id: I7de333ee2b7502c0040c2f27f36c8059e188ec03
2017-04-03 20:23:15 +00:00
Josh Gao a5199a9e43 debuggerd_test: add test for process/thread names.
Make sure that we can get the process/thread names for nondumpable
processes with capabilities.

Bug: http://b/36237221
Test: /data/nativetest/debuggerd_test/debuggerd_test32
Change-Id: Iedd4eae18065c2e64abeebff15e3b9b09a630550
2017-04-03 13:18:34 -07:00
Vineeta Srivastava 8bc5c8521a Merge "Add vbmeta image support for verified boot" 2017-04-03 20:13:19 +00:00
Keun-young Park 8aebd47ca5 Merge "add shutdown animation" am: 8aae1b158a
am: e15756a604

Change-Id: I8595e5b6865f5c0f7ef5b43166853370ada8a141
2017-04-03 19:37:33 +00:00
Keun-young Park e15756a604 Merge "add shutdown animation"
am: 8aae1b158a

Change-Id: I1ccd7473d8ed305597fbb98b724dc7748b577d14
2017-04-03 19:34:04 +00:00
Keun-young Park 8aae1b158a Merge "add shutdown animation" 2017-04-03 19:27:34 +00:00
Elliott Hughes e96faa6ecd Merge "Switch to a shell_and_utilities phony module." am: 2aeed10a28
am: 40fa93dbf0

Change-Id: Ib58a38a624151f3e24af8fd4c3d073584d8f03ca
2017-04-03 17:23:04 +00:00
Elliott Hughes 40fa93dbf0 Merge "Switch to a shell_and_utilities phony module."
am: 2aeed10a28

Change-Id: Id1a3cd08ad08793c49d1f8618b87ae9712619196
2017-04-03 17:19:28 +00:00
Elliott Hughes 2aeed10a28 Merge "Switch to a shell_and_utilities phony module." 2017-04-03 17:15:17 +00:00
Elliott Hughes 521d303582 Switch to a shell_and_utilities phony module.
(cherrypick of 8ad0e66e77c795d11e9cd5c7b576eed0da60537e.)

Bug: N/A
Test: builds
Change-Id: I700700abb4de76017a2ff811ceff19ea2ee86eb2
2017-04-03 17:14:26 +00:00
Jeff Sharkey 02a8ac95e1 Merge "Revert "Allocate GID to use reserved disk space."" am: 7c06d2c79a
am: fc2ead70cd

Change-Id: I8dd7395f7b21cc4122a32684d9b641bec33c8deb
2017-04-03 15:23:48 +00:00
Jeff Sharkey fc2ead70cd Merge "Revert "Allocate GID to use reserved disk space.""
am: 7c06d2c79a

Change-Id: Ic9a6a9048ab796833b9a765d4270184efe5ba35b
2017-04-03 15:20:19 +00:00
Treehugger Robot 7c06d2c79a Merge "Revert "Allocate GID to use reserved disk space."" 2017-04-03 15:14:33 +00:00
Mark Salyzyn 292068e1ff Merge "liblog: Speed up and extend the radio log redirect code" am: 54f20c5553
am: 5ca80df1ec

Change-Id: Ia81858f62fd47d8d820bad336db92eecb44f466f
2017-04-03 14:29:08 +00:00
Mark Salyzyn f9785f5c4d Merge changes Ic590c230,Ibd4be82b am: 3c013de8d8
am: 0b743b925e

Change-Id: I33131242a9ec0e00d7fccca9c56818e02b05436e
2017-04-03 14:28:56 +00:00
Mark Salyzyn d599f97ee5 Merge "logd: correctly label identical lines" am: a9b5a5e96a
am: 41e44283d2

Change-Id: Ic047a52853ea1ef9e7b8d9e7c7604b48866ee373
2017-04-03 14:28:45 +00:00
Mark Salyzyn 5ca80df1ec Merge "liblog: Speed up and extend the radio log redirect code"
am: 54f20c5553

Change-Id: Ida2e522c81305b3145d167f7ec11d2953aabd9a0
2017-04-03 14:25:42 +00:00
Mark Salyzyn 0b743b925e Merge changes Ic590c230,Ibd4be82b
am: 3c013de8d8

Change-Id: I1d9e7535106ae09cfb0f2adc547be31ee7a89f4d
2017-04-03 14:25:28 +00:00
Mark Salyzyn 41e44283d2 Merge "logd: correctly label identical lines"
am: a9b5a5e96a

Change-Id: I0cd6ad498e46bbaa2c78ee8ad95b920b309edd90
2017-04-03 14:25:15 +00:00
Mark Salyzyn 54f20c5553 Merge "liblog: Speed up and extend the radio log redirect code" 2017-04-03 14:21:57 +00:00
Mark Salyzyn 3c013de8d8 Merge changes Ic590c230,Ibd4be82b
* changes:
  logd: liblog benchmark check BM_log_overhead regression
  liblog: benchmark add BM_log_event_overhead_42 for a well known tag
2017-04-03 14:21:41 +00:00
Mark Salyzyn a9b5a5e96a Merge "logd: correctly label identical lines" 2017-04-03 14:21:13 +00:00
Jeff Sharkey d185445eee Revert "Allocate GID to use reserved disk space."
This reverts commit 82f8bb785e.

Sadly, we'd have to extend CAP_SYS_RESOURCE to a bunch of execution
domains to make this work, which isn't feasible.

Bug: 36450358
Change-Id: Iffe88e45d538c044382eb0d0ac24ff11a10d73c3
2017-04-03 04:00:36 +00:00
Bowgo Tsai da5a7a585b Merge "fs_mgr: removing fs_mgr_read_fstab_with_dt()" am: 53108b269e
am: 5a5017c07c

Change-Id: I496ed9890a1d5a31a1af05ca1a8400d31976f0a3
2017-04-01 03:11:56 +00:00
Bowgo Tsai 5a5017c07c Merge "fs_mgr: removing fs_mgr_read_fstab_with_dt()"
am: 53108b269e

Change-Id: I32a784c7b68d12d6e4cf9c2c0c4ad13829835541
2017-04-01 03:09:27 +00:00
Treehugger Robot 53108b269e Merge "fs_mgr: removing fs_mgr_read_fstab_with_dt()" 2017-04-01 03:05:25 +00:00
Jeff Sharkey 211093ce82 Merge "Allocate GID to use reserved disk space." am: 145e185ddb
am: 3afe2fc987

Change-Id: Ibce4fc5c1285b302e50d808623de6836b6237c66
2017-04-01 01:39:21 +00:00
Jeff Sharkey 3afe2fc987 Merge "Allocate GID to use reserved disk space."
am: 145e185ddb

Change-Id: I1ee502f8714d9e78aeca5e5ad9a78c15667722c2
2017-04-01 01:36:21 +00:00
Treehugger Robot 145e185ddb Merge "Allocate GID to use reserved disk space." 2017-04-01 01:33:16 +00:00
Dan Shi 2c67dfbc09 Add test config to libcutils_test
This change allows TradeFederation to run the test directly.
Refer to b/35882476 for design and discussion of this change.

Bug: 35882476
Test: local test
tradefed.sh run template/local --template:map test=libcutils_test

Change-Id: Ie083d1641e4ea226cbf7b82c6fd2c115e15b6bf6
2017-03-31 17:12:18 -07:00
Dan Shi 688b6e5e6e Add test config to libappfuse_test
This change allows TradeFederation to run the test directly.
Refer to b/35882476 for design and discussion of this change.

Bug: 35882476
Test: local test
tradefed.sh run template/local --template:map test=libappfuse_test

Change-Id: Ic3a23d9d609036658fd37fc72571e2fc7db0e88d
2017-03-31 17:11:50 -07:00
Keun-young Park 7830d59500 add shutdown animation
- Run shutdown animation during shutdown if surfaceflinger is
  available / running.
- services necessary for animation should be added to animation
  class.
- Keep debugging tools while non-critical services are terminated:
  logd, adbd, tombstoned

bug: 36526187
Test: many reboots

Change-Id: I758f700a622c6005f3df9f29de2b55270055ad4d
2017-03-31 16:48:20 -07:00
Jeff Sharkey 82f8bb785e Allocate GID to use reserved disk space.
Filesystems like ext4 allow the setting of the "resgid" parameter
to designate a GID that is allowed to use the "reserved" disk space
(in addition to UID 0).  We'll be granting this GID to critical
system processes, so that the system is usable enough for the user
to free up disk space used by apps.

Test: builds
Bug: 36450358
Change-Id: I224bd1e597130edb411a1528872faff1ada02a89
2017-03-31 16:39:45 -06:00
Mark Salyzyn ae2abf112c logd: correctly label identical lines
Move lastTid array from local in LogBuffer::flushTo to per-reader
context in LogTimes::mLastTid and pass into LogBuffer::flushTo.

Replace NULL with nullptr in touched files.

Simplify LogTimeEntry::cleanSkip_Locked initialization of skipAhead
to memset, to match mLastTid memset initialization.

Test: gTest liblog-unit-tests, logd-unit-tests & logcat-unit-tests
Test: adb logcat -b all | grep chatty | grep -v identical
Bug: 36488201
Change-Id: I0c3887f220a57f80c0490be4b182657b9563aa3f
2017-03-31 13:56:38 -07:00
James Hawkins ea15338c50 Merge "bootstat: Refactor init/utils/boot_clock into base/chrono_utils." am: bc9cb3885b
am: 904e8e90a5

Change-Id: Idc1fd4e74536e5d905484fec600dd78dc5e976bb
2017-03-31 20:56:32 +00:00
James Hawkins 904e8e90a5 Merge "bootstat: Refactor init/utils/boot_clock into base/chrono_utils."
am: bc9cb3885b

Change-Id: Ib7eb48b8f82dfb7bace9b3228e755f20689b2fa4
2017-03-31 20:54:03 +00:00
James Hawkins bc9cb3885b Merge "bootstat: Refactor init/utils/boot_clock into base/chrono_utils." 2017-03-31 20:47:09 +00:00
Mark Salyzyn 81ab11af67 logd: liblog benchmark check BM_log_overhead regression
Failed to acquire BM_log_print_overhead as it was renamed from
BM_log_overhead in commit 8f2492f582
(liblog: benchmark: Use local LOGGER_NULL frontend')

The test report would not clearly identify which entry was missing, or
unparsed, so unrolled the loop and incorporating the indexes by name
so that gTest failure report offers a much better clue to the problem.

Test: gTest logd-unit-tests --gtest=logd.benchmark
Bug: 36683634
Bug: 27405083
Change-Id: Ic590c230569871651fb716054ecf635385d0f8a2
2017-03-31 13:41:45 -07:00
Mark Salyzyn fe8c96d152 liblog: benchmark add BM_log_event_overhead_42 for a well known tag
Measure the cost of using a known test event log tag from
system/core/logcat/event.logtags:

42    answer (to life the universe etc|3)

Test: liblog_benchmarks BM_log_event_overhead_42
Bug: 36683634
Change-Id: Ibd4be82bebfcedd381c84e8078cf6d05a636aa98
2017-03-31 13:25:36 -07:00
Vineeta Srivastava 20ef986715 Add vbmeta image support for verified boot 2017-03-31 13:22:34 -07:00
Mark Salyzyn 525b34d142 liblog: Speed up and extend the radio log redirect code
This code was supposed to be deprecated in time.  Let's make it more
efficient and add QC_RIL prefix to the list of catches to redirect
from the main logs to the radio logs.

Test: gTest liblog-unit-tests
Change-Id: I38b371b25da472ec77cbde4affeebf2eafcf6155
2017-03-31 13:10:18 -07:00
Tom Cherry 32d30011f5 Merge "Make init builtin command installkey respect property updates" am: cf29755e28
am: e58af94ba8

Change-Id: I701d0e1cd26dc3491e8b01051f5fbb91611a2545
2017-03-31 16:45:06 +00:00
Tom Cherry e58af94ba8 Merge "Make init builtin command installkey respect property updates"
am: cf29755e28

Change-Id: Ifc4ce43769a244d1abf036bd6f4b0af7c6e0075b
2017-03-31 16:43:04 +00:00
Tom Cherry cf29755e28 Merge "Make init builtin command installkey respect property updates" 2017-03-31 16:41:02 +00:00
Bowgo Tsai cecfaff6cd Merge "fs_mgr_avb_ops: stores the by-name prefix of /misc instead of fstab struct" am: 5c4af9698c
am: 474897035d

Change-Id: I3f26e5adc173cfd448bb300c39f5320b967712ae
2017-03-31 04:34:05 +00:00
Bowgo Tsai 474897035d Merge "fs_mgr_avb_ops: stores the by-name prefix of /misc instead of fstab struct"
am: 5c4af9698c

Change-Id: I588ab02220cab9cdea7331c17e1d1c2eccdeaf06
2017-03-31 04:28:38 +00:00
Treehugger Robot 5c4af9698c Merge "fs_mgr_avb_ops: stores the by-name prefix of /misc instead of fstab struct" 2017-03-31 04:10:37 +00:00