From owner-freebsd-hackers@FreeBSD.ORG Thu Mar 19 16:38:46 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 1EF30E5F for ; Thu, 19 Mar 2015 16:38:46 +0000 (UTC) Received: from mail-ie0-x22d.google.com (mail-ie0-x22d.google.com [IPv6:2607:f8b0:4001:c03::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9E59BE6 for ; Thu, 19 Mar 2015 16:38:45 +0000 (UTC) Received: by iecvj10 with SMTP id vj10so71553807iec.0 for ; Thu, 19 Mar 2015 09:38:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Sw39OecvoG1auIsri9GF9FB9gUPtguOP9PSk7yInQi0=; b=ZbgtDig/66LHjCRktTNTpI3iQEXQtoP+iaTmF7SKY/1MbAJbhIYIGwbDvB4ghPXMr5 7B1YkW1IXz4uuPTipb40rL+tt1OGDKTWmBz9Kg8F/9TgFaJS7UjvL49MA/2tdikHFIzw c/lsHnz2fB1kAKvMky+pKJyZmBzJpukns+FlVzQo6s/qloz/a1tX4OU9lcZgO4QP1ona qo3ZYzFz9pQMjQrtA/U2zyBCQ3gAhwveKbdfNzmXZsNLsT6zr/zfyGxHg/m1K/iNeH7B ML4LAgCmWLbqw02wQkSdKqLDdSlzdedeQqXybsttv7pgfMNE1yEzQfWiVmBBxcSvFWAL G1kQ== MIME-Version: 1.0 X-Received: by 10.107.132.13 with SMTP id g13mr106548585iod.4.1426783125083; Thu, 19 Mar 2015 09:38:45 -0700 (PDT) Received: by 10.36.30.75 with HTTP; Thu, 19 Mar 2015 09:38:45 -0700 (PDT) In-Reply-To: References: Date: Thu, 19 Mar 2015 22:08:45 +0530 Message-ID: Subject: Re: GSoC 15 - ZFS Boot Environment menu for GPT/EFI boot From: Prasad Joshi To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 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 16:38:46 -0000 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 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