New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 866810 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Sep 7
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

cros factory: image_tool improvement

Project Member Reported by stimim@google.com, Jul 24

Issue description

`image_tool merge_rma` can be used to merge multiple RMA image into one universal shim. However, there is no easy way to:

1. List the content of universal shim
2. Update parts of universal shim

Proposal:

1. Add /dev_image/etc/cros_rma_metadata.json, which contains:

     a list of {'board': ..., 'kernel': ..., 'rootfs': ...}

   so we know the mapping from board to partitions. And new command:

     image_tool show_rma xxx_rma.bin

   to show the content of RMA shim based on this metadata.


2. With one, we should be able to update part of universal shim

     image_tool rma --update <other parameters of rma subcommand>
 
Sounds like a good idea. cros_rma_metadata.json may be replaced by scanning files in cros_payloads folder.

And maybe you can merge all sub commands into rma, say:

 image_tool rma -o output [--create] [--release ...]
 image_tool rma -o output --merge image1.bin,image2.bin
 image_tool rma -o output --merge universal.bin,new_image1.bin
 image_tool rma -i image --show # only display contents

Cc: marcochen@chromium.org
Project Member

Comment 3 by bugdroid1@chromium.org, Jul 31

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/30e9a152719f686179cd2d0efda9656229507b9f

commit 30e9a152719f686179cd2d0efda9656229507b9f
Author: Wei-Han Chen <stimim@google.com>
Date: Tue Jul 31 06:08:17 2018

image_tool: rename RMA related subcommands

* `image_tool rma` is renamed to `image_tool rma-create`
* `image_tool merge_rma` is renamed to `image_tool rma-merge`

Also make the old subcommands aliases of new subcommands, so the old
scripts should work.

Also fix the alias selection code to make alias work properly.  However,
we no longer support usage like:

  ln -s image_tool rma
  rma -o output ...

BUG= chromium:866810 
TEST=manual test
TEST=make test

Change-Id: Ied4a2da4d2ec1f8711d1b8e2fb659c4408457140
Reviewed-on: https://chromium-review.googlesource.com/1148303
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Wei-Han Chen <stimim@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>

[modify] https://crrev.com/30e9a152719f686179cd2d0efda9656229507b9f/py/tools/image_tool.py
[modify] https://crrev.com/30e9a152719f686179cd2d0efda9656229507b9f/setup/README.md
[modify] https://crrev.com/30e9a152719f686179cd2d0efda9656229507b9f/py/tools/image_tool_unittest.py
[modify] https://crrev.com/30e9a152719f686179cd2d0efda9656229507b9f/README.md

Project Member

Comment 4 by bugdroid1@chromium.org, Aug 1

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/41d7bbba8094831c55cd0c50937ee45bc95f412b

commit 41d7bbba8094831c55cd0c50937ee45bc95f412b
Author: Wei-Han Chen <stimim@google.com>
Date: Wed Aug 01 21:52:23 2018

image_tool: add rma_metadata.json

This file is added to RMA image under cros_payload folder to track
number of boards and their corresponding install shim partitions.

For example, a new created RMA shim with only one board should have
rma_metadata.json as:

  [{"board": "BOARD", "kernel": 2, "rootfs": 3}]

And when multiple RMA shim are merged by 'rma-merge' command, the
metadata will be updated, e.g.

  [{"board": "BOARD_A", "kernel": 2, "rootfs": 3},
   {"board": "BOARD_B", "kernel": 4, "rootfs": 5}, ]

BUG= chromium:866810 
TEST=manual test
TEST=make test

Change-Id: Ib64cc0e13842f988e7ac23e98f69d88bab552450
Reviewed-on: https://chromium-review.googlesource.com/1148304
Commit-Ready: Wei-Han Chen <stimim@chromium.org>
Tested-by: Wei-Han Chen <stimim@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>

[modify] https://crrev.com/41d7bbba8094831c55cd0c50937ee45bc95f412b/py/tools/image_tool.py
[modify] https://crrev.com/41d7bbba8094831c55cd0c50937ee45bc95f412b/py/tools/image_tool_unittest.py

Project Member

Comment 5 by bugdroid1@chromium.org, Aug 1

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/fecde3b8a1ad8f85f2fda60ea077b9b5c360f279

commit fecde3b8a1ad8f85f2fda60ea077b9b5c360f279
Author: Wei-Han Chen <stimim@google.com>
Date: Wed Aug 01 21:52:23 2018

image_tool: add subcommand rma-show

This command will parse cros_rma_metadata.json and cros_payloads to show
the content of a RMA shim.

BUG= chromium:866810 
TEST=make test
TEST=manual test

Change-Id: I848c8ecfa18ccd265ea2f9e5b41065422d42f8d0
Reviewed-on: https://chromium-review.googlesource.com/1148305
Commit-Ready: Wei-Han Chen <stimim@chromium.org>
Tested-by: Wei-Han Chen <stimim@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>

[modify] https://crrev.com/fecde3b8a1ad8f85f2fda60ea077b9b5c360f279/py/tools/image_tool.py
[modify] https://crrev.com/fecde3b8a1ad8f85f2fda60ea077b9b5c360f279/setup/README.md

Status: Fixed (was: Assigned)

Sign in to add a comment