Commit Graph

3818 Commits

Author SHA1 Message Date
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
Jean-Baptiste Queru 2a2e10fbb3 am 16d2b6ae: am 91e5551f: Merge "toolbox: rmmod: fix module unloading"
* commit '16d2b6ae4050b1232fd164cef1dbade532fe29a4':
  toolbox: rmmod: fix module unloading
2012-06-11 15:25:44 -07:00
Jean-Baptiste Queru 16d2b6ae40 am 91e5551f: Merge "toolbox: rmmod: fix module unloading"
* commit '91e5551f88aea5aa64e1b4f8b4b52d7be2b28b64':
  toolbox: rmmod: fix module unloading
2012-06-11 15:23:56 -07:00
Jean-Baptiste Queru 91e5551f88 Merge "toolbox: rmmod: fix module unloading" 2012-06-11 15:16:07 -07:00
Jamie Gennis 0f3974c3d0 Merge "Enable tracing on user builds" into jb-dev 2012-06-11 12:04:27 -07:00
The Android Open Source Project a6f4e65bc4 Reconcile with jb-release
Change-Id: Ic8df0fdb3f0a3e9eb54bbd37a929b04c394beb28
2012-06-11 09:22:54 -07:00
The Android Automerger 7452db9890 merge in jb-release history after reset to jb-dev 2012-06-11 07:05:20 -07:00
Jeff Brown f87d9c8698 am 9cec175c: Remove a stray newline in the backtrace output.
* commit '9cec175c66100d9edbb1054f3f2977a5c3f80af2':
  Remove a stray newline in the backtrace output.
2012-06-08 15:30:33 -07:00
Jeff Brown 536b81afed resolved conflicts for merge of 053b8654 to jb-dev-plus-aosp
Change-Id: Idfef8c26b7a9e1a1a202e21dc5d34022bbaa92cc
2012-06-08 15:27:01 -07:00
Jamie Gennis 1279013dee Enable tracing on user builds
This change adds init.rc steps to:
 * allow kernel tracing to be enabled via adb
 * allow a limited set of kernel trace events to be enabled via adb
 * allow the kernel trace to be read via adb
 * allow all users to write to the kernel trace from userland

Bug: 6513400
Change-Id: Ic3c189b5697aa5edf88d2f507c932971bed6caff
2012-06-08 14:26:29 -07:00
Jeff Brown 9cec175c66 Remove a stray newline in the backtrace output.
Bug: 6615693
Change-Id: I1ac1746286afb77c3f5c4042c4592333ebb08a51
2012-06-08 14:21:51 -07:00
Jeff Brown 053b865412 Enhance native stack dumps.
Provides a new mechanism for dumpstate (while running as root)
to request that debuggerd dump the stacks of native processes that
we care about in bug reports.  In this mode, the backtrace
is formatted to look similar to a Dalvik backtrace.

Moved the tombstone generating code into a separate file to
make it easier to maintain.

Fixed a bug where sometimes the stack traces would be incomplete
because we were not waiting for each thread to stop after issuing
PTRACE_ATTACH, only the main thread.  So sometimes we were missing
traces for some threads.

Refactored the logging code to prevent accidentally writing data
to logcat when explicitly dumping a tombstone or backtrace from the
console.

Only root or system server can request to dump backtraces but
only root can dump tombstones.

Bug: 6615693
Change-Id: Ib3edcc16f9f3a687e414e3f2d250d9500566123b
2012-06-08 13:29:23 -07:00
The Android Open Source Project d96544ff69 Reconcile with jb-release
Change-Id: Ida4b92a5bf99e33e3162186f823b410317d9f6b1
2012-06-07 07:51:38 -07:00
The Android Automerger e545c5341f merge in jb-release history after reset to jb-dev 2012-06-05 06:59:47 -07:00
Dima Zavin 779b12fc35 am 5f2d00b0: rootdir: init.rc: remove audio app/sys groups, merge to fg
* commit '5f2d00b0677cbe9ad42ea0394def0a51aef7bdda':
  rootdir: init.rc: remove audio app/sys groups, merge to fg
2012-06-05 00:33:34 -07:00
Dima Zavin 2b628a3c2e am 29319a67: cutils: sched_policy: remove audio app/sys groups, merge into fg
* commit '29319a6753569fb3ef160c2de2f1c4d9d1398178':
  cutils: sched_policy: remove audio app/sys groups, merge into fg
2012-06-05 00:33:33 -07:00
Dima Zavin 38160c06ca am df44b886: core: init.rc: create apps cgroup for fg tasks, move bg under it
* commit 'df44b88621f60e933d7d31090bf0bb892e88142c':
  core: init.rc: create apps cgroup for fg tasks, move bg under it
