Commit graph

730 commits

Author SHA1 Message Date
Elliott Hughes
86920d80b6 am bca8dc6a: am 000c009b: Merge "Reduce the coldboot timeout to 1s."
* commit 'bca8dc6a44b3505e8d72b9247f813f8070211393':
  Reduce the coldboot timeout to 1s.
2015-05-14 20:34:32 +00:00
Elliott Hughes
c7331d02d1 Reduce the coldboot timeout to 1s.
5s was already a ridiculously long time to delay booting, and some OEMs are
trying to make it even more insane:

  https://www.codeaurora.org/cgit/quic/la/platform/system/core/commit/?h=lp&id=fd23edd48272976d2fb333f377242173f92aa343

Let's at least ensure that Nexus and Android One devices don't take forever
to boot...

Bug: http://b/19899875
Change-Id: I9680c166a759360f34118e51cd0645e12b6bd5c8
2015-05-14 12:03:14 -07:00
Elliott Hughes
2550355ceb resolved conflicts for merge of d410a9b3 to mnc-dev-plus-aosp
Change-Id: I2e8e6c9a2024e0a753d3912111ccd1c2bfbfef10
2015-05-12 20:16:40 -07:00
Tom Cherry
cce7e93b28 Fix insmod module size
read_file() used to append a new line character to the end of the buffer it
returns, because parse_config() isn't able to cope with input that's not
'\n'-terminated. Fix read_file() to be less insane, and push the workarounds
into the parse_config() callers.

Longer term we should rewrite parse_config().

Bug: http://b/21079470
Change-Id: Ie9d9a7adcd33b66621726aef20c4b8cc51c08be7
(cherry picked from commit eaa3b4ec6f)
2015-05-12 19:42:38 -07:00
Emmanuel Berthier
30cc3d7249 Enable property expansion for insmod
Useful for dynamic kernel module location.
This permits to use init rule like:

  insmod ${persist.modules.location}/<module_name>

Change-Id: If7479bdcb4e69ea7666f52a0075c785be025c2e9
Signed-off-by: Emmanuel Berthier <emmanuel.berthier@intel.com>
(cherry picked from commit ac41230cbc)
2015-05-12 15:01:02 -07:00
Tom Cherry
eaa3b4ec6f Fix insmod module size
read_file() used to append a new line character to the end of the buffer it
returns, because parse_config() isn't able to cope with input that's not
'\n'-terminated. Fix read_file() to be less insane, and push the workarounds
into the parse_config() callers.

Longer term we should rewrite parse_config().

Change-Id: Ie9d9a7adcd33b66621726aef20c4b8cc51c08be7
2015-05-12 14:18:49 -07:00
Andres Morales
b7f8b91040 am 86aeb11e: Merge "load ro.recovery_id property from recovery partition" into mnc-dev
* commit '86aeb11ed047b3698948c4eee8fbaccd20131ecb':
  load ro.recovery_id property from recovery partition
2015-05-09 00:46:52 +00:00
Andres Morales
cb3fce80fa load ro.recovery_id property from recovery partition
Change-Id: I9dc1f325e353375d9c1c8ed949636e2404601076
(cherry picked from commit db5f5d4367)
2015-05-08 17:35:13 -07:00
Andres Morales
db5f5d4367 load ro.recovery_id property from recovery partition
Change-Id: I9dc1f325e353375d9c1c8ed949636e2404601076
2015-05-08 17:23:24 -07:00
Andres Morales
d7f055bc76 am d34c722c: Merge changes Iac33dbaa,I18fcd37d into mnc-dev
* commit 'd34c722c59b13c80f89cfdeaf45ff38a3a12a6c5':
  pass in correct buffer to print_id
  stop including rootdir build.prop
2015-05-08 16:40:44 +00:00
Andres Morales
dff18174d2 stop including rootdir build.prop
merged with default.prop

Change-Id: I18fcd37ddc63e3607278d0741181d0779118132d
2015-05-08 09:20:13 -07:00
Andres Morales
5147eacad1 stop including rootdir build.prop
merged with default.prop

