mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-23 23:59:22 +00:00
uboot: Add the missing disk write operation support
uboot_disk_write() is currently lacking the write support to storage devices because, historically, those devices did not implement block_write() in U-Boot. The solution has been tested using a patched U-Boot loading and booting GRUB in a QEMU vexpress-a9 environment. The disk write operations were triggered with GRUB's save_env command. Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
1 parent
f8d1ad2678
commit
088f7f56e5
3 files changed
+34
-7
No files matched your search
@@ -243,6 +243,22 @@ grub_uboot_dev_read (struct device_info *dev, void *buf, grub_size_t blocks,
|
||||
return retval;
|
||||
}
|
||||
|
||||
int
|
||||
grub_uboot_dev_write (struct device_info *dev, const void *buf,
|
||||
grub_size_t blocks, grub_uint32_t start)
|
||||
{
|
||||
int retval;
|
||||
|
||||
if (!OPEN_DEV (dev))
|
||||
return -1;
|
||||
|
||||
if (!grub_uboot_syscall (API_DEV_WRITE, &retval, dev, buf,
|
||||
&blocks, &start))
|
||||
return -1;
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
int
|
||||
grub_uboot_dev_recv (struct device_info *dev, void *buf,
|
||||
int size, int *real_size)
|
||||
|
||||
Reference in new issue
Block a user