Commit graph

26325 commits

Author SHA1 Message Date
Daichi Hirono
c0a79ff4cf Merge "Use FUSE_COMPAT_22_INIT_OUT_SIZE always if available."
am: c884f80755

Change-Id: I6faf8eb8c92f3eced1493eba0d3fe61834914c97
2016-11-16 04:09:53 +00:00
Treehugger Robot
c884f80755 Merge "Use FUSE_COMPAT_22_INIT_OUT_SIZE always if available." 2016-11-16 03:57:46 +00:00
Ting-Yuan Huang
1700a162d5 Merge "init: fix memory leaks"
am: a73ba879b1

Change-Id: I3375372ddc23b7440edab0107ff1cbe34d550865
2016-11-16 03:32:40 +00:00
Treehugger Robot
a73ba879b1 Merge "init: fix memory leaks" 2016-11-16 03:25:34 +00:00
Ting-Yuan Huang
32bf66a168 Merge "toolbox: fix memory leak"
am: e3bd4a2fec

Change-Id: I1c3d0e7308acf2af333b9a41a73b2a4120a3cc0b
2016-11-16 03:17:20 +00:00
Treehugger Robot
e3bd4a2fec Merge "toolbox: fix memory leak" 2016-11-16 03:10:38 +00:00
Daichi Hirono
16d0b426a3 Use FUSE_COMPAT_22_INIT_OUT_SIZE always as the resopnse size of FUSE_INIT.
We return the minor version number 15 to FUSE_INIT since we don't handle
BATCH_FORGET. Thus the kernel does not accept the latest size of
fuse_init_out. Instead we need to use FUSE_COMPAT_22_INIT_OUT_SIZE.

Previously the code unintentionally used FUSE_COMPAT_22_INIT_OUT_SIZE always
because we override the minor version out->minor to 15. Because sdcard.c shares
the buffer for |in| and |out|, it overrides the version number of in->minnor as
well.

The if closure in the previous code "if (in->minor <= 22)" was always true. The
CL removes the if closure to explicitly use FUSE_COMPAT_22_INIT_OUT_SIZE always.

Bug: 32779923
Test: Manually boot Android and check if the storage shows up in Settings app.
Change-Id: Ibbc50da7fb82be148acfc5f1a3d46fefbe211f9d
2016-11-16 01:58:28 +00:00
Daichi Hirono
471ad6a59d Use FUSE_COMPAT_22_INIT_OUT_SIZE always if available.
We return the minor version number 15 to FUSE_INIT since we don't handle
BATCH_FORGET. Thus the kernel does not accept the latest size of
fuse_init_out. Instead we need to use FUSE_COMPAT_22_INIT_OUT_SIZE.

Bug: 32779923
Test: libappfuse_test

Change-Id: I5c979d0e45344ca8adfe3ad3f4a9561442abcb3a
2016-11-16 01:56:00 +00:00
Ting-Yuan Huang
09bd41d097 init: fix memory leaks
It's possible that node is not freed before return.

Test: make WITH_TIDY=1 mmma system/core/init

Change-Id: I648eea9dda006d2b2239e169785190817ad31352
2016-11-15 16:55:50 -08:00
Ting-Yuan Huang
58da81d987 toolbox: fix memory leak
free img

Test: make WITH_TIDY=1 mmma system/core/toolbox
Change-Id: I2f8feff0eddca763ee4e7fc9867480af60c8a911
2016-11-15 16:27:03 -08:00
Mark Salyzyn
4a9419f627 Merge "liblog: logprint: report truncated event log contents if error"
am: 9258348219

Change-Id: I8b49452b92a65f5cf1cf92ec1d3b776d954243a6
2016-11-16 00:26:00 +00:00
Mark Salyzyn
9258348219 Merge "liblog: logprint: report truncated event log contents if error" 2016-11-16 00:18:02 +00:00
Mark Salyzyn
1a57ae3a7d liblog: logprint: report truncated event log contents if error
We need to accept that a log tag can contain no payload.  For those
that are corrupted, and to aid debugging, report what we did manage
to interpret.  Report last character as a ! for corruption, and ^
for truncation.  Fix a few Android Coding standard issues.

Test: gTest logcat-unit-tests
Bug: 32903864
Change-Id: Id11bef3a7b6569305c51701dd66c45d2038d6628
2016-11-15 14:46:34 -08:00
Damien Bargiacchi
329c60458b Update to new minui text API
Change-Id: Ic753564a397b90a9ba54660c78bec9c1a1ef583d
(cherry picked from commit 0ee524de68)
2016-11-15 14:25:44 -08:00
Tao Bao
af2a8858c4 Merge "ziparchive: Allow ExtractEntryToFile() to work with block device."
am: 787482ecd9

