If we process the import directive inline, then the ordering of the
commands for the "on xxx" sections would be a little unexpected. The
init.rc files do not really have an implied order as to which section
appears and gets processed first. The init code itself provides that
ordering explicitly. For the user, the expectation is that if both the
current file and the imported file define a section (e.g. "on init"),
then the commands in the current file will be executed first, and then
the ones from the imported file(s).
The current implementation did not do that. It processed the import
directive inline, and thus the imported (i.e. dependent) files would
appear first in the command lists for the sections. This created
unintended side effects and the solution would have been to try and
put the import lines somewhere in the middle of the init file. This
would be difficult to notice and hard to extract the dependencies.
To solve this, we add the imports to a list for each file being parsed
and process the list after finishing parsing the file. This provides
predictable order for imports and provides a logical flow from the
user perspective: the currently parsed file gets to run its commands
before the files being imported.
Change-Id: I06dc35ff286314060e16b18923683cd2787269de
Signed-off-by: Dima Zavin <dima@android.com>
Also, clean up how we initialize the ro.xx properties and process
the kernel command line.
Change-Id: Iedda6c90e31340a189171a44b2767480403354f7
Signed-off-by: Dima Zavin <dima@android.com>
This removes the hardcoding of the file import in init and instead
allows the init.rc file to fully control what is loaded.
Change-Id: I933e5bbab57f1e8705a370d660f92c6508da94d2
Signed-off-by: Dima Zavin <dima@android.com>
Adds new property syntax in init files during init file filename
expansion during the import command:
${prop.name}
So, one can do: import /init.${ro.hardware}.usb.rc
Should convert other usages of property names to use the new function.
Change-Id: I9205d7d7a2da620bc8e6b89ac0eb554fad53ded3
Signed-off-by: Dima Zavin <dima@android.com>
The property service is still started later, but the property area
and the initial boot properties are initialized before the init.rc
file is processed. This allows init.rc files to have access to boot
properties during parsing.
Change-Id: Iae9ed1093c821831a864b39ae6bc697e62b94757
Signed-off-by: Dima Zavin <dima@android.com>
Use the same call sequence that 'adb pull' uses for creating the
output file. adb_open_mode() apparently does not work on Windows
hosts.
Bug 5733007
Change-Id: I48d719c4657c93e19f6790cf1c6da610d49f5806
This patch uses mmap() to read /data/system/packages.list
This avoids depending on the size of a fixed static buffer
which may happen to be too short for systems with a lot of
packages installed.
Also avoids calling malloc() which we don't want to trust here
since run-as is a setuid program.
Change-Id: I1d640a08b5d73af2fc80546b01c8d970c7f6b514
The reason for the crash is that ADB on Windows uses WaitForMultipleObjects to
wait on connection events. When number of connections exceeds 64, ADB crashes,
because WaitForMultipleObjects API doesn't support more than 64 handles. This
CL contains a fixer routine that allows waiting on an arbitrary number of
handles.
(cherry picked from commit ac52833e48)
Change-Id: I8ad264765e5b38d01a31e42b445f97ea86e49948
The reason for the crash is that ADB on Windows uses WaitForMultipleObjects to
wait on connection events. When number of connections exceeds 64, ADB crashes,
because WaitForMultipleObjects API doesn't support more than 64 handles. This
CL contains a fixer routine that allows waiting on an arbitrary number of
handles.
Change-Id: I83f712e552018df308318154c27df184015a16ee
Show the symbol offset, when available.
Centralized formatting of native stack traces in libcorkscrew.
It's handy for automated tools if all stacks look the same.
Since we already made them all look them same, we might as well
do the formatting in just one place.
Do not strip the Thumb bit on ARM. This fixes an off-by-one
issue that could happen when resolving a PC that was at the
very beginning of a Thumb function, since the symbol table would
have the Thumb bit set but since we stripped the bit from our
PC, we would be looking for an address one byte before the
one listed in the symbol table. It's also quite useful to see
whether a given function is executing in Thumb mode just by glancing
at the PC.
Change-Id: Icaa29add85ce0bcafe24d5ce2098e138d809e2ab