Change-Id: I18fcd37ddc63e3607278d0741181d0779118132d
2015-05-07 15:18:20 -07:00
Elliott Hughes
fdf2546ae7 am a5aa7a11: am 55c2e1f4: Merge "Clean up init /proc/cmdline handling."
* commit 'a5aa7a11266f1d407275b78981fc864c6c863358':
  Clean up init /proc/cmdline handling.
2015-05-07 18:31:16 +00:00
Elliott Hughes
e5ce30fed8 Clean up init /proc/cmdline handling.
Helped debug a problem where the N9 bootloader incorrectly
concatenated the various command lines.

Bug: http://b/20906691
Change-Id: I0580b06f4185129c7eedf0bdf74b5ce17f88bf9c
2015-05-07 11:02:08 -07:00
Elliott Hughes
cf0a113811 am 950c6250: am 5138958c: Merge "Enable property expansion for insmod"
* commit '950c6250ad5c67700d4bffcaa0671b4c145fa563':
  Enable property expansion for insmod
2015-05-06 22:44:23 +00:00
Elliott Hughes
5138958cb3 Merge "Enable property expansion for insmod" 2015-05-04 22:54:10 +00:00
Paul Lawrence
b8fca94e81 Merge commit '2fe6a631' into manualmerge
Change-Id: Ib8d61ee25711e86a2df3705e87904a50c0ef5187
2015-04-29 09:56:26 -07:00
Paul Lawrence
806d10be23 Securely encrypt the master key
Move all key management into vold
Reuse vold's existing key management through the crypto footer
to manage the device wide keys.

Use ro.crypto.type flag to determine crypto type, which prevents
any issues when running in block encrypted mode, as well as speeding
up boot in block or no encryption.

This is one of four changes to enable this functionality:
  https://android-review.googlesource.com/#/c/148586/
  https://android-review.googlesource.com/#/c/148604/
  https://android-review.googlesource.com/#/c/148606/
  https://android-review.googlesource.com/#/c/148607/

Bug: 18151196

Change-Id: I6a8a18f43ae837e330e2785bd26c2c306ae1816b
2015-04-28 15:34:10 -07:00
Nick Kralevich
61c086e54e am 3ef42dd2: am f0d24737: Merge "init: remove support for disabled SELinux"
* commit '3ef42dd20f8d54d98cc5e95995761d2f6b5b4950':
  init: remove support for disabled SELinux
2015-04-28 21:33:36 +00:00
Paul Lawrence
658801ff9f resolved conflicts for merge of 6a5244bc to mnc-dev-plus-aosp
Change-Id: Ied1bbf09aeeed53daefb53c559498066abd9b767
2015-04-28 14:28:44 -07:00
Paul Lawrence
adc385c265 am 2306880f: am 6e8c8f54: Merge "Revert "Only run vold command when file encryption enabled""
* commit '2306880f07c01f39b9f6f5d3e3aee3e2ca945adf':
  Revert "Only run vold command when file encryption enabled"
2015-04-28 21:10:37 +00:00
Nick Kralevich
d34e407aeb init: remove support for disabled SELinux
Remove support for androidboot.selinux=disabled. Running with SELinux
disabled is not a supported configuration anymore. SELinux must be
in enforcing in shipping devices, but we also support permissive for
userdebug/eng builds.

Don't try security_setenforce() if we're already in enforcing mode.
A kernel compiled without CONFIG_SECURITY_SELINUX_DEVELOP does
not have a permissive mode, so the kernel will already be enforcing
once the policy is loaded.

Bug: 19702273
Change-Id: I07525a017ddb682020ec0d42e56a2702c053bdeb
2015-04-28 13:11:07 -07:00
Paul Lawrence
2b3a493946 Merge "Revert "Securely encrypt the master key"" 2015-04-28 19:15:40 +00:00
Paul Lawrence
7ac2807546 Revert "Securely encrypt the master key"
This reverts commit 4bf1887c78.

Change-Id: Ie6d1f39de530b99b50a27ddc45bcc900a24e04b5
2015-04-28 19:15:01 +00:00
Paul Lawrence
6e8c8f542d Merge "Revert "Only run vold command when file encryption enabled"" 2015-04-28 19:14:45 +00:00
Paul Lawrence
34276a1534 Revert "Only run vold command when file encryption enabled"
This reverts commit efe190e023.

