Commit graph

636 commits

Author SHA1 Message Date
Mark Salyzyn
7a3d66c9eb init: missing break statement
Change-Id: Iac4a19c404590c3faba6021c7e537b01805c2d45
2015-03-24 07:29:22 -07:00
Elliott Hughes
930974cedf Add missing parenthesis in init log message.
Change-Id: Iddcd8a002bfc692b1e70d59fa8c6530306c500fa
2015-03-23 08:07:19 -07:00
Sami Tolvanen
8d6ea4bed4 Fix the number of arguments for verity commands
Neither of the built-in verity state commands accept arguments, so
set the number of required arguments to zero.

Change-Id: Id57fe671b6b82eaf1e43b8ed7ff9d1e502ada5bd
2015-03-22 12:41:46 +00:00
Elliott Hughes
cd67f00e18 Always use strerror to report errno.
Change-Id: Icd18e4bd7dc093c18967f45b99cd451359457b03
2015-03-20 17:05:56 -07:00
Elliott Hughes
bf684148e2 Merge "Ensure all init commands are documented." 2015-03-21 00:01:27 +00:00
Elliott Hughes
91a3be547c Ensure all init commands are documented.
Change-Id: I21ef4d88b33337093396e14d792e1ff1fe0bfa17
2015-03-20 16:59:59 -07:00
Daniel Rosenberg
72510c56ec Merge "init: refactor firmware loading locations into table" 2015-03-20 23:55:30 +00:00
Elliott Hughes
81399e1e0e Use unique_ptr to call closedir.
Change-Id: I8f572a06ce59283e5bd444ae0491dea71b0ea304
2015-03-20 16:03:41 -07:00
Daniel Rosenberg
d1d9602f89 init: refactor firmware loading locations into table
Change-Id: I3ce8f9d237bf783335ae85540306aa539a8da568
Signed-off-by: Daniel Rosenberg <drosen@google.com>
2015-03-20 15:42:01 -07:00
Elliott Hughes
db3f267c99 Clean up property setting code.
In particular, ensure that all property_set failures are reported.

Change-Id: Iab94a28bcba2346868c0f39bcfe26e55a2c55562
2015-03-20 10:03:32 -07:00
Elliott Hughes
1b8dbe7441 Merge "Lose bootmode and console globals." 2015-03-20 16:29:37 +00:00
Sami Tolvanen
ddd0639e7e Merge "Add init command to set verified properties" 2015-03-20 15:59:33 +00:00
Elliott Hughes
d679bc9e56 Lose bootmode and console globals.
Also remove some code marked "TODO: these are obsolete. We should delete
them".

Change-Id: I6255cee4cb6680bfcbc5b46366990309cba95037
2015-03-20 08:58:42 -07:00
Rom Lemarchand
6a52443d31 Parse boot properties from device tree
- Make sure compatible DT node is "android,firmware"
- Set ro.boot.* properties from firmware/android/ DT node

(cherry-pick of cbcbea27c70846a96f4bba2f7cb245f937de4d3f.)

Change-Id: If3d0716831516cb3d3fde1f75d57e2691d42d054
2015-03-19 16:32:02 -07:00
Elliott Hughes
bbc01d8254 Merge "Remove /proc/cpuinfo parsing" 2015-03-19 23:21:29 +00:00
Sami Tolvanen
acbf9bef43 Add init command to set verified properties
Add a command that updates dm-verity state and sets partition.%.verified
properties used by adb remount.

This is needed in init since fs_mgr cannot set properties:
    I6a28cccb1ccce960841af20a4b20c32d424b5524

Change-Id: I0fdf5bc29c56690dcadff9d0eb216d3c68483538
2015-03-19 10:11:17 +00:00
Elliott Hughes
ee2e362f8b Merge "Remove useless memset from init." 2015-03-19 05:07:33 +00:00
Elliott Hughes
0dccc888bd Remove useless memset from init.
Change-Id: Ia880810bb2c9a976dceeb0ffdba0cb98e69e3c6d
2015-03-18 20:17:31 -07:00
Elliott Hughes
7010301933 Remove chroot from init.
This is not obviously useful. Let's wait until we have an actual need.

