Commit graph

8136 commits

Author SHA1 Message Date
Sreeram Ramachandran
34627d82d7 Merge "Stop and start netd explicitly for "adb shell stop/start"." 2014-07-22 16:35:00 +00:00
Nick Kralevich
ec331b1e40 Merge "adb: set O_CLOEXEC on lots of file descriptors" 2014-07-21 15:45:44 +00:00
Nick Kralevich
9866a66d6d adb: set O_CLOEXEC on lots of file descriptors
Too many leaking FDs.

Fixes bug: https://code.google.com/p/android/issues/detail?id=65857
(and more)

(cherrypicked from commit fe8d7f4f2e)

Change-Id: I67d8683244e54288a8105f6f65ee40abe2378d7e
2014-07-21 19:34:31 -07:00
Colin Cross
02c7113dee Merge "adb: replace utimes() with utime()" 2014-07-21 15:45:44 +00:00
Greg Hackmann
7046773595 adb: replace utimes() with utime()
Fix the win_sdk host build by replacing utimes() with utime().  utime()
is functionally equivalent to utimes() when dealing with non-fractional
second timestamps, and is supported by the Windows CRT.

(The Windows CRT uses the nonstandard name _utime(), but mingw creates
aliases to the POSIX names.)

Change-Id: I513c6c5de05376c34cbb0894a94259acba8ae6f1
2014-07-21 17:10:34 -07:00
Colin Cross
143b9e3dd6 Merge changes I1730d1df,I42c18cb5,I03bb5cc1
* changes:
  adb: use oom_score_adj instead of oom_adj
  Add "exec" service: shell commands with no pty.
  adb: added support for adb pull -a to preserve time stamps and mode
2014-07-21 15:45:37 +00:00
Sreeram Ramachandran
018c6a57f3 Stop and start netd explicitly for "adb shell stop/start".
netd is supposed to be restarted when the zygote is restarted (see the
"onrestart" section for "service zygote" in init.zygote*.rc). But this
only works if you send a restart command (say via "ctl.restart").

"stop && start" != "restart". It seems ingrained in developers to do
"stop && start", so we don't have much hope of convincing everyone to
switch to "adb shell restart", even if we did add such a toolbox command.

Bug: 15855807
Change-Id: I387fe86600f4a2862abc3a05a2ef9a1e7374e21d
2014-07-19 18:36:32 +00:00
Rom Lemarchand
1b3f2ff028 adb: use oom_score_adj instead of oom_adj
(cherry picked from commit 07ce7cab72)

Change-Id: I1730d1df34039a5502200002ac813ce96a3eaa1a
2014-07-18 21:55:38 -07:00
Jeff Sharkey
eb97987332 Add "exec" service: shell commands with no pty.
To facilitate device scripts that want to read/write binary data from
the host side, this change introduces a new "exec" service that
behaves like "shell" but without creating a pty, which would otherwise
mangle binary data.

After forking, it hooks up stdin/stdout of the child process to
the socket connected through to the host.  The adb transport doesn't
support shutdown(), so the host can't half-close the socket and wait
for device termination.  Instead, the host side now has two explicit
commands "exec-in" and "exec-out" for either sending or receiving
data.

Teach host side copy_to_file() to deal with stdin/stdout special
cases.  Switch device side backup/restore services to use the new
create_subproc_raw under the hood.

(cherry picked from commit 5d9d434efa)

Change-Id: I42c18cb5bb907449b458c94450ef6c584d84ecdb
2014-07-18 21:46:23 -07:00
Lajos Molnar
4b35c01e3e adb: added support for adb pull -a to preserve time stamps and mode
Added -a flag to adb pull that preserves time and mode.  Mode is
subjected to umask for security.  We only receive modification
time from adb server, so creation time will be set to the modification
time as well.

Signed-off-by: Lajos Molnar <lajos@google.com>

(cherry picked from commit de8ff4adca)

