Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-4]: src/usr.sbin/mbrlabel pull up rev 1.6 from trunk (requested...
details: https://anonhg.NetBSD.org/src/rev/6ebf8e1eedef
branches: netbsd-1-4
changeset: 469492:6ebf8e1eedef
user: cgd <cgd%NetBSD.org@localhost>
date: Sun Sep 26 05:32:09 1999 +0000
description:
pull up rev 1.6 from trunk (requested by ws):
Correct handling of extended partitions within extended partitions, and
add support for Linux extended partitions.
diffstat:
usr.sbin/mbrlabel/mbrlabel.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diffs (73 lines):
diff -r cae9f58042fa -r 6ebf8e1eedef usr.sbin/mbrlabel/mbrlabel.c
--- a/usr.sbin/mbrlabel/mbrlabel.c Sun Sep 26 05:26:08 1999 +0000
+++ b/usr.sbin/mbrlabel/mbrlabel.c Sun Sep 26 05:32:09 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mbrlabel.c,v 1.3.2.1 1999/08/20 05:06:06 cgd Exp $ */
+/* $NetBSD: mbrlabel.c,v 1.3.2.2 1999/09/26 05:32:09 cgd Exp $ */
/*
* Copyright (C) 1998 Wolfgang Solfrank.
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: mbrlabel.c,v 1.3.2.1 1999/08/20 05:06:06 cgd Exp $");
+__RCSID("$NetBSD: mbrlabel.c,v 1.3.2.2 1999/09/26 05:32:09 cgd Exp $");
#endif /* not lint */
#include <stdio.h>
@@ -55,7 +55,7 @@
void usage __P((void));
void getlabel __P((int));
void setlabel __P((int));
-int getparts __P((int, int, u_int32_t));
+int getparts __P((int, int, u_int32_t, u_int32_t));
int nbsdtype __P((int));
u_int32_t getlong __P((void *p));
@@ -132,10 +132,11 @@
}
int
-getparts(sd, np, off)
+getparts(sd, np, off, eoff)
int sd;
int np;
u_int32_t off;
+ u_int32_t eoff;
{
unsigned char buf[DEV_BSIZE];
struct mbr_partition parts[NMBRPART];
@@ -162,6 +163,7 @@
break;
case MBR_PTYPE_EXT:
case MBR_PTYPE_EXT_LBA:
+ case MBR_PTYPE_EXT_LNX:
/* Will be handled below */
break;
default:
@@ -193,10 +195,14 @@
np++;
}
for (i = 0; i < NMBRPART; i++) {
+ u_int32_t poff;
+
switch (parts[i].mbrp_typ) {
case MBR_PTYPE_EXT:
case MBR_PTYPE_EXT_LBA:
- np = getparts(sd, np, getlong(&parts[i].mbrp_start) + off);
+ case MBR_PTYPE_EXT_LNX:
+ poff = getlong(&parts[i].mbrp_start) + eoff;
+ np = getparts(sd, np, poff, eoff ? eoff : poff);
break;
default:
break;
@@ -231,7 +237,7 @@
exit(1);
}
getlabel(sd);
- np = getparts(sd, FIRSTPART, MBR_BBSECTOR);
+ np = getparts(sd, FIRSTPART, MBR_BBSECTOR, 0);
if (np > label.d_npartitions)
label.d_npartitions = np;
setlabel(sd);
Home |
Main Index |
Thread Index |
Old Index