Change-Id: I2c75c96314b281e89df25b6ed202b3dd5dfdaf15
2015-03-18 12:41:54 -07:00
Elliott Hughes
cc86fb2b29 Switch init over to _PATH_DEFPATH.
Bug: 19564110
Change-Id: I343b4a360b10319dca13ab01f2d411ff940e9052
2015-03-17 20:01:13 -07:00
Dan Albert
c007bc3856 Revert "Revert "Create libbase.""
This reverts commit a7870d8816.
2015-03-16 10:08:46 -07:00
Nicolas Geoffray
a7870d8816 Revert "Create libbase."
Breaks internal master.

This reverts commit 98ff77204c.

Change-Id: I18dc6021cb43efff8aa88486c2d980dc2b8eedba
2015-03-16 11:07:29 +00:00
Elliott Hughes
641d3e8ea0 Remove chdir from init.
Change-Id: Ib2880c6cb18db613deac04ee3b06b9719f5248b9
2015-03-15 10:52:20 -07:00
Johan Redestig
0b42ba24ac Document mkdir behavioural change
Since 27164dc mkdir will update mode, owner and group even
if the directory exists already

Change-Id: Ic37975d118a87afded5bfade775cb3d0d3b19892
2015-03-15 17:47:36 +01:00
Elliott Hughes
285c2ae04a Merge "Document the mount option string in the readme.txt" 2015-03-15 16:39:56 +00:00
Niklas Tibbling
bc3f69f190 Document the mount option string in the readme.txt
also make a distinction between flag and option.

Change-Id: Ia872bc8dc98b3459f9c1e992d096c115699357af
2015-03-15 16:20:44 +00:00
Dan Albert
98ff77204c Create libbase.
Move StringPrintf and the string based file I/O from libutils to
libbase.

Change-Id: I0297a6063874b9d92100e0dd5123fddfbda932fe
2015-03-14 16:36:18 -07:00
Rom Lemarchand
74b34f3cb7 Remove /proc/cpuinfo parsing
- Clean up the paths for ro.revision and ro.hardware parsing
- Use ro.hardwre in ueventd instead of parsing the kernel command line

(cherry-pick of 38b340a52f8e864650db8bae1eb88d5c00485db0.)

Bug: 19366018
Change-Id: I018a293f3d46e736a8b65132b5b00b0f7c20edae
2015-03-14 11:05:48 -07:00
Elliott Hughes
5878aa92cd Remove obsolete setkey.
It's undocumented and unused.

Change-Id: I685dc900adbc14f2e8b4eeebb1e4d111782f141d
2015-03-13 15:37:54 -07:00
Stephen Smalley
d4b2d8923f Remove getsebool/setsebool from init and toolbox.
These were leftovers from the SELinux boolean support that
was originally merged.  Since Android prohibits SELinux policy
booleans, we can just drop it.

Change-Id: I02f646a7d8db65e153702205b082b87a73f60d73
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2015-03-13 14:01:58 -04:00
Nick Kralevich
cee683e290 builtins: remove setenforce command
Adding "setenforce 0" to init.rc isn't a supported way to turn off
SELinux, and doesn't work with AOSP SELinux policy. Remove the code
from init.

Change-Id: If8c8149560789c9a7ba518a0a100e6033bb68898
2015-03-11 17:48:45 -07:00
Elliott Hughes
58c3bacc38 Fix a printf format string (caught by clang but not GCC).
Change-Id: I665756615eef74b05ef92f5865d910f29ead0695
2015-03-11 12:31:53 -07:00
Elliott Hughes
a4d98484a2 Merge "Implement exec." 2015-03-11 18:20:29 +00:00
Elliott Hughes
7c0c15f0ed Fix outdated comments in grab-bootchart.sh.
I've been deliberately vague about the name of the readme because I want to
come back and switch to markdown, but that probably won't happen today.

Change-Id: I60651703709bbfd499227f882eb949396e8f4f6c
2015-03-06 13:25:32 -08:00
Sami Tolvanen
8ee42f9c50 Merge "Add init support for dm-verity logging mode" 2015-03-04 20:42:09 +00:00
Sami Tolvanen
8ff0190835 Add init support for dm-verity logging mode
Add a built-in command for loading verity state. If dm-verity
will be started in logging mode, trigger verity-logging.

Needs changes from
  Ibb82953594d234f81ad21c40f524190b88e4ac8f

Change-Id: I5af4918f2f14fdd4d07f51c55837e08111fd3748
2015-03-04 03:07:47 +00:00
Elliott Hughes
8d82ea05cb Implement exec.
Change-Id: I20329bc9b378479d745b498d6a00eca0872cd5ab
2015-02-25 17:55:34 -08:00
Mark Salyzyn
d4e5c32af7 init: grab-bootchart.sh: run bootchart and display results
- KISS as all options are now passed to adb for better or worse
- runs bootchart and immediately displays the results