Change-Id: I03bb5cc14ce542299cf3b221a8be318a28ee8a8d
2014-07-18 21:46:18 -07:00
Elliott Hughes
d8b00c89bf Merge "Fix implicit declaration of function 'prctl' in logd." 2014-07-17 22:33:42 +00:00
Elliott Hughes
e5a0f2064b Fix implicit declaration of function 'prctl' in logd.
Change-Id: I0f655ad15295739adb8f04ec62c88a220413875e
2014-07-18 17:39:41 -07:00
Elliott Hughes
fd62d07db0 Merge "Fix implicit declaration of function 'prctl' in adb." 2014-07-17 22:33:54 +00:00
Elliott Hughes
b4dd6ef223 Fix implicit declaration of function 'prctl' in adb.
Change-Id: I9f14cabbb36d658510c11833b3314565a2445e10
2014-07-18 16:44:58 -07:00
Elliott Hughes
719fd238d8 Merge "Added default constructor for log_t." 2014-07-17 22:34:52 +00:00
Brigid Smith
c75a02fe3f Added default constructor for log_t.
Bug: 16357258
Change-Id: I39169b35653d2b717fadbcff75978db01cc375ef
2014-07-17 15:49:39 -07:00
Patrick Tjin
5328f671b5 Merge "Scan all descriptors when checking for fastboot" 2014-07-16 23:31:38 +00:00
Hans Boehm
baab180c2d Merge "Do not typedef char16_t if it is a keyword." 2014-07-16 23:43:15 +00:00
Hans Boehm
dfdbe61d28 Do not typedef char16_t if it is a keyword.
Don't define char16_t on platforms where char16_t is a keyword, as
C11 and C++11 define it to be.

Change-Id: I6717bc2133c1363ecd85861f3869e1eabd2ce96a
2014-07-16 16:09:37 -07:00
Riley Andrews
81a640646d Merge "Remove the /dev/.booting file before triggering boot." 2014-07-16 13:13:16 +00:00
Riley Andrews
d721f5fc21 Remove the /dev/.booting file before triggering boot.
On mako only, there is a race condition such that
core + main services must be started after releasing
ueventd (by removing /dev/.booting).

bug 16304711
bug 16333352
2014-07-16 03:59:53 +00:00
Elliott Hughes
a94abb8481 Merge "Add SIGFPE to crasher." 2014-07-15 00:03:29 +00:00
Elliott Hughes
3ecc42106e Add SIGFPE to crasher.
Bug: 3399996
Change-Id: I115caf846a47f57984c1b1844104e37d29e6f24e
2014-07-15 11:38:47 -07:00
Elliott Hughes
c8a3791342 Merge "Add missing arm64 registers." 2014-07-15 00:17:18 +00:00
Elliott Hughes
b40c50351e Add missing arm64 registers.
Also fix dumping of arm64's vector registers, which are actually 128 bits wide.

Also move the arm/arm64 FP registers to the tombstone. (We've never dumped
them at all for the other architectures.)

Change-Id: I239a86dd225b47fa90109bc824b7610df67ad812
2014-07-14 17:12:20 -07:00
Riley Andrews
ebf9f8f1e8 Merge "Move unlink("/dev/.booting") until after filesystems are mounted." 2014-07-14 17:12:08 +00:00
Hans Boehm
981dcd79d5 Merge "Add comment to discourage use of cutils/atomic.h." 2014-07-11 23:26:34 +00:00
Hans Boehm
5af7877950 Add comment to discourage use of cutils/atomic.h.
Change-Id: Ib05c745158fdf5a11fd4697c3665a6370ffc04f5
2014-07-11 18:30:13 -07:00
Riley Andrews
9464e5a58d Move unlink("/dev/.booting") until after filesystems are mounted.
Move the unlink out of init.c and into init.rc, so that the file
will be removed after all the filesystems with firmware are up.

Change-Id: I7442df2042cc2788d0301f00e3c2fba7d6e0e1c7
2014-07-11 15:47:15 -07:00
Patrick Tjin
aac89db8a5 Scan all descriptors when checking for fastboot
For Linux, the USB code was only looking at the first
descriptor when searching for the fastboot interface
which caused some devices to not be found.

Also clarify some code by using the actual USB structures
instead of void or char pointers.

