Skip to content

[Tutorial] Shimless RMA

Ethan Cheng edited this page May 2, 2024 · 25 revisions

Prerequisites

  1. Clone the repo here: https://github.com/GoogleChromeLabs/cros-sample-telemetry-extension
  2. Put the device must be in developer mode, follow instructions here

Set Up Shimless RMA Mode

  1. Run the following script to enter RMA Mode
$ mkdir -p /mnt/stateful_partition/unencrypted/rma-data
$ touch /mnt/stateful_partition/unencrypted/rma-data/state
$ chown rmad /mnt/stateful_partition/unencrypted/rma-data/state
$ mkdir -p /var/lib/rmad/.test
$ start rmad # or restart rmad if rmad is already started

Set up 3p Diagnostics environment

  1. Enable OS flags by appending to the file /etc/chrome_dev.conf:
$ vim /etc/chrome_dev.conf

...
################################################################################
# This file should only be modified by hand by developers on their local
# dev-mode devices; do not check in changes to it or write code that modifies
# it. Permanent changes to Chrome's configuration, including conditionally-set
# flags, should be made in session_manager (see chrome_setup.h).
#
# To edit this file rootfs write protection must be removed:
# https://chromium.googlesource.com/chromiumos/docs/+/HEAD/developer_mode.md#disable-verity
################################################################################
--enable-features=IsolatedWebAppDevMode,ShimlessRMA3pDiagnosticsDevMode
  1. Override the device OEM to Google
$ cp -r /run/chromeos-config/v1 /run/chromeos-config/test
$ printf %s 'Google' > /run/chromeos-config/test/branding/oem-name
# Note: You must stop then restart cros_healthd here, running restart will not propogate the change.
$ stop cros_healthd
$ start cros_healthd 
  1. run restart ui for the change to take effect
$ restart ui
  1. Build the extension component

Clone this wiki locally