[U-Boot] Updating ZFS for U-boot
Jorgen Lundman
lundman at lundman.net
Mon Dec 11 05:07:00 UTC 2017
The draft update for ZFS is ready, and is available here:
https://github.com/lundman/u-boot/commit/c2727e5004fe011d19156d728babdf968515b28d
I will refresh myself on U-boot commit procedures, and start the proper
method soon.
I did a question though, to be able to test file reading, I had to add the
code:
#ifdef CONFIG_SANDBOX
char *bufx = map_sysmem((phys_addr_t)(uint64_t)buf, movesize);
memmove(bufx, data->file_buf + file->offset + red
- data->file_start, movesize);
unmap_sysmem(bufx);
#else
memmove(buf, data->file_buf + file->offset + red
- data->file_start, movesize);
#endif
Should I keep that as #ifdef SANDBOX, or is there a preferred method?
I have tried to follow checkcommit.pl rules, and changed a few things to
"const" etc, to make it cleaner.
Example output:
Hit any key to stop autoboot: 0
=> host bind 0 ./raid1.raw
=> host bind 1 ./raid2.raw
=> host bind 2 ./raid3.raw
=> zfsls host 0:0 /@/
zfs: adding device 'host' dev 0
zfs: couldn't find a necessary member device of multi-device filesystem
zfs: couldn't find a necessary member device of multi-device filesystem
zfs: looking for devices...
zfs: adding device 'host' dev 1
zfs: adding device 'host' dev 2
zfs: device scan completed.
zfs fsname = '/' snapname='<NULL>' filename = '/'
<DIR> hello.world
file.txt
The device scan function ended up looking like:
for (
uclass_first_device(UCLASS_BLK, &dev);
dev;
uclass_next_device(&dev)
) {
struct blk_desc *desc = dev_get_uclass_platdata(dev);
for (part = 0; part <= MAX_SEARCH_PARTITIONS; part++) {
snprintf(dev_str, sizeof(dev_str), "%u:%u", desc->devnum, part);
part = blk_get_device_part_str(blk_get_if_type_name(desc->if_type),
dev_str,
&dev.disk, &dev.part_info, 1);
if (part < 0)
continue;
Hopefully that is acceptable.
Any other cleanups requested in the ZFS area?
Lund
--
Jorgen Lundman | <lundman at lundman.net>
Unix Administrator | +81 (0)90-5578-8500
Shibuya-ku, Tokyo | Japan
More information about the U-Boot
mailing list