Change-Id: Ib15af9a85b0b885a388bda28511a6fc39a777264
2015-04-28 19:12:35 +00:00
Paul Lawrence
e29c5b299c am 2088427c: am a71ef0d5: Merge "Only run vold command when file encryption enabled"
* commit '2088427c8c01c1cbc11496a73882df6264026f14':
  Only run vold command when file encryption enabled
2015-04-28 15:40:58 +00:00
Paul Lawrence
a71ef0d5b5 Merge "Only run vold command when file encryption enabled" 2015-04-28 15:24:10 +00:00
Paul Lawrence
7880f812f7 resolved conflicts for merge of 72fad66f to mnc-dev-plus-aosp
Change-Id: Ib6659a50ee3f1f1ac3719e5d3397c21f786b9afc
2015-04-27 14:44:15 -07:00
Paul Lawrence
9234b169e6 Merge "Securely encrypt the master key" 2015-04-27 20:08:53 +00:00
Emmanuel Berthier
ac41230cbc Enable property expansion for insmod
Useful for dynamic kernel module location.
This permits to use init rule like:

  insmod ${persist.modules.location}/<module_name>

Change-Id: If7479bdcb4e69ea7666f52a0075c785be025c2e9
Signed-off-by: Emmanuel Berthier <emmanuel.berthier@intel.com>
2015-04-27 13:50:09 +02:00
Nick Kralevich
eab1e21996 am ecf184c9: am 9c9280d8: Merge "init: get rid of the remaining double mounts"
* commit 'ecf184c901b78994773d687763c1478752e9375e':
  init: get rid of the remaining double mounts
2015-04-26 22:14:51 +00:00
Nick Kralevich
14adea307d am 45a49d0e: am ccac2be8: Merge "init: use SELinux /dev/null if available"
* commit '45a49d0eb7e2e9fc3d2c48884c84f6a6c7397720':
  init: use SELinux /dev/null if available
2015-04-26 22:14:47 +00:00
Nick Kralevich
ada332e4a0 am ecf184c9: am 9c9280d8: Merge "init: get rid of the remaining double mounts"
* commit 'ecf184c901b78994773d687763c1478752e9375e':
  init: get rid of the remaining double mounts
2015-04-26 02:11:28 +00:00
Nick Kralevich
ec9bd166cc am 45a49d0e: am ccac2be8: Merge "init: use SELinux /dev/null if available"
* commit '45a49d0eb7e2e9fc3d2c48884c84f6a6c7397720':
  init: use SELinux /dev/null if available
2015-04-26 01:39:13 +00:00
Nick Kralevich
f667a3247a init: get rid of the remaining double mounts
Don't double mount /dev and its subdirectories anymore. Instead, the
first stage init is solely responsible for mounting it.

Don't have init prepare the property space. This is the responsibility
of the second stage init.

Don't have SELinux use the property space to determine how we should
be running. Instead, create a new function and extract the data we
need directly from /proc/cmdline. SELinux needs this information in
the first stage init process where the property service isn't available.

Change-Id: I5b4f3bec79463a7381a68f30bdda78b5cc122a96
2015-04-25 18:29:26 -07:00
Nick Kralevich
e34577ce1b init: use SELinux /dev/null if available
SELinux provides it's own /dev/null character device at
/sys/fs/selinux/null. This character device is exactly the same
as /dev/null, including the same major/minor numbers, and can
be used wherever /dev/null is used.

Use /sys/fs/selinux/null instead of trying to create our own
/dev/__null__ device. This moves us one step closer to eliminating
all uses of mknod() by init.

/sys/fs/selinux/null is only available once the /sys/fs/selinux filesystem
is mounted. It's not available to the first stage init, so we
still have to fall back to mknod then.

Change-Id: Ic733767ea6220a130537de33cc478ae79578ce20
2015-04-25 16:48:23 -07:00
Nick Kralevich
1c2457ffda am b31c3a5a: am 178299fd: Merge "init: don\'t double mount /proc and /sys"
* commit 'b31c3a5a453cd9f472698068af9909e80a96ab2c':
  init: don't double mount /proc and /sys
2015-04-25 23:28:45 +00:00
Nick Kralevich
2ae7d4eefd am 6b6df173: am f8b0743e: Merge "init: fix write_file checkreqprot logic error"
* commit '6b6df1733711ace006e0f4f9d44c718f85d2f70d':
  init: fix write_file checkreqprot logic error
2015-04-25 23:28:44 +00:00
Nick Kralevich
178299fd45 Merge "init: don't double mount /proc and /sys" 2015-04-25 23:11:27 +00:00
Nick Kralevich
9dec93bfeb init: don't double mount /proc and /sys
The first stage init mounts /proc and /sys, and then the second
stage init also mounts /proc and /sys on top of the existing mount.
Only mount these two directories once, in the first stage init.

Not yet fixed: the double mounting of /dev. Removing the double
mounting doesn't work right now because both init stages are trying
to create a property space, and if the double mount of /dev goes away,
the property service in the second stage init fails to work.

Change-Id: I13719027a47526d074390c2b1a605ad99fb43a8f
2015-04-25 15:50:03 -07:00
Nick Kralevich
eedbe81f75 init: fix write_file checkreqprot logic error
write_file() returned -errno on error, not -1. Callers who check for
-1 would falsely believe that the write was successful when it wasn't.
Fixup write_file so that it return -1 on error consistent
with other functions.

Change-Id: Ic51aaf8678d8d97b2606bd171f11b3b11f642e39
2015-04-25 15:36:13 -07:00
Nick Kralevich
04faed7aba am ecfb3664: am 8929c77a: Merge "init: remove mkdir /dev /proc /sys"
* commit 'ecfb3664fea6cbe39d94459ceb06a91f57006820':
  init: remove mkdir /dev /proc /sys
2015-04-25 21:30:45 +00:00
Nick Kralevich
a1f6a4b139 init: remove mkdir /dev /proc /sys
These directories are already present in the initial ramdisk, and
these mkdir calls are no-ops.

Change-Id: I528f9e96a3471de904845a2f9e09c1b6ff83a708
2015-04-25 13:48:26 -07:00
Elliott Hughes
2b57981b05 am ae3154e3: am 2899c94b: Merge "Switch init to epoll."
* commit 'ae3154e3968e991fb1e9a6b47bedd1e0819f7925':
  Switch init to epoll.
2015-04-25 05:21:43 +00:00
Elliott Hughes
929f407076 Switch init to epoll.
Not just because it's what the cool kids are doing --- it also lets us
simplify the inner loop and decouple it from whatever systems want to
be woken to perform some activity if there's data to be read on some fd.

Currently this is just used to clean up the existing signal handling,
keychord, and property service code.

Change-Id: I4d7541a2c4386957ad877df69e3be08b96a7dec5
2015-04-24 21:13:44 -07:00
Elliott Hughes
52e5e55cac am 0a4f0be2: am df5d4482: Merge "Clean up property service initialization."
* commit '0a4f0be2aaf697ca4b0938b31fc19bb007e87d0d':
  Clean up property service initialization.
2015-04-25 02:57:36 +00:00
Elliott Hughes
c6c26ed781 Clean up property service initialization.
All the code that was being delayed does is create a socket. We can
do that straight away, avoid the overhead, and simplify our main loop.

The keychord fd, on the other hand, seems a little tricky. It looks
like /dev/keychord isn't immediately available, at least not on N9;
we have to wait for ueventd to set us up the bomb.

Change-Id: I020e75b8e4b233497707f0a3cbbb6038b714161f
2015-04-24 19:15:20 -07:00
Elliott Hughes
799d8a165b am d503cc21: am b749be0b: Merge "Clean up init signal handling a little."
* commit 'd503cc21ec663b39e8d84feb373d3a287bb02d63':
  Clean up init signal handling a little.
2015-04-25 01:31:14 +00:00
Elliott Hughes
9042cae40b Clean up init signal handling a little.
We can set it up earlier, and error reporting like this helped me find
the SELinux problem with the last change to this code.

Change-Id: If0f38bc5ff0465c4030e2d39d34f31f49b2d8487
2015-04-24 17:43:21 -07:00