some requests for ZFS

From: Norikatsu Shigemura <nork_at_FreeBSD.org>
Date: Sun, 21 Dec 2008 00:47:59 +0900
Hi Doug!

	I confirmed that your zfsboot code is good on my i386/amd64 note
	PCs after r186243!  Thanks for your works!


	I have two requests:
		1. To support zpool for lsdev like following.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OK lsdev -v
cd devices:
disk devices:
    disk0:   BIOS drive C:
        disk0s1a: ZFS 72GB (63 - 151048055)
        disk0s1b: swap 5120MB (302096047 - 312581808)
        disk0s1a: ZFS 72GB (151048055 - 302096047)
pxe devices:
zfs devices:
  pool: tank
config:

        NAME             STATE
        tank             ONLINE
          ad4s1a         ONLINE
OK
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		2. To support case of "slice has only zpool and no bsd partition".
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# zpool create tank ad0s1
 and
boot from ad0s1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

	SEE ALSO:
	http://lists.freebsd.org/pipermail/freebsd-fs/2008-July/004895.html


--- sys/boot/i386/libi386/biosdisk.c.orig	2008-11-20 01:04:07.000000000 +0900
+++ sys/boot/i386/libi386/biosdisk.c	2008-11-21 02:00:56.078793628 +0900
_at__at_ -469,6 +469,7 _at__at_
 	 * unused.
 	 */
 	if ((lp->d_partitions[i].p_fstype == FS_BSDFFS) ||
+            (lp->d_partitions[i].p_fstype == FS_ZFS) ||
             (lp->d_partitions[i].p_fstype == FS_SWAP) ||
             (lp->d_partitions[i].p_fstype == FS_VINUM) ||
 	    ((lp->d_partitions[i].p_fstype == FS_UNUSED) && 
_at__at_ -477,6 +478,7 _at__at_
 	    /* Only print out statistics in verbose mode */
 	    if (verbose)
 	        sprintf(line, "  %s%c: %s %s (%d - %d)\n", prefix, 'a' + i,
+		    (lp->d_partitions[i].p_fstype == FS_ZFS) ? "ZFS " : 
 		    (lp->d_partitions[i].p_fstype == FS_SWAP) ? "swap " : 
 		    (lp->d_partitions[i].p_fstype == FS_VINUM) ? "vinum" :
 		    "FFS  ",
_at__at_ -485,6 +487,7 _at__at_
 		    lp->d_partitions[i].p_offset + lp->d_partitions[i].p_size);
 	    else
 	        sprintf(line, "  %s%c: %s\n", prefix, 'a' + i,
+		    (lp->d_partitions[i].p_fstype == FS_ZFS) ? "ZFS" :
 		    (lp->d_partitions[i].p_fstype == FS_SWAP) ? "swap" : 
 		    (lp->d_partitions[i].p_fstype == FS_VINUM) ? "vinum" :
 		    "FFS");
_at__at_ -696,7 +699,8 _at__at_
 
 	if (lp->d_magic != DISKMAGIC) {
 	    DEBUG("no disklabel");
-	    return (ENOENT);
+	    od->od_flags &= ~BD_LABELOK;
+	    od->od_boff = sector;	/* no partition, must be after the slice */
 	}
 	if (dev->d_kind.biosdisk.partition >= lp->d_npartitions) {
 	    DEBUG("partition '%c' exceeds partitions in table (a-'%c')",
Received on Sat Dec 20 2008 - 14:48:02 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:39 UTC