From owner-freebsd-hackers@FreeBSD.ORG Thu Mar 19 17:22:05 2015 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4024CA02 for ; Thu, 19 Mar 2015 17:22:05 +0000 (UTC) Received: from mx1.scaleengine.net (beauharnois2.bhs1.scaleengine.net [142.4.218.15]) by mx1.freebsd.org (Postfix) with ESMTP id 17314307 for ; Thu, 19 Mar 2015 17:22:04 +0000 (UTC) Received: from [192.168.1.2] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id AED679EA79; Thu, 19 Mar 2015 17:22:03 +0000 (UTC) Message-ID: <550B05CF.80503@freebsd.org> Date: Thu, 19 Mar 2015 13:22:23 -0400 From: Allan Jude User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Subject: Re: GSoC 15 - ZFS Boot Environment menu for GPT/EFI boot References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ft9NAfFVNieKQmqGG47ak3ofaT7GEaul5" Cc: prasadjoshi.linux@gmail.com X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2015 17:22:05 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ft9NAfFVNieKQmqGG47ak3ofaT7GEaul5 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2015-03-19 12:38, Prasad Joshi wrote: > Hello All, >=20 > To get my self familiarize with the project idea. I tried certain thing= s > 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 >=20 > 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. >=20 > Once a bootable pool or dataset has been identified, it is given to > zfsbootloader for final stage of kernel bootstrapping. >=20 > 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. >=20 > 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? >=20 > 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. >=20 > 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. >=20 > Thanks and Regards, > Prasad >=20 > On Wed, Mar 18, 2015 at 8:57 PM, Prasad Joshi > 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/pr= asadjoshi/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=3Dprasad-joshi >> >> I have also worked on KVM Tools project few years back, wherein I adde= d >> 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@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.o= rg" >=20 the beadm tool works by taking a snapshot of the current 'bootfs' dataset, and then creating a clone from that (since snapshots are read on= ly) In general, beadm has each boot environment as a dataset below some common point, the old default was /ROOT/ however, newer versions of beadm allow the user to use any arbitrary common directory, mine is /bootenv/ 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=3D/bootenv that gptzfsboot could then list all of the child datasets of, to generate the menu --=20 Allan Jude --ft9NAfFVNieKQmqGG47ak3ofaT7GEaul5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJVCwXRAAoJEJrBFpNRJZKfz8wP/RHosLqWTCd6bF3/aEDHO0FZ SJaWYHEXM10kkUq+ZwgA4ao9FjhYZoyvM7cQzOFH4Bi60bwNL4EeTrmEoWpsEQKA 7KBAy75sLWtBn+S4m0QR/mRyKtWdbEgx8RabKCeHu3dBOjSm1X8CXLCAQFyaSh6o 25XJ87DykFyfiJS9ukHe8iOcZ0GCEt8sqX/jzlXF52KOgApMwJEWeejKYc1IX+21 I6vcqSUylc/sF80AEt2jO03GnLrdWoWnJeR3J5gh4zx9QIdh43GvSYYnpU4weD6p 5SbN4Z3aXjgCdFGlK37WCvyZm9571mU/kj+pj3Furja7+bvL1MzBu3s/cU+3dPIv zYwsktSsTnhlgS9Kb3HlZFSGkQ9Z8eZxMg/kCRgnKXU9NigoaPr+qYnVCHjSo1TT brv2aJH7Vp/00/XxNkxRQjRTh/r5oi19vnEB3i0u435EFvz3agAtGCLjfoiLFMSI ANV7VEWflqbjtunlKChS2hIaI6U3dC6Jy1KTVZNQc8jrWi9X/0NhKfR8nzgO/g2d GtgxHNorW6Osf+rpFn+T+iwaO1Lk7kK1k6njJsuMGmPTXh9gBz0wrug86LtlPL7p tZc7Q5eze/Mo9QZpIfa2Jg5Kh5C7hVlWJ8hnSur6HDGWIZTdiEBKYJnIHi21EUe3 6rSa+w+Q0DujL2bdgjXu =8W+r -----END PGP SIGNATURE----- --ft9NAfFVNieKQmqGG47ak3ofaT7GEaul5--