GSoC 15 - ZFS Boot Environment menu for GPT/EFI boot
Allan Jude
allanjude at freebsd.org
Thu Mar 19 17:22:05 UTC 2015
On 2015-03-19 12:38, Prasad Joshi wrote:
> Hello All,
>
> To get my self familiarize with the project idea. I tried certain things
> 1. Experimented with beadm - to create multiple environments,
> intentionally corrupted boot environment and then used earlier BE to
> boot from.
> 2. Compiled FreeBSD source and boot from it
> 3. Skimmed through https://wiki.freebsd.org/RootOnZFS/GPTZFSBoot to
> get some understanding of gptzfsboot
>
> As far as I can understand, gptzfsboot is installed on GTP partition
> explicitly taged as freebsd-boot partition. During machine bootup,
> gptzfsboot goes through all visible disks looking for ZFS file system.
> In my opinion, it identifies whether a disk belongs to ZFS by reading
> VDEV Label (not 100% sure though). Once a disk is identified, it has
> to discover other VDEVs in the ZPOOL. Once the pool has been figured
> out, it would be used for booting. I think a POOL or Dataset must also
> have bootfs property set.
>
> Once a bootable pool or dataset has been identified, it is given to
> zfsbootloader for final stage of kernel bootstrapping.
>
> Assuming my understanding is correct, at the moment, gptzfsboot finds
> a single bootable dataset and starts bootstrapping. The aim of this
> project is to find list of all bootable datasets and display the list.
> User can select either one of dataset, which then will be passed to
> zfsloader.
>
> Besides this, as far as I understand, beadm must be taking snapshot of
> ZFS filesystem. Along with detecting bootable datasets, shouldn't
> gptzfsboot also look for snapshots created from beadm?
>
> I tried to browse through FreeBSD source, however I could not find
> gptzfsboot source. I think, it must be inside freebsd/sys/boot/i386
> directory. I will try to dig further.
>
> I will really appreciate, if experts from FreeBSD community help me in
> right direction. I will look forward for reply. BTW, I am still
> looking for mentor, please help.
>
> Thanks and Regards,
> Prasad
>
> On Wed, Mar 18, 2015 at 8:57 PM, Prasad Joshi
> <prasadjoshi.linux at gmail.com> wrote:
>> Hello,
>>
>> I am Prasad Joshi from India. I am planing to apply for GSoC 15, I
>> found idea 'ZFS Boot Environment menu for GPT/EFI boot'.
>> (https://wiki.freebsd.org/IdeasPage#ZFS_Boot_Environment_menu_for_GPT.2FEFI_boot)
>>
>> Last year I participated in GSoC, wherein I worked on OSv to add
>> Symlink support. Here is the link to my project
>> https://www.google-melange.com/gsoc/project/details/google/gsoc2014/prasadjoshi/5741031244955648.
>> During the project I worked on enabling ZFS symlink support. I added
>> various related system calls like stat, lstat etc. I too had to modify
>> name lookup (namei) to take care of symbolic links. It involved
>> changing other system calls like open, rename, unlink (basically
>> anything that touches file). However, my commits in OSv did not limit
>> to symlink support - I also worked on adding eventfd, fixing zfs
>> import/export/unmount functionality, and adding support for few
>> smaller system or glibc calls. Here is the link for my commits which
>> are accepted in OSv
>> https://github.com/cloudius-systems/osv/commits?author=prasad-joshi
>>
>> I have also worked on KVM Tools project few years back, wherein I added
>> QCOW1/2 support in KVM Tools. Here is link of KVM Tools announcement
>> http://lwn.net/Articles/447556/
>>
>> I have also contributed few patches in QEMU, Illumos, and Linux
>> Kernel. In 2008-2010, I worked with company called KQInfotech, as a
>> developer for porting ZFS to Linux
>> (http://en.wikipedia.org/wiki/ZFS#KQ_InfoTech).
>>
>> Though I haven't worked on FreeBSD or PCBSD before, I am confident
>> that, I would be able to get up to speed in very short period of time.
>>
>> At the moment, I am in process of understanding FreeBSD BE and
>> preparing a formal proposal for GSoC 15. I wish to find a mentor for
>> this project.
>>
>> I will look forward to reply.
>>
>> Thanks and Regards,
>> Prasad
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
>
the beadm tool works by taking a snapshot of the current 'bootfs'
dataset, and then creating a clone from that (since snapshots are read only)
In general, beadm has each boot environment as a dataset below some
common point, the old default was <poolname>/ROOT/<BEname>
however, newer versions of beadm allow the user to use any arbitrary
common directory, mine is <poolname>/bootenv/<BEname>
I wonder what the best way to pass this directory down to the gptzfsboot
code would be, maybe a 2nd property, in addition to bootfs (the default
dataset to use), something like belist=<poolname>/bootenv that
gptzfsboot could then list all of the child datasets of, to generate the
menu
--
Allan Jude
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20150319/9ecb5d12/attachment.sig>
More information about the freebsd-hackers
mailing list