tree: 442eb09e8c806e1a064c985f55a029c06db4c964 [path history] [tgz]
  1. dbus/
  2. dbus_bindings/
  3. helpers/
  4. minijail/
  5. proto/
  6. scripts/
  7. seccomp/
  8. test_protos/
  9. tmpfiles.d/
  10. udev/
  11. async_modem_flasher.cc
  12. async_modem_flasher.h
  13. async_modem_flasher_test.cc
  14. BUILD.gn
  15. daemon.cc
  16. daemon.h
  17. daemon_delegate.h
  18. daemon_task.cc
  19. daemon_task.h
  20. daemon_task_test.cc
  21. DIR_METADATA
  22. dlc_manager.cc
  23. dlc_manager.h
  24. dlc_manager_test.cc
  25. error.cc
  26. error.h
  27. error_test.cc
  28. file_decompressor.cc
  29. file_decompressor.h
  30. file_decompressor_test.cc
  31. firmware_directory.cc
  32. firmware_directory.h
  33. firmware_directory_stub.cc
  34. firmware_directory_stub.h
  35. firmware_directory_test.cc
  36. firmware_file.cc
  37. firmware_file.h
  38. firmware_file_info.h
  39. firmware_file_test.cc
  40. firmware_manifest.h
  41. firmware_manifest_v2.cc
  42. firmware_manifest_v2_fuzzer.cc
  43. flash_task.cc
  44. flash_task.h
  45. flash_task_test.cc
  46. heartbeat_task.cc
  47. heartbeat_task.h
  48. heartbeat_task_test.cc
  49. journal.cc
  50. journal.h
  51. journal_test.cc
  52. logging.cc
  53. logging.h
  54. main.cc
  55. metrics.cc
  56. metrics.h
  57. metrics_test.cc
  58. mock_daemon_delegate.h
  59. mock_journal.h
  60. mock_metrics.h
  61. mock_modem.h
  62. mock_modem_flasher.h
  63. mock_modem_helper.h
  64. mock_notification_manager.h
  65. modem.cc
  66. modem.h
  67. modem_flasher.cc
  68. modem_flasher.h
  69. modem_flasher_test.cc
  70. modem_helper.cc
  71. modem_helper.h
  72. modem_helper_directory.cc
  73. modem_helper_directory.h
  74. modem_helper_directory_stub.h
  75. modem_sandbox.cc
  76. modem_sandbox.h
  77. modem_test.cc
  78. modem_tracker.cc
  79. modem_tracker.h
  80. modemfwd.conf
  81. notification_manager.cc
  82. notification_manager.h
  83. OWNERS
  84. prefs.cc
  85. prefs.h
  86. prefs_test.cc
  87. README.md
  88. recovery_file.cc
  89. recovery_file.h
  90. scoped_temp_file.cc
  91. scoped_temp_file.h
  92. suspend_checker.cc
  93. suspend_checker.h
  94. unblocked_terms.txt
  95. upstart_job_controller.cc
  96. upstart_job_controller.h
modemfwd/README.md

Modem Firmware Daemon

This daemon abstracts out the common portions of updating modem firmware, i.e. deciding whether there is currently newer firmware available and getting the modem ready to be flashed with new firmware.

Modem-specific program API

In order to enforce a process boundary between the open-source modemfwd and potentially non-open-source modem firmware updaters, we farm out steps that require modem-specific knowledge to different programs. modemfwd will call into these programs with different flags to request different services. These flags are declared in the system API repo.

  • --get_fw_info: return version information for the currently installed firmware (see below)
  • --prepare_to_flash: put the modem into firmware download mode
  • --flash_fw=<type>:<file>[,<type2>:<file2>[,<type3>:<file3>]
  • --flash_mode_check: see if the modem is present in firmware download mode
  • --reboot
  • --get_heartbeat_config: retrieve the preferred heartbeat configuration for ths modem type
  • --fw_version: can be optionally passed along with --flash_fw to signify the firmware version(s) of the passed file(s), it using the same key/value syntax.
  • --get_recovery_file_list: allows modemfwd to check what files are needed by the modemfwd-helper to recover the modem. The reply may include a list of files or directories that will be needed to perform recovery, so that modemfwd can prepare them before calling for flashing.

--get_fw_info should return a list of key/value pairs, one per line. The key is the type of the firmware/version and the value is the actual version number (not specific format defined). The separator between the key and the value is a colon (:). The example below has the main firmware on the first line, the carrier firmware version on the next line and the carrier UUIDn on the one after that:

$ modem_program --get_fw_info
main:11.22.33.44
carrier:55.66
carrier_uuid:big-long-carrier-uuid-string

The carrier UUID should match with one from the shill mobile operator DB.

For --flash_fw, --fw_version, --get_fw_info, the following keys are currently defined for the type:

  • main: Main or base firmware (and its associated version).
  • carrier: Carrier customization package (and its associated version).
  • oem: OEM settings (and their associated version).
  • carrier_uuid: the UUID of carrier for the current customization package.

--flash_mode_check should return the string “true” if the modem is present in flash mode, and something else otherwise (preferably “false” for readability).

--get_heartbeat_config should return a list of key/value pairs, one per line. Valid pairs are:

  • max_failures: the number of failures before modemfwd should reset this modem
  • interval: the interval between heartbeat checks, in seconds
  • modem_idle_interval: at modem idle state, the interval between heartbeat checks, in seconds

--get_recovery_file_list should take as input a path to the directory of recovery metadata for this variant via the --recovery_metadata_dir flag, and return a list of paths to the supporting files needed to perform recovery.

All commands should return 0 on success and something non-zero on failure. modemfwd will look for these binaries in the directory passed as the --helper_directory argument on the command line.

Helper and firmware directory structure

The protos defined in helper_manifest.proto and firmware_manifest_v2.proto define manifests that should be provided in the helper and firmware directories so modemfwd can figure out what devices, carriers, etc. the contents can be used with.