tree: 1255dc009547f77477e98f2e4b275d2e6ee9a296 [path history] [tgz]
  1. client/
  2. dbus_adaptors/
  3. ramfs/
  4. screens/
  5. scripts/
  6. BUILD.gn
  7. daemon.cc
  8. daemon.h
  9. disk_util.cc
  10. disk_util.h
  11. disk_util_test.cc
  12. draw_interface.h
  13. draw_utils.cc
  14. draw_utils.h
  15. draw_utils_test.cc
  16. error.cc
  17. error.h
  18. key_reader.cc
  19. key_reader.h
  20. key_reader_test.cc
  21. logger.cc
  22. logger.h
  23. logger_test.cc
  24. main.cc
  25. metrics_reporter.cc
  26. metrics_reporter.h
  27. metrics_reporter_interface.h
  28. minios.cc
  29. minios.h
  30. minios_interface.h
  31. mock_disk_util.h
  32. mock_draw_interface.h
  33. mock_draw_utils.h
  34. mock_minios.h
  35. mock_network_manager.h
  36. mock_process_manager.h
  37. mock_recovery_installer.h
  38. mock_screen_controller.h
  39. mock_screen_interface.h
  40. mock_shill_proxy.h
  41. mock_state_reporter_interface.h
  42. mock_update_engine_proxy.h
  43. network_manager.cc
  44. network_manager.h
  45. network_manager_interface.h
  46. network_manager_test.cc
  47. org.chromium.MiniOs.conf
  48. OWNERS
  49. process_manager.cc
  50. process_manager.h
  51. process_manager_interface.h
  52. README.md
  53. recovery_installer.cc
  54. recovery_installer.h
  55. recovery_installer_interface.h
  56. recovery_installer_test.cc
  57. screen_controller.cc
  58. screen_controller.h
  59. screen_controller_interface.h
  60. screen_controller_test.cc
  61. screen_interface.h
  62. screen_types.h
  63. shill_proxy.cc
  64. shill_proxy.h
  65. shill_proxy_interface.h
  66. state_reporter_interface.h
  67. test_utils.h
  68. update_engine_proxy.cc
  69. update_engine_proxy.h
  70. utils.cc
  71. utils.h
  72. utils_test.cc
minios/README.md

MiniOS

MiniOS is a subset of thanOS, also known as the Network Based Recovery Project (go/cros-nbr). MiniOS consumer facing feature used to help recover devices using only a network or ethernet connection. Once connected to the network, MiniOS will automatically repartition the disk, wipe the stateful partition and all user data, and update to the latest stable version. The UI theme and elements are an extension of the Groot recovery flow.

The main MiniOS components include D-bus, update_engine, and network manager.

Upstart

MiniOS is brought up with Upstart, similar to ChromeOS. The majority of the scripts are located in platform2/init/upstart with some MiniOS specific processes located in minios/init.

Frecon

MiniOS graphics are done with frecon-lite and can show images and draw shapes. The layout of MiniOS elements is based on the frecon canvas size and scaling factor which are from frecon.conf. The images are created with Pango during build time with no run time size or color changes supported.

KeyReader

KeyReader is how MiniOS processes input. There are two types of input KeyReader handles.

The first type is basic navigation using the up, down, and enter keys. This is used to navigate between screens and make basic selections. This type of input uses an Epoll file descriptor which sends all input to ScreenController so each screen can decide what action to take based on user input.

The other kind of functionality KeyReader supports is taking in alphanumeric input, which is used for things like the network password; this does not use the watcher. For this type of input, KeyReader must be given a keyboard layout to correctly map key codes to characters. Currently, there is no foolproof way to do this, but the region information is read from VPD and then mapped to a list of supported chrome keyboard layouts using cros-regions.json. Due to the size and complexity constraints of MiniOS, only standard ASCII characters are processed. Other special characters such as “ê” are ignored even if they are a part of the keyboard layout.

Locally testing on older devices

MiniOS can be test on devices which don't have the newer partitions for miniOS. The way to test is by repartitioning the device.

On locally available DUTs:

  1. Convert to disk_layout_v3 or newer in disk_layout.json.
  2. Enabled minios USE flag.
  3. Build image.
  4. chromeos-install the image from USB.
  5. Reboot the device.

On lab DUTs:

  1. From the labstation run:
# Find the correct SERVO_PORT (e.g. 9996, 9997)
$> start servod PORT=$P
$> dut-control -p $P power_state:off
# Only for devices with battery and type-c connection to servo with PD.
$> dut-control -p $P servo_pd_role:snk
# Download a image to flash or use a cache server URL.
# The flashing of USB might take some time.
$> dut-control -p $P download_image_to_usb_dev:$PATH_OR_URL
$> dut-control -p $P image_usbkey_direction:dut_sees_usbkey
$> dut-control -p $P power_state:rec
  1. From the DUT:
# Verify that the DUT has booted from USB.
$> rootdev -s # should be /dev/sd*
$> /usr/sbin/chromeos-install
$> reboot

The device will now use the newer layout with miniOS support.