I would like to write a file system driver so that I can use ZFS for storing kernels. There is very limited documentation on how to use refind's 'fsw', or where to start. I was hoping someone might be able to give me some guidance as to how 'fsw' should be used, and what needs to be done to get a successful driver working.
Last edit: John Ramsden 2017-08-21
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Although I maintain rEFInd, I did not write any of the current filesystem drivers. At most, I've fixed a few bugs and tweaked the code here and there. That said, many of the drivers are based, in part, on GRUB filesystem driver code. Thus, my recommendation is to pick one or two existing drivers and examine how the rEFInd and GRUB code are and are not similar. You'll see that some of the things they do are similar -- they've got functions with similar names to do tasks like mount a partition, for instance. Once you've got a handle on this, you should be able to take the GRUB driver for ZFS as a base and start modifying it to fit the rEFInd framework.
That said, ZFS is a pretty complex filesystem and driver. Thus, it's not likely to be easy to convert or write, even in read-only form. Even though you want to do ZFS, you might want to consider doing something simpler as a learning case -- maybe XFS or JFS. OTOH, maybe you could get something that at least mostly works with ZFS just as easily. As I said, I've not done this myself, so I'm unfamiliar with the challenges involved. Likewise, I've never delved into ZFS specifically.
Good luck!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I would like to write a file system driver so that I can use ZFS for storing kernels. There is very limited documentation on how to use refind's 'fsw', or where to start. I was hoping someone might be able to give me some guidance as to how 'fsw' should be used, and what needs to be done to get a successful driver working.
Last edit: John Ramsden 2017-08-21
Although I maintain rEFInd, I did not write any of the current filesystem drivers. At most, I've fixed a few bugs and tweaked the code here and there. That said, many of the drivers are based, in part, on GRUB filesystem driver code. Thus, my recommendation is to pick one or two existing drivers and examine how the rEFInd and GRUB code are and are not similar. You'll see that some of the things they do are similar -- they've got functions with similar names to do tasks like mount a partition, for instance. Once you've got a handle on this, you should be able to take the GRUB driver for ZFS as a base and start modifying it to fit the rEFInd framework.
That said, ZFS is a pretty complex filesystem and driver. Thus, it's not likely to be easy to convert or write, even in read-only form. Even though you want to do ZFS, you might want to consider doing something simpler as a learning case -- maybe XFS or JFS. OTOH, maybe you could get something that at least mostly works with ZFS just as easily. As I said, I've not done this myself, so I'm unfamiliar with the challenges involved. Likewise, I've never delved into ZFS specifically.
Good luck!