From owner-soc-status@FreeBSD.ORG Tue Jun 9 01:06:20 2015 Return-Path: Delivered-To: soc-status@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65CACF11 for ; Tue, 9 Jun 2015 01:06:20 +0000 (UTC) (envelope-from prasadjoshi.linux@gmail.com) Received: from mail-vn0-x22c.google.com (mail-vn0-x22c.google.com [IPv6:2607:f8b0:400c:c0f::22c]) (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 232841CC1 for ; Tue, 9 Jun 2015 01:06:20 +0000 (UTC) (envelope-from prasadjoshi.linux@gmail.com) Received: by vnbf62 with SMTP id f62so631231vnb.12 for ; Mon, 08 Jun 2015 18:06:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=2SjEOwzoYC/sI+x7tLull7ii9allgLbjbdgwrIT7L/A=; b=dv0/kWFbP+4p47CYM4V3zFYYkA1p/isclrOIbFZDHBy7dcefbSO29xkDpZANgnqPK/ ps/ZF57OqfInXabzoGyB0Q1XGV7A8XnoPWcm6UJT7mqZuNcsrkKQa6pEgDuhwRh0y7f8 X6jcYZLQa3ocUlBGWJiQmx2AbdmwS94PTaoWKpP0fAqsLbbVXYToPWB44NVq6ht+pEMA BTMMWO0IY49mMuVeu7Sl8ogyVlt5YMh5XtvSapSfObaLVuWKNvCEpzWW/WxbWcbEuovP QovW+T+0PxZG6Vpo8XLMEdp9Dv8GkCXAJK284ohKBi+OhYS9X92svzoyw39FoDDnXMb1 Hgrw== MIME-Version: 1.0 X-Received: by 10.52.171.199 with SMTP id aw7mr37709974vdc.87.1433811979108; Mon, 08 Jun 2015 18:06:19 -0700 (PDT) Received: by 10.31.190.76 with HTTP; Mon, 8 Jun 2015 18:06:19 -0700 (PDT) Date: Tue, 9 Jun 2015 06:36:19 +0530 Message-ID: Subject: [gsoc15] dynamically discover bes From: Prasad Joshi To: soc-status@freebsd.org Cc: Xin LI Content-Type: text/plain; charset=UTF-8 X-BeenThere: soc-status@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Summer of Code Status Reports and Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2015 01:06:20 -0000 Last week I mostly worked on understanding beadm and gptzfsboot code beadm create prepares new BE by creating a snapshot and clone of that snapshot. beadm activate command sets bootfs property of the POOL. bootfs property contains object number of active dataset object. During bootup gptzfsboot probes all the disks, creating SPA for any valid pool. gptzfsboot assumes the first pool it finds as a primary pool, it then reads meta object set, then tries to find object nunber of active dataset object either through a. bootfs - it would be set if BE was already created b. mos->properties_zap->root_dataset->dd_head_dataset_obj (through root_datasets bonus buffer) Once the object number is obtaind gptzfsboot mounts the dataset. After mounting, few files are looked up like /boot/config or /boot.config for presense of boot command (did not went into details of this). Then (if keyboard is not hit), gptzfsboot execs /boot/zfsloader. If gptzfsboot is interrupted by keyboard, then it displays default BE or POOL it is trying to boot from (using zfs_rlookup() to map active dataset object to string BE name). Though I haven't checked this but through serial console user would be allowed to enter other pool or BE to boot from. I could not go into details of how gptzfsboot reads /boot/zfsloader from disk. Pending Tasks ============= 1. Understand upon keyboard interruption, how user entered zfs paths (format [zfs:pool/filesystem:][/path/to/loader]) are converted in object numbers? 2. Learn ZFS on disk format in more details so as to identify active dataset object numbers of all BEs. Once the object numbers are available, I can use zfs_rlookup() function to map object number to printable pool name. 3. Prepare library for console based menu. Plan for next week ================== Pending task 2 above