diff --git a/crates/rugpi-bakery/src/config.rs b/crates/rugpi-bakery/src/config.rs index 6bee049c..1e3b20a4 100644 --- a/crates/rugpi-bakery/src/config.rs +++ b/crates/rugpi-bakery/src/config.rs @@ -34,6 +34,7 @@ pub enum IncludeFirmware { None, #[default] Pi4, + Pi5, } /// Load the configuration file from the current directory. diff --git a/crates/rugpi-bakery/src/tasks/bake.rs b/crates/rugpi-bakery/src/tasks/bake.rs index 744e2bd2..18673bcd 100644 --- a/crates/rugpi-bakery/src/tasks/bake.rs +++ b/crates/rugpi-bakery/src/tasks/bake.rs @@ -62,6 +62,7 @@ pub fn run(task: &BakeTask) -> Anyhow<()> { match config.include_firmware { crate::config::IncludeFirmware::None => { /* Do not include any firmware. */ } crate::config::IncludeFirmware::Pi4 => include_pi4_firmware(&temp_dir_path)?, + crate::config::IncludeFirmware::Pi5 => include_pi5_firmware(&temp_dir_path)?, } } Ok(()) @@ -110,3 +111,26 @@ fn include_pi4_firmware(autoboot_path: &Utf8Path) -> Anyhow<()> { ])?; Ok(()) } + +fn include_pi5_firmware(autoboot_path: &Utf8Path) -> Anyhow<()> { + run!([ + "cp", + "-f", + "/usr/share/rugpi/rpi-eeprom/firmware-2712/stable/pieeprom-2023-10-30.bin", + autoboot_path.join("pieeprom.upd") + ])?; + run!([ + "/usr/share/rugpi/rpi-eeprom/rpi-eeprom-digest", + "-i", + autoboot_path.join("pieeprom.upd"), + "-o", + autoboot_path.join("pieeprom.sig") + ])?; + run!([ + "cp", + "-f", + "/usr/share/rugpi/rpi-eeprom/firmware-2712/stable/recovery.bin", + autoboot_path.join("recovery.bin") + ])?; + Ok(()) +}