Commit graph

3851 commits

Author SHA1 Message Date
Stephen Hines
b3a5343e3e Merge "Fixed a discarded const qualifier warning" 2012-08-08 15:27:25 -07:00
Stephen Hines
f889f0dba4 Merge "Trivial signed/unsigned warning fix for adbd" 2012-08-08 15:27:17 -07:00
Stephen Hines
e551055e17 Merge "Fix signed/unsigned comparison warning" 2012-08-08 15:27:09 -07:00
Stephen Hines
80bcb48930 Merge "Fixed un-initialized variable warnings" 2012-08-08 15:26:49 -07:00
Jean-Baptiste Queru
ef3f7fa32b Merge "Set the SELinux security label on new directories." 2012-08-08 13:42:20 -07:00
Jean-Baptiste Queru
8261d27115 Merge "restorecon tombstone directory." 2012-08-08 13:41:41 -07:00
Elliott Hughes
63b2c57752 Merge "Conditionally use SIGSTKFLT" 2012-08-08 13:40:17 -07:00
Jean-Baptiste Queru
8fb0caa73b Merge "config_mbr: Fix integer overflow" 2012-08-08 13:18:29 -07:00
Edwin Vane
de7f1ad86f Fixed a discarded const qualifier warning
Change-Id: I9007924d0bf49705363aa130e6e588a9e0ccdc31
Author: Edwin Vane <edwin.vane@intel.com>
Reviewed-by: Tareq A Siraj <tareq.a.siraj@intel.com>
2012-08-02 09:20:51 -04:00
Edwin Vane
ae06933cde Trivial signed/unsigned warning fix for adbd
Change-Id: Icd674006bb2b526166960b4f90eb274030d80439
Author: Edwin Vane <edwin.vane@intel.com>
Reviewed-by: Ariel J Bernal <ariel.j.bernal@intel.com>
2012-08-02 09:17:53 -04:00
Chris Dearman
7ac420972a Conditionally use SIGSTKFLT
Change-Id: I555b33b5a93df332c556944a1c00fff417825247
2012-08-01 15:51:09 -07:00
Edwin Vane
97d2aef6d2 Fix signed/unsigned comparison warning
Trivial warning fix.

Change-Id: I93b905b34155214fc2d211a0d9319f06b67fa193
Author: Edwin Vane <edwin.vane@intel.com>
Reviewed-by: Ariel J Bernal <ariel.j.bernal@intel.com>
2012-08-01 16:36:06 -04:00
Tareq A. Siraj
8bcfb8bcff Fixed un-initialized variable warnings
These un-initialized variables were being used before initialized.

Change-Id: I80c94c5e0c2e959834b99618549377bfb3607272
Author: Tareq A. Siraj <tareq.a.siraj@intel.com>
2012-08-01 15:15:11 -04:00
Dima Zavin
ce76e2d00e Merge "Modify init.rc and init.goldfish.rc for SE Android." 2012-08-01 09:14:42 -07:00
Stephen Smalley
1eee419e7a Modify init.rc and init.goldfish.rc for SE Android.
Set the security context for the init process.
Restore the security contexts of /cache and /data in case they were reset.
Specify the security context for services launched from the rootfs since
we cannot label their executables.
If on the emulator, set a policy boolean and restore the context of
/sys/qemu_trace to allow accesses not normally permitted on a device.

Change-Id: I166ffc267e8e0543732e7118eb0fd4b031efac3b
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2012-07-26 15:37:45 -04:00
Andrew Boie
0b344e7f11 config_mbr: Fix integer overflow
The values need to be converted to loff_t *before* performing
the multiplication, else any sector offset past MAX_INT
bytes will overflow.

Change-Id: Ib8992f28aa4119ac7b4ad354b2448c4b0cfaf846
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2012-07-26 10:18:14 -07:00
Stephen Smalley
e096e36e50 Set the SELinux security label on new directories.
Automatically set the SELinux security label on directories created
by init.rc.  This avoids the need to separately call restorecon on
each such directory from the init.rc file.  Also restorecon /dev
and /dev/socket after initial policy load so that they are labeled
correctly before any other dev nodes or sockets are created.

Change-Id: If6af6c4887cdead949737cebdd673957e9273ead
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2012-07-26 09:01:22 -04:00
Colin Cross
23ee469c4b Merge "fastboot: change default sparse limit to disabled" 2012-07-24 18:21:52 -07:00
Colin Cross
0bbfb3976e fastboot: change default sparse limit to disabled
Change the default sparse limit to disabled to prevent resparsing files
unless the bootloader or user specifies a sparse limit.  Some
bootloaders issue an erase before every flash command, which causes
earlier parts of the downloaded image to get erased.

Change-Id: Iac6f3b05580aba8b82ed0f2f800979a49c33c691
2012-07-24 18:07:18 -07:00
Colin Cross
f650c07586 Merge "fastboot: check argc before using argv" 2012-07-24 18:07:06 -07:00
Colin Cross
8fb6e06ba4 fastboot: check argc before using argv
"fastboot -w" would segfault because *argv was invalid when no
non-option arguments were specified.  Check argc > 0 before
dereferencing argv.

Change-Id: I822a799e6a38e4e5c0a4eca48c6343b8a08a6185
2012-07-24 16:37:52 -07:00
Colin Cross
f58f62eb31 Merge "libsparse: fix 32 bit overflow when calculating last chunk" 2012-07-23 17:26:32 -07:00
Colin Cross
f1ec8ac84a libsparse: fix 32 bit overflow when calculating last chunk
last_block * s->block_size can overflow when writing large filesystems,
cast to 64 bits before multiplying.