Change-Id: Icdce4207cb64e084e200b6f7f8ae194831d5c4f0
2016-11-15 22:11:21 +00:00
Tao Bao
787482ecd9 Merge "ziparchive: Allow ExtractEntryToFile() to work with block device." 2016-11-15 22:00:47 +00:00
Tao Bao
a456c21348 ziparchive: Allow ExtractEntryToFile() to work with block device.
FileWriter::Create() calls ftruncate(2) to truncate the destination
file, which doesn't work with FD that references a block device. It
leads to kIoError when calling ExtractEntryToFile() to extract an entry
to block device FD.

As a result, it fails the package_extract_file() command in OTA updates
(e.g. 'package_extract_file("boot.img",
"/dev/block/platform/soc.0/f9824900.sdhci/by-name/boot")').

This CL skips the call to ftruncate(2) if FD references a block device.

Bug: 32903624
Test: ziparchive-tests works.
Test: Build an OTA updater (m updater) and call package_extract_file().

Change-Id: Ia81116f1a8d7cab802396bdc32c6096b4cb56a3c
2016-11-15 10:19:04 -08:00
Elliott Hughes
3ee9807554 Merge "Switch fastboot/init/libprocessgroup to std::this_thread::sleep_for."
am: f3e731b3c5

Change-Id: I2028bb8835c5e55e1bf8c88c3395253ded9d66d3
2016-11-15 18:09:46 +00:00
Elliott Hughes
f3e731b3c5 Merge "Switch fastboot/init/libprocessgroup to std::this_thread::sleep_for." 2016-11-15 18:02:30 +00:00
Wei Wang
4286801ccb Merge "init: fix BuildTriggersString for empty string"
am: 9b1d5e15ef

Change-Id: Ia344bac744e767ab26d7811ceb2806cce5f28a60
2016-11-15 17:32:13 +00:00
Treehugger Robot
9b1d5e15ef Merge "init: fix BuildTriggersString for empty string" 2016-11-15 17:23:56 +00:00
Nick Desaulniers
ea516950fb Merge "Revert "init: warn slow action""
am: 431c489568

Change-Id: I570911d0940fa6819de6f07e0d88cfadbfb6bdd1
2016-11-15 07:05:12 +00:00
Treehugger Robot
431c489568 Merge "Revert "init: warn slow action"" 2016-11-15 06:58:53 +00:00
Daichi Hirono
83e2cfdf52 Merge "Add static assert to check if FuseBuffer is standard layout union."
am: a0967504f9

Change-Id: Id2ba10a4a905b5c6c96f64f689b951e8798ecb64
2016-11-15 05:56:38 +00:00
Treehugger Robot
a0967504f9 Merge "Add static assert to check if FuseBuffer is standard layout union." 2016-11-15 05:43:15 +00:00
Wei Wang
69b9b36c11 init: fix BuildTriggersString for empty string
behavior is undefined if pop_back() on empty std::string

Test: grep init log
Bug: 32712851
Bug: 32838381
Change-Id: I5bfac2fb275036abd0158b78df14019d2e82716d
2016-11-14 20:20:48 -08:00
Daichi Hirono
1eda78472a Merge "Add FuseAppLoop to libappfuse."
am: e1d24f8465

Change-Id: Ic15e0ca892a1432fa82cfd80737cbf95a976fab4
2016-11-15 02:51:04 +00:00
Treehugger Robot
e1d24f8465 Merge "Add FuseAppLoop to libappfuse." 2016-11-15 02:35:42 +00:00
Josh Gao
771d6ea526 Merge "libprocinfo: introduce."
am: f4cdb6aeaf

Change-Id: I7d8cd121342037e86dc5404a72a7c0a2ce88641a
2016-11-15 01:44:26 +00:00
Josh Gao
f4cdb6aeaf Merge "libprocinfo: introduce." 2016-11-15 01:39:04 +00:00
Daichi Hirono
0d97be4d7d Add static assert to check if FuseBuffer is standard layout union.
Bug: 32260320
Test: libappfuse_test
Change-Id: I6430c11fdeb2405996410c97044b4260c25209b8
2016-11-15 10:18:37 +09:00
Elliott Hughes
290a228fdc Switch fastboot/init/libprocessgroup to std::this_thread::sleep_for.
Bug: http://b/32878766
Test: boots
Change-Id: Ie0ddfb7e60f2da5f6eefbb10c83a92e88c137ae3
2016-11-14 17:08:47 -08:00
Nick Desaulniers
1802d11cc7 Revert "init: warn slow action"
This reverts commit b1a309ac1f.

