From owner-p4-projects@FreeBSD.ORG Mon Dec 3 05:16:42 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BA9AB16A46C; Mon, 3 Dec 2007 05:16:42 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A2EB16A468 for ; Mon, 3 Dec 2007 05:16:42 +0000 (UTC) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 49A4813C469 for ; Mon, 3 Dec 2007 05:16:42 +0000 (UTC) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lB35Gfmm089788 for ; Mon, 3 Dec 2007 05:16:41 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lB35Gftr089785 for perforce@freebsd.org; Mon, 3 Dec 2007 05:16:41 GMT (envelope-from marcel@freebsd.org) Date: Mon, 3 Dec 2007 05:16:41 GMT Message-Id: <200712030516.lB35Gftr089785@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Cc: Subject: PERFORCE change 130077 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Dec 2007 05:16:43 -0000 http://perforce.freebsd.org/chv.cgi?CH=130077 Change 130077 by marcel@marcel_cluster on 2007/12/03 05:15:41 Add support for BSD disklabels to g_part. BSD disklabels with 8-20 (incl) partitions is supported. No bootcode support as of yet. Compile-tested only. Affected files ... .. //depot/projects/ia64/sys/conf/NOTES#118 edit .. //depot/projects/ia64/sys/conf/files#159 edit .. //depot/projects/ia64/sys/conf/options#109 edit .. //depot/projects/ia64/sys/geom/part/g_part.c#4 edit .. //depot/projects/ia64/sys/geom/part/g_part.h#4 edit .. //depot/projects/ia64/sys/geom/part/g_part_bsd.c#1 add .. //depot/projects/ia64/sys/ia64/conf/DEFAULTS#9 edit Differences ... ==== //depot/projects/ia64/sys/conf/NOTES#118 (text+ko) ==== @@ -146,6 +146,7 @@ options GEOM_MULTIPATH # Disk multipath options GEOM_NOP # Test class. options GEOM_PART_APM # Apple partitioning +options GEOM_PART_BSD # BSD disklabel options GEOM_PART_GPT # GPT partitioning options GEOM_PART_MBR # MBR partitioning options GEOM_PC98 # NEC PC9800 partitioning ==== //depot/projects/ia64/sys/conf/files#159 (text+ko) ==== @@ -1294,6 +1294,7 @@ geom/part/g_part.c standard geom/part/g_part_if.m standard geom/part/g_part_apm.c optional geom_part_apm +geom/part/g_part_bsd.c optional geom_part_bsd geom/part/g_part_gpt.c optional geom_part_gpt geom/part/g_part_mbr.c optional geom_part_mbr geom/raid3/g_raid3.c optional geom_raid3 ==== //depot/projects/ia64/sys/conf/options#109 (text+ko) ==== @@ -88,6 +88,7 @@ GEOM_MULTIPATH opt_geom.h GEOM_NOP opt_geom.h GEOM_PART_APM opt_geom.h +GEOM_PART_BSD opt_geom.h GEOM_PART_GPT opt_geom.h GEOM_PART_MBR opt_geom.h GEOM_PC98 opt_geom.h ==== //depot/projects/ia64/sys/geom/part/g_part.c#4 (text+ko) ==== @@ -664,6 +664,14 @@ error = g_getattr("PART::depth", cp, &attr); table->gpt_depth = (!error) ? attr + 1 : 0; + /* If we're nested, get the absolute sector offset on disk. */ + if (table->gpt_depth) { + error = g_getattr("PART::offset", cp, &attr); + if (error) + goto fail; + table->gpt_offset = attr; + } + /* * Synthesize a disk geometry. Some partitioning schemes * depend on it and since some file systems need it even @@ -1329,7 +1337,15 @@ goto fail; table = gp->softc; - + + /* If we're nested, get the absolute sector offset on disk. */ + if (table->gpt_depth) { + error = g_getattr("PART::offset", cp, &attr); + if (error) + goto fail; + table->gpt_offset = attr; + } + /* * Synthesize a disk geometry. Some partitioning schemes * depend on it and since some file systems need it even @@ -1505,6 +1521,9 @@ return; if (g_handleattr_int(bp, "PART::depth", table->gpt_depth)) return; + if (g_handleattr_int(bp, "PART::offset", + table->gpt_offset + entry->gpe_offset)) + return; if (!strcmp("GEOM::kerneldump", bp->bio_attribute)) { /* * Check that the partition is suitable for kernel ==== //depot/projects/ia64/sys/geom/part/g_part.h#4 (text+ko) ==== @@ -99,6 +99,13 @@ */ uint32_t gpt_sectors; uint32_t gpt_heads; + /* + * gpt_offset holds the absolute block address of the scheme + * on disk. Some partitioning schemes (historically) use + * absolute addressing. Relative addresses are obtained by + * subtracting gpt_offset from the absolute addresses. + */ + uint64_t gpt_offset; int gpt_depth; /* Sub-partitioning level. */ int gpt_isleaf:1; /* Cannot be sub-partitioned. */ ==== //depot/projects/ia64/sys/ia64/conf/DEFAULTS#9 (text+ko) ==== @@ -14,7 +14,7 @@ # UART chips on this platform device uart_ns8250 -options GEOM_BSD +options GEOM_PART_BSD options GEOM_PART_GPT options GEOM_PART_MBR