Change-Id: I3e54097852ce7d0fd271eab53d65e666284898e4
2012-07-23 17:11:29 -07:00
Colin Cross
ec7d9dc713 Merge "Avoid zombies on androidscreencast" 2012-07-23 14:16:21 -07:00
Yuriy Zabroda
5a536efa5b Avoid zombies on androidscreencast
When using a third party screen capture program called androidscreencast
(http://code.google.com/p/androidscreencast/) to get the framebuffer of
the device, there are tons of screencap zombie processes got left behind.
The issue is also mentioned here: http://code.google.com/p/android/issues/detail?id=22836.
The cause of the issue is that adbd spawns off screencap processes,
and these child processes were not waited to be finished.
This change fixes the issue.

Change-Id: Ife928d65ecf6a2ff39b8b72ddba930fda6733a00
Signed-off-by: Yuriy Zabroda <yuriy.zabroda@ti.com>
2012-07-23 15:23:20 +03:00
rpcraig
f1186f3e98 restorecon tombstone directory.
Restore the security contexts of tombstone directory
when initially created.

Change-Id: I25b53730991576eccb62ca57050decd584acc639
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
2012-07-19 09:38:06 -04:00
Colin Cross
f694ba5f7f Merge changes I6c59381c,I0da088fc,I883572f5,Idc2cfe20,I1a156d10,I177abdb9,I18707bd9,I26744c74,I266f70e1,I75f10db2,I95aa2317,I2f21355b,I5d4ab07f,Ic138ad58,I012d8a42,If664e4fc
* changes:
  fastboot: add support for auto-resparsing large files
  fastboot: add fb_getvar
  fastboot: use getopt_long
  libsparse: rename symbols that conflict with libext4_utils
  libsparse: add sparse_file_len
  libsparse: add function to resparse a file and a utility to use it
  libsparse: add callback output file type
  libsparse: pseudo-subclass output_file for normal and gz files
  libsparse: add sparse_file read and convert tools to use it
  libsparse: fix windows image writing
  libsparse: merge adjacent blocks of the same type
  libsparse: add error reporting functions
  libsparse: add support for including fds
  libsparse: cleanups
  libsparse: remove static variables
  system/core: move libsparse into system/core
2012-07-17 18:36:41 -07:00
Wink Saville
b3a679386d Add telephony-common and mms-common to BOOTCLASSPATH - DO NOT MERGE
Change-Id: Ib113b8147d20fee1ec69d68cf6a7a02d59ff4df6
2012-07-17 12:23:40 -07:00
Colin Cross
f838788e6a fastboot: add support for auto-resparsing large files
Add support to fastboot for automatically using libsparse to break large
files, whether they are in sparse or normal format, into multiple sparse
files that can each fit into the target's memory.  Allows flashing
images that are larger than the size of the available memory on the
target.

By default, any file over 512MB will be sparsed into 512MB chunks.  The
limit can be modified with the -m argument, or sparsing can be forced
with -S or avoided with -N.  If -m is not specified, the target can
override the default by implementing getvar:max-download-size

Change-Id: I6c59381c3d24475c4f2587ea877200b96971cbd7
2012-07-09 22:17:58 -07:00
Colin Cross
80f2d036a9 fastboot: add fb_getvar
Add an fb_getvar helper that can be used to get values from the
target.

Change-Id: I0da088fcbc8d40076c7bf5ef6e5bbd97fae61471
2012-07-09 22:16:57 -07:00
Colin Cross
8879f988ba fastboot: use getopt_long
Modify the fastboot argument parsing to use getopt_long.  This
simplifies argument parsing, and permutes all the commands to the end of
argv to allow parsing them later.

Also moves usb initailization between argument and command processing,
to allow commands to query parameters over usb.

Change-Id: I883572f52c4190c80ee3b4aa4511ea2061a6b734
2012-07-09 22:16:55 -07:00
Colin Cross
b43828b247 libsparse: rename symbols that conflict with libext4_utils
Until ext4_utils switches to using libsparse, libext4_utils defines some
of the same symbols as libsparse.  Fastboot links statically against
both of them, and there is no easy way to make the symbols hidden, so
just rename them in libsparse.

Change-Id: Idc2cfe20efe3c3a7fb8233f453a89bbbeb0dcc8b
2012-07-09 22:09:37 -07:00
Colin Cross
317a09e2d4 libsparse: add sparse_file_len
Add sparse_file_len, which will compute the size of data that would
be produced if sparse_file_write was called.  Useful combined with
sparse_file_callback.

Change-Id: I1a156d1071760f5559483954a5c62ffc20298703
2012-07-09 22:09:37 -07:00
Colin Cross
bdc6d39ed6 libsparse: add function to resparse a file and a utility to use it
Add sparse_file_repsarse, which splits chunks in an existing sparse
file such that the maximum size of a chunk, plus a header and footer,
is smaller than the given size.  This will allow multiple smaller
sparse files to result in the same data as a large sparse file.

Change-Id: I177abdb958a23d5afd394ff265c5b0c6a3ff22fa
2012-07-09 22:09:37 -07:00
Colin Cross
1e17b313a6 libsparse: add callback output file type
Add a new output file subclass that will call a callback for
each block as it is written.  Will be used to measure the space
used by each sparse block to allow resparsing files.

Also add sparse_file_callback, which will write out a sparse
file by calling the provided write function.

Change-Id: I18707bd9c357b68da319cc07982e93d1c2b2bee2
2012-07-09 22:09:37 -07:00
Colin Cross
b4cd267db3 libsparse: pseudo-subclass output_file for normal and gz files
Create two subclasses of output_file that can handle normal
and gzipped files, and refactor open_output_fd.  Will allow
adding support for an output_file type that is not file
backed.

Change-Id: I26744c74d13f205cf17df1ea9caac1eea9c57357
2012-07-09 22:09:37 -07:00
Colin Cross
0c4c47f88d libsparse: add sparse_file read and convert tools to use it
Abstract the logic from simg2img into libsparse, and add logic
for reading a regular image into libsparse.  simg2img then
becomes a simple wrapper around libsparse.

img2simg was not actually making the file sparse, it was using
sparse files to create multiple files that could be pieced back
together.  Replace it with a simple wrapper around libsparse.
Its functionality will be replaced by an simg2simg that can
resparse a file into smaller chunks.

Change-Id: I266f70e1c750454183ce46c71a7bb66bbb033a26
2012-07-09 22:09:37 -07:00
Colin Cross
13a5606593 libsparse: fix windows image writing
Fix write_fd_chunk on windows.  Uses malloc and read instead of mmap.

Change-Id: I75f10db2e04f19e7f3a6ff46b6978d143cb5254e
2012-07-09 22:09:37 -07:00
Colin Cross
be8ddcb35a libsparse: merge adjacent blocks of the same type
When a block is added that is adjacent to another block and of the same
type, merge it.  This will be useful for converting regular images to
sparse images, allowing the reader to add a single block at a time and
letting libsparse optimize into larger blocks as it goes.

Does not support merge two blocks that are backed by a data pointer,
only blocks that are backed by a file for now.

Change-Id: I95aa231714cbe01ac194e868c21385806c0bdb97
2012-07-09 22:09:37 -07:00
Colin Cross
a21930b6b0 libsparse: add error reporting functions
Change-Id: I2f21355b6c5339d1d724b4c121ea30d575b2d366
2012-07-09 22:09:37 -07:00
Colin Cross
9e1f17e926 libsparse: add support for including fds
Add sparse_file_add_fd to include all or part of the contents
of an fd in the output file.  Will be useful for re-sparsing files
where fd will point to the input sparse file.

Change-Id: I5d4ab07fb37231e8e9c1912f62a2968c8b0a00ef
2012-07-09 22:09:37 -07:00
Colin Cross
b55dceea98 libsparse: cleanups
Move block loops into sparse.c with iterator helpers in backed_block.c.
Simplify chunk writing by moving skip chunk calls from output_file.c to
sparse.c.
Rename variables to be consistent with new naming.
Remove use of u8, u32, u64.

Change-Id: Ic138ad58bef9f96239266ccee12ee83ea285e7eb
2012-07-09 22:09:37 -07:00
Colin Cross
411619e921 libsparse: remove static variables
Removes static variables in backed_block.c to allow multiple
sparse files to be open at the same time.

Change-Id: I012d8a424c6e21a7352408416adb7c72ee8add21
2012-07-09 22:09:36 -07:00
Colin Cross
28fa5bc347 system/core: move libsparse into system/core
This moves an exact copy of libsparse from
system/extras/ext4_utils/libsparse to system/core/libsparse in
preparation for linking tools in system/core against it.

Change-Id: If664e4fcfd6612844ac745589beb1517e7f9fe58
2012-07-09 22:09:36 -07:00
The Android Open Source Project
2177c79bdd Reconcile with jb-release
Change-Id: If15d22c16a727b5a57edb82572fef50bab8f28a3
2012-06-19 06:13:58 -07:00
The Android Automerger
29f26a8dc7 merge in jb-release history after reset to jb-dev 2012-06-13 08:49:09 -07:00
Benoit Goby
504dccec97 am aeceb517: adb: Fix adb tcpip command
* commit 'aeceb5174502659cb4fff6de924b54ef7e6cdae7':
  adb: Fix adb tcpip command
2012-06-12 16:44:11 -07:00
Benoit Goby
aeceb51745 adb: Fix adb tcpip command
When running "adb tcpip 5555", adb create a service socket named
"tcpip:5555". Only compare the 6 first chars "tcpip:" to decide if
we enable exit_on_close.

Bug: 6650130
Change-Id: I0835973de044f1cfde0e859ff0277c0ccc2630a3
2012-06-12 16:14:58 -07:00
Jamie Gennis
1e96e16f81 am 0f3974c3: Merge "Enable tracing on user builds" into jb-dev
* commit '0f3974c3d0ee2ffe5e0cb9a56658ba18d511f6ea':
  Enable tracing on user builds
2012-06-12 12:41:25 -07:00
The Android Automerger
26ef0f99cd merge in jb-release history after reset to jb-dev 2012-06-12 11:25:53 -07:00