chromeos-config-tools: cros_configfs block boot-services

Change cros_configfs to block boot-services, until cros_configfs
is ready. By extension, this ensure that the cros config mechanism
is ready for use as soon as "boot-services" transitions to "started".

Problem:
The cros config mechanism is globally dead until cros_configfs is
mounted. The mounting is accomplished by the cros_configfs upstart
pre-start section. Although this is done in the pre-start section, the
script is triggered from the "started boot-services" signal, which
gives assurances about completion, with respect to other service start
time. This means that cros_configfs can complete mounting at any point,
after boot-services starts.
See b/161421508 for an example of the errors this causes.

Explanation of Solution:
Cros config is assumed to be a core feature, similar to dbus or metrics,
that is used by many services. It would incur unnecessary complexity
and additional room for error if all services had to form an explicit
startup dependencies for cros_configfs (which is what cros config
indirectly uses). See b/161421508 for more analysis.

cros_configfs should block boot-services itself, similar to what
metrics_library currently does.

Assumptions (which might change in the future):
* No service before boot-services shall use cros config.
* No service that blocks boot-services
  ("start on starting boot-services") shall use cros config.
* Services that "start on started boot-services" or start on later
  events may use cros config (eg. powerd, ui, or system-services).

BUG=b:157095325, b:161421508
TEST=# The following test occurred on both Nocturne and Dratini
     # Flash R86-13376.0.0
     /usr/share/vboot/bin/make_dev_ssd.sh --partitions '2 4' --default_rw_root --remove_rootfs_verification
     sync
     reboot
     # Edit /etc/init/cros_configfs.conf
     # - Do NOT apply fix
     # - Add a "sleep 10" to the top of the pre-start section
     cat >/etc/init/before.conf <<-EOF
          start on starting boot-services
          task
          script
          echo "name = '$(cros_config / name)'" >/var/log/${UPSTART_JOB}.log
          end script
     EOF
     cat >/etc/init/after.conf <<-EOF
          start on started boot-services
          task
          script
          echo "name = '$(cros_config / name)'" >/var/log/${UPSTART_JOB}.log
          end script
     EOF
     sync
     reboot
     # Check that /var/log/before.log shows "name = ''"
     # Check that /var/log/after.log shows "name = ''"
     #
     # Edit /etc/init/cros_configfs.conf
     # - Apply fix
     sync
     reboot
     # Check that /var/log/before.log shows "name = ''"
     # Check that /var/log/after.log shows "name = '<BOARD>'"
TEST=# Thanks to @yichengli for the following test:
     # On a nami device without /dev/cros_fp:
     # (1) without this change, boot many times, observe that 1 in ~3
     #     boots bio_fw_updater fails to query cros_configfs, and
     #     decided to do legacy update, and failed to query FPMCU
     #     version (there's no FPMCU at all).
     # (2) with this change, boot >10 times, observe that every time
     #     bio_fw_updater learns from cros_configfs that there's no
     #     FPMCU.

