tree: 8f2c541e74220acf60cf28e305a1fe749ad570f1 [path history] [tgz]
  1. dbus/
  2. dbus_bindings/
  3. test_protos/
  4. BUILD.gn
  5. daemon.cc
  6. daemon.h
  7. file_decompressor.cc
  8. file_decompressor.h
  9. file_decompressor_test.cc
  10. firmware_directory.cc
  11. firmware_directory.h
  12. firmware_directory_stub.cc
  13. firmware_directory_stub.h
  14. firmware_directory_test.cc
  15. firmware_file.cc
  16. firmware_file.h
  17. firmware_file_info.h
  18. firmware_file_test.cc
  19. firmware_manifest.cc
  20. firmware_manifest.h
  21. firmware_manifest.proto
  22. firmware_manifest_fuzzer.cc
  23. firmware_manifest_v2.cc
  24. firmware_manifest_v2.proto
  25. firmware_manifest_v2_fuzzer.cc
  26. helper_manifest.proto
  27. journal.cc
  28. journal.h
  29. journal_entry.proto
  30. journal_test.cc
  31. logging.cc
  32. logging.h
  33. main.cc
  34. mock_journal.h
  35. mock_modem.h
  36. mock_modem_helper.h
  37. modem.cc
  38. modem.h
  39. modem_flasher.cc
  40. modem_flasher.h
  41. modem_flasher_test.cc
  42. modem_helper.cc
  43. modem_helper.h
  44. modem_helper_directory.cc
  45. modem_helper_directory.h
  46. modem_helper_directory_stub.h
  47. modem_tracker.cc
  48. modem_tracker.h
  49. modemfwd.conf
  50. OWNERS
  51. README.md
  52. scoped_temp_file.cc
  53. scoped_temp_file.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_main_fw=<file>
  • --flash_carrier_fw=<file>
  • --flash_mode_check: see if the modem is present in firmware download mode
  • --reboot
  • --clear_attach_apn=<carrier_id>: clear the attach APN in the modem NVM if the carrier ID is matching the one provided
  • --fw_version: can be optionally passed along with --flash_main_fw or --flash_carrier_fw to signify the firmware version of the passed file

--get_fw_info should return the main firmware on the first line, the carrier UUID on the next line and the carrier version on the one after that:

$ modem_program --get_fw_info
11.22.33.44
big-long-carrier-uuid-string
55.66

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

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

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 firmawre directory structure

The protos defined in helper_manifest.proto and firmware_manifest.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.