Skip to content

Commit

Permalink
feat: add support for rpi5 firmware
Browse files Browse the repository at this point in the history
Raspberry Pi 5 logic can be added via
include_firmware = "pi5"
  • Loading branch information
reubenmiller authored and koehlma committed Nov 18, 2023
1 parent 66c17dc commit df8749a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/rugpi-bakery/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pub enum IncludeFirmware {
None,
#[default]
Pi4,
Pi5,
}

/// Load the configuration file from the current directory.
Expand Down
24 changes: 24 additions & 0 deletions crates/rugpi-bakery/src/tasks/bake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand Down Expand Up @@ -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(())
}

0 comments on commit df8749a

Please sign in to comment.