From leonardjo@hetnet.nl  Fri Jul  7 12:50:23 2000
Return-Path: <leonardjo@hetnet.nl>
Received: from hetnet.nl (net090s.hetnet.nl [194.151.104.183])
	by hub.freebsd.org (Postfix) with ESMTP id 5592137C455
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  7 Jul 2000 12:50:22 -0700 (PDT)
	(envelope-from leonardjo@hetnet.nl)
Received: from potkoffie ([195.121.128.4]) by hetnet.nl  with Microsoft SMTPSVC(5.5.1877.387.38);
	 Fri, 7 Jul 2000 21:50:18 +0200
Message-Id: <39665041.10109.B8D16@localhost>
Date: Fri, 7 Jul 2000 21:48:49 +0200
From: "Leonard den Ottolander" <leonardjo@hetnet.nl>
To: FreeBSD-gnats-submit@freebsd.org
Subject: Inability to use linux extended partition (type 0x85)

>Number:         19756
>Category:       kern
>Synopsis:       [patch] Inability to use linux extended partition (type 0x85)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 07 13:00:00 PDT 2000
>Closed-Date:    
>Last-Modified:  Sat Mar 06 21:13:15 UTC 2010
>Originator:     Leonard den Ottolander
>Release:        FreeBSD 4.0-RELEASE i386
>Organization:
>Environment:

>Description:

 The kernel is yet unable to use the linux extended partition (type 0x85). The
linux extended partition is just a dos extended partition with a different
identifier, as not to confuse dos.
 Implementing the use of the linux extended partition requires the partition
type to be known, and a check for its presence.

>How-To-Repeat:

>Fix:

 Following is a diff of the original to a patched /sys/kern/subr_diskmbr.c:

*** subr_diskmbr.c.000	Fri Jan 28 11:22:07 2000
--- subr_diskmbr.c	Mon Jun 26 19:42:55 2000
***************
*** 49,55 ****
--- 49,59 ----
  #include <sys/disklabel.h>
  #define	DOSPTYP_EXTENDED	5
  #define	DOSPTYP_EXTENDEDX	15
+ #define	DOSPTYP_LINUXEXTENDED	133
  #define	DOSPTYP_ONTRACK		84
+ #define IS_EXTENDED(p) \
+ 	((p) == DOSPTYP_EXTENDED || (p) == DOSPTYP_EXTENDEDX \
+ 	|| (p) == DOSPTYP_LINUXEXTENDED )
  #include <sys/diskslice.h>
  #include <sys/malloc.h>
  #include <sys/syslog.h>
***************
*** 343,350 ****
  	/* Handle extended partitions. */
  	sp -= NDOSPART;
  	for (dospart = 0; dospart < NDOSPART; dospart++, sp++)
! 		if (sp->ds_type == DOSPTYP_EXTENDED ||
! 		    sp->ds_type == DOSPTYP_EXTENDEDX)
  			mbr_extended(bp->b_dev, lp, ssp,
  				     sp->ds_offset, sp->ds_size, sp->ds_offset,
  				     max_nsectors, max_ntracks, mbr_offset, 1);
--- 347,353 ----
  	/* Handle extended partitions. */
  	sp -= NDOSPART;
  	for (dospart = 0; dospart < NDOSPART; dospart++, sp++)
! 		if (IS_EXTENDED(sp->ds_type))
  			mbr_extended(bp->b_dev, lp, ssp,
  				     sp->ds_offset, sp->ds_size, sp->ds_offset,
  				     max_nsectors, max_ntracks, mbr_offset, 1);
***************
*** 433,440 ****
  		if (dp->dp_scyl == 0 && dp->dp_shd == 0 && dp->dp_ssect == 0
  		    && dp->dp_start == 0 && dp->dp_size == 0)
  			continue;
! 		if (dp->dp_typ == DOSPTYP_EXTENDED ||
! 		    dp->dp_typ == DOSPTYP_EXTENDEDX) {
  			static char buf[32];
  
  			sname = dsname(dev, dkunit(dev), WHOLE_DISK_SLICE,
--- 436,442 ----
  		if (dp->dp_scyl == 0 && dp->dp_shd == 0 && dp->dp_ssect == 0
  		    && dp->dp_start == 0 && dp->dp_size == 0)
  			continue;
! 		if (IS_EXTENDED(dp->dp_typ)) {
  			static char buf[32];
  
  			sname = dsname(dev, dkunit(dev), WHOLE_DISK_SLICE,




>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sheldonh 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Tue Jul 18 10:19:22 PDT 2000 
Responsible-Changed-Why:  
I'll commit something close to this once it's made it  
through a kernel build. :-) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=19756 
Responsible-Changed-From-To: sheldonh->freebsd-bugs 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Tue Nov 27 10:36:28 PST 2001 
Responsible-Changed-Why:  
I seem to remember either bde or msmith being unhappy with the change for 
some reason.  Shame on me for not copying the message to the audit trail. 
Anyway, I can't follow it up now, so throw it open to the peanut gallery. :-) 
. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=19756 
>Unformatted:
