summaryrefslogtreecommitdiff
path: root/init/builtins.cpp
AgeCommit message (Collapse)Author
2016-11-17Merge changes from topic 'slow_log'Wei Wang
* changes: init: fix undefined behavior in ExecuteCommand Revert "Revert "init: warn slow action""
2016-11-16init: fix undefined behavior in ExecuteCommandWei Wang
ExecuteCommand may change command_ vector which leads undefined behavior This bug is found when adding logs in ExecuteCommand printing our Command class fields Bug: 32838381 Test: on emulator Change-Id: I96468bd2192ca80013871a3a6ac4132149363fff
2016-11-16Add flags to restorecon_recursive to traverse filesystemsPaul Lawrence
Use to solve the problem of tracefs conditionally being mounted under debugfs and needing restorecon'd without boot performance penalty. Also move skip-ce to a flag for consistency. Test: Check that trace_mount has correct attributes after boot Bug: 32849675 Change-Id: Ib6731f502b6afc393ea5ada96fa95b339f14da49
2016-11-16Only restorecon CE storage after unlocked.Jeff Sharkey
On FBE devices, the filenames inside credential-encrypted directories are mangled until the key is installed. This means the initial restorecon at boot needs to skip these directories until the keys are installed. This CL changes the implementation of the "restorecon_recursive" built-in command to use the new SKIPCE flag to avoid labeling files in CE directories. vold will request a restorecon when the keys are actually installed. (cherrypicked from commit 1635afe83d1ebd6b5f1fac1e9c6c6b5cd1c93204) Bug: 30126557 Test: Cherry-picked from master Change-Id: I320584574a4d712c493b5bbd8a79b56c0c04aa58
2016-11-15Merge "Switch fastboot/init/libprocessgroup to std::this_thread::sleep_for."Elliott Hughes
am: f3e731b3c5 Change-Id: I2028bb8835c5e55e1bf8c88c3395253ded9d66d3
2016-11-14Switch fastboot/init/libprocessgroup to std::this_thread::sleep_for.Elliott Hughes
Bug: http://b/32878766 Test: boots Change-Id: Ie0ddfb7e60f2da5f6eefbb10c83a92e88c137ae3
2016-11-14Merge "init start time tracking."Elliott Hughes
am: 601bf9e7c9 Change-Id: Idd707d4694a4339e26884fe72b8f0c08c4100daf
2016-11-14Merge "init start time tracking."Elliott Hughes
2016-11-12init start time tracking.Elliott Hughes
With this change, init sets a property "init.start" to show the CLOCK_BOOTTIME time at which init itself started, and for each service an "init.svc.<name>.start" property to show the CLOCK_BOOTTIME time at which that service was most recently started. These times can be used by tools like bootstat to track boot time. As part of this change, move init over to std::chrono. Also, rather than make the command-line argument handling more complex, I've switched to using an environment variable for communication between first- and second-stage init, and added another environment variable to pass the start time of the first stage through to the second stage. Bug: http://b/32780225 Test: manual Change-Id: Ia65a623e1866ea688b9a5433d6507926ce301dfe
2016-11-10Merge "Implement Reboot bootloader via bootloader_message"Vineela Tummalapalli
am: e759c83bde Change-Id: Id0a0e9e9c10f3df206138f297d2acafa87dc4ebf
2016-11-08Implement Reboot bootloader via bootloader_messageVineela Tummalapalli
- Write reboot bootloader message to misc - Clarify naming for reboot to recovery BUG: https://issuetracker.google.com/issues/32474515 Change-Id: I4e42509bfcf572e37c8fc070d6571afe406a48b6 Signed-off-by: Vineela Tummalapalli <vineela.tummalapalli@intel.com> Signed-off-by: Bruce Beare <bruce.j.beare@intel.com> Reviewed-on: https://android.intel.com/548494
2016-10-18init: use libbootloader_message.Yabin Cui
Bug: 29582118 Change-Id: I6285b29774a11d6dda8496c7c73e4c1d17a672bd (cherry picked from commit 0b1252cca0ecd5603e0fc0d5dadde91410b6b557)
2016-10-14resolve merge conflicts of a4398c1 to stage-aosp-master am: 195669febcElliott Hughes
am: b2ab1c43cb Change-Id: I412943235ad6cd908aca04c56aa19a3d2bbb5413
2016-10-13Move off std::sto* function which abort on failure.Elliott Hughes
Bug: http://b/31403370 Test: builds, boots, libbase tests pass Change-Id: I89cd7ca3d8f1c8a1bad0ddf3043439449d19a293
2016-10-10Merge "Update the header path for ext4_utils." am: 5bc3ce85cf am: 148b85b050Tao Bao
am: 2815ac5584 Change-Id: I966296de6eb4ff7518b9cfcd5853fe919765b826
2016-10-09Update the header path for ext4_utils.Tao Bao
Test: `mmma system/core` Change-Id: I6291d10d6c8d4972aeca55596baa83f555496193
2016-09-06Split fstab mount into 2 phasesWei Wang
This will make it possible to start some key services before mounting data partition Bug: 30118894 Change-Id: Ia9f8cc035de6cc0df9a61605864915efa0266d7f (cherry picked from commit abfbec342fdd2fc9d139a88a2d950953918e1b4e)
2016-09-06Split fstab mount into 2 phasesWei Wang
This will make it possible to start some key services before mounting data partition (cherry picked from commit abfbec342fdd2fc9d139a88a2d950953918e1b4e) Bug: 30118894 Change-Id: Ia9f8cc035de6cc0df9a61605864915efa0266d7f
2016-08-05Move init's kernel logging into libbase. am: 7bc87a5a78 am: e2a7eb17b5Elliott Hughes
am: b7252fc35a Change-Id: Ibfba937cede98ceb8f4b76d3a636e5b8035689c0
2016-08-05Move init's kernel logging into libbase.Elliott Hughes
am: 7bc87a5a78 Change-Id: Ie5e359e8bd7dee4c0549072c7e955eeefe57d785
2016-08-04Move init's kernel logging into libbase.Elliott Hughes
This will let other stuff (such as adbd and recovery) use it too. Bug: http://b/28467098 Change-Id: Idab51f438ed3edd6fe65a56c4b396eaff5f3833e
2016-07-18Merge \"Only restorecon CE storage after unlocked.\" into nyc-mr1-devJeff Sharkey
am: 96f387e8c0 Change-Id: I3a1c31334d32e7bdff8e05558356d2833fcfb831
2016-07-15Only restorecon CE storage after unlocked.Jeff Sharkey
On FBE devices, the filenames inside credential-encrypted directories are mangled until the key is installed. This means the initial restorecon at boot needs to skip these directories until the keys are installed. This CL changes the implementation of the "restorecon_recursive" built-in command to use the new SKIPCE flag to avoid labeling files in CE directories. vold will request a restorecon when the keys are actually installed. Bug: 30126557 Change-Id: I320584574a4d712c493b5bbd8a79b56c0c04aa58
2016-06-30Merge \"init: use libbootloader_message.\" into nyc-mr1-devYabin Cui
am: ca4cf4e4af Change-Id: I8234e796a8b35115ef1ecf33c987882f8fe286cd
2016-06-30Merge "init: use libbootloader_message." into nyc-mr1-devYabin Cui
2016-06-29init: use libbootloader_message.Yabin Cui
Bug: 29582118 Change-Id: I6285b29774a11d6dda8496c7c73e4c1d17a672bd
2016-06-29Add umount call to init to unmount a filesystemAlex Light
am: 68ab20febd Change-Id: I1166f88814193092f10dad8a2fa841028613e03e
2016-06-29Add umount call to init to unmount a filesystemAlex Light
Bug: 29278988 Change-Id: Ia14ab1bcad9513688df97f7b4d9162a9ab282480
2016-06-27resolve merge conflicts of 54c1219 to stage-aosp-masterElliott Hughes
Change-Id: I4b3b2a8690cfe147929fd096de380a9d4b79f1ec
2016-06-27Move init to libbase logging.Elliott Hughes
Change-Id: Ibfbefeff587a69e948978a037c555fd12a5ade6a
2016-06-25Merge \"Remove MTD cruft from init.\"Elliott Hughes
am: 90db709a2f Change-Id: I027708dd324000cbfad1a2a6e970f742db97bae5
2016-06-24Remove MTD cruft from init.Elliott Hughes
Bug: http://b/29250988 Change-Id: I38ab263192944e4ff291fd91b25db163a8848d75
2016-06-24resolve merge conflicts of 66277db to stage-aosp-masterHung-ying Tyan
Change-Id: I58b1f7fec779c707ac4048ae5401087ec4b7c8b0
2016-06-24Add -f to insmodHung-ying Tyan
When the flag is on, insmod will bypass vermagic and symbol version checking in the kernel. This is to make it possible to update kernel without recompiling kernel modules. BUG=28803994 Change-Id: Ib4be6999ef52baefd4210ee0d242360e43318907
2016-05-10Merge "Wipe device on policy error" into nyc-devPaul Crowley
am: 8a59fa8524 * commit '8a59fa85243a5f748108279f6d30b01292518b0a': Wipe device on policy error Change-Id: I35205b2ddf8b3e8d049525e3717d27836d6c59a2
2016-05-10Wipe device on policy errorPaul Crowley
If we fail to set a crypto policy on a system-DE directory, this is a serious and unrecoverable condition; the only way forward is to erase the entire device. In a future commit we will also allow users the option of booting again. Bug: 28318405 Change-Id: Iff1e52c5bbee1beed29dc4b609d24bfeb7d138da
2016-05-04init/builtins.cpp: Switch to finit_moduleNick Kralevich
Switch insmod from using init_module to finit_module. From "man finit_module": The finit_module() system call is like init_module(), but reads the module to be loaded from the file descriptor fd. It is useful when the authenticity of a kernel module can be determined from its location in the file system; in cases where that is possible, the overhead of using cryptographically signed modules to determine the authenticity of a module can be avoided. finit_module is preferred over init_module because it allows LSMs, such as SELinux, to perform a permission check on kernel module loads based on the file from which the module is loaded. This functionality is not yet implemented in the Linux kernel, but is on the SEAndroid TODO list. See https://bitbucket.org/seandroid/wiki/wiki/ToDo Bug: 27824855 (cherry picked from commit 124a9c97e9815142a33480b81a5a3041a7cd66bd) Change-Id: I5e87de1a7b8c3d8849bf757c71b08e81c378b021
2016-04-19Merge "Don\'t start defaultcrypto twice" into nyc-devPaul Lawrence
am: fe5d55a * commit 'fe5d55a68b9dc3a593d3f6ee5be919b8a9de710c': Don't start defaultcrypto twice Change-Id: I0e9a27208ea046a2cf738992ba97141da9026c08
2016-04-18Don't start defaultcrypto twicePaul Lawrence
The old way (using triggers) starts defaultcrypto twice because queue_property_triggers_action retriggers the action. Bug: 27452459 Change-Id: I48c844836f551673d0dbfed6c33bd8ee1e035f40
2016-04-09Merge "init: write bootloader message directly." into nyc-devYabin Cui
am: a3a7a88 * commit 'a3a7a886f5277b6223140761e58cea0753854225': init: write bootloader message directly. Change-Id: I764e0288b40264b8e48fc09011c3c0475b71a04e
2016-04-08init: write bootloader message directly.Yabin Cui
Bug: 27176738 Change-Id: I8c95a193f3436c0893d5103760b700f3052888db
2016-04-08Merge "init: drop unused header android_filesystem_config.h" am: 54c27c7Elliott Hughes
am: 8cb6a9c * commit '8cb6a9cdb7cb1feaff29914aa88c68399e32f14f': init: drop unused header android_filesystem_config.h Change-Id: I1cc001c883199e8355e97d93a2f6ce0d46bdd767
2016-04-07init: drop unused header android_filesystem_config.hWilliam Roberts
Change-Id: I66e637bc2d7fd5f385f40f150becfe515c53c19a Bug: 27999086 Signed-off-by: William Roberts <william.c.roberts@intel.com>
2016-04-05init: turn off backlight when performing shutdown cleanupMark Salyzyn
(cherry pick from commit a98cc9c202b9ff97df89e2258bf04bc3b8b57301) Try writing a "0" into: - /sys/class/leds/lcd-backlight/brightness - /sys/class/backlight/*/brightness to turn off the backlight during shutdown cleanup. Bug: 27506425 Change-Id: Ic8a44dc8909b303f24e14f71cfb43292df60efde
2016-04-05Merge "init: turn off backlight when performing shutdown cleanup" am: adf1cdeMark Salyzyn
am: 23702b5 * commit '23702b538b3a02ca35f24c55d406a7cc7b14641f': init: turn off backlight when performing shutdown cleanup Change-Id: I249106a3b6c22e77d06bca5aee1d92184b00ba33
2016-04-05init: turn off backlight when performing shutdown cleanupMark Salyzyn
Try writing a "0" into: - /sys/class/leds/lcd-backlight/brightness - /sys/class/backlight/*/brightness to turn off the backlight during shutdown cleanup. Bug: 27506425 Change-Id: Ic8a44dc8909b303f24e14f71cfb43292df60efde
2016-04-05init: watchdog restarted during shutdown fsckMark Salyzyn
(cherry pick from commit ad575e04a1d89f5a2a4e3006a58e801cad9c9805) Bug: 27506425 Change-Id: I40967068d18ce1a8cbaf0b750e7a7af6eab3e4e8
2016-04-05Merge "init: watchdog restarted during shutdown fsck" am: 3443caaMark Salyzyn
am: 34dcdd8 * commit '34dcdd8075a0c12de552219d4f326bccd1c8fe62': init: watchdog restarted during shutdown fsck Change-Id: I28e3a730f2d854c51f1d760a5400faecd3f1fafc
2016-04-05init: watchdog restarted during shutdown fsckMark Salyzyn
Bug: 27506425 Change-Id: I40967068d18ce1a8cbaf0b750e7a7af6eab3e4e8
2016-03-30Merge "init/builtins.cpp: Switch to finit_module" am: b3cf2e0Nick Kralevich
am: 699b115 * commit '699b115be3c79547e9cc6d8bca771d77eb384915': init/builtins.cpp: Switch to finit_module Change-Id: Iab21b9e058fe9435847ba9bca4cb2d1c0f50c88f