Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions common/src/api/external/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3421,6 +3421,13 @@ pub struct TufArtifactMeta {
/// The size of the artifact in bytes.
pub size: u64,

/// Contents of the `BORD` field of a Hubris archive caboose. Only
/// applicable to artifacts that are Hubris archives.
///
/// This field should always be `Some(_)` if `sign` is `Some(_)`, but the
/// opposite is not true (SP images will have a `board` but not a `sign`).
pub board: Option<String>,

/// Contents of the `SIGN` field of a Hubris archive caboose, i.e.,
/// an identifier for the set of valid signing keys. Currently only
/// applicable to RoT image and bootloader artifacts, where it will
Expand Down
17 changes: 7 additions & 10 deletions dev-tools/reconfigurator-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ struct SledUpdateSpArgs {
#[derive(Debug, Args)]
struct SledUpdateRotArgs {
/// id of the sled
sled_id: SledUuid,
sled_id: SledOpt,

/// sets the version reported for the RoT slot a
#[clap(long, required_unless_present_any = &["slot_b"])]
Expand Down Expand Up @@ -1713,26 +1713,23 @@ fn cmd_sled_update_rot(
);

let mut state = sim.current_state().to_mut();
state.system_mut().description_mut().sled_update_rot_versions(
args.sled_id,
let system = state.system_mut();
let sled_id = args.sled_id.to_sled_id(system.description())?;
system.description_mut().sled_update_rot_versions(
sled_id,
args.slot_a,
args.slot_b,
)?;

sim.commit_and_bump(
format!(
"reconfigurator-cli sled-update-rot: {}: {}",
args.sled_id,
"reconfigurator-cli sled-update-rot: {sled_id}: {}",
labels.join(", "),
),
state,
);

Ok(Some(format!(
"set sled {} RoT settings: {}",
args.sled_id,
labels.join(", ")
)))
Ok(Some(format!("set sled {sled_id} RoT settings: {}", labels.join(", "))))
}

fn cmd_sled_update_host_phase_1(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,30 +124,42 @@ blueprint-diff latest
sled-set serial1 mupdate-override unset
inventory-generate

# This will attempt to update the first sled's host OS. Walk through that update
# and the host OS of the two other sleds.
# This will attempt to update the RoT bootloader on the first sled.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is kind of followup to #8832 (comment). On that PR, I had to change this test to update the host OS so that we could move on to the planner doing things with zones, but in review, the question came up of "why don't we also have to do the same thing for the bootloader, RoT, and SP?". The superficial answer was "the fake TUF repo doesn't have any matching artifacts for those so the planner is skipping them", but I didn't dig into why that is. With the changes on this PR, the fake TUF repo now does have matching artifacts. So instead of just updating the host OS here, we have to do all the MGS-based updates for all three fake sleds.

blueprint-plan latest latest
blueprint-show latest
blueprint-diff latest

# Update the RoT bootloader.
sled-update-rot-bootloader serial0 --stage0 2.0.0

# If were to generate inventory and replan now, we'd want to update the RoT on
# this sled, then its SP, then its host OS, then repeat all four for the other
# three sleds. That's not the point of this test, so let's short-circuit that a
# bit: we'll go ahead and change inventory to reflect all of these MGS-based
# updates are done on all sleds.

# Finish the MGS-based updates on sled 0.
sled-update-rot serial0 --slot-a 2.0.0
sled-update-sp serial0 --active 2.0.0
sled-update-host-phase2 serial0 --boot-disk B --slot-b 0c0362b640cece5b9a5e86d8fa683bd2eb84c3e7f90731f597197d604ffa76e3
sled-update-host-phase1 serial0 --active B --slot-b 44714733af7600b30a50bfd2cbaf707ff7ee9724073ff70a6732e55a88864cf6
inventory-generate

# Second sled host OS
blueprint-plan latest latest
blueprint-diff latest
# All the MGS-based updates on sled 1.
sled-update-rot-bootloader serial1 --stage0 2.0.0
sled-update-rot serial1 --slot-a 2.0.0
sled-update-sp serial1 --active 2.0.0
sled-update-host-phase2 serial1 --boot-disk B --slot-b 0c0362b640cece5b9a5e86d8fa683bd2eb84c3e7f90731f597197d604ffa76e3
sled-update-host-phase1 serial1 --active B --slot-b 44714733af7600b30a50bfd2cbaf707ff7ee9724073ff70a6732e55a88864cf6
inventory-generate

# Third sled host OS
blueprint-plan latest latest
blueprint-diff latest
# All the MGS-based updates on sled 2.
sled-update-rot-bootloader serial2 --stage0 2.0.0
sled-update-rot serial2 --slot-a 2.0.0
sled-update-sp serial2 --active 2.0.0
sled-update-host-phase2 serial2 --boot-disk B --slot-b 0c0362b640cece5b9a5e86d8fa683bd2eb84c3e7f90731f597197d604ffa76e3
sled-update-host-phase1 serial2 --active B --slot-b 44714733af7600b30a50bfd2cbaf707ff7ee9724073ff70a6732e55a88864cf6
inventory-generate

# All host OS updates complete
# All MGS-based updates complete.
inventory-generate
blueprint-plan latest latest
blueprint-diff latest

Expand Down
24 changes: 12 additions & 12 deletions dev-tools/reconfigurator-cli/tests/output/cmds-example-stdout
Original file line number Diff line number Diff line change
Expand Up @@ -1058,10 +1058,10 @@ Sled serial0
A 0101010101010101010101010101010101010101010101010101010101010101
B 0202020202020202020202020202020202020202020202020202020202020202
cabooses:
SLOT BOARD NAME VERSION GIT_COMMIT SIGN
SpSlot0 SimGimletSp SimGimletSp 0.0.1 unknown n/a
RotSlotA SimRot SimRot 0.0.2 unknown SimRot
Stage0 SimRotStage0 SimRotStage0 0.0.1 unknown SimRotStage0
SLOT BOARD NAME VERSION GIT_COMMIT SIGN
SpSlot0 SimGimletSp SimGimletSp 0.0.1 unknown n/a
RotSlotA SimRot SimRot 0.0.2 unknown sign-gimlet
Stage0 SimRot SimRot 0.0.1 unknown sign-gimlet
RoT pages:
SLOT DATA_BASE64
RoT: active slot: slot A
Expand All @@ -1083,10 +1083,10 @@ Sled serial1
A 0101010101010101010101010101010101010101010101010101010101010101
B 0202020202020202020202020202020202020202020202020202020202020202
cabooses:
SLOT BOARD NAME VERSION GIT_COMMIT SIGN
SpSlot0 SimGimletSp SimGimletSp 0.0.1 unknown n/a
RotSlotA SimRot SimRot 0.0.2 unknown SimRot
Stage0 SimRotStage0 SimRotStage0 0.0.1 unknown SimRotStage0
SLOT BOARD NAME VERSION GIT_COMMIT SIGN
SpSlot0 SimGimletSp SimGimletSp 0.0.1 unknown n/a
RotSlotA SimRot SimRot 0.0.2 unknown sign-gimlet
Stage0 SimRot SimRot 0.0.1 unknown sign-gimlet
RoT pages:
SLOT DATA_BASE64
RoT: active slot: slot A
Expand All @@ -1108,10 +1108,10 @@ Sled serial2
A 0101010101010101010101010101010101010101010101010101010101010101
B 0202020202020202020202020202020202020202020202020202020202020202
cabooses:
SLOT BOARD NAME VERSION GIT_COMMIT SIGN
SpSlot0 SimGimletSp SimGimletSp 0.0.1 unknown n/a
RotSlotA SimRot SimRot 0.0.2 unknown SimRot
Stage0 SimRotStage0 SimRotStage0 0.0.1 unknown SimRotStage0
SLOT BOARD NAME VERSION GIT_COMMIT SIGN
SpSlot0 SimGimletSp SimGimletSp 0.0.1 unknown n/a
RotSlotA SimRot SimRot 0.0.2 unknown sign-gimlet
Stage0 SimRot SimRot 0.0.1 unknown sign-gimlet
RoT pages:
SLOT DATA_BASE64
RoT: active slot: slot A
Expand Down
Loading
Loading