Change-Id: I9e4871c4d477ac10ba75bb17a955f176809af289
Signed-off-by: Patrick Tjin <pattjin@google.com>
2014-07-11 14:15:30 -07:00
Christopher Ferris
56cbd19b1b Merge "Fix build." 2014-07-10 20:43:44 +00:00
Christopher Ferris
3cbea9f056 Fix build.
Change-Id: Ied4adacde94ee10deb30647156f07d46a38fbe1f
2014-07-10 23:12:49 -07:00
Elliott Hughes
8098114c90 Merge "Sync with upstream grep." 2014-07-10 21:39:36 +00:00
Elliott Hughes
04650ef7f6 Sync with upstream grep.
Change-Id: Ie1da2e95ee7e3513afb87f357be983dc80cd1515
2014-07-10 19:38:01 -07:00
Elliott Hughes
7a8420ec4a Merge "fix duplicated grep usage printing" 2014-07-10 21:14:09 +00:00
Rocky Zhang
b34b1fcb2b fix duplicated grep usage printing
Change-Id: I579d2046f96ba8ae9fd0bf8f36e2e2f64da622ea
Signed-off-by: Rocky Zhang <zhangyan.hit@gmail.com>
2014-07-11 09:49:35 +08:00
Mark Salyzyn
755df2956f Merge "logd: test: disable kernel LOGGER" 2014-07-10 20:49:23 +00:00
Mark Salyzyn
89472df4cd logd: test: disable kernel LOGGER
Bug: 15384806
Change-Id: I3072d6dd0618fa9ebe151c78a85eb121327f9df3
2014-07-10 13:31:57 -07:00
Elliott Hughes
796fccb80d Merge "Fix environment variable assignment in init" 2014-07-10 16:05:36 +00:00
James Morrissey
381341f5f7 Fix environment variable assignment in init
The init process allows environment variables to be specified in
the rc script globally, via 'export', and for a specific process,
via the 'setenv' option.

However, the mechanism for assembling the environment simply
appended the new variable without checking whether it was already
defined, so it was not possible to overwrite an existing entry.
This patch fixes that behaviour.

Limitations and concerns:

The limit of a maximum number of 31 variables is unchanged.

Currently, most callers of "add_environment" do not check the return
value, but the function now logs the failure rather than failing
silently.

Change-Id: Ie9a68c37a0f55c5b40e904e695cd35514f67f480
2014-07-10 11:22:46 -07:00
Badhri Jagan Sridharan
77a2c22dcb Merge "adbd: adb root should terminate adbd only if it's debuggable" 2014-07-09 21:40:17 +00:00
Elliott Hughes
660ba37298 Merge "Fix arm emulator "D register out of range for selected VFP version" build failure." 2014-07-09 14:45:53 +00:00
Elliott Hughes
cb7aae167e Fix arm emulator "D register out of range for selected VFP version" build failure.
Change-Id: Ia37cb3f8ecb00a927fa3fc8b4131c158413646e7
2014-07-09 16:41:04 -07:00
Elliott Hughes
b518659848 Merge "Integrate vfp-crasher with crasher." 2014-07-09 14:45:53 +00:00
Elliott Hughes
328c3ef6e0 Merge "Fix typo in fs.h" 2014-07-09 22:27:32 +00:00
Markus Mayer
c335a3500c Fix typo in fs.h
fs.h defined _FH_H_ rather than _FS_H_

Change-Id: I710ef53e88d3601e486fde9957f6d022871d9602
Signed-off-by: Markus Mayer <code@mmayer.net>
2014-07-09 15:27:53 -07:00
Elliott Hughes
e7f18e14a9 Integrate vfp-crasher with crasher.
There's no good reason to separate "fill the integer registers with
recognizable patterns and crash" from "fill the FP registers with recognizable
patterns and crash".

Also remove the incorrect use of ARCH_ARM_HAVE_VFP_D32 rather than try to fix
it.

Change-Id: I3a4a3aca1575de5489314027ae52168997404d79
2014-07-09 12:19:32 -07:00
Nick Kralevich
c87237f5af Merge "restorecon_recursive /cache" 2014-07-08 18:09:01 +00:00
Nick Kralevich
e1695914d5 restorecon_recursive /cache
Make sure all files / directories within /cache are properly
labeled, not just the directory itself.

Addresses the following denial:

  type=1400 audit(0.0:26): avc: denied { getattr } for comm="Thread-85" path="/cache/lost+found" dev="mmcblk0p27" ino=11 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:unlabeled:s0 tclass=dir

Change-Id: I5937b30043efeb696ffaa77258b7294d20d1494e
2014-07-09 12:40:13 -07:00
Nick Kralevich
8022ce1e87 Merge "ueventd fixup_sys_perms: fixup SELinux labels unconditionally" 2014-07-07 18:07:41 +00:00