Commit graph

357 commits

Author SHA1 Message Date
Colin Cross
f987398723 am 5954ecb8: Merge "Allow more characters in partition name links"
* commit '5954ecb87b8c77425d8cc766c0cc798957a07a7d':
  Allow more characters in partition name links
2013-07-22 15:40:55 -07:00
Johan Redestig
93ca79b445 Allow more characters in partition name links
We have several partitions with underscores in their names
which would not be properly linked in:
/dev/block/platform/msm_sdcc.1/by-name/

With this change more characters (_-.) are allowed in
partition name links. Also, any other character is
replaced with '_' so the resulting link names have the
same length as the partition name.

Change-Id: I746566c03db98b10326c755692362d2c10e528ae
2013-07-18 10:06:01 +02:00
Colin Cross
b1e3bb2798 am b1a9f8cf: resolved conflicts for merge of b6c60285 to stage-aosp-master
* commit 'b1a9f8cf4b15a861ab998a4c5f0c69068f22c62a':
  init: move initial property area allocation into bionic
  property_service: make /dev/__properties__ readable
2013-06-24 17:22:56 -07:00
Colin Cross
b1a9f8cf4b resolved conflicts for merge of b6c60285 to stage-aosp-master
Change-Id: I5afba55b668065499fa28369cf217d4f5eafab4a
2013-06-24 17:19:43 -07:00
Colin Cross
b6c6028594 Merge changes Ieb94caab,I762da21e
* changes:
  init: move initial property area allocation into bionic
  property_service: make /dev/__properties__ readable
2013-06-25 00:07:54 +00:00
Colin Cross
372d668a27 am 39021a48: am 83ada447: Merge changes Ib54f39fd,I7e36edd8
* commit '39021a48a0e0687c654423acd5a4c99a1d79440d':
  init: Retain traditional restart behavior for critical and oneshot services.
  init: Safely restart services to avoid race conditions.
2013-06-24 15:27:43 -07:00
Colin Cross
39021a48a0 am 83ada447: Merge changes Ib54f39fd,I7e36edd8
* commit '83ada447aed69dfcd0a88e952eced8db1e4d6584':
  init: Retain traditional restart behavior for critical and oneshot services.
  init: Safely restart services to avoid race conditions.
2013-06-24 15:24:57 -07:00
Colin Cross
83ada447ae Merge changes Ib54f39fd,I7e36edd8
* changes:
  init: Retain traditional restart behavior for critical and oneshot services.
  init: Safely restart services to avoid race conditions.
2013-06-24 22:23:32 +00:00
Greg Hackmann
2baad52520 init: move initial property area allocation into bionic
bionic's __system_property_add() now expands the property area as needed
by mapping in more pages.  Rather than duplicate the mapping code, move
it inside bionic and have bionic's __system_property_area_init() set up
the first page.

Signed-off-by: Greg Hackmann <ghackmann@google.com>

(cherry picked from commit f14eef0c3c)

Change-Id: Ieb94caab1527c71f2155efe3795490b0ea215a29
2013-06-19 12:26:31 -07:00
Nick Kralevich
26f2d2f519 property_service: make /dev/__properties__ readable
Currently, system properties are passed via the environment
variable ANDROID_PROPERTY_WORKSPACE and a file descriptor passed
from parent to child. This is insecure for setuid executables,
as the environment variable can be changed by the caller.

Make the /dev/__properties__ file accessible, so an app can
get properties directly from the file, rather than relying on
environment variables.

Preserve the environment variable for compatibility with pre-existing
apps.

Bug: 8045561

(cherry picked from commit 7ece0a862c)

Change-Id: I762da21ef4075f288745efed0ec7d16c2b71303c
2013-06-19 12:26:28 -07:00
Colin Cross
44d1f3c703 am 99c1a416: resolved conflicts for merge of 95a41f6b to stage-aosp-master
* commit '99c1a4168ba792437f298d31cd4631ff01661476':
  init: fix copying boot properties
  toolbox: hide property implementation from watchprops
  init: verify size of property buffers passed to property_get
  init: move the system property writer implementation
  init: switch property_get to use __system_property_get
2013-06-17 18:24:39 -07:00
Colin Cross
99c1a4168b resolved conflicts for merge of 95a41f6b to stage-aosp-master
Change-Id: Icfae29edf989fb43a7f0b8bda188a9807f76a3b9
2013-06-17 18:19:28 -07:00
Colin Cross
5e484e9c43 init: fix copying boot properties
The previous patch "init: verify size of property buffers passed
to property_get" incorrectly modified one of the callers,
resulting in ro.serialno, ro.bootmode, ro.baseband, and
ro.bootloader always being set to their default values.

Bug: 9469860

(cherry picked from commit 67e3663fc9)

Change-Id: Ia7b337e1fab6e334729f47ee1269e6c736615177
2013-06-17 16:58:14 -07:00
Colin Cross
a5a860ef20 init: verify size of property buffers passed to property_get
Verify that the buffer passed as the value parameter to property_get
is always big enough.

(cherry picked from commit 88ac54a4e8)