2012-06-05 00:33:31 -07:00
Dima Zavin 2449c83a09 am 13ed76bf: cutils: sched_policy: make bg group be nested under fg
* commit '13ed76bfbce8e96604e781f88808b4d883891dde':
  cutils: sched_policy: make bg group be nested under fg
2012-06-05 00:33:30 -07:00
Dima Zavin 5f2d00b067 rootdir: init.rc: remove audio app/sys groups, merge to fg
With this change, the audio rr/fifo threads will just run in
the fg cgroup.

Also, the RR budget for the apps fg/bg threads has been bumped
to 80%. Ideally, the bg budget would be much smaller but there
are legacy libraries that seem to be very sensitive to this so
for now keep it at this value.

Bug: 6528015
Change-Id: I08f295e7ba195a449b96cd79d954b0529cee8636
Signed-off-by: Dima Zavin <dima@android.com>
2012-06-04 15:11:33 -07:00
Dima Zavin 29319a6753 cutils: sched_policy: remove audio app/sys groups, merge into fg
Bug: 6528015
Change-Id: I6c2658b62442d811b53c6d18476fbd6cd45f9e3f
Signed-off-by: Dima Zavin <dima@android.com>
2012-06-04 13:20:17 -07:00
Dima Zavin df44b88621 core: init.rc: create apps cgroup for fg tasks, move bg under it
Bug: 6538553
Change-Id: I7c29975aa376bcdda9d6bbd1fd3e04fdb1c1b1fe
Signed-off-by: Dima Zavin <dima@android.com>
2012-06-04 13:02:44 -07:00
Dima Zavin 13ed76bfbc cutils: sched_policy: make bg group be nested under fg
Adds an apps cgroup which will contain fg tasks. Move the bg group
nested underneath it.

Bug: 6538553
Change-Id: I55279415da625e15a5bb061c2b45fbe7f7a4c047
Signed-off-by: Dima Zavin <dima@android.com>
2012-06-04 10:42:40 -07:00
Robert Greenwalt 6f523cda13 am 7bb1b958: am ff856a2b: Merge "Add error handling to SocketClient::sendData"
* commit '7bb1b9585d2d61beaf05c997971aee27f87ad3f7':
  Add error handling to SocketClient::sendData
2012-05-30 15:29:07 -07:00
Robert Greenwalt 7bb1b9585d am ff856a2b: Merge "Add error handling to SocketClient::sendData"
* commit 'ff856a2b927aaadb189181d2cd9dd08dc98456a4':
  Add error handling to SocketClient::sendData
2012-05-30 15:23:29 -07:00
Robert Greenwalt ff856a2b92 Merge "Add error handling to SocketClient::sendData" 2012-05-30 14:57:50 -07:00
The Android Open Source Project 99565a9e80 Reconcile with jb-release
Change-Id: Idc084816f4d709bf71c761151d548c8136085767
2012-05-29 09:41:27 -07:00
The Android Automerger b7eb2cc299 merge in jb-release history after reset to jb-dev 2012-05-29 09:01:51 -07:00
Mattias Falk 2e5fcd08ac Add error handling to SocketClient::sendData
Return failure and set errno if mSocket isn't valid.

Change-Id: I579114d435db46d0bb5682167ef34bebe061a8f8
2012-05-29 14:19:06 +02:00
Jean-Baptiste Queru 79c71831ca am a802b837: am 1d5e7885: Merge "toolbox: implement rm -f flag"
* commit 'a802b8374a22da9f52541e1fc286dcbdb1cfa1b4':
  toolbox: implement rm -f flag
2012-05-25 08:12:59 -07:00
Jean-Baptiste Queru a802b8374a am 1d5e7885: Merge "toolbox: implement rm -f flag"
* commit '1d5e7885698ca81241f10d06d475ef4e6075089b':
  toolbox: implement rm -f flag
2012-05-25 08:09:42 -07:00
Jean-Baptiste Queru 1d5e788569 Merge "toolbox: implement rm -f flag" 2012-05-25 07:32:02 -07:00
Eric Laurent 27ca5f1493 am 88f11846: audio policy: allow disabling A2DP for media.
* commit '88f11846a621b148387aa09754bc939933793717':
  audio policy: allow disabling A2DP for media.
2012-05-24 11:42:54 -07:00
Eric Laurent 88f11846a6 audio policy: allow disabling A2DP for media.
Added FORCE_NO_BT_A2DP forced use to allow applications to
override default policy to use A2DP whenever connected.

Bug 6485897.

Change-Id: I0039232ea6cce4121f375961b2c153d1a0d92e49
2012-05-24 10:10:45 -07:00
The Android Open Source Project c79e59ce77 Reconcile with jb-release
Change-Id: I76ffcc7449cf140d5598612a6be3e8f7b964dc9b
2012-05-24 09:01:53 -07:00