Bug: 32712851
Bug: 32838381
Change-Id: Ib4c47de5ea5b0bad765a43cbff9f73d9978729d4
2016-11-15 00:53:00 +00:00
Daichi Hirono
a0aecda12b Add FuseAppLoop to libappfuse.
The class is used at the app side (StorageManager) to parse FUSE
commands.

Bug: 32260320
Test: libappfuse_test
Change-Id: I1ae2904d3290a041f1efbf8fc10ba032eda5449c
2016-11-15 09:47:31 +09:00
Elliott Hughes
85599ef5de Merge "Switch ueventd to sendfile(2)."
am: f77d8b0452

Change-Id: Iaf6d923bdf6f19e6c23fa6c4a80817fca59e6813
2016-11-14 21:48:38 +00:00
Josh Gao
911d729c8a libprocinfo: introduce.
Add a new library for parsing /proc files. Start with helpers for
parsing /proc/<pid>/status and /proc/<pid>/task.

Bug: http://b/30705528
Test: libprocinfo_test32/64 on host/bullhead
Change-Id: I5757514c0aede8a9d75834b55aae42a5cf762b95
2016-11-14 13:42:18 -08:00
Elliott Hughes
f77d8b0452 Merge "Switch ueventd to sendfile(2)." 2016-11-14 21:39:25 +00:00
Elliott Hughes
eefaa1f250 Merge "init start time tracking."
am: 601bf9e7c9

Change-Id: Idd707d4694a4339e26884fe72b8f0c08c4100daf
2016-11-14 21:34:24 +00:00
Elliott Hughes
601bf9e7c9 Merge "init start time tracking." 2016-11-14 21:21:00 +00:00
Christopher Ferris
430f61fd83 Merge "Revert "Use process_vm_readv to read memory.""
am: f96e7446fd

Change-Id: Ib0a7f77fa7e3ed9ab2653e87e274d1a3eb032ab7
2016-11-14 20:27:33 +00:00
Christopher Ferris
f96e7446fd Merge "Revert "Use process_vm_readv to read memory."" 2016-11-14 20:14:18 +00:00
Elliott Hughes
632e99a0d4 Switch ueventd to sendfile(2).
Bug: http://b/32826495
Test: booted and checked dmesg
Change-Id: Idfd813dfe6f512fdbc05b1411c7960e950e2f59b
2016-11-14 11:40:06 -08:00
Keun-young Park
ec2d5d8f04 Merge "fix swapped min / max in priority parsing"
am: 557359863c

Change-Id: Ie8bbb5add66b56ff8641f26a081fe185204b7cc1
2016-11-13 04:52:29 +00:00
Treehugger Robot
557359863c Merge "fix swapped min / max in priority parsing" 2016-11-13 04:44:43 +00:00
Elliott Hughes
9605a945f7 init start time tracking.
With this change, init sets a property "init.start" to show the
CLOCK_BOOTTIME time at which init itself started, and for each service
an "init.svc.<name>.start" property to show the CLOCK_BOOTTIME time at
which that service was most recently started.

These times can be used by tools like bootstat to track boot time.

As part of this change, move init over to std::chrono. Also, rather than
make the command-line argument handling more complex, I've switched to
using an environment variable for communication between first- and
second-stage init, and added another environment variable to pass the
start time of the first stage through to the second stage.

Bug: http://b/32780225
Test: manual
Change-Id: Ia65a623e1866ea688b9a5433d6507926ce301dfe
2016-11-12 11:17:40 -08:00
Keun-young Park
dd34ca45ea fix swapped min / max in priority parsing
- This error led into not handling highest priority,
  which made zygote's priority boost no-op

bug: 32718256
Test: check init log during bootup

Change-Id: I959eb94912a9c1d95bfdb98ee675fdd12cf85699
2016-11-11 18:32:13 -08:00
Josh Gao
e1a06eef2a Merge "crasher: add option to wait for input before crashing."
am: 84db3f19bc

Change-Id: I448bf3e527cd7435f650345492a9df1711b91048
2016-11-12 01:17:04 +00:00
Treehugger Robot
84db3f19bc Merge "crasher: add option to wait for input before crashing." 2016-11-12 01:04:41 +00:00
Josh Gao
100ce3910d crasher: add option to wait for input before crashing.
This will be useful for tests that want to do things with crasher's pid
before it crashes.

Bug: http://b/30705528
Test: crasher wait-abort; crasher wait-thread-abort
Change-Id: I8ba826094dc304d6cd0e6ab088e5cfdb35d2007b
2016-11-11 14:29:13 -08:00
Christopher Ferris
fdb02f8b9c Revert "Use process_vm_readv to read memory."
This reverts commit 279843e139.

Bug: 32806783

Change-Id: I61df26d979a8139a571ff5a6442fb5499ca20547
Test: Verified that the stack and read data works with the revert.
2016-11-10 23:19:30 +00:00