Change-Id: Iacc2b42bfe4069e0bfcbb1c48474f30126a93139
2013-06-17 16:58:02 -07:00
Colin Cross
993b6ceeb0 init: move the system property writer implementation
Move the system property writer implementation into bionic to keep
it next to the reader implementation and allow for better testing.

(cherry picked from commit 9f5af63501)

Change-Id: Idf6100d1d0170751acd5163a22597912bff480f0
2013-06-17 16:57:49 -07:00
Colin Cross
1a6f4c3bf2 init: switch property_get to use __system_property_get
(cherry picked from commit 2deedfe0b1)

Change-Id: If3fba2cc1dd5c167b0924ddfe42dbe2e6387208a
2013-06-17 16:57:32 -07:00
Ajay Dudani
05a5205566 am 76c58893: Free file handle for /firmware/image after use
* commit '76c5889325c2ada5dda07fd9af20a4a485978538':
  Free file handle for /firmware/image after use
2013-06-14 08:36:02 -07:00
Ajay Dudani
76c5889325 Free file handle for /firmware/image after use
Change-Id: Id59e25486b45dffc87a89a961970a6e8128a5237
2013-06-13 13:18:12 -07:00
Colin Cross
e9ab162f30 init: prevent action being added to the action_queue twice
Property triggers may cause an action to be queued twice, resulting
in a loop in the action queue.  Keep actions that are not on the queue
in the list_empty state (act->qlist->next == act->qlist), and only
add them to the list if they are in that state.

Bug: 8335133
Change-Id: I3a3ec18176cf19cbaa3a45220a03c7560eacfe79
2013-06-10 14:16:00 -07:00
Matthew Xie
5cb9a02b03 am 7e723498: Merge "Add permission for bluetooth app in non-primary users" into jb-mr2-dev
* commit '7e72349865db83d62f98eec8bca4b170712fe0e0':
  Add permission for bluetooth app in non-primary users
2013-05-22 10:38:44 -07:00
Matthew Xie
7e72349865 Merge "Add permission for bluetooth app in non-primary users" into jb-mr2-dev 2013-05-22 17:36:53 +00:00
Matthew Xie
40a91a2884 Add permission for bluetooth app in non-primary users
bug 8954114
Change-Id: Id6a42f5a5beefa22c3cc8eecfb39a2222017a3b4
2013-05-22 10:00:23 -07:00
gcondra@google.com
8f6adcfcc5 am 49be2407: Revert "Add logic to fixup file contexts after a policy update."
* commit '49be240735a06f44e1d91aa51dd299779ad36d96':
  Revert "Add logic to fixup file contexts after a policy update."
2013-05-20 15:52:28 -07:00
gcondra@google.com
253e91b4ff am 477e35d6: Revert "Add persistent property for SELinux enforcment status."
* commit '477e35d6d56c7fe9b2305becdf3ed4f590ddfbd6':
  Revert "Add persistent property for SELinux enforcment status."
2013-05-20 15:52:28 -07:00
gcondra@google.com
43329bc1c9 am 8a387870: Revert "Reload policy after setting up the data partition."
* commit '8a3878700eb9cd8ecf495cd01f15face5c3879c8':
  Revert "Reload policy after setting up the data partition."
2013-05-20 15:52:27 -07:00
gcondra@google.com
f5410f2bde am 3d32cd93: Revert "Remove /system from the dirs to relabel."
* commit '3d32cd938746215e5fa9b1a3c3b78903e043ae73':
  Revert "Remove /system from the dirs to relabel."
2013-05-20 15:52:27 -07:00
gcondra@google.com
b9866649e2 am 52351300: Revert "Add a version check for SELinux policy on device."
* commit '52351300d156826bf22c493828571f45a1cea16a':
  Revert "Add a version check for SELinux policy on device."
2013-05-20 15:52:26 -07:00
repo sync
49be240735 Revert "Add logic to fixup file contexts after a policy update."
This reverts commit ebcf93e3bf.
2013-05-17 12:48:34 -07:00
repo sync
477e35d6d5 Revert "Add persistent property for SELinux enforcment status."
This reverts commit b89bdfde42.
2013-05-17 12:48:18 -07:00
repo sync
8a3878700e Revert "Reload policy after setting up the data partition."
This reverts commit fee250d27a.
2013-05-17 12:47:04 -07:00
repo sync
3d32cd9387 Revert "Remove /system from the dirs to relabel."
This reverts commit 3d4d07b2fa.
2013-05-17 12:46:31 -07:00
repo sync
52351300d1 Revert "Add a version check for SELinux policy on device."
This reverts commit 921be8b656.
2013-05-17 12:46:00 -07:00
gcondra@google.com
5a98566d58 am 921be8b6: Add a version check for SELinux policy on device.
* commit '921be8b6568df0057c4eacbac2e1022b71e09620':
  Add a version check for SELinux policy on device.
2013-05-14 23:43:56 -07:00
repo sync
921be8b656 Add a version check for SELinux policy on device.
This helps to ensure that when a new system image is installed,
old userdata policy isn't applied over the top of it.

