Skip to content

Commit 2e8b2f4

Browse files
committed
BIOS: extend support for update & adopt_update on all devices
For dual boot, need to extend support for both.
1 parent 40039c4 commit 2e8b2f4

File tree

1 file changed

+7
-23
lines changed

1 file changed

+7
-23
lines changed

src/bios.rs

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -167,18 +167,11 @@ impl Component for Bios {
167167
return Ok(None);
168168
};
169169

170-
let mut parent_devices = rootcxt.devices.iter();
171-
let Some(parent) = parent_devices.next() else {
172-
anyhow::bail!("Failed to find parent device");
173-
};
174-
175-
if let Some(next) = parent_devices.next() {
176-
anyhow::bail!(
177-
"Found multiple parent devices {parent} and {next}; not currently supported"
178-
);
170+
for parent in rootcxt.devices.iter() {
171+
self.run_grub_install(rootcxt.path.as_str(), &parent)?;
172+
log::debug!("Install grub modules on {parent}");
179173
}
180-
self.run_grub_install(rootcxt.path.as_str(), &parent)?;
181-
log::debug!("Installed grub modules on {parent}");
174+
182175
Ok(Some(InstalledContent {
183176
meta: update.clone(),
184177
filetree: None,
@@ -195,20 +188,11 @@ impl Component for Bios {
195188
.query_update(&rootcxt.sysroot)?
196189
.expect("update available");
197190

198-
let mut parent_devices = rootcxt.devices.iter();
199-
let Some(parent) = parent_devices.next() else {
200-
anyhow::bail!("Failed to find parent device");
201-
};
202-
203-
if let Some(next) = parent_devices.next() {
204-
anyhow::bail!(
205-
"Found multiple parent devices {parent} and {next}; not currently supported"
206-
);
191+
for parent in rootcxt.devices.iter() {
192+
self.run_grub_install(rootcxt.path.as_str(), &parent)?;
193+
log::debug!("Install grub modules on {parent}");
207194
}
208195

209-
self.run_grub_install(rootcxt.path.as_str(), &parent)?;
210-
log::debug!("Install grub modules on {parent}");
211-
212196
let adopted_from = None;
213197
Ok(InstalledContent {
214198
meta: updatemeta,

0 commit comments

Comments
 (0)