diff --git a/README.md b/README.md index 6d441865..684c1b6d 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,7 @@ Just run `topgrade`. It will run the following steps: * **Linux**: Update snap packages * **Linux**: Run [fwupdmgr](https://github.com/hughsie/fwupd) to show firmware upgrade. (View only. No upgrades will actually be performed) +* **Linux**: Run `rpi-update` to update Raspberry Pi Firmware * Run custom defined commands * Final stage * **Linux**: Run [needrestart](https://github.com/liske/needrestart) diff --git a/src/main.rs b/src/main.rs index 5d374b57..513a5d4c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -372,6 +372,12 @@ fn run() -> Result<(), Error> { #[cfg(target_os = "linux")] { + execute( + &mut report, + "rpi-update", + || linux::run_rpi_update(sudo.as_ref(), run_type), + config.no_retry(), + )?; execute( &mut report, "Firmware upgrades", diff --git a/src/steps/os/linux.rs b/src/steps/os/linux.rs index 88b0c43a..3f75b1da 100644 --- a/src/steps/os/linux.rs +++ b/src/steps/os/linux.rs @@ -300,6 +300,16 @@ pub fn run_snap(sudo: Option<&PathBuf>, run_type: RunType) -> Result<(), Error> run_type.execute(sudo).arg(snap).arg("refresh").check_run() } +#[must_use] +pub fn run_rpi_update(sudo: Option<&PathBuf>, run_type: RunType) -> Result<(), Error> { + let sudo = require_option(sudo)?; + let rpi_update = require("rpi-update")?; + + print_separator("rpi-update"); + + run_type.execute(sudo).arg(rpi_update).check_run() +} + #[must_use] pub fn run_etc_update(sudo: Option<&PathBuf>, run_type: RunType) -> Result<(), Error> { let sudo = require_option(sudo)?;