Change-Id: I4b1bc6d5599f81089434dca65bb335e5af6aa58a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2320013
Tested-by: Craig Hesling <hesling@chromium.org>
Auto-Submit: Craig Hesling <hesling@chromium.org>
Commit-Queue: Yicheng Li <yichengli@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Matthew Blecker <matthewb@chromium.org>
Reviewed-by: Yicheng Li <yichengli@chromium.org>
1 file changed
tree: b801bb49f786ec06af55dd2612ad50f47e948f60
  1. arc/
  2. attestation/
  3. authpolicy/
  4. avtest_label_detect/
  5. biod/
  6. bluetooth/
  7. bootstat/
  8. buffet/
  9. camera/
  10. cfm-dfu-notification/
  11. chaps/
  12. chromeos-common-script/
  13. chromeos-config/
  14. chromeos-dbus-bindings/
  15. chromeos-nvt-tcon-updater/
  16. codelab/
  17. common-mk/
  18. crash-reporter/
  19. cros-disks/
  20. cros-fuzz/
  21. crosdns/
  22. crosh/
  23. croslog/
  24. cryptohome/
  25. cups_proxy/
  26. debugd/
  27. dev-install/
  28. diagnostics/
  29. disk_updater/
  30. dlcservice/
  31. easy-unlock/
  32. feedback/
  33. fitpicker/
  34. foomatic_shell/
  35. glib-bridge/
  36. goldfishd/
  37. hammerd/
  38. hardware_verifier/
  39. hermes/
  40. hwsec-test-utils/
  41. iioservice/
  42. image-burner/
  43. imageloader/
  44. init/
  45. installer/
  46. ippusb_bridge/
  47. ippusb_manager/
  48. kerberos/
  49. libbrillo/
  50. libchromeos-rs/
  51. libchromeos-ui/
  52. libcontainer/
  53. libhwsec/
  54. libipp/
  55. libmems/
  56. libpasswordprovider/
  57. libtpmcrypto/
  58. login_manager/
  59. lorgnette/
  60. media_perception/
  61. mems_setup/
  62. metrics/
  63. midis/
  64. mist/
  65. ml/
  66. ml_benchmark/
  67. modem-utilities/
  68. modemfwd/
  69. mtpd/
  70. nnapi/
  71. ocr/
  72. oobe_config/
  73. p2p/
  74. patchpanel/
  75. permission_broker/
  76. policy_proto/
  77. policy_utils/
  78. power_manager/
  79. print_tools/
  80. regions/
  81. run_oci/
  82. runtime_probe/
  83. salsa/
  84. screenshot/
  85. sealed_storage/
  86. secure-wipe/
  87. secure_erase_file/
  88. sepolicy/
  89. shill/
  90. smbfs/
  91. smbprovider/
  92. smogcheck/
  93. st_flash/
  94. storage_info/
  95. system-proxy/
  96. system_api/
  97. thd/
  98. timberslide/
  99. touch_firmware_calibration/
  100. touch_keyboard/
  101. tpm2-simulator/
  102. tpm_manager/
  103. tpm_softclear_utils/
  104. trace_events/
  105. trim/
  106. trunks/
  107. typecd/
  108. u2fd/
  109. ureadahead-diff/
  110. usb_bouncer/
  111. userfeedback/
  112. userspace_touchpad/
  113. virtual_file_provider/
  114. vm_tools/
  115. vpn-manager/
  116. webserver/
  117. wifi-testbed/
  118. .clang-format
  119. .gitignore
  120. .gn
  121. CPPLINT.cfg
  122. LICENSE
  123. navbar.md
  124. OWNERS
  125. PRESUBMIT.cfg
  126. PRESUBMIT.py
  127. README.md
README.md

The Chromium OS Platform

This repo holds (most) of the custom code that makes up the Chromium OS platform. That largely covers daemons, programs, and libraries that were written specifically for Chromium OS.

We moved from multiple separate repos in platform/ to a single repo in platform2/ for a number of reasons:

  • Make it easier to work across multiple projects simultaneously
  • Increase code re-use (via common libs) rather than duplicate utility functions multiple items over
  • Share the same build system

While most projects were merged, not all of them were. Some projects were standalone already (such as vboot), or never got around to being folded in (such as imageloader). Some day those extra projects might get merged in.

Similarly, some projects that were merged in, were then merged back out. This was due to the evolution of the Brillo project and collaboration with Android. That means the AOSP repos are the upstream and Chromium OS carries copies.

Local Project Directory

ProjectDescription
arcTools/deamons/init-scripts to run ARC
attestationDaemon and client for managing remote attestation
authpolicyDaemon for integrating with Microsoft Active Directory (AD) domains
avtest_label_detectTest tool for OCRing device labels
biodBiometrics daemon
bluetoothBluetooth Service and tools
bootstatTools for tracking points in the overall boot process (for metrics)
buffetDaemon for reacting to cloud messages
cameraChrome OS Camera daemon
cfm-dfu-notificationCFM specific library for DFU notifications
chapsPKCS #11 implementation for TPM 1 devices
chromeos-common-scriptShared scripts for partitions and basic disk information
chromeos-configCrOS unified build runtime config manager
chromeos-dbus-bindingsSimplifies the implementation of D-Bus daemons and proxies
chromeos-nvt-tcon-updaterLibrary for integrating the Novatek TCON firmware updater into a CrOS device
codelabCodelab exercise
common-mkCommon build & test logic for platform2 projects
crash-reporterThe system crash handler & reporter
cros-disksDaemon for mounting removable media (e.g. USB sticks and SD cards)
cros-fuzzSupport crate for fuzzing rust code
crosdnsHostname resolution service for Chrome OS
croshThe Chromium OS shell
croslogThe log manipulation command
cryptohomeDaemon and tools for managing encrypted /home and /var directories
cups_proxyDaemon for proxying CUPS printing request
debugdCentralized debug daemon for random tools
dev-installTools & settings for managing the developer environment on the device
diagnosticsDevice telemetry and diagnostics daemons
disk_updaterUtility for updating root disk firmware (e.g. SSDs and eMMC)
dlcserviceDownloadable Content (DLC) Service daemon
easy-unlockDaemon for handling Easy Unlock requests (e.g. unlocking Chromebooks with an Android device)
feedbackDaemon for headless systems that want to gather feedback (normally Chrome manages it)
fitpicker
foomatic_shellSimple shell used by the foomatic-rip package
glib-bridgelibrary for libchrome-glib message loop interoperation
goldfishdAndroid Emulator Daemon
hammerdFirmware updater utility for hammer hardware
hardware_verifierHardware verifier tool
hermesChrome OS LPA implementation for eSIM hardware support
hwsec-test-utilsHwsec-related test-only features
iioserviceDaemon and libraries that provide sensor data to all processes
image-burnerDaemon for writing disk images (e.g. recovery) to USB sticks & SD cards
imageloaderDaemon for mounting signed disk images
initCrOS common startup init scripts and boot time helpers
installerCrOS installer utility (for AU/recovery/etc...)
ippusb_bridgeHTTP proxy to IPP-enabled printers
ippusb_manager“Service” for ipp-over-usb printing
kerberosDaemon for managing Kerberos tickets
libbrilloCommon platform utility library
libchromeos-rsCommon platform utility library for Rust
libchromeos-ui
libcontainer
libhwsecLibrary for the utility functions of all TPM related daemons
libippLibrary for building and parsing IPP (Internet Printing Protocol) frames
libmemsUtility library to configure, manage and retrieve events from IIO sensors
libpasswordproviderPassword Provider library for securely managing credentials with system services
libtpmcryptoLibrary for AES256-GCM encryption with TPM sealed keys
login_managerSession manager for handling the life cycle of the main session (e.g. Chrome)
lorgnetteDaemon for managing attached USB scanners via SANE
media_perceptionMedia perception service for select platforms
memdDaemon that logs memory-related data and events
mems_setupBoot-time initializer tool for sensors
metricsClient side user metrics collection
midisMIDI service
mistModem USB Interface Switching Tool
mlMachine learning service
ml_benchmarkML performance benchmark for Chrome OS
modem-utilities
modemfwdDaemon for managing modem firmware updaters
mtpdDaemon for handling Media Transfer Protocol (MTP) with devices (e.g. phones)
nnapiImplementation of the Android Neural Networks API
ocrOptical Character Recognition (OCR) service for Chrome OS
oobe_configUtilities for saving and restoring OOBE config state
p2pService for sharing files between CrOS devices (e.g. updates)
patchpanelPlatform networking daemons
permission_broker
policy_protoBuild file to compile policy proto file
policy_utilsTools and related library to set or override device policies
power_managerUserspace power management daemon and associated tools
print_toolsVarious tools related to the native printing system
regions
run_ociMinimalistic container runtime
runtime_probeRuntime probe tool for ChromeOS
salsaTouchpad experimentation framework
screenshotTiny command to take a screenshot
sealed_storageLibrary for sealing data to device identity and state
secure-wipeSecure disk wipe
secure_erase_fileHelper tools for securely erasing files from storage (e.g. keys and PII data)
sepolicySELinux policy for Chrome OS
shillChrome OS Connection Manager
smbfsFUSE-based filesystem for accessing Samba / Windows networking shares
smbproviderDaemon for connecting Samba / Windows networking shares to the Files.app
smogcheckDeveloper library for working with raw I2C devices
st_flash
storage_infoHelper shell functions for retrieving disk information)
system-proxyDaemon for web proxy authentication support on Chrome OS
system_apiHeaders and .proto files etc. to be shared with chromium
thdThermal daemon to help keep systems running cool
timberslideTool for working with EC crashes for reporting purposes
touch_firmware_calibration
touch_keyboardUtilities for a touch based virtual keyboard
tpm2-simulatorA software TPM 2.0 implementation (for testing/debugging)
tpm_managerDaemon and client for managing TPM setup and operations
tpm_softclear_utilsUtilities that soft-clear TPM (for testing only)
trace_eventsA framework for adding trace events to your Rust code.
trimService to manage filesystem trim operations in the background
trunksMiddleware and resource manager for interfacing with TPM 2.0 hardware
typecdSystem daemon to keep track of USB Type C state
u2fdU2FHID emulation daemon for systems with secure elements (not TPMs)
ureadahead-diffTool to calculate difference between 2 ureadahead packs
usb_bouncerTools for managing USBGuard white-lists and configuration on Chrome OS
userfeedbackVarious utilities to gather extended data for user feedback reports
userspace_touchpad
virtual_file_provider
vm_toolsUtilities for Virtual Machine (VM) orchestration
vpn-managerChrome OS Native L2TP/IPSec VPN Daemon
webserverSmall web server with D-Bus client backends
wifi-testbedTools for creating a WiFi testbed image

AOSP Project Directory

These projects can be found here: https://chromium.googlesource.com/aosp/platform/