Cheng-Han Yang | 4563a2c | 2019-01-14 08:08:53 | [diff] [blame] | 1 | # Chrome OS RMA shim |
| 2 | |
| 3 | [TOC] |
| 4 | |
Cheng-Han Yang | 730845a | 2019-01-25 07:31:57 | [diff] [blame] | 5 | ## Overview |
Cheng-Han Yang | 4563a2c | 2019-01-14 08:08:53 | [diff] [blame] | 6 | |
Cheng-Han Yang | 730845a | 2019-01-25 07:31:57 | [diff] [blame] | 7 | RMA stands for Return Merchandise Authorization. When there’s a problem that the |
| 8 | end user cannot solve, the user returns the device to the partner’s service |
| 9 | center for diagnosis and repair. The service center may swap components and |
| 10 | reinstall the firmware and/or software image. For Chromebooks, that means the |
| 11 | service center may need to disable write protection and change the HWID to match |
| 12 | the new configuration. |
Cheng-Han Yang | 4563a2c | 2019-01-14 08:08:53 | [diff] [blame] | 13 | |
Cheng-Han Yang | 730845a | 2019-01-25 07:31:57 | [diff] [blame] | 14 | ### RMA shim |
| 15 | |
| 16 | Chromebooks are highly secured. With verified boot and write protection, it’s |
| 17 | difficult for the service center to run diagnosis and repair programs (usually |
| 18 | built and customized by partners) because those won’t be signed by Google. |
| 19 | Service centers may also have limited (or even no) network access. In general, |
| 20 | what the partner needs is a tool that fulfills these requirements: |
| 21 | |
| 22 | * The tool is signed by Google. An operator can boot the device by turning on |
| 23 | the developer mode, attaching a USB stick and invoking recovery mode. |
| 24 | * The tool can run the partner’s customized tool programs to check and verify |
| 25 | components, very similar to the way the factory process works. |
| 26 | |
| 27 | The RMA shim image is designed to meet these requirements. An RMA shim image is |
| 28 | a combination of existing [Chrome OS factory bundle](./BUNDLE.md) components, |
| 29 | all combined into one disk, including: |
| 30 | |
| 31 | * [Factory install |
Stimim Chen | 38241b4 | 2020-12-08 05:07:34 | [diff] [blame] | 32 | shim](https://chromium.googlesource.com/chromiumos/platform/factory_installer/+/HEAD/README.md) |
Cheng-Han Yang | 730845a | 2019-01-25 07:31:57 | [diff] [blame] | 33 | * Release image (FSI) |
| 34 | * Test image |
| 35 | * Factory toolkit |
| 36 | * HWID bundle |
| 37 | * Other optional components (firmware, complete script, etc.) |
| 38 | |
| 39 | ### Universal RMA shim (Multi-board RMA shim) |
| 40 | |
| 41 | A problem for regular (single-board) RMA shims is that we have to create |
| 42 | separate per-board RMA shims for each project, which makes it hard to manage |
| 43 | shim images and physical USB drives. A universal shim contains multiple RMA |
| 44 | shims for different boards, which is easier to manage and distribute. |
| 45 | |
| 46 | Pros: |
| 47 | |
| 48 | * Reduce the number of shims to manage. |
| 49 | |
| 50 | Cons: |
| 51 | |
| 52 | * The size of a universal shim can be large. Each board in a shim takes about |
| 53 | 3 GB, so a universal shim containing 3 boards will have size 9~10 GB. |
| 54 | |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 55 | ## Get the tool |
| 56 | |
| 57 | [image_tool](../py/tools/image_tool.py) is a useful tool to manage RMA shims. We |
| 58 | can get this tool by downloading the factory public repo. |
| 59 | |
| 60 | $ git clone https://chromium.googlesource.com/chromiumos/platform/factory |
| 61 | $ cd factory/ |
| 62 | |
| 63 | The tool is located at `setup/image_tool`. It's recommended to sync the git repo |
| 64 | periodically to get the latest version. |
| 65 | |
| 66 | (in factory/ repository) |
| 67 | $ git pull |
| 68 | |
| 69 | After downloading the factory repo, we can run the unit test for RMA commands |
| 70 | to check if it runs normally on the machine. The tool should be able to run in |
| 71 | a fresh Linux environment without chroot. |
| 72 | |
| 73 | $ py/tools/image_tool_rma_unittest.py |
| 74 | |
Cheng-Han Yang | 730845a | 2019-01-25 07:31:57 | [diff] [blame] | 75 | ## Create an RMA shim |
| 76 | |
| 77 | To create an RMA shim, you should first get a factory bundle and follow the |
| 78 | steps below. |
| 79 | |
| 80 | ### Adjust RMA test list in factory toolkit ### |
| 81 | |
| 82 | RMA test list is different from the test list used in factory manufacture line. |
| 83 | For instance, there is no factory server during RMA. Hence, we need another test |
| 84 | list for RMA. |
| 85 | |
| 86 | The recommended way is to create a test list that inherits |
| 87 | `generic_rma.test_list.json`, which already takes care of general RMA settings |
| 88 | such as disabling factory server and enabling `rma_mode`, and then add factory |
| 89 | tests to `RMAFFT` group. |
| 90 | |
| 91 | ```javascript |
| 92 | { |
| 93 | "inherit": [ |
| 94 | "generic_rma.test_list" |
| 95 | ], |
| 96 | "label": "RMA Test List for <project>", |
| 97 | "definitions": { |
| 98 | "RMAFFT": { |
| 99 | "subtests": [ |
| 100 | ... |
| 101 | ... |
| 102 | ] |
| 103 | } |
| 104 | } |
| 105 | } |
| 106 | ``` |
| 107 | |
| 108 | * In general, run all factory tests (runin and fatp) in the service centers with |
| 109 | reduced test cycles. For example, reduce the duration of the stress test from |
| 110 | 4 hours to 10 minutes. |
| 111 | * Verify that all spare mainboards used in service centers complete SMT tests. |
| 112 | * Verify that all spare mainboards have a registration code that was burned into |
| 113 | RW_VPD during the factory process before sending the boards to service |
| 114 | centers. |
| 115 | * Discuss with the OEM to finalize test items for the RMA process. |
| 116 | * **Do not** modify or remove any GRT (Google Required Test) items. |
| 117 | * Make sure the firmware write protection is enabled (which should be true if |
| 118 | `constants.phase` is set to PVT). |
| 119 | |
| 120 | ### Combine factory bundle components into an RMA shim image ### |
| 121 | |
| 122 | After getting all the bundle components ready, we can combine these components |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 123 | into a single RMA shim image. To create an RMA shim image from a factory bundle, |
| 124 | use `image_tool rma create` command: |
Cheng-Han Yang | 4563a2c | 2019-01-14 08:08:53 | [diff] [blame] | 125 | |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 126 | $ setup/image_tool rma create \ |
| 127 | --board BOARD \ |
| 128 | --factory_shim path/to/factory_install_shim.bin \ |
| 129 | --test_image path/to/chromiumos_test_image.bin \ |
| 130 | --toolkit path/to/install_factory_toolkit.run \ |
| 131 | --release_image path/to/chromiumos_image.bin \ |
| 132 | --hwid path/to/hwid_bundle.sh \ |
| 133 | --output rma_image.bin |
Cheng-Han Yang | 4563a2c | 2019-01-14 08:08:53 | [diff] [blame] | 134 | |
| 135 | The command can be simplified if all the components are put in their respective |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 136 | [bundle](./BUNDLE.md) directories (`release_image/`, `test_image/`, etc.): |
Cheng-Han Yang | 4563a2c | 2019-01-14 08:08:53 | [diff] [blame] | 137 | |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 138 | $ setup/image_tool rma create \ |
| 139 | --board BOARD \ |
| 140 | --output rma_image.bin |
| 141 | |
| 142 | We can also specify the active test list when creating the RMA shim, so that we |
| 143 | don't need to modify `active_test_list.json` in factory toolkit. |
| 144 | |
| 145 | $ setup/image_tool rma create \ |
| 146 | --board BOARD \ |
| 147 | --output rma_image.bin \ |
| 148 | --active_test_list rma_main |
Cheng-Han Yang | 4563a2c | 2019-01-14 08:08:53 | [diff] [blame] | 149 | |
Cheng-Han Yang | 730845a | 2019-01-25 07:31:57 | [diff] [blame] | 150 | ## Use an RMA shim |
Cheng-Han Yang | 4563a2c | 2019-01-14 08:08:53 | [diff] [blame] | 151 | |
Cheng-Han Yang | 730845a | 2019-01-25 07:31:57 | [diff] [blame] | 152 | Flash the `rma_image.bin` to a USB drive, boot it with developer switch |
| 153 | enabled in recovery mode (see following steps), and then the device will boot |
| 154 | from the RMA shim. |
| 155 | |
Cheng-Han Yang | 97c0af9 | 2019-07-20 18:57:01 | [diff] [blame] | 156 | Note: The following instructions only work for a Google signed RMA shim. If you |
| 157 | are using a developer signed RMA shim, the boot process is the same as |
Stimim Chen | 38241b4 | 2020-12-08 05:07:34 | [diff] [blame] | 158 | [booting from a test image](https://chromium.googlesource.com/chromiumos/docs/+/HEAD/developer_guide.md#boot-from-your-usb-disk). |
Cheng-Han Yang | 97c0af9 | 2019-07-20 18:57:01 | [diff] [blame] | 159 | |
Cheng-Han Yang | 730845a | 2019-01-25 07:31:57 | [diff] [blame] | 160 | ### Flash an image to USB drive |
| 161 | |
| 162 | Use `dd` command to flash a shim image to a USB drive or SD card, replacing |
| 163 | `/dev/sdX` with the name of the USB/SD device. |
| 164 | |
| 165 | $ sudo dd if=rma_image.bin of=/dev/sdX bs=8M iflag=fullblock oflag=dsync |
| 166 | |
| 167 | If you have a |
Stimim Chen | 38241b4 | 2020-12-08 05:07:34 | [diff] [blame] | 168 | [Chromium OS development environment](https://chromium.googlesource.com/chromiumos/docs/+/HEAD/developer_guide.md), |
Cheng-Han Yang | 730845a | 2019-01-25 07:31:57 | [diff] [blame] | 169 | you can also use |
| 170 | [`cros flash`](https://sites.google.com/a/chromium.org/dev/chromium-os/build/cros-flash) |
| 171 | command in chroot. |
| 172 | |
| 173 | $ cros flash usb:// rma_image.bin |
| 174 | |
| 175 | ### Boot from RMA shim (clamshells / convertibles) |
| 176 | |
Cheng-Han Yang | 6f8aa66 | 2021-01-07 05:51:17 | [diff] [blame] | 177 | 1. Enter recovery mode. |
Cheng-Han Yang | 97c0af9 | 2019-07-20 18:57:01 | [diff] [blame] | 178 | 1. Press `CTRL + D` to turn on developer switch. |
| 179 | 1. Press `ENTER` to confirm. |
Cheng-Han Yang | 6f8aa66 | 2021-01-07 05:51:17 | [diff] [blame] | 180 | 1. Enter recovery mode again (no need to wait for wiping). |
Cheng-Han Yang | 97c0af9 | 2019-07-20 18:57:01 | [diff] [blame] | 181 | 1. Insert and boot from USB stick with `rma_image.bin`. |
Cheng-Han Yang | 730845a | 2019-01-25 07:31:57 | [diff] [blame] | 182 | |
| 183 | ### Boot from RMA shim (tablets / detachables) |
| 184 | |
Cheng-Han Yang | 6f8aa66 | 2021-01-07 05:51:17 | [diff] [blame] | 185 | 1. Enter recovery mode. |
Cheng-Han Yang | 97c0af9 | 2019-07-20 18:57:01 | [diff] [blame] | 186 | 1. Press `VOL_UP + VOL_DOWN` to show recovery menu. |
Cheng-Han Yang | 730845a | 2019-01-25 07:31:57 | [diff] [blame] | 187 | 1. Press `VOL_UP` or `VOL_DOWN` to move the cursor to "Confirm Disabling OS |
Cheng-Han Yang | 97c0af9 | 2019-07-20 18:57:01 | [diff] [blame] | 188 | Verification", and press `POWER` to select it. |
Cheng-Han Yang | 6f8aa66 | 2021-01-07 05:51:17 | [diff] [blame] | 189 | 1. Enter recovery mode again (no need to wait for wiping). |
Cheng-Han Yang | 97c0af9 | 2019-07-20 18:57:01 | [diff] [blame] | 190 | 1. Insert and boot from USB stick with `rma_image.bin`. |
Cheng-Han Yang | 730845a | 2019-01-25 07:31:57 | [diff] [blame] | 191 | |
Cheng-Han Yang | 6f8aa66 | 2021-01-07 05:51:17 | [diff] [blame] | 192 | See [here](https://google.com/chromeos/recovery) for instructions to enter |
| 193 | recovery mode. |
| 194 | |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 195 | ### RMA shim menu |
| 196 | |
Cheng-Han Yang | 730845a | 2019-01-25 07:31:57 | [diff] [blame] | 197 | The RMA shim has a menu that allows the user to select an action to perform, |
| 198 | which is described in |
| 199 | [Factory Installer README](https://chromium.googlesource.com/chromiumos/platform/factory_installer/#factory-shim-menu). |
Cheng-Han Yang | b82a193 | 2019-04-20 06:04:48 | [diff] [blame] | 200 | Moreover, if the RMA shim is created using `image_tool rma create` command, the |
Cheng-Han Yang | 730845a | 2019-01-25 07:31:57 | [diff] [blame] | 201 | tool adds a flag `RMA_AUTORUN=1` in `lsb-factory` file, which sets the default |
Cheng-Han Yang | 1e42568 | 2020-07-14 08:53:50 | [diff] [blame] | 202 | action of the menu depending on the cr50 version and hardware write protection |
Cheng-Han Yang | 730845a | 2019-01-25 07:31:57 | [diff] [blame] | 203 | status, such that: |
| 204 | |
Chih-Yao Chuang | 7bc752d | 2024-10-09 02:43:01 | [diff] [blame] | 205 | 1. If hardware write protection is enabled, set the default action to |
| 206 | **(E) Reset Cr50**, also known as RSU (RMA Server Unlock) to disable |
| 207 | hardware write protection and enter factory mode. After RMA reset, the |
| 208 | device will reboot. The user should enter recovery mode and boot to shim |
| 209 | again. |
| 210 | 1. If hardware write protection is disabled, set the default action to |
| 211 | **(I) install** to install payloads from USB. If hardware write protection |
| 212 | is disabled by disconnecting the battery instead of doing RSU, the install |
| 213 | script will also enable factory mode at the end of installation. |
Cheng-Han Yang | 730845a | 2019-01-25 07:31:57 | [diff] [blame] | 214 | |
| 215 | You can stop the default action and return to shim menu by pressing any key |
| 216 | within 3 seconds when the console prompts "press any key to show menu instead". |
| 217 | |
| 218 | During installation, you can remove the RMA shim when the copy is complete (the |
| 219 | text color changes from yellow to green). After the installation, the device |
| 220 | will boot into the test image with factory toolkit. Run through the factory |
| 221 | tests to complete the flow. The last test should wipe out the factory test image |
| 222 | and enable the release image. |
| 223 | |
| 224 | ## Create a universal RMA shim |
| 225 | |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 226 | We can use `image_tool rma merge` command to create a universal shim using |
| 227 | multiple RMA shims. |
Cheng-Han Yang | 730845a | 2019-01-25 07:31:57 | [diff] [blame] | 228 | |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 229 | $ setup/image_tool rma merge \ |
Cheng-Han Yang | 730845a | 2019-01-25 07:31:57 | [diff] [blame] | 230 | -i soraka.bin scarlet.bin \ |
| 231 | -o universal.bin |
| 232 | |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 233 | To delete a previously generated output image, specify the `-f` option: |
Cheng-Han Yang | 730845a | 2019-01-25 07:31:57 | [diff] [blame] | 234 | |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 235 | $ setup/image_tool rma merge \ |
Cheng-Han Yang | 730845a | 2019-01-25 07:31:57 | [diff] [blame] | 236 | -i soraka.bin scarlet.bin \ |
| 237 | -o universal.bin -f |
| 238 | |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 239 | ## Update a universal RMA shim |
| 240 | |
| 241 | `image_tool rma merge` supports merging universal shims. If there are duplicate |
| 242 | boards, it will ask the user to select which one to use. It can be used to |
| 243 | update a board in a universal shim using an updated single-board RMA shim. |
| 244 | |
| 245 | $ setup/image_tool rma merge \ |
| 246 | -i universal.bin soraka_new.bin \ |
| 247 | -o universal_new.bin |
| 248 | Scanning 2 input image files... |
| 249 | |
| 250 | Board soraka has more than one entry. |
| 251 | ======================================================================== |
| 252 | (1) |
| 253 | From universal.bin |
| 254 | board : soraka |
| 255 | install_shim : 10323.39.28 |
| 256 | release_image : 10575.37.0 (Official Build) dev-channel soraka |
| 257 | test_image : 10323.39.24 (Official Build) dev-channel soraka test |
| 258 | toolkit : soraka Factory Toolkit 10323.39.24 |
| 259 | firmware : Google_Soraka.10431.32.0;Google_Soraka.10431.48.0 |
| 260 | hwid : None |
| 261 | complete : None |
| 262 | toolkit_config: None |
| 263 | lsb_factory : lsb_factory |
| 264 | ======================================================================== |
| 265 | (2) |
| 266 | From soraka_new.bin |
| 267 | board : soraka |
| 268 | install_shim : 10323.39.31 |
| 269 | release_image : 10575.37.0 (Official Build) dev-channel soraka |
| 270 | test_image : 10323.39.24 (Official Build) dev-channel soraka test |
| 271 | toolkit : soraka Factory Toolkit 10323.39.24 |
| 272 | firmware : Google_Soraka.10431.32.0;Google_Soraka.10431.48.0 |
| 273 | hwid : None |
| 274 | complete : None |
| 275 | toolkit_config: None |
| 276 | lsb_factory : lsb_factory |
| 277 | ======================================================================== |
| 278 | Please select an option [1-2]: |
| 279 | |
Cheng-Han Yang | 730845a | 2019-01-25 07:31:57 | [diff] [blame] | 280 | ## Use a universal RMA shim |
| 281 | |
| 282 | Using a universal RMA shim is exactly the same as using a normal single-board |
| 283 | RMA shim. Flash the image to a USB drive and boot from it using the instructions |
| 284 | mentioned [above](#use-an-rma-shim). |
| 285 | |
| 286 | ## Other RMA commands |
| 287 | |
| 288 | There are other `image_tool` commands that makes verifying and modifying RMA |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 289 | shims easier. For detailed description and usage, please use the `--help` |
| 290 | argument of the commands. For instance: |
| 291 | |
| 292 | $ setup/image_tool rma show --help |
Cheng-Han Yang | 730845a | 2019-01-25 07:31:57 | [diff] [blame] | 293 | |
| 294 | ### Print bundle components in an RMA shim |
| 295 | |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 296 | `image_tool rma show` command can print the component versions in an RMA shim. |
Cheng-Han Yang | 18ac6e6 | 2019-01-15 06:23:18 | [diff] [blame] | 297 | |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 298 | $ setup/image_tool rma show -i soraka.bin |
Cheng-Han Yang | 18ac6e6 | 2019-01-15 06:23:18 | [diff] [blame] | 299 | This RMA shim contains boards: soraka |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 300 | ======================================================================== |
| 301 | board : soraka |
| 302 | install_shim : 10323.39.31 |
| 303 | release_image : 10575.37.0 (Official Build) dev-channel soraka |
| 304 | test_image : 10323.39.24 (Official Build) dev-channel soraka test |
| 305 | toolkit : soraka Factory Toolkit 10323.39.24 |
| 306 | firmware : Google_Soraka.10431.32.0;Google_Soraka.10431.48.0 |
| 307 | hwid : None |
| 308 | complete : None |
| 309 | toolkit_config: cb5b52296cd4fcb0418b6879c0acc32b |
| 310 | lsb_factory : d2c9d6a7d32ee3b1279c2b0b27244727 |
| 311 | ======================================================================== |
Cheng-Han Yang | 18ac6e6 | 2019-01-15 06:23:18 | [diff] [blame] | 312 | |
Cheng-Han Yang | 730845a | 2019-01-25 07:31:57 | [diff] [blame] | 313 | This command also applies to universal RMA shim. |
Cheng-Han Yang | 18ac6e6 | 2019-01-15 06:23:18 | [diff] [blame] | 314 | |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 315 | $ setup/image_tool rma show -i universal.bin |
Cheng-Han Yang | 18ac6e6 | 2019-01-15 06:23:18 | [diff] [blame] | 316 | This RMA shim contains boards: soraka scarlet |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 317 | ======================================================================== |
| 318 | board : soraka |
| 319 | install_shim : 10323.39.31 |
| 320 | release_image : 10575.37.0 (Official Build) dev-channel soraka |
| 321 | test_image : 10323.39.24 (Official Build) dev-channel soraka test |
| 322 | toolkit : soraka Factory Toolkit 10323.39.24 |
| 323 | firmware : Google_Soraka.10431.32.0;Google_Soraka.10431.48.0 |
| 324 | hwid : None |
| 325 | complete : None |
| 326 | toolkit_config: cb5b52296cd4fcb0418b6879c0acc32b |
| 327 | lsb_factory : d2c9d6a7d32ee3b1279c2b0b27244727 |
| 328 | ======================================================================== |
| 329 | board : scarlet |
| 330 | install_shim : 10211.68.0 |
| 331 | release_image : 10575.67.0 (Official Build) stable-channel scarlet |
| 332 | test_image : 10211.53.0 (Official Build) dev-channel scarlet test |
| 333 | toolkit : scarlet Factory Toolkit 10211.53.0 |
| 334 | firmware : Google_Scarlet.10388.26.0 |
| 335 | hwid : None |
| 336 | complete : None |
| 337 | toolkit_config: None |
| 338 | lsb_factory : c82d4c1f831bf20d7cdc70138fe4ef72 |
| 339 | ======================================================================== |
| 340 | |
| 341 | ### Replace bundle components in an RMA shim |
| 342 | |
| 343 | `image_tool rma replace` command can replace components in an RMA shim. For |
| 344 | instance, to replace the HWID bundle in an RMA shim with a new one: |
| 345 | |
| 346 | $ setup/image_tool rma replace -i rma_image.bin --hwid new_hwid_bundle.sh |
| 347 | |
| 348 | If the RMA shim is a universal shim, argument `--board` is needed. |
| 349 | |
| 350 | $ setup/image_tool rma replace -i universal.bin \ |
| 351 | --board soraka --hwid new_hwid_bundle.sh |
| 352 | |
| 353 | This command supports replacing `release_image`, `test_image`, `toolkit`, |
| 354 | `factory_shim`, `firmware`, `hwid`, `complete_script` and `toolkit_config`. |
| 355 | |
| 356 | ### Extract a single-board RMA shim from a universal shim |
| 357 | |
| 358 | `image_tool rma extract` command can extract a single-board RMA shim from a |
| 359 | universal shim. |
| 360 | |
| 361 | $ setup/image_tool rma extract -i universal.bin -o extract.bin |
| 362 | Scanning input image file... |
| 363 | |
| 364 | Please select a board to extract. |
| 365 | ======================================================================== |
| 366 | (1) |
| 367 | board : soraka |
| 368 | install_shim : 10323.39.31 |
| 369 | release_image : 10575.37.0 (Official Build) dev-channel soraka |
| 370 | test_image : 10323.39.24 (Official Build) dev-channel soraka test |
| 371 | toolkit : soraka Factory Toolkit 10323.39.24 |
| 372 | firmware : Google_Soraka.10431.32.0;Google_Soraka.10431.48.0 |
| 373 | hwid : None |
| 374 | complete : None |
| 375 | toolkit_config: cb5b52296cd4fcb0418b6879c0acc32b |
| 376 | lsb_factory : d2c9d6a7d32ee3b1279c2b0b27244727 |
| 377 | ======================================================================== |
| 378 | (2) |
| 379 | board : scarlet |
| 380 | install_shim : 10211.68.0 |
| 381 | release_image : 10575.67.0 (Official Build) stable-channel scarlet |
| 382 | test_image : 10211.53.0 (Official Build) dev-channel scarlet test |
| 383 | toolkit : scarlet Factory Toolkit 10211.53.0 |
| 384 | firmware : Google_Scarlet.10388.26.0 |
| 385 | hwid : None |
| 386 | complete : None |
| 387 | toolkit_config: None |
| 388 | lsb_factory : c82d4c1f831bf20d7cdc70138fe4ef72 |
| 389 | ======================================================================== |
| 390 | Please select an option [1-2]: |
| 391 | |
| 392 | ### Edit lsb-factory config in an RMA shim |
| 393 | |
| 394 | `image_tool edit_lsb` command can modify `lsb-factory` config, such as |
| 395 | `RMA_AUTORUN` flag. |
| 396 | |
| 397 | $ setup/image_tool edit_lsb -i rma_image.bin |
| 398 | |
| 399 | Current LSB config: |
| 400 | ======================================================================== |
| 401 | CHROMEOS_AUSERVER=http://... |
| 402 | CHROMEOS_DEVSERVER=http://... |
| 403 | FACTORY_INSTALL=1 |
| 404 | HTTP_SERVER_OVERRIDE=true |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 405 | FACTORY_INSTALL_FROM_USB=1 |
| 406 | RMA_AUTORUN=true |
| 407 | ======================================================================== |
Chih-Yao Chuang | c548f49 | 2023-07-20 02:27:47 | [diff] [blame] | 408 | (1) Modify board to install. |
| 409 | (2) Modify Chrome OS Factory Server address. |
| 410 | (3) Modify default action (will be overridden by RMA autorun). |
| 411 | (4) Enable/disable countdown before default action. |
| 412 | (5) Enable/disable complete prompt in RMA shim. |
| 413 | (6) Enable/disable autorun in RMA shim. |
| 414 | (7) Modify cutoff config in cros payload (only for old devices). |
| 415 | (8) Enable or disable qrcode when factory reset. |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 416 | (w) Apply changes and exit. |
Chih-Yao Chuang | c548f49 | 2023-07-20 02:27:47 | [diff] [blame] | 417 | (q) Quit without saving changes. |
| 418 | Please select an option [1-9, w, q]: |
| 419 | |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 420 | |
| 421 | or |
| 422 | |
| 423 | $ setup/image_tool edit_lsb -i universal.bin --board soraka |
| 424 | |
Chih-Yao Chuang | c548f49 | 2023-07-20 02:27:47 | [diff] [blame] | 425 | |Flags|Description|Option to modify|release shim version| |
| 426 | |-|-|-|-| |
| 427 | |CHROMEOS_RELEASE_BOARD|For using board specific config. (might be overridden by the value in firmware)|(1)|-| |
| 428 | |CHROMEOS_AUSERVER|Chrome OS Factory Server address.|(2)|-| |
| 429 | |CHROMEOS_DEVSERVER|Not used.|(2)|-| |
| 430 | |FACTORY_INSTALL_DEFAULT_ACTION|The factory shim will execute the default action automatically if not interrupted by user.|(3)|-| |
| 431 | |FACTORY_INSTALL_ACTION_COUNTDOWN|Countdown before doing default action, the countdown is 3 seconds|(4)|12387| |
| 432 | |FACTORY_INSTALL_COMPLETE_PROMPT|Wait for ENTER after action **(I) Install** is completed.|(5)|11766| |
Chih-Yao Chuang | 7bc752d | 2024-10-09 02:43:01 | [diff] [blame] | 433 | |RMA_AUTORUN|The factory shim will set the default action to **(I) Install** or **(E) Perform RSU**, depending on HWWP status. |(6)|11394| |
Chih-Yao Chuang | c548f49 | 2023-07-20 02:27:47 | [diff] [blame] | 434 | |CUTOFF_METHOD, CUTOFF_AC_STATE, CUTOFF_BATTERY_MIN_PERCENTAGE, CUTOFF_BATTERY_MAX_PERCENTAGE, CUTOFF_BATTERY_MIN_VOLTAGE, CUTOFF_BATTERY_MAX_VOLTAGE, SHOPFLOOR_URL|[Deprecated](#deprecate_cutoff).|(7)|-| |
| 435 | |DISPLAY_QRCODE|Display the information of the DUT as a qrcode, to increase the flexibility of customized process of factory reset.|(8)|15448| |
Chih-Yao Chuang | 1b9c202 | 2023-12-05 07:31:05 | [diff] [blame] | 436 | |DISPLAY_INFO|Support fields are: `hwid`, `serial_number`, `mlb_serial_number`, `wifi_mac0`, `service_tag`. For example: `hwid serial_number, wifi_mac0` will display hwid and serial_number in the first qrcode, and display wifi_mac0 in the second qrcode. |(8)|15448| |
Chih-Yao Chuang | c548f49 | 2023-07-20 02:27:47 | [diff] [blame] | 437 | |NETBOOT_RAMFS|This flag is automatically set to `1` when using netboot firmware. The factory shim will set the default action to **(I) Install**.|N/A|-| |
| 438 | |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 439 | Note: |
| 440 | |
| 441 | * Please do not directly mount the stateful partition and modify `lsb-factory` |
| 442 | file. The actual config is stored in cros payload, so the modifications in |
| 443 | the file will be overwritten. |
Chih-Yao Chuang | c548f49 | 2023-07-20 02:27:47 | [diff] [blame] | 444 | * <div id="deprecate_cutoff">Starting from version 12162.0.0, cutoff config is not stored in `lsb-factory`. |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 445 | Using this command to modify cutoff config is only effective for factory shim |
| 446 | older than this version. For factory shim later than this version, please use |
Chih-Yao Chuang | c548f49 | 2023-07-20 02:27:47 | [diff] [blame] | 447 | `image_tool edit_toolkit_config` command to edit cutoff config.</div> |
| 448 | * The install shim also checks `/etc/lsb-factory` for flags that decides the |
| 449 | default action of the shim menu (listed from high priority to low priority). |
| 450 | * `NETBOOT_RAMFS=1` |
| 451 | * `RMA_AUTORUN=true` |
| 452 | * `DEFAULT_ACTION=<action>` |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 453 | |
| 454 | ### Edit toolkit config in an RMA shim. |
| 455 | |
| 456 | `image_tool edit_toolkit_config` command can modify toolkit config, such as |
Chih-Yao Chuang | 4a46052 | 2024-03-29 05:53:33 | [diff] [blame] | 457 | active test list and cutoff config (after version 12162.0.0) and the config of |
| 458 | customized reset process. |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 459 | |
| 460 | $ setup/image_tool edit_toolkit_config -i rma_image.bin |
| 461 | |
| 462 | Toolkit config: |
| 463 | ======================================================================== |
| 464 | { |
| 465 | "cutoff": { |
| 466 | "CUTOFF_BATTERY_MAX_PERCENTAGE": 90, |
| 467 | "CUTOFF_BATTERY_MIN_PERCENTAGE": 60, |
| 468 | "CUTOFF_METHOD": "battery_cutoff", |
Chih-Yao Chuang | f8a0131 | 2023-09-04 07:49:39 | [diff] [blame] | 469 | "CUTOFF_AC_STATE": "remove_ac", |
| 470 | "CONTINUE_KEY": "s", |
| 471 | "QRCODE_INFO": "serial_number" |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 472 | }, |
| 473 | "active_test_list": { |
| 474 | "id": "main_rma" |
| 475 | } |
| 476 | } |
| 477 | ======================================================================== |
| 478 | (1) Modify active test list. |
| 479 | (2) Modify test list constants. |
| 480 | (3) Modify cutoff config. |
Chih-Yao Chuang | 4a46052 | 2024-03-29 05:53:33 | [diff] [blame] | 481 | (4) Enable or disable a confirmation before battery cutoff. |
| 482 | (5) Enable or disable qrcode right before cutoff. |
| 483 | (6) Modify the config to perform customized reset process. |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 484 | (q) Quit without saving changes. |
| 485 | (w) Apply changes and exit. |
| 486 | Please select an option [1-3, q, w]: |
| 487 | |
| 488 | or |
| 489 | |
| 490 | $ setup/image_tool edit_toolkit_config -i universal.bin --board soraka |
| 491 | |
Chih-Yao Chuang | c548f49 | 2023-07-20 02:27:47 | [diff] [blame] | 492 | |Flags|Description|Option to modify| |
| 493 | |-|-|-| |
| 494 | |active_test_list.id|The default test list when starting toolkit.|(1)| |
Chih-Yao Chuang | 4a46052 | 2024-03-29 05:53:33 | [diff] [blame] | 495 | |test_list_constants|The constant variables in test list.|(2)| |
| 496 | |cutoff|Cutoff process is at the end of factory reset. Check [cutoff README](https://chromium.googlesource.com/chromiumos/platform/factory/+/HEAD/sh/cutoff/README.md) for more information.|(3), (4), (5)| |
| 497 | |custom_reset_process|The config to perform customized reset process. Check [CUSTOM_RESET_PROCESS](./CUSTOM_RESET_PROCESS.md) for more information.|(6)| |
Chih-Yao Chuang | c548f49 | 2023-07-20 02:27:47 | [diff] [blame] | 498 | |
Cheng-Han Yang | 953efab | 2019-05-22 11:55:15 | [diff] [blame] | 499 | ### Unpack and repack toolkit in an RMA shim. |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 500 | |
Cheng-Han Yang | 953efab | 2019-05-22 11:55:15 | [diff] [blame] | 501 | `image_tool payload toolkit` command can unpack and repack the factory toolkit |
| 502 | in an RMA shim. |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 503 | |
Cheng-Han Yang | 953efab | 2019-05-22 11:55:15 | [diff] [blame] | 504 | $ setup/image_tool payload toolkit -i rma_image.bin --unpack toolkit_path |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 505 | (Edit some files in toolkit_path/ ...) |
Cheng-Han Yang | 953efab | 2019-05-22 11:55:15 | [diff] [blame] | 506 | $ setup/image_tool payload toolkit -i rma_image.bin --repack toolkit_path |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 507 | |
| 508 | or |
| 509 | |
Cheng-Han Yang | 953efab | 2019-05-22 11:55:15 | [diff] [blame] | 510 | $ setup/image_tool payload toolkit \ |
| 511 | -i universal.bin --board soraka --unpack toolkit_path |
Cheng-Han Yang | 169e2b9 | 2019-04-25 03:54:51 | [diff] [blame] | 512 | (Edit some files in toolkit_path/ ...) |
Cheng-Han Yang | 953efab | 2019-05-22 11:55:15 | [diff] [blame] | 513 | $ setup/image_tool payload toolkit \ |
| 514 | -i universal.bin --board soraka --repack toolkit_path |