OSDN Git Service
Chih-Wei Huang [Tue, 6 Oct 2015 19:08:21 +0000 (03:08 +0800)]
libsuspend: enable earlysuspend for android-x86
Chih-Wei Huang [Mon, 28 Sep 2015 02:48:43 +0000 (10:48 +0800)]
android_filesystem: enable houdini executables
Chih-Wei Huang [Thu, 10 Sep 2015 16:39:13 +0000 (00:39 +0800)]
libcutils: refine probe_module
Make the code be more elegant and fix the realloc bug.
Chih-Wei Huang [Wed, 2 Sep 2015 17:33:26 +0000 (01:33 +0800)]
init: add modprobe to load kernel requested modules
Chih-Wei Huang [Mon, 10 Aug 2015 08:31:28 +0000 (16:31 +0800)]
Software-accelerated Pixel Flinger
The typical graphic workloads on VirtualBox are improved 3X.
Supports both x86 and x86_64.
Similar change by HazouPH <jgrharbers@gmail.com>:
http://review.cyanogenmod.org/#/c/70896/
And by Quanganh pham <quanganh2627@gmail.com>:
http://review.cyanogenmod.org/#/c/97125/
Chih-Wei Huang [Fri, 3 Apr 2015 12:36:39 +0000 (20:36 +0800)]
init.rc: fix for "add_tid_to_cgroup failed to write" warnings
I still don't understand why only 0660 works.
Chih-Wei Huang [Thu, 14 Feb 2013 14:01:11 +0000 (22:01 +0800)]
ueventd: load modules in a forked process
Loading some modules (e.g., ath3k) will be blocked to wait for
firmware. The forking is necessary, otherwise ueventd has no
chance to load the firmware.
Chih-Wei Huang [Wed, 6 Feb 2013 12:52:34 +0000 (20:52 +0800)]
allow to load modules from standard module path
Chih-Wei Huang [Tue, 22 Dec 2015 03:23:51 +0000 (11:23 +0800)]
Merge branch 'android-ia2' into lollipop-x86
Conflicts:
init/init.c
Chih-Wei Huang [Mon, 3 Nov 2014 15:06:02 +0000 (23:06 +0800)]
Allow all to execute su
The Superuser app can control how su is used.
Chih-Wei Huang [Wed, 29 Oct 2014 15:25:57 +0000 (23:25 +0800)]
init.rc: let some services run as root
The surfaceflinger needs root permission to control vt.
Run the console shell as root to make debugging easier.
Chih-Wei Huang [Fri, 8 Aug 2014 10:17:04 +0000 (18:17 +0800)]
libutils: fix incorrect calculation in utf8_length() method
The first character of utf-8 could be larger than 128. If use signed char
variable to hold it, it would be treated as negative. That may result in
some unexpected errors.
For example, without this patch, suppose the code is 0xE88888, then
first_char is 0xE8 and converted to int32_t type (0xFFFFFFE8) and
masked with (~to_ignore_mask). The result utf32 is
FFF08208
which is incorrect.
Change-Id: I72b355f380865bc375251eb287fc225fd585a115
Chih-Wei Huang [Tue, 20 Nov 2012 17:50:51 +0000 (01:50 +0800)]
init: handle DEBUG and HWACCEL variables
On DEBUG=1, set debug.logcat=1 to trigger actions in class debug.
On HWACCEL=0, set debug.egl.hw=0 to disable hardware acceleration.
Chih-Wei Huang [Sun, 29 Apr 2012 07:04:55 +0000 (15:04 +0800)]
Set correct permission for pppd
The pppd needs setuid root to setup ppp interface.
Chih-Wei Huang [Sun, 1 Jan 2012 19:16:41 +0000 (03:16 +0800)]
init: avoid virtual console be set blanked
Chih-Wei Huang [Thu, 14 Apr 2011 01:48:52 +0000 (09:48 +0800)]
init: builtins: Add 'setkeycode' command to init.rc parser
The command is used to set an entry into the kernel's scancode-to-keycode map.
Change-Id: If772b3590c08d3696ff9d015f1faf0e75405e262
Chih-Wei Huang [Tue, 12 Apr 2011 08:46:45 +0000 (16:46 +0800)]
init: make sure the last parameter to execve is NULL
Extend the buffer to hold one more pointer, and set it is NULL.
Change-Id: I3018d62a1b0d61c0a3f5f2f7ffa12c7ce9ee32c5
Chih-Wei Huang [Tue, 1 Feb 2011 07:47:03 +0000 (15:47 +0800)]
init: change FIRMWARE_DIR1 for Android-x86
Chih-Wei Huang [Sat, 15 Jan 2011 22:44:37 +0000 (06:44 +0800)]
ueventd.rc: remove redundant definitions
Change-Id: Icb4f051abf941052aca9752ca2949386738d94e5
Chih-Wei Huang [Sat, 15 Jan 2011 22:25:37 +0000 (06:25 +0800)]
init.rc: use relative path for symlink
Usually it's better to use relative path for symlink. For example,
to use Android in a chroot environment, the absolute symlink will
fail outside the chroot environment. Using relative path guarantees
the link will work both inside and outside chroot.
Change-Id: I2f654a05189b9a666aed1fc7bdfb5a50357aff78
Magnus Malmborn [Fri, 14 Jan 2011 08:42:18 +0000 (09:42 +0100)]
Adding an 'exec' implementation to init
This is useful for running programs synchronously
during startup.
Change-Id: I0212fad22613124dd13b4f20b86d0dcc6cb59b6e
Weichuan Yan [Tue, 28 Dec 2010 07:45:02 +0000 (15:45 +0800)]
Fix a crash when there is no command action in some trigger
Change-Id: I5c002c9f86afceca83c39715576392cf88dd8614
Signed-off-by: Weichuan Yan <wchyan@marvell.com>
Andreas Gampe [Fri, 1 May 2015 03:39:12 +0000 (20:39 -0700)]
LibNativeBridge: Version 2
Add a callback function to retrieve "signal handler" from the bridge,
if the bridge wants it to be managed by the runtime. The signal handler
will be invoked after the runtime's own one, and before any other
chained handler.
Add a callback function to check compatibility of the bridge with the
library.
Add a function to expose the native bridge version. Add a test for this
function.
Bug:
20217701
Change-Id: Ic23a60b949f119c7d8b0e7cb27a61e6c16532a23
TraianX Schiau [Wed, 17 Dec 2014 08:53:41 +0000 (10:53 +0200)]
logd: Fix pruning
In a scenario in which an on-line (blocking) client is running and
a clean is attempted (logcat -c), the following can be observed:
1) the on-line logger seems to freeze
2) any other clear attempt will have no effect
What is actually happening:
In this case prune function will "instruct" the oldest timeEntry
to skip a huge number (very close to ULONG_MAX) of messages, this
being the cause of 1.
Since the consumer thread will skip all the log entries, mStart
updating will also be skipped. So a new cleaning attempt will have
the same oldest entry, nothing will be done.
Fix description:
a. keep a separated skipAhead count for individual log buffers (log_id_t)
LogTimeEntry::LogTimeEntry
LogTimeEntry::FilterSecondPass
LogTimeEntry::skipAhead
LogTimeEntry::riggerSkip_Locked
b. update LogTimeEntry::mStart even if the current message is skipped
LogTimeEntry::FilterSecondPass
c. while pruning, only take into account the LogTimeEntrys that are monitoring
the log_id in question, and provide a public method of checking this.
LogTimeEntry::isWatching
LogTimeEntry::FilterFirstPass
LogTimeEntry::FilterSecondPass
d. Reset the skip cont befor the client thtread starts to sleep, at this point
we should be up to date.
LogTimeEntry::cleanSkip_Locked
LogTimeEntry::threadStart
Change-Id: I1b369dc5b02476e633e52578266a644e37e188a5
Signed-off-by: TraianX Schiau <traianx.schiau@intel.com>
Andreas Gampe [Thu, 13 Nov 2014 23:50:17 +0000 (15:50 -0800)]
System/core: Use memmove
Should use memmove when you expect overlap.
Change-Id: I268a173db40a4be54232958e37aa8a03c2a885ee
Bo Huang [Mon, 29 Sep 2014 06:54:02 +0000 (14:54 +0800)]
When new error happend, then errno should be updated accordingly. Otherwise, need to keep previous errno.
Reproduced steps:
pre-condition:
DUT support external SDcard or Usb mass storage;
1. Insert blank(no partition) SDcard or UMS to DUT;
Expected result:
Should prompt user with storage error.
Test result:
There is no notification for error.
Error log:
01-01 01:06:49.239 I/fsck_msdos( 200): fsck_msdos terminated by exit(8)
01-01 01:06:49.239 E/Vold ( 200): /dev/block/vold/179:16 failed FS checks (I/O error)
01-01 01:06:49.239 D/Vold ( 200): Volume sdcard1 state changing 3 (Checking) -> 1 (Idle-Unmounted)
01-01 01:06:49.239 W/Vold ( 200): Returning OperationFailed - no handler for errno 0)
Root cause analysis:
1.Volume::setState will call senBroadcase to send out state notification;
2.Finally, SocketClient::sendDataLockedv was called to sent message.
In sendDataLockedv funtion, when current == iovcnt, e is 0 by default.
So Vold get incorrect errno.
Change-Id: Ibd5ec8c44428b01b5ee7ee5211064128ffb66830
Tracked-On: https://jira01.devtools.intel.com/browse/IMINAN-953
Category: aosp improvement
Domain: Storage-Removable_Storage
Origin: internal
Upstream-Candidate: yes
Signed-off-by: Bo Huang <bo.b.huang@intel.com>
Reviewed-on: https://android.intel.com:443/288658
Irina Patru [Fri, 22 Aug 2014 12:18:49 +0000 (15:18 +0300)]
UPSTREAM_PENDING newfs_msdos: Handle alignment failure
When trying to create a new FAT32 file system using alignment, the resulted
MBR structure is corrupted, because the total sectors reported does not
correspond to the actual available sectors. This is due to the reserved
sectors field which is updated during the alignment.
When fsck_msdos will try to check this file system, it will fail because it
cannot match the reported sectors with the actual available sectors.
Due to the failed check, the file system cannot be mounted by vold.
I/fsck_msdos( 2180): FAT size too small, 242822 entries won't fit into 1897 sectors
I/fsck_msdos( 2180): fsck_msdos terminated by exit(8)
E/Vold ( 2180): Filesystem check failed (unknown exit code 8)
E/Vold ( 2180): /dev/block/vold/179:49 failed FS checks (I/O error)
D/Vold ( 2180): Volume sdcard1 state changing 3 (Checking) -> 1 (Idle-Unmounted)
In order to fix this issue, we will save the initial bpb structure and restore
it if the alignment fails.
Change-Id: I58d5078551c689b28c9070585bb330c45bab9c62
Signed-off-by: Irina Patru <irina.patru@intel.com>
Reviewed-on: https://android.intel.com/256992
Reviewed-by: Dolca, Robert <robert.dolca@intel.com>
Reviewed-by: cactus <cactus@intel.com>
Reviewed-by: Popa, Valentin <valentin.popa@intel.com>
Samuel Ortiz [Thu, 17 Jul 2014 23:35:29 +0000 (01:35 +0200)]
devices: Increase the uevent socket buffer size
Depending on the timing, hald may start while ueventd is not done yet
with its initial coldboot. As hald also independently starts its own
coldboot, ueventd netlink socket buffer could get filled quickly and
thus ueventd could lose some uevents.
This is fixed by increasing the ueventd netlink socket buffer size.
Change-Id: Ie92f77c14099421740b3984f1cc23f813287b78f
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Reviewed-on: https://android.intel.com/219843
Reviewed-by: Escande, Thierry <thierry.escande@intel.com>
Reviewed-by: cactus <cactus@intel.com>
Reviewed-by: Ortiz, Samuel <samuel.ortiz@intel.com>
Tested-by: Ortiz, Samuel <samuel.ortiz@intel.com>
Tested-by: cactus <cactus@intel.com>
Reviewed-by: Porlan, Patrick <patrick.porlan@intel.com>
Reviewed-by: Bianti, Sebastien <sebastien.bianti@intel.com>
Reviewed-by: Mahalingam, Ganesh <ganesh.mahalingam@intel.com>
Tested-by: Mahalingam, Ganesh <ganesh.mahalingam@intel.com>
Ukri Niemimuukko [Mon, 28 Apr 2014 22:25:28 +0000 (06:25 +0800)]
RefBase: make Renamer destructor virtual
This patch makes the Renamer class destructor virtual and fixes
the incorrect constructor initialization list ordering.
These issues and related compiler warnings have been suppressed
by the build system which uses the gcc \96isystem command
line option, unless a project explicitly adds the include the path
system/core/include to Android.mk and uses the templates.
Change-Id: Iff76a655eb8bd547adfe994c7315a005e98aed41
Signed-off-by: Ukri Niemimuukko <ukri.niemimuukko@intel.com>
Signed-off-by: Mingwei Shi <mingwei.shi@intel.com>
Signed-off-by: Yong Yao <yong.yao@intel.com>
Sean V Kelley [Wed, 1 May 2013 21:35:07 +0000 (14:35 -0700)]
system: Add hw specific pixel format
Relocate hw pixel format to graphics header for convenience
from drm_gralloc codebase.
Change-Id: I405398b172fab19949fef33c89a60132b1bd0ea9
Signed-off-by: Sean V Kelley <sean.v.kelley@intel.com>
Billy [Thu, 14 Mar 2013 08:00:23 +0000 (16:00 +0800)]
Init: Setting system time back to utc
Fix:
When rtc_local_time is enabled (ro.rtc_local_time = 1),
system time loaded from rtc should be local time too during boot.
Setting system time back to utc as soon as fast, which avoid programs
get confused about it.
For convert local time to utc, we need to get timezone information.
Android store timezone in property variable "persist.sys.timezone", and
its raw file stored on /data partition. So, the reasonalbe time when we
trigger sysclk should be after /data partition loaded and persist_props
loaded. We must add a new property variable for triggering sysclk if we
want to trigger it after load_persist_props commmand, which will make code
more complicated. Thinking about above, I add sysclk command on post-fs-data
section in init.bigcore.rc. At this point, partitions loaded, persist_props
not loaded yet. I get the timezone infromation through reading raw file
directly instead of call propert_get function
Issue: AXIA-2051
Change-Id: I0ff1d5932c5b1aaa8695129de44c06dba31cb443
Signed-off-by: Xiaobing Feng <xiaobing.feng@windriver.com>
Vincent Tinelli [Thu, 9 Aug 2012 10:21:53 +0000 (12:21 +0200)]
Expand variables on mount_all command
BZ: 50823
Reason:
Generic mount_all command in init.common.rc
instead of duplicating in init.${ro.hardware}
fstab.${ro.hardware} needed for vold/cryptfs
Implementation:
Expand variables on mount_all command
Category: aosp improvement
Domain: PUPDR-Flashing
Origin: internal
Upstream-Candidate: no, need rework
Change-Id: Ic328b6914d412ffa343c20581e4ddde2eacc3e51
Orig-Change-Id: I4663fb7c77f5000b6c548a683b51977f3107646b
Orig-Change-Id: I15f2443d2aae71ddfc8d2e24fc84584662b498ec
Signed-off-by: Vincent Tinelli <vincent.tinelli@intel.com>
Reviewed-on: http://android.intel.com:8080/76542
Reviewed-by: Yao, Yong <yong.yao@intel.com>
Reviewed-by: Romieu, Benoit <benoit.romieu@intel.com>
Tested-by: Romieu, Benoit <benoit.romieu@intel.com>
Reviewed-by: cactus <cactus@intel.com>
Tested-by: cactus <cactus@intel.com>
Andrew Boie [Thu, 25 Oct 2012 21:10:07 +0000 (14:10 -0700)]
init: expand usage of property lookup and allow file lookup
Currently, the init.rc syntax ${prop.name} to substitute a value
looked up from the property service is only supported for the
setprop, write, and import commands. Here we generalize it so that
the arguments for all commands and services allow for references like
this.
We also introduce the syntax $[/path/to/file] to substitute the
contents of a file (typically a sysfs node), pruning any trailing
newlines from the file first.
Substitutions are always done at the last possible moment; right
when the command is executed or the service is started. If a service
is started/stopped multiple times, the substitutions will always be
re-done each time it starts.
If any substitition fails, the command will not run/service will not
start.
The deprecated syntax $prop.name is no longer supported.
Change-Id: I8560b70f48c0396832d9a7fadc546441e8e81ff9
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Andrew Boie [Tue, 30 Oct 2012 22:16:04 +0000 (15:16 -0700)]
init: Allow for configurable init.rc path
If androidboot.initrc is passed in the kernel command line,
the path it refers to will be used for the initial init.rc
and not /init.rc.
This is to support specialized boot modes using the same
ramdisk.
Change-Id: Icfa179c422bf1d548c4ddef33c41cc89718d762d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Andrew Boie [Fri, 12 Oct 2012 22:23:40 +0000 (15:23 -0700)]
init: Add 'readprops' command
This reads the contents of a text file and sets system properties
based on its contents.
Change-Id: Ic03de7ee9afb8a12439d0dff343560011e152beb
For: AXIA-102
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Octavian Purdila [Thu, 27 Sep 2012 16:28:43 +0000 (19:28 +0300)]
devices: allow sending on device-add notifications for major/minor-less devices
This is usefull for getting device plug/unplug notifications for
things like USB ethernet adapters which do not have major/minor
numbers.
Change-Id: I8f032ef983aeb36dd013fafc4a5df5238decbb17
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Andrew Boie [Tue, 27 Nov 2012 20:58:19 +0000 (12:58 -0800)]
init: HACK: Try multiple times to open console
If the console is set to be a USB-to-serial adapter, there is
a bootup race for the creation of its associated device nodes
and init's one-time console detection.
If the console can't be opened, try polling up to 5 seconds. Log
an error if it ultimately fails.
A better solution would be to reimplement the console functionality
to be hot-pluggable, but this would require much more invasive changes
to make it robust.
Change-Id: I20b19095a2f22efffafe2a7ac22d2be753a62d4b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Daniel Leung [Tue, 7 Aug 2012 22:03:34 +0000 (15:03 -0700)]
libcutils: wait for properties and value comparison
Add a property_try_get() function to wait for property to appear.
This can be used to block operations until some properties are set.
Add property_cmp() and property_try_cmp() to compare property
to specified value.
Also add a trygetprop, cmpprop, trycmpprop command in toolbox
to use these.
Issue: AXIA-539
Change-Id: I9d531e57c84140cebe6440efe3d3195c505932fa
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Andrew Boie [Tue, 27 Nov 2012 21:21:38 +0000 (13:21 -0800)]
init: wildcard matching for chmod/chown in init.rc
Implement wildcard matching for the builtin command
chmod and chown for use in init.rc.
For security reason, the number of slashes has to match.
For example, to match /dir_a/dir_b/dir_c/dir_d/file,
the path needs to be /dir_a/*/*/*/file. Simply doing
/dir_a/*/file does not work.
Issue: AXIA-576
Change-Id: I21b5aa58b3d3142725bc73ff31afb65d4fd4bc99
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Andrew Boie [Tue, 29 Nov 2011 20:45:58 +0000 (12:45 -0800)]
util.c: Fix file_read() with sysfs nodes
Sysfs nodes always report a file size of 4096 regardless of how much
data can be read. Hence don't fail if read() can't get the full size;
specifically look for errors or 0 (which is EOF).
Change-Id: Ief1ffbe08ac5e4daa80805713efa4f2af0a1a33e
Octavian Purdila [Mon, 20 Feb 2012 07:42:15 +0000 (09:42 +0200)]
bootchart: add threads support
Grab information about threads not only processes. This gives us
additional important information about the boot processes especially
for heavy processes such as system server and zygote.
Issue: ANDROID-609
Change-Id: Ia941da116de1589c46101f262db64b0bc730e643
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Andrew Boie [Thu, 12 Jul 2012 22:39:25 +0000 (15:39 -0700)]
adb: reserve a wakelock when clients are connected over socket
USB OTG connections already have a wakelock reserved, but if a network
socket connection is made, the device can unexpectedly suspend
in the middle of a session. The lock is released when the client
disconnects.
Change-Id: Id5ac01699fab9350955c9814042259542fc6a694
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Jianxun Zhang [Mon, 2 Jul 2012 18:32:30 +0000 (11:32 -0700)]
add modprobe-like capability and automatic ueventd loading
Author: Jianxun Zhang <jianxun.zhang@intel.com>
Author: Daniel Leung <daniel.leung@intel.com>
Author: Andrew Boie <andrew.p.boie@intel.com>
- insmod_by_dep() added to libcutils; loads a module into kernel.
Modules the target module depends on will be loaded first. Loading
will be stopped when an error occurs.
- rmmod_by_dep() added to libcutils; removes a module from kernel.
It also tries to remove other modules the target module depends
on until an error occurs.
- Implement wildcard matching for ueventd rules.
The PCI and USB addresses for devices can change from devices
from devices for a particular class of peripheral, for example,
bluetooth. The ueventd rules created with these addresses are
then device-specific.
This changes the way ueventd rules with wildcard are handled.
Instead of matching just the prefix with a trailing wildcard,
now these rules can have wildcard anywhere in the rule.
The wildcard matching is implemented using fnmatch(), where
its matching is simliar to shell pathname expansion. It suits
this particular usage model well.
For example, instead of creating a rule to match:
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/bluetooth/hci0/rfkill*
, this would suffice:
/sys/devices/*/bluetooth/hci0/rfkill*
- Let ueventd auto-load kernel modules. Implements the functionality
for ueventd to auto-load kernel modules when uevents are triggered.
Since /system may not be mounted when uevents are fired,
a deferred loading mechanism is implemented. Once mapping of
module and alias is available, these modules are then loaded.
Modules can also be blacklisted so they will not be loaded
automatically. One example would be the Wifi driver, as
Android's has to control its loading and unloading.
- add 'probemod' builtin command. This command accepts the name of a
kernel module plus a set of command line arguments. The module will
be loaded, along with all its dependencies, using the libcutils
insmod_by_dep() API.
- Drivers in kernel can request modules by launching a program in
user space, the program's path by default is "/sbin/modprobe".
Because Android system has no modprobe and ueventd is the only
program handling the module aliases so far, This patch provides a
cheap approach to handle kernel's requests in ueventd executable.
- Add new builtin init command "coldboot". The main purpose is to
provide an approach in init.*.rc files to fire uevents for devices
under the path which is passed as the the argument. This should be
called after /system is mounted so any queued events that need to
load a module can be fired.
Andrew P. Boie [Fri, 31 Aug 2012 19:05:55 +0000 (12:05 -0700)]
libdiskconfig: Enable Mac OS X host build
Change-Id: Iacc7d5463364d0cd15ca9fabaa58ad05857d9e78
Signed-off-by: Andrew P. Boie <andrew.p.boie@intel.com>
Andrew Boie [Fri, 11 Nov 2011 01:58:05 +0000 (17:58 -0800)]
diskconfig: Fix disk_layout.conf size parsing
If the user was appending 'K' to their lengths (which is valid
but redundant) it was being treated as megabytes instead of
kilobytes.
Change-Id: I979ec4d01f1342de1f3209b946201ca87bad32a7
Paul Drews [Mon, 20 Jun 2011 17:01:24 +0000 (10:01 -0700)]
Use progressive offset in buffer for successive writes
The code for copying from one raw file to another looped
back and tried again with a suitably smaller number of bytes
if the entire buffer was not written on the first try.
However, it failed to advance an offset in the buffer past
the bytes that were written. This could conceivably happen
under rare circumstances, leading to a corrupted disk image.
This fix defines an offset into the buffer, advancing it by
the number of bytes written on each successive retry.
Signed-off-by: Paul Drews <paul.drews@intel.com>
Change-Id: I76b8e0b3c0d3b0c32bd2114d0867ac7489808279
Andrew Boie [Wed, 11 Jul 2012 03:43:29 +0000 (20:43 -0700)]
libdiskconfig: HACK Don't do space checks on zero-size images
If an image file is of zero size, assume we just want to expand it
to fit the available images.
Change-Id: If8f22eb12d3a5179960d4359307bb177e3323e8a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
srinivas pandruvada [Thu, 24 May 2012 21:25:10 +0000 (14:25 -0700)]
System-core-init: Implement device triggers
Android system/core/init/readme describes two triggers, which are
not implemented in the code yet.
They are:
device-added-<path>
device-removed-<path>
Triggers of these forms occur when a device node is added or removed.
These triggers are very important for PnP devices. For example when
system goes to suspend, the inbuilt usb in some devices is power-off
causing whole driver to be removed. When they are driver restarts on
resume the sysfs files permission will be reset to root again. This
will cause processes with non-root access to fail.
These triggers allows to change ownership again.
Android ueventd.*.rc file allows to modify permissions of file
matching the path sent by udev event, but doesn't allow to set
permissions in sysfs files or other files.
Also this patch goes through device triggers at the end of boot
process and fires them to account for uevents before the init
process was created.
Change-Id: Ib7f47124f324fdba4da332c7d1ea5040f45eeb13
Signed-off-by: srinivas pandruvada <srinivas.pandruvada@intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Narayan Kamath [Fri, 28 Aug 2015 11:59:48 +0000 (12:59 +0100)]
libutils: Fix integer overflows in VectorImpl.
Use external/safe-iop to check for overflows on arithmetic
operations.
Also remove an unnecessary copy of Vector/SharedBuffer from
codeflinger and use the copy from libutils instead.
Note that some of the unit tests are somewhat useless due to
test-runner limitations : gtest's ability to filter on abort message
doesn't work when combined with messages formatted by android's logging
system.
bug:
22953624
(cherry picked from commit
c609c31fb56ae434caa2d0153cd0a2f74a715071)
Change-Id: I61644633db6b54fa230683615de9724f7fabf6fb
Sergio Giro [Tue, 18 Aug 2015 13:44:54 +0000 (14:44 +0100)]
libutils: fix overflow in String8::allocFromUTF8
Patch contributed in:
https://code.google.com/p/android/issues/detail?id=182908
Bug:
23290056
(cherry picked from commit
4eeacbeec0ae66e9d9395abbf83666709f2e11e3)
Change-Id: Ife1dc0791040150132bea6884f1e6c8d31972d1b
(cherry picked from commit
ebabef275283f771151ec93c17469374b789b2c8)
Sergio Giro [Tue, 18 Aug 2015 16:36:50 +0000 (17:36 +0100)]
libutils: fix overflow in SharedBuffer [DO NOT MERGE]
See
https://code.google.com/p/android/issues/detail?id=181910
Bug:
22952485
(cherry picked from commit
66b6eb9490beeeabc804d790c1c4060ce047afd4)
Change-Id: Ic71dd0025b9a7588c4f3bb1c7be1bd13d2ff5105
Abhishek Arya [Fri, 21 Aug 2015 00:38:16 +0000 (17:38 -0700)]
Fix compile failure after rIfe1dc0791040150132bea6884f1e6c8d31972d1b
Bug:
23290056
Change-Id: If6e22b0159de6635a8ca5305895b7718f15becc7
Adam Lesinski [Mon, 27 Apr 2015 19:13:33 +0000 (12:13 -0700)]
Prevent integer overflow when allocating native_handle_t
User specified values of numInts and numFds can overflow
and cause malloc to allocate less than we expect, causing
heap corruption in subsequent operations on the allocation.
Bug:
19334482
Change-Id: I43c75f536ea4c08f14ca12ca6288660fd2d1ec55
Chris Fries [Thu, 5 Sep 2013 18:19:21 +0000 (13:19 -0500)]
fs_mgr: introduce fs_mgr_format to format wiped partitions
Move fastboot's format logic into fs_mgr, to consolidate the knowledge
about how to do this (and when to wipe metadata).
Try to format these formattable paritions if they are wiped.
If formatting fails, we will fall out to let recovery mode handle it.
Bug:
20082763
Change-Id: I397cc197550e78d932e8a154fd234695c46dbe7b
The Android Automerger [Mon, 9 Feb 2015 14:10:55 +0000 (06:10 -0800)]
merge in lmp-mr1-release history after reset to lmp-mr1-dev
Paul Lawrence [Fri, 6 Feb 2015 17:18:19 +0000 (17:18 +0000)]
Revert "Make encryption configurable"
This reverts commit
bda6272446454886339841a62daaa1b66c07ad60.
The original fix seems to have led to boot failures in QA. Rather than
risk shipping, revert the change. Bug
18764230 reopened.
Requires change
https://googleplex-android-review.git.corp.google.com/#/c/629764/
Bug:
19278390
Bug:
19199624
Change-Id: I8b6ab585666f2b0f585ffb2a5f61ac2e3462e06e
The Android Automerger [Tue, 27 Jan 2015 14:10:48 +0000 (06:10 -0800)]
merge in lmp-mr1-release history after reset to lmp-mr1-dev
Paul Lawrence [Wed, 21 Jan 2015 17:57:01 +0000 (09:57 -0800)]
Make encryption configurable
Delay mounting encryptable but unencrypted volumes until we can
check the ro.vold.forceencrypt flag, then optionally encrypt.
Requires matching vold change from
https://googleplex-android-review.git.corp.google.com/#/c/615309/
Bug:
18764230
Change-Id: If22008be8de6a4f3216b349f81ace49be1730314
The Android Automerger [Mon, 19 Jan 2015 14:10:48 +0000 (06:10 -0800)]
merge in lmp-mr1-release history after reset to lmp-mr1-dev
Dmitry Shmidt [Thu, 15 Jan 2015 18:35:54 +0000 (10:35 -0800)]
android_filesystem: Remove setuid bits from tcpdump
Bug:
18669116
Change-Id: I25486f2fe0e994f569b788fc9f03ef6d383f54d4
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Dmitry Shmidt [Thu, 15 Jan 2015 20:45:04 +0000 (20:45 +0000)]
Merge "android_filesystem: Remove setuid bits from tcpdump" into lmp-mr1-dev
Dmitry Shmidt [Thu, 15 Jan 2015 18:35:54 +0000 (10:35 -0800)]
android_filesystem: Remove setuid bits from tcpdump
Bug:
18669116
Change-Id: I25486f2fe0e994f569b788fc9f03ef6d383f54d4
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Jean-Michel Trivi [Thu, 15 Jan 2015 17:16:22 +0000 (17:16 +0000)]
Merge "Remove explict use of ASCII encoding" into lmp-mr1-dev
Jean-Michel Trivi [Thu, 15 Jan 2015 17:16:00 +0000 (17:16 +0000)]
Merge "Return path including executable instead of without" into lmp-mr1-dev
Jean-Michel Trivi [Thu, 15 Jan 2015 17:15:33 +0000 (17:15 +0000)]
Merge "Fix building on modern versions of Xcode and OS X." into lmp-mr1-dev
The Android Automerger [Thu, 15 Jan 2015 14:10:48 +0000 (06:10 -0800)]
merge in lmp-mr1-release history after reset to lmp-mr1-dev
Narayan Kamath [Thu, 15 Jan 2015 09:43:09 +0000 (09:43 +0000)]
Merge "sdcard : inode numbers must be fully representable as uint32_t." into lmp-mr1-dev
Christopher Ferris [Wed, 14 Jan 2015 03:07:12 +0000 (19:07 -0800)]
Add timed versions of stack dumping functions.
Under some unknown circumstances, debuggerd could become unresponsive.
If you try and take a bugreport during this time, it will hang forever.
Adding functions that have a timeout will allow dumpstate to stop if
dumping is taking too long.
Bug:
18766581
Change-Id: I85053b8dcfe6224e2b64b4d8f7f2ef448b3cda34
Al Sutton [Fri, 21 Nov 2014 15:56:59 +0000 (15:56 +0000)]
Remove explict use of ASCII encoding
Replace the use of CFStringGetCString with kCFStringEncodingASCII specified
with CFStringGetFileSystemRepresentation which will ensure the correct
character encoding is used to conver the CFString into a NULL terminated
char array suitable for use with POSIX APIs.
(cherry picked from commit
2a4b5f9e804f019c0d565c86579f07963989ed1b)
Change-Id: Ie6e2027e59b49ca634c7308bcda7bb492d372f46
Al Sutton [Thu, 20 Nov 2014 13:33:57 +0000 (13:33 +0000)]
Return path including executable instead of without
The previous implementation returned the path the executable was in instead
of returning the path including the executable (i.e. it returned ...bin
instead of ...bin/executable). This is not what the original methods did
and caused the process forking of adb to fail.
This patch corrects the implementation.
(cherry picked from commit
26b53bb75e6bdf9aa7820a3343845dae145625cc)
Change-Id: Icad6870bbb0a88f611ca71d90fff30f7b576c367
Al Sutton [Wed, 19 Nov 2014 19:50:48 +0000 (19:50 +0000)]
Fix building on modern versions of Xcode and OS X.
Recent versions of XCode fail to compile the adb and fastboot binaries due to
two functions being deprecated in 10.9 (GetCurrentProcess and
ProcessInformationCopyDictionary), and the use of -Werrror.
This patch replaces the method implementations which use calls to methods
deprecated in the 10.9 SDK with versions which only call non-deprecated methods.
(cherry picked from commit
f456d47c506d87265ce0ff6080cba5374dced011)
Change-Id: Ibd80dda73ccdd7c561b50b4065581e645d9855d6
Narayan Kamath [Tue, 13 Jan 2015 18:21:10 +0000 (18:21 +0000)]
sdcard : inode numbers must be fully representable as uint32_t.
This works around a bug on on 64 bit kernels + sdcard daemons
where we were using memory addresses as inode numbers.
bug:
19012244
Change-Id: Ia63c5b33b4212bf03ff92fa2faff0bb76e48791c
The Android Automerger [Mon, 12 Jan 2015 14:38:16 +0000 (06:38 -0800)]
merge in lmp-mr1-release history after reset to lmp-mr1-dev
Leo Wang [Fri, 9 Jan 2015 01:17:51 +0000 (01:17 +0000)]
Merge "Provide a way to select force encryption from vendor partition" into lmp-mr1-dev
The Android Automerger [Thu, 8 Jan 2015 17:33:49 +0000 (09:33 -0800)]
merge in lmp-mr1-release history after reset to lmp-mr1-dev
Christopher R. Palmer [Mon, 22 Sep 2014 18:35:54 +0000 (14:35 -0400)]
init: Fix memory corruption when sanitizing platform paths
This commit fixes code that incorrectly increments s when it
hits the terminator character of the string being sanitized.
This means it will randomly start trashing memory beyond the
end of the string being sanitized until it happens to hit two
NULs (\0\0) which will break it out of the loop.
(cherry picked from commit
07f3fee164bd7ba14ce9b2dd3818006f07162845)
Bug:
18885357
Change-Id: If6b01fe2b9bd5985f08f1278deb03b311d0170dc
Paul Lawrence [Wed, 7 Jan 2015 19:44:51 +0000 (11:44 -0800)]
Provide a way to select force encryption from vendor partition
This allows a vendor to force encryption on devices via a vendor
partition flag:
ro.vold.forceencryption 1
Bug:
18764230
Change-Id: Id0049ce64e34e4f6f96e593aadd70c277ac131c8
The Android Automerger [Wed, 10 Dec 2014 14:12:13 +0000 (06:12 -0800)]
merge in lmp-mr1-release history after reset to lmp-mr1-dev
Eric Laurent [Tue, 9 Dec 2014 20:11:36 +0000 (12:11 -0800)]
audio: add usage "virtual source" to audio attributes.
Bug:
16006090.
Change-Id: I2d22b52e97095b57a6508b82bd11e27f860bb2e7
The Android Automerger [Thu, 27 Nov 2014 14:17:20 +0000 (06:17 -0800)]
merge in lmp-mr1-release history after reset to lmp-mr1-dev
Eric Laurent [Tue, 11 Nov 2014 22:03:35 +0000 (14:03 -0800)]
audio: new stream types
Added stream types for internal use by audio policy
and audio flinger.
Bug:
18067208.
Change-Id: I90fd4df9ed5e0d8fb8c220d67e95fd0e32a06f14
Daisuke Okitsu [Mon, 24 Nov 2014 08:37:55 +0000 (09:37 +0100)]
sdcard: mount sdcard with the noexec option
Vold mounts the sdcard with noexec, but the fuse deamon
mounts with exec, so it is still possible to execute
binaries:
/dev/fuse /storage/sdcard1 fuse rw,nosuid,nodev,relatime,
user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/block/vold/179:65 /mnt/media_rw/sdcard1 vfat rw,dirsync,
nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,
dmask=0007,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,
shortname=mixed,utf8,errors=remount-ro 0 0
With this change both vold and fuse mounts with noexec.
(cherry picked from commit
f777d6694eecf6e61d9859df2090199863050017)
Change-Id: I66cbfc3a3a89a26958f83577f5e7a5e27f99184e
The Android Automerger [Thu, 20 Nov 2014 14:14:08 +0000 (06:14 -0800)]
merge in lmp-mr1-release history after reset to lmp-mr1-dev
Nick Kralevich [Wed, 19 Nov 2014 21:33:22 +0000 (13:33 -0800)]
logd: throttle SELinux denials to 20/sec
Impose a limit of 20 selinux denials per second. Denials beyond
that point don't add any value, and have the potential to cause
crashes or denial of service attacks.
Do some other misc cleanup while I'm here.
Bug:
18341932
(cherry picked from commit
c234a1b879d9c9d8e1a797c5dcf3098249945748)
Change-Id: Ic5c96003db82e504baf301e87be5c8c539c73c2a
The Android Automerger [Tue, 18 Nov 2014 14:14:07 +0000 (06:14 -0800)]
merge in lmp-mr1-release history after reset to lmp-mr1-dev
The Android Automerger [Mon, 17 Nov 2014 14:14:10 +0000 (06:14 -0800)]
merge in lmp-mr1-release history after reset to lmp-mr1-dev
Nick Kralevich [Thu, 13 Nov 2014 23:17:29 +0000 (15:17 -0800)]
Introduce "adb keygen"
Introduce the "adb keygen" command.
Usage: adb keygen <filename>
This command creates an adb public/private key pair in a user
specified file. This can be used to create new adb keys, or rotate
existing keys.
Modify adb's key generation routines to use the HOSTNAME/LOGNAME
environment variables if available. This allows someone to override
the username/hostname embedded within the adb public key file if
desired. Fallback to the old mechanisms if those environment
variables aren't available.
Bug:
18342715
Change-Id: Ibccee6088d4609aa05ad6687d3a1d8a8689d3e8a
(cherry picked from commit
af782b9f2ac4fb817ded80d4317a45345bb3f992)
Change-Id: Ic76ffc9412171dddc879af0bbf6e20fbe1a8f057
Christopher Ferris [Fri, 14 Nov 2014 18:35:13 +0000 (18:35 +0000)]
Merge "Convert futex to cond wait." into lmp-mr1-dev
Christopher Ferris [Sat, 8 Nov 2014 23:57:11 +0000 (15:57 -0800)]
Convert futex to cond wait.
Switch to the better supported pthread_cond to handle the Wait/Wake
functions.
Also, increase the number of simultaneous threads in the thread tests.
Bug:
18381207
Change-Id: I63240208e8b7f641b3f35a3fc0bb1acf80dc796e
Daniel Rosenberg [Fri, 14 Nov 2014 01:08:16 +0000 (01:08 +0000)]
Merge "property_service: Added vendor build properties to load_all_props" into lmp-mr1-dev
Sami Tolvanen [Fri, 7 Nov 2014 18:20:02 +0000 (10:20 -0800)]
DO NOT MERGE: Do not mount devices with invalid verity metadata
The return value of read_verity_metadata is propagated to caller
even if the verity metadata is invalid, provided that it can be
read from the device. This results in devices with invalid verity
metadata signatures to be mounted normally, which is not desirable.
This change fixes the bug by changing the return value in case of
verification failure to FS_MGR_SETUP_VERITY_FAIL.
Bug:
15984840
Bug:
18120110
Change-Id: Ic29f37a23cb417c2538d60fb05de9dd310d50f4a
(cherry picked from commit
c95e9da39660f278ace4b14d688dc6818d1a38bf)
Sami Tolvanen [Fri, 7 Nov 2014 04:33:07 +0000 (20:33 -0800)]
DO NOT MERGE: Switch fs_mgr to use SHA-256 instead of SHA-1
Verity metadata signatures will be switched to SHA-256. Switch
fs_mgr signature verification to use the correct algorithm.
Needs matching changes from
https://googleplex-android-review.git.corp.google.com/#/c/579905/
https://googleplex-android-review.git.corp.google.com/#/c/583213/
https://googleplex-android-review.git.corp.google.com/#/c/583214/
https://googleplex-android-review.git.corp.google.com/#/c/583233/
Bug:
15984840
Bug:
18120110
Bug:
17917515
Change-Id: I8f90519bffa105a0eb7abeaad3aea1ffceb851e2
(cherry picked from commit
a3465e250cfc3c00931735711e11ad61cf84d8b2)
Daniel Rosenberg [Tue, 11 Nov 2014 01:01:33 +0000 (17:01 -0800)]
property_service: Added vendor build properties to load_all_props
Signed-off-by: Daniel Rosenberg <drosen@google.com>
(cherry picked from commit
b95122205dba535215ff6b011ef8009933c55d3b)
Bug:
18281574
Change-Id: Id1f1c4e9e0d1bfbcae3995fb7966d18bf7d6e06d
The Android Automerger [Wed, 12 Nov 2014 14:13:18 +0000 (06:13 -0800)]
merge in lmp-mr1-release history after reset to lmp-mr1-dev
The Android Automerger [Mon, 10 Nov 2014 14:12:18 +0000 (06:12 -0800)]
merge in lmp-mr1-release history after reset to lmp-mr1-dev
The Android Automerger [Sun, 9 Nov 2014 16:05:45 +0000 (08:05 -0800)]
merge in lmp-mr1-release history after reset to lmp-mr1-dev
The Android Automerger [Sat, 8 Nov 2014 14:15:46 +0000 (06:15 -0800)]
merge in lmp-mr1-release history after reset to
0eabf64ce0c649e4ef691ae1b70cb20d599dd429
JP Abgrall [Sat, 8 Nov 2014 01:14:14 +0000 (17:14 -0800)]
fs_mgr: let fsck.f2fs actually attempt a fix
The newer fsck.f2fs (1.4.0++) has better fix support, so invoke it.
Requires http://ag/583949 f2fs-tools update.
Bug:
17640053
Bug:
18292088
Change-Id: I42370d92b232e0bdbf28cccf7035a15dbffeb268
Signed-off-by: JP Abgrall <jpa@google.com>
Christopher Ferris [Thu, 6 Nov 2014 22:34:24 +0000 (14:34 -0800)]
Fix adb/fastboot windows compilations.
Many of the windows files where not including stdlib.h even though they
are using malloc/free calls.
Bug:
18283958
(cherry picked from commit
ae7bf0959bd3f79afbf365e41f015ed1c304afdc)
Change-Id: Iebc09cc314fa8f0ba6c6cd45ba26135052f156dd
The Android Automerger [Thu, 6 Nov 2014 14:18:10 +0000 (06:18 -0800)]
merge in lmp-mr1-release history after reset to
ac12f25004d728fe117c058446fccb0ca0a397c9