(&mut self, file: &File)
| 714 | } |
| 715 | |
| 716 | pub fn add_initramfs_data(&mut self, file: &File) -> Result<()> { |
| 717 | let initramfs_size = file.metadata()?.len(); |
| 718 | self.known_items[FW_CFG_INITRD_SIZE as usize] = FwCfgContent::U32(initramfs_size as _); |
| 719 | self.known_items[FW_CFG_INITRD_DATA as usize] = FwCfgContent::File(0, file.try_clone()?); |
| 720 | Ok(()) |
| 721 | } |
| 722 | |
| 723 | fn read_content(content: &FwCfgContent, offset: u32, data: &mut [u8], size: u32) -> Option<u8> { |
| 724 | let start = offset as usize; |