Bug: 8841348
Change-Id: I135af32250aa62979763e775842ce0af3c8b6f9f
2013-05-14 21:05:03 -07:00
gcondra@google.com
ac5cf925f8 am 683aa89b: Merge "Remove /system from the dirs to relabel." into jb-mr2-dev
* commit '683aa89bfdf2439d1c5d9a4dc240d6a673678a98':
  Remove /system from the dirs to relabel.
2013-05-07 19:19:50 -07:00
repo sync
3d4d07b2fa Remove /system from the dirs to relabel.
Bug: 8841348
Change-Id: Ia1545288e8a8184feffaaa6158faad62f95cbcce
2013-05-07 19:05:08 -07:00
Colin Cross
803eda6a2d am f69cc564: Merge "Update ueventd set the SELinux context on sysfs"
* commit 'f69cc564f4129ad7f223bb7d83ebec9fe3438b62':
  Update ueventd set the SELinux context on sysfs
2013-04-30 21:12:28 -07:00
Colin Cross
55d69a9681 am 032be7a4: Merge "Log an error if property pool is exhausted"
* commit '032be7a4c5be8c015063084d162d1f394279aa3d':
  Log an error if property pool is exhausted
2013-04-30 21:12:28 -07:00
Colin Cross
f69cc564f4 Merge "Update ueventd set the SELinux context on sysfs" 2013-05-01 03:48:41 +00:00
gcondra@google.com
63577d9280 am fee250d2: Reload policy after setting up the data partition.
* commit 'fee250d27a9c03af1ba439047b976d89563b1887':
  Reload policy after setting up the data partition.
2013-04-30 17:04:53 -07:00
repo sync
fee250d27a Reload policy after setting up the data partition.
This forces a policy reload + fixcon to deal with dynamically
delivered policy changing labels on device nodes.

It's implemented as a new keyword in init.

Bug: 8702843
Change-Id: I803cf1ecf6ff8318ce25dcc5cda4f292adc9738c
2013-04-30 11:40:22 -07:00
Johan Redestig
fd7ffb1089 Log an error if property pool is exhausted
Failing to set properties due to an exhausted pool leads
to difficult to debug problems. This change adds an
error log to make the situation a bit easier to handle.

Change-Id: Icc1d97a80882fb23e74428a0195f1d28dba68fa8
2013-04-29 13:07:40 +02:00
gcondra@google.com
14ad786183 am 538b5d4e: Merge "Add persistent property for SELinux enforcment status." into jb-mr2-dev
* commit '538b5d4e8e4c480b2120aa957fe3e11a2836a1b3':
  Add persistent property for SELinux enforcment status.
2013-04-26 13:37:52 -07:00
repo sync
b89bdfde42 Add persistent property for SELinux enforcment status.
Also adds triggers for going between enforcing and
permissive status.

Bug: 8702843
Change-Id: I841d80999b96acf6b6fd0a5408fb074952d6ae72
2013-04-25 14:19:16 -07:00
Geremy Condra
7e25fa1859 am ebcf93e3: Add logic to fixup file contexts after a policy update.
* commit 'ebcf93e3bf92bf46c54c8e0f2ec8936bb2db6aea':
  Add logic to fixup file contexts after a policy update.
2013-04-15 16:13:53 -07:00
Geremy Condra
ebcf93e3bf Add logic to fixup file contexts after a policy update.
Bug: 8116902

(cherry picked from commit 47677a506f)

Change-Id: I2a50f68a53aee2c94d03d3e5ced1ea36337fde33
2013-04-15 14:59:42 -07:00
Ken Sumrall
d45dcbd5f8 am 1a6d9ec2: Merge "fs_mgr: Capture the output of e2fsck and add to the kernel log" into jb-mr2-dev
* commit '1a6d9ec2af7b3151c64a167162c87d258d30735b':
  fs_mgr: Capture the output of e2fsck and add to the kernel log
2013-04-15 10:35:32 -07:00
Ken Sumrall
bf021b4cd7 fs_mgr: Capture the output of e2fsck and add to the kernel log
Currently, the output of e2fsck is not saved, and we have no insight
into how many errors e2fsck is finding and fixing.  Using the new
abbreviated logging feature in liblogwrap, up to the first 100 lines,
and last 4K bytes of the output of e2fsck is captured by fs_mgr, and
added to the kernel log.

Usually, the filesystem will be clean, and this will only add a few
lines to the kernel log on boot, but when things go wrong, it should
save enough to indicate what the problem is, without potentially
filling the kernel log with only e2fsck output if the filesystem is
really corrupted.

Change-Id: I9c264798e6fe721c8f818b5ce15d0975027ddbdd
2013-04-14 17:11:00 -07:00
Colin Cross
a5ca229a45 am 1615c09a: Merge "init: Fix potential null pointer issue"
* commit '1615c09ac1065104f56ddc444f5467aff76c0daa':
  init: Fix potential null pointer issue
2013-04-05 19:56:27 -07:00
Jeff Sharkey
b4d52a437e Only handle keycodes when adb is enabled.
This prevents accidental bugreports on userdebug/eng devices.

Bug: 8541006
Change-Id: Iefd15826090fd91434403f197cfd166e64400224
2013-04-04 10:46:33 -07:00