Bug: 19485335
Bug: 18390773
Change-Id: Id32930031371d0368e605810f0c998232a1d4f16
2015-02-24 13:56:43 -08:00
Yabin Cui
e2d63af002 Move sprintf to snprintf.
Bug: 19340053
Change-Id: Id0d866e6195ed4752b4be6081eeb2aab8b1dbe9a
2015-02-17 19:27:51 -08:00
Elliott Hughes
0f58cb0035 Remove unused variable BOOTCHART_DEFAULT_TIME_SEC.
Change-Id: Id43c73dd32d2f9f1eee9592b55aa3fd3c02094b2
2015-02-13 16:17:42 -08:00
Elliott Hughes
841b263fae Further refactoring of the bootchart code.
Change-Id: Ifed6ae8d481b605139fd27799574de4c2d0f5908
2015-02-13 15:15:11 -08:00
Yongqin Liu
a197ff12dd bootchart: fix bootchart can not be triggered problem
bootchart uses a file on the data partition to decide if it should collect
data for bootchart, but the data partition will be mounted by the mount_all
command in the "on fs" section, and it will be only added into the action
queue when command "trigger fs" is executed, but that's after the
bootchart_init action (late_init).

This change makes bootchart_init a builtin command of init,
and make it executed as the first command of "on post-fs" section
which will be triggered after the "on fs" section.

This change also refactors the bootchart code to all be in bootchart.cpp.

Change-Id: Ia74aa34ca5b785f51fcffdd383075a549b2a99d9
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
2015-02-12 12:13:24 -08:00
Johan Redestig
7e952f41f1 Bump do_write buffer size
In the case of do_write (write to generic file) there
is really no relation to the PROP_VALUE_MAX limitation
of system properties. The current value, 92, is not so
much for writing to files so bump it a bit.

Ideally there should not be any low hard limit in this
case. Either expand_props should allocate the output
buffer or take the output fd and to streaming write.
Such a change is rather invasive though and at this
point in time it seems reasonable that one dont want
more than 256 character strings in the init files.

Change-Id: I846a282ae4e747e6171eef38b302b46287951451
2015-02-07 10:57:10 +01:00
Elliott Hughes
f682b4786a Clean up reading and writing in init.
This isn't particularly useful in and of itself, but it does introduce the
first (trivial) unit test, improves the documentation (including details
about how to debug init crashes), and made me aware of how unpleasant the
existing parser is.

I also fixed a bug in passing --- unless you thought the "peboot" and "pm"
commands were features...

Bug: 19217569
Change-Id: I6ab76129a543ce3ed3dab52ef2c638009874c3de
2015-02-06 14:20:30 -08:00
Elliott Hughes
c0e919c920 Stop using #if for conditional compilation.
Use regular 'if' to prevent bitrot.

Also remove remaining typedefs.

Change-Id: I2e6ca928e2db29b88b643cf990ff05cfb0be94a6
2015-02-04 17:16:11 -08:00
Elliott Hughes
24627906bf Use TEMP_FAILURE_RETRY, always build bootchart.cpp.
Also switch the revision parsing over to sscanf as promised. I haven't
done the hardware parsing because I don't yet know whether we actually need
to keep the space-stripping code.

Change-Id: Ic33378345cd515cb08d00c543acf44eb72673396
2015-02-04 10:25:09 -08:00
Elliott Hughes
2145779c87 Fix clang "ueventd.cpp:111:1: error: no return statement in function returning non-void".
Change-Id: I69c9e5534975bffa0fbf98ca4af50400f6b94aa0
2015-02-04 10:19:50 -08:00
Elliott Hughes
f3cf438714 Build init as C++.
This is just the minimal change to keep it building.

Change-Id: I245c5b8413a1db114576c81462eb5737f5ffcef2
2015-02-04 08:59:10 -08:00
Dmitriy Ivanov
3107a2f5f2 Fix x86_64 build
Change-Id: Iaa3a641907de55b398a3bdd0bbc63cbb9d367982
2015-02-03 16:43:15 -08:00
Elliott Hughes
d4a6fc5bc2 Merge "Init: Fix Clang unsupported attributes" 2015-02-03 22:51:47 +00:00