Make disklabel(8) and fdisk(8) into "host tools " last step: build

and install ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-disklabel,
${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk by "reaching over" to
the sources in ${NETBSDSRCDIR}/sbin/{disklabel fdisk}/.

To avoid clashes with a build-host's header files, especially on
*BSD, the host-tools versions of fdisk and disklabel search for
#includes such as disklabel.h, disklabel_acorn.h, disklabel_gpt.h,
and bootinfo.h in a new #includes namespace, nbinclude/.  That is,
they #include <nbinclude/sys/disklabel.h>, <nbinclude/machine/disklabel.h>,
<nbinclude/sparc64/disklabel.h>, instead of <sys/disklabel.h> and
such.  I have also updated the system headers to #include from
nbinclude/-space when HAVE_NBTOOL_CONFIG_H is #defined.
This commit is contained in:
dyoung 2005-06-12 19:46:15 +00:00
parent 960c071724
commit a37289db57
47 changed files with 338 additions and 61 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: util.h,v 1.35 2005/05/15 21:01:34 thorpej Exp $ */
/* $NetBSD: util.h,v 1.36 2005/06/12 19:46:15 dyoung Exp $ */
/*-
* Copyright (c) 1995
@ -33,7 +33,9 @@
#define _UTIL_H_
#include <sys/cdefs.h>
#if !HAVE_NBTOOL_CONFIG_H
#include <sys/ttycom.h>
#endif /* !HAVE_NBTOOL_CONFIG_H */
#include <sys/types.h>
#include <stdio.h>
#include <pwd.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.c,v 1.31 2004/04/23 14:47:23 christos Exp $ */
/* $NetBSD: disklabel.c,v 1.32 2005/06/12 19:46:15 dyoung Exp $ */
/*
* Copyright (c) 1983, 1987, 1993
@ -29,12 +29,16 @@
* SUCH DAMAGE.
*/
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)disklabel.c 8.2 (Berkeley) 5/3/95";
#else
__RCSID("$NetBSD: disklabel.c,v 1.31 2004/04/23 14:47:23 christos Exp $");
__RCSID("$NetBSD: disklabel.c,v 1.32 2005/06/12 19:46:15 dyoung Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -42,10 +46,17 @@ __RCSID("$NetBSD: disklabel.c,v 1.31 2004/04/23 14:47:23 christos Exp $");
#include <sys/param.h>
#define DKTYPENAMES
#define FSTYPENAMES
#include <sys/disklabel.h>
#include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
#if HAVE_NBTOOL_CONFIG_H
#include "../../sys/sys/disklabel.h"
#include "../../include/disktab.h"
#else
#include <sys/disklabel.h>
#include <disktab.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
#include <assert.h>
#include <ctype.h>
#include <errno.h>
@ -55,8 +66,6 @@ __RCSID("$NetBSD: disklabel.c,v 1.31 2004/04/23 14:47:23 christos Exp $");
#include <string.h>
#include <unistd.h>
#include <disktab.h>
#ifdef __weak_alias
__weak_alias(getdiskbyname,_getdiskbyname)
#endif

View File

@ -1,3 +1,7 @@
/* $NetBSD: disklabel.h,v 1.1 2002/03/24 15:46:56 bjh21 Exp $ */
/* $NetBSD: disklabel.h,v 1.2 2005/06/12 19:46:15 dyoung Exp $ */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/arm/disklabel.h>
#else
#include <arm/disklabel.h>
#endif /* HAVE_NBTOOL_CONFIG_H */

View File

@ -1,3 +1,7 @@
/* $NetBSD: disklabel.h,v 1.1 2001/10/05 22:27:49 reinoud Exp $ */
/* $NetBSD: disklabel.h,v 1.2 2005/06/12 19:46:15 dyoung Exp $ */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/arm/disklabel.h>
#else
#include <arm/disklabel.h>
#endif /* HAVE_NBTOOL_CONFIG_H */

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.1 2001/05/28 16:22:18 thorpej Exp $ */
/* $NetBSD: disklabel.h,v 1.2 2005/06/12 19:46:15 dyoung Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@ -38,7 +38,11 @@
#define MAXPARTITIONS 8 /* number of partitions */
#define RAW_PART 2 /* raw partition: xx?c */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/dkbad.h>
#else
#include <sys/dkbad.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
/* Just a dummy */
struct cpu_disklabel {

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.7 2002/04/03 06:16:01 lukem Exp $ */
/* $NetBSD: disklabel.h,v 1.8 2005/06/12 19:46:15 dyoung Exp $ */
/*
* Copyright (c) 1994, 1999 Christopher G. Demetriou
@ -39,7 +39,11 @@
#define MAXPARTITIONS 8 /* number of partitions */
#define RAW_PART 2 /* raw partition: xx?c */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/dkbad.h>
#else
#include <sys/dkbad.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
/* Just a dummy */
struct cpu_disklabel {

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.4 2003/10/08 04:25:44 lukem Exp $ */
/* $NetBSD: disklabel.h,v 1.5 2005/06/12 19:46:15 dyoung Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@ -44,10 +44,18 @@
* MAXPARTITIONS was increased.
*/
/* Pull in MBR partition definitions. */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/bootblock.h>
#else
#include <sys/bootblock.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
#ifndef __ASSEMBLER__
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/dkbad.h>
#else
#include <sys/dkbad.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
struct cpu_disklabel {
struct dkbad bad;
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.7 2003/10/08 04:25:44 lukem Exp $ */
/* $NetBSD: disklabel.h,v 1.8 2005/06/12 19:46:15 dyoung Exp $ */
/* $OpenBSD: disklabel.h,v 1.14 1999/03/23 16:36:17 millert Exp $ */
/* NetBSD: disklabel.h,v 1.3 1996/03/09 20:52:54 ghudson Exp */
@ -43,9 +43,17 @@
#define OPENBSD_RAW_PART 2 /* raw partition: XX?c */
/* Pull in MBR partition definitions. */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/bootblock.h>
#else
#include <sys/bootblock.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/dkbad.h>
#else
#include <sys/dkbad.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
struct cpu_disklabel {
struct mbr_partition dosparts[MBR_PART_COUNT];
struct dkbad bad;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.5 2005/06/02 17:45:59 he Exp $ */
/* $NetBSD: disklabel.h,v 1.6 2005/06/12 19:46:15 dyoung Exp $ */
/*
* Copyright (c) 1994 Mark Brinicombe.
@ -51,9 +51,15 @@
#define MAXPARTITIONS 8 /* number of partitions */
#define RAW_PART 2 /* raw partition: XX?c */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/dkbad.h>
#include <nbinclude/sys/disklabel_acorn.h>
#include <nbinclude/sys/bootblock.h>
#else
#include <sys/dkbad.h>
#include <sys/disklabel_acorn.h>
#include <sys/bootblock.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
struct cpu_disklabel {
struct mbr_partition mbrparts[MBR_PART_COUNT];

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.6 2003/10/08 04:25:44 lukem Exp $ */
/* $NetBSD: disklabel.h,v 1.7 2005/06/12 19:46:15 dyoung Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@ -39,9 +39,17 @@
#define RAW_PART 3 /* raw partition: XX?d (XXX) */
/* Pull in MBR partition definitions. */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/bootblock.h>
#else
#include <sys/bootblock.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/dkbad.h>
#else
#include <sys/dkbad.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
struct cpu_disklabel {
struct mbr_partition dosparts[MBR_PART_COUNT];
struct dkbad bad;

View File

@ -1,3 +1,7 @@
/* $NetBSD: disklabel.h,v 1.3 2001/11/25 15:55:55 thorpej Exp $ */
/* $NetBSD: disklabel.h,v 1.4 2005/06/12 19:46:15 dyoung Exp $ */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/arm/disklabel.h>
#else
#include <arm/disklabel.h>
#endif /* HAVE_NBTOOL_CONFIG_H */

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.7 2003/10/08 04:25:44 lukem Exp $ */
/* $NetBSD: disklabel.h,v 1.8 2005/06/12 19:46:15 dyoung Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@ -39,10 +39,18 @@
#define RAW_PART 3
/* Pull in MBR partition definitions. */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/bootblock.h>
#else
#include <sys/bootblock.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
#ifndef __ASSEMBLER__
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/dkbad.h>
#else
#include <sys/dkbad.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
struct cpu_disklabel {
struct mbr_partition dosparts[MBR_PART_COUNT];
struct dkbad bad;

View File

@ -1,7 +1,11 @@
/* $NetBSD: disklabel.h,v 1.1 2000/12/11 18:19:14 marcus Exp $ */
/* $NetBSD: disklabel.h,v 1.2 2005/06/12 19:46:15 dyoung Exp $ */
#ifndef _DREAMCAST_DISKLABEL_H_
#define _DREAMCAST_DISKLABEL_H_
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sh3/disklabel.h>
#else
#include <sh3/disklabel.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
#endif /* _DREAMCAST_DISKLABEL_H_ */

View File

@ -1,3 +1,7 @@
/* $NetBSD: disklabel.h,v 1.1 2001/11/25 15:56:03 thorpej Exp $ */
/* $NetBSD: disklabel.h,v 1.2 2005/06/12 19:46:15 dyoung Exp $ */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/arm/disklabel.h>
#else
#include <arm/disklabel.h>
#endif /* HAVE_NBTOOL_CONFIG_H */

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.1 2002/03/07 14:44:00 simonb Exp $ */
/* $NetBSD: disklabel.h,v 1.2 2005/06/12 19:46:15 dyoung Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@ -38,7 +38,11 @@
#define MAXPARTITIONS 16 /* number of partitions */
#define RAW_PART 2 /* raw partition: xx?c */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/dkbad.h>
#else
#include <sys/dkbad.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
/* Just a dummy */
struct cpu_disklabel {

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.3 2003/11/19 13:58:11 scw Exp $ */
/* $NetBSD: disklabel.h,v 1.4 2005/06/12 19:46:15 dyoung Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@ -40,13 +40,21 @@
#define LABELSECTOR 1 /* sector containing label */
#define LABELOFFSET 0 /* offset of label in sector */
/* Pull in MBR partition definitions. */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/bootblock.h>
#else
#include <sys/bootblock.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
#else
#define LABELSECTOR 0 /* sector containing label */
#define LABELOFFSET 64 /* offset of label in sector */
#endif /* EVBPPC_HAS_MBR */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/dkbad.h>
#else
#include <sys/dkbad.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
struct cpu_disklabel {
#ifdef EVBPPC_HAS_MBR

View File

@ -1,7 +1,11 @@
/* $NetBSD: disklabel.h,v 1.1 1999/09/13 10:30:32 itojun Exp $ */
/* $NetBSD: disklabel.h,v 1.2 2005/06/12 19:46:15 dyoung Exp $ */
#ifndef _EVBSH3_DISKLABEL_H_
#define _EVBSH3_DISKLABEL_H_
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sh3/disklabel.h>
#else
#include <sh3/disklabel.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
#endif /* _EVBSH3_DISKLABEL_H_ */

View File

@ -1,3 +1,7 @@
/* $NetBSD: disklabel.h,v 1.1 2002/07/05 13:31:43 scw Exp $ */
/* $NetBSD: disklabel.h,v 1.2 2005/06/12 19:46:15 dyoung Exp $ */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sh5/disklabel.h>
#else
#include <sh5/disklabel.h>
#endif /* HAVE_NBTOOL_CONFIG_H */

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.5 2004/07/28 09:17:31 skrll Exp $ */
/* $NetBSD: disklabel.h,v 1.6 2005/06/12 19:46:15 dyoung Exp $ */
/* $OpenBSD: disklabel.h,v 1.5 2000/07/05 22:37:22 mickey Exp $ */
@ -41,9 +41,17 @@
#define MAXPARTITIONS 16 /* number of partitions */
#define RAW_PART 2 /* raw partition: xx?c */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/bootblock.h>
#else
#include <sys/bootblock.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/dkbad.h>
#else
#include <sys/dkbad.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
struct cpu_disklabel {
struct hp700_lifvol lifvol;
struct hp700_lifdir lifdir[HP700_LIF_NUMDIR];

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.4 2003/10/08 04:25:44 lukem Exp $ */
/* $NetBSD: disklabel.h,v 1.5 2005/06/12 19:46:16 dyoung Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@ -39,10 +39,18 @@
#define RAW_PART 3 /* raw partition: XX?d (XXX) */
/* Pull in MBR partition definitions. */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/bootblock.h>
#else
#include <sys/bootblock.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
#ifndef __ASSEMBLER__
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/dkbad.h>
#else
#include <sys/dkbad.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
struct cpu_disklabel {
struct mbr_partition dosparts[MBR_PART_COUNT];
struct dkbad bad;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.6 2003/10/08 04:25:44 lukem Exp $ */
/* $NetBSD: disklabel.h,v 1.7 2005/06/12 19:46:16 dyoung Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@ -53,10 +53,18 @@
((part) / OLDMAXPARTITIONS) * (__HPCMIPS_MAXDISKS * OLDMAXPARTITIONS))
/* Pull in MBR partition definitions. */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/bootblock.h>
#else
#include <sys/bootblock.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
#ifndef __ASSEMBLER__
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/dkbad.h>
#else
#include <sys/dkbad.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
struct cpu_disklabel {
struct mbr_partition dosparts[MBR_PART_COUNT];
struct dkbad bad;

View File

@ -1,7 +1,11 @@
/* $NetBSD: disklabel.h,v 1.2 2001/01/28 03:31:31 uch Exp $ */
/* $NetBSD: disklabel.h,v 1.3 2005/06/12 19:46:16 dyoung Exp $ */
#ifndef _HPCSH_DISKLABEL_H_
#define _HPCSH_DISKLABEL_H_
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sh3/disklabel.h>
#else
#include <sh3/disklabel.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
#endif /* _HPCSH_DISKLABEL_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.12 2003/10/08 04:25:45 lukem Exp $ */
/* $NetBSD: disklabel.h,v 1.13 2005/06/12 19:46:16 dyoung Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@ -53,10 +53,18 @@
((part) / OLDMAXPARTITIONS) * (__I386_MAXDISKS * OLDMAXPARTITIONS))
/* Pull in MBR partition definitions. */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/bootblock.h>
#else
#include <sys/bootblock.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
#ifndef __ASSEMBLER__
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/dkbad.h>
#else
#include <sys/dkbad.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
struct cpu_disklabel {
struct dkbad bad;
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.1 2003/10/19 03:33:50 matt Exp $ */
/* $NetBSD: disklabel.h,v 1.2 2005/06/12 19:46:16 dyoung Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@ -39,8 +39,13 @@
#define RAW_PART 2 /* raw partition: xx?c */
/* Pull in MBR partition definitions. */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/bootblock.h>
#include <nbinclude/sys/dkbad.h>
#else
#include <sys/bootblock.h>
#include <sys/dkbad.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
struct cpu_disklabel {
struct mbr_partition dosparts[MBR_PART_COUNT];

View File

@ -1,3 +1,7 @@
/* $NetBSD: disklabel.h,v 1.1 2004/10/13 23:28:35 gavan Exp $ */
/* $NetBSD: disklabel.h,v 1.2 2005/06/12 19:46:16 dyoung Exp $ */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/arm/disklabel.h>
#else
#include <arm/disklabel.h>
#endif /* HAVE_NBTOOL_CONFIG_H */

View File

@ -1,3 +1,7 @@
/* $NetBSD: disklabel.h,v 1.1 1999/09/13 10:30:55 itojun Exp $ */
/* $NetBSD: disklabel.h,v 1.2 2005/06/12 19:46:16 dyoung Exp $ */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sh3/disklabel.h>
#else
#include <sh3/disklabel.h>
#endif /* HAVE_NBTOOL_CONFIG_H */

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.4 2003/10/08 04:25:45 lukem Exp $ */
/* $NetBSD: disklabel.h,v 1.5 2005/06/12 19:46:16 dyoung Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@ -39,9 +39,14 @@
#define RAW_PART 2 /* raw partition: xx?c */
/* Pull in MBR partition definitions. */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/bootblock.h>
#include <nbinclude/sys/dkbad.h>
#else
#include <sys/bootblock.h>
#include <sys/dkbad.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
struct cpu_disklabel {
struct mbr_partition dosparts[MBR_PART_COUNT];
struct dkbad bad;

View File

@ -1,3 +1,7 @@
/* $NetBSD: disklabel.h,v 1.3 2001/11/25 15:56:07 thorpej Exp $ */
/* $NetBSD: disklabel.h,v 1.4 2005/06/12 19:46:16 dyoung Exp $ */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/arm/disklabel.h>
#else
#include <arm/disklabel.h>
#endif /* HAVE_NBTOOL_CONFIG_H */

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.4 2003/11/15 17:52:30 bouyer Exp $ */
/* $NetBSD: disklabel.h,v 1.5 2005/06/12 19:46:16 dyoung Exp $ */
/*
* Copyright (c) 1994 Rolf Grossmann
* All rights reserved.
@ -32,7 +32,11 @@
#ifndef _MACHINE_DISKLABEL_H_
#define _MACHINE_DISKLABEL_H_
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/bootblock.h>
#else
#include <sys/bootblock.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
#if 0 /* XXX the following doesn't work - still need to find a proper place for the NetBSD disklabel */
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.4 2003/10/08 04:25:45 lukem Exp $ */
/* $NetBSD: disklabel.h,v 1.5 2005/06/12 19:46:16 dyoung Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@ -39,10 +39,18 @@
#define RAW_PART 2
/* Pull in MBR partition definitions. */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/bootblock.h>
#else
#include <sys/bootblock.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
#ifndef __ASSEMBLER__
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/dkbad.h>
#else
#include <sys/dkbad.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
struct cpu_disklabel {
struct mbr_partition dosparts[MBR_PART_COUNT];
struct dkbad bad;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.3 2003/10/08 04:25:46 lukem Exp $ */
/* $NetBSD: disklabel.h,v 1.4 2005/06/12 19:46:16 dyoung Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@ -38,10 +38,13 @@
#define MAXPARTITIONS 16 /* number of partitions */
#define RAW_PART 2 /* raw partition: wdNc */
/* Pull in MBR partition definitions. */
#include <sys/bootblock.h>
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/bootblock.h> /* Pull in MBR partition definitions. */
#include <nbinclude/sys/dkbad.h>
#else
#include <sys/bootblock.h> /* Pull in MBR partition definitions. */
#include <sys/dkbad.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
struct cpu_disklabel {
struct mbr_partition dosparts[MBR_PART_COUNT];
struct dkbad bad;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.5 2003/10/08 04:25:46 lukem Exp $ */
/* $NetBSD: disklabel.h,v 1.6 2005/06/12 19:46:16 dyoung Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@ -38,10 +38,13 @@
#define MAXPARTITIONS 8 /* number of partitions */
#define RAW_PART 2 /* raw partition: xx?c */
/* Pull in MBR partition definitions. */
#include <sys/bootblock.h>
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/bootblock.h> /* Pull in MBR partition definitions. */
#include <nbinclude/sys/dkbad.h>
#else
#include <sys/bootblock.h> /* Pull in MBR partition definitions. */
#include <sys/dkbad.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
struct cpu_disklabel {
struct mbr_partition dosparts[MBR_PART_COUNT];
struct dkbad bad;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.4 2003/10/08 04:25:46 lukem Exp $ */
/* $NetBSD: disklabel.h,v 1.5 2005/06/12 19:46:16 dyoung Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@ -38,10 +38,13 @@
#define MAXPARTITIONS 16 /* number of partitions */
#define RAW_PART 2 /* raw partition: wdNc */
/* Pull in MBR partition definitions. */
#include <sys/bootblock.h>
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/bootblock.h> /* Pull in MBR partition definitions. */
#include <nbinclude/sys/dkbad.h>
#else
#include <sys/bootblock.h> /* Pull in MBR partition definitions. */
#include <sys/dkbad.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
struct cpu_disklabel {
struct mbr_partition dosparts[MBR_PART_COUNT];
struct dkbad bad;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.4 2003/10/25 13:06:03 simonb Exp $ */
/* $NetBSD: disklabel.h,v 1.5 2005/06/12 19:46:17 dyoung Exp $ */
/*
* Copyright 2000, 2001
@ -74,10 +74,18 @@
#ifdef __NetBSD__
/* Pull in MBR partition definitions. */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/bootblock.h>
#else
#include <sys/bootblock.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
#ifndef __ASSEMBLER__
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/dkbad.h>
#else
#include <sys/dkbad.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
struct cpu_disklabel {
struct mbr_partition dosparts[MBR_PART_COUNT];
struct dkbad bad;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.7 2004/11/24 21:59:32 jmc Exp $ */
/* $NetBSD: disklabel.h,v 1.8 2005/06/12 19:46:17 dyoung Exp $ */
/*
* Copyright (c) 2000 Soren S. Jorvang
@ -46,6 +46,10 @@ struct cpu_disklabel {
};
/* Pull in partition definitions. */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/bootblock.h>
#else
#include <sys/bootblock.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
#endif /* _MACHINE_DISKLABEL_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.5 2003/10/08 04:25:46 lukem Exp $ */
/* $NetBSD: disklabel.h,v 1.6 2005/06/12 19:46:17 dyoung Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@ -39,10 +39,18 @@
#define RAW_PART 2
/* Pull in MBR partition definitions. */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/bootblock.h>
#else
#include <sys/bootblock.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
#ifndef __ASSEMBLER__
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/dkbad.h>
#else
#include <sys/dkbad.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
struct cpu_disklabel {
struct mbr_partition dosparts[MBR_PART_COUNT];
struct dkbad bad;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.2 2003/10/08 04:25:46 lukem Exp $ */
/* $NetBSD: disklabel.h,v 1.3 2005/06/12 19:46:17 dyoung Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@ -44,10 +44,18 @@
#define RAW_PART 2
/* Pull in MBR partition definitions. */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/bootblock.h>
#else
#include <sys/bootblock.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
#ifndef __ASSEMBLER__
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/dkbad.h>
#else
#include <sys/dkbad.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
struct cpu_disklabel {
struct mbr_partition dosparts[MBR_PART_COUNT];
struct dkbad bad;

View File

@ -1,3 +1,7 @@
/* $NetBSD: disklabel.h,v 1.1 2002/02/10 01:57:14 thorpej Exp $ */
/* $NetBSD: disklabel.h,v 1.2 2005/06/12 19:46:17 dyoung Exp $ */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/arm/disklabel.h>
#else
#include <arm/disklabel.h>
#endif /* HAVE_NBTOOL_CONFIG_H */

View File

@ -1,3 +1,7 @@
/* $NetBSD: disklabel.h,v 1.2 2002/07/20 11:52:21 mrg Exp $ */
/* $NetBSD: disklabel.h,v 1.3 2005/06/12 19:46:17 dyoung Exp $ */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sparc/disklabel.h>
#else
#include <sparc/disklabel.h>
#endif /* HAVE_NBTOOL_CONFIG_H */

View File

@ -1,3 +1,7 @@
/* $NetBSD: disklabel.h,v 1.2 2001/06/14 13:12:50 fredette Exp $ */
/* $NetBSD: disklabel.h,v 1.3 2005/06/12 19:46:17 dyoung Exp $ */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sun68k/disklabel.h>
#else
#include <sun68k/disklabel.h>
#endif /* HAVE_NBTOOL_CONFIG_H */

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.2 1998/06/30 11:59:11 msaitoh Exp $ */
/* $NetBSD: disklabel.h,v 1.3 2005/06/12 19:46:17 dyoung Exp $ */
/*
* Copyright (c) 1994 Masaru Oki
@ -51,7 +51,11 @@ struct dos_partition {
unsigned long dp_size; /* partition size (1024bytes/block) */
};
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/dkbad.h>
#else
#include <sys/dkbad.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
struct cpu_disklabel {
struct dos_partition dosparts[NDOSPART];
struct dkbad bad;

View File

@ -1,4 +1,4 @@
/* $NetBSD: bootinfo.h,v 1.7 2005/02/04 22:03:53 fvdl Exp $ */
/* $NetBSD: bootinfo.h,v 1.8 2005/06/12 19:46:17 dyoung Exp $ */
/*
* Copyright (c) 1997
@ -111,7 +111,11 @@ struct btinfo_memmap {
struct bi_memmap_entry entry[1]; /* var len */
};
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/bootblock.h>
#else
#include <sys/bootblock.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
/*
* Structure describing disk info as seen by the BIOS.

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.90 2005/01/07 18:29:15 matt Exp $ */
/* $NetBSD: disklabel.h,v 1.91 2005/06/12 19:46:17 dyoung Exp $ */
/*
* Copyright (c) 1987, 1988, 1993
@ -48,7 +48,11 @@
* label can describe and the number of the "whole disk" (raw)
* paritition are machine dependent.
*/
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/machine/disklabel.h>
#else
#include <machine/disklabel.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
/*
* The absolute maximum number of disk partitions allowed.
@ -80,10 +84,12 @@
* Translate between device numbers and major/disk unit/disk partition.
*/
#ifndef __HAVE_OLD_DISKLABEL
#if !HAVE_NBTOOL_CONFIG_H
#define DISKUNIT(dev) (minor(dev) / MAXPARTITIONS)
#define DISKPART(dev) (minor(dev) % MAXPARTITIONS)
#define DISKMINOR(unit, part) \
(((unit) * MAXPARTITIONS) + (part))
#endif /* !HAVE_NBTOOL_CONFIG_H */
#endif
#define MAKEDISKDEV(maj, unit, part) \
(makedev((maj), DISKMINOR((unit), (part))))
@ -194,7 +200,7 @@ struct disklabel {
} d_partitions[MAXPARTITIONS]; /* actually may be more */
};
#ifdef __HAVE_OLD_DISKLABEL
#if defined(__HAVE_OLD_DISKLABEL) && !HAVE_NBTOOL_CONFIG_H
/*
* Same as above, but with OLDMAXPARTITIONS partitions. For use in
* the old DIOC* ioctl calls.

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.89 2005/05/30 15:51:36 thorpej Exp $
# $NetBSD: Makefile,v 1.90 2005/06/12 19:46:17 dyoung Exp $
.include <bsd.own.mk>
@ -28,8 +28,12 @@ SUBDIR= host-mkdep .WAIT compat .WAIT \
yacc .WAIT \
lex .WAIT \
${TOOLCHAIN_BITS} \
asn1_compile cat cksum compile_et config db file installboot \
lint1 makefs menuc mkcsmapper mkesdb mklocale mknod msgc pax \
asn1_compile cat cksum compile_et config db \
file installboot lint1 \
makefs menuc mkcsmapper mkesdb mklocale mknod msgc \
pax .WAIT \
disklabel \
fdisk \
pwd_mkdb stat sunlabel zic
.if ${MKMAN} != "no"

23
tools/Makefile.disklabel Normal file
View File

@ -0,0 +1,23 @@
# $NetBSD: Makefile.disklabel,v 1.1 2005/06/12 19:46:17 dyoung Exp $
_ARCHDIR= ${.CURDIR}/../../sys/arch
_SYSDIR= ${.CURDIR}/../../sys/sys
_SUBDIR!= cd ${_ARCHDIR} && ${MAKE} -V SUBDIR
_ARCH_INCS!= cd ${_ARCHDIR} && find . -name disklabel.h
_INCS= bootblock.h \
disklabel.h disklabel_acorn.h disklabel_gpt.h dkbad.h
HOST_CPPFLAGS+= -I${TOOLDIR}/include
beforedepend:
${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude
${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude/sys
cd ${_ARCHDIR} && \
${TOOL_PAX} -s /include\\/// -rw ${_ARCH_INCS} \
${TOOLDIR}/include/nbinclude
cd ${_SYSDIR} && \
${TOOL_PAX} -rw ${_INCS} ${TOOLDIR}/include/nbinclude/sys
cd ${TOOLDIR}/include/nbinclude && rm -f machine && \
${HOST_INSTALL_SYMLINK} ${MACHINE} machine

10
tools/disklabel/Makefile Normal file
View File

@ -0,0 +1,10 @@
# $NetBSD: Makefile,v 1.1 2005/06/12 19:46:17 dyoung Exp $
HOSTPROGNAME= ${MACHINE_GNU_PLATFORM}-disklabel
HOST_SRCDIR= sbin/disklabel
HOST_SRCS= getcap.c disklabel.c
.include "${.CURDIR}/../Makefile.disklabel"
.include "${.CURDIR}/../Makefile.host"
.PATH: ${.CURDIR}/../../lib/libc/gen

10
tools/fdisk/Makefile Normal file
View File

@ -0,0 +1,10 @@
# $NetBSD: Makefile,v 1.1 2005/06/12 19:46:17 dyoung Exp $
HOSTPROGNAME= ${MACHINE_GNU_PLATFORM}-fdisk
HOST_SRCDIR= sbin/fdisk
HOST_SRCS= getcap.c disklabel.c
.include "${.CURDIR}/../Makefile.disklabel"
.include "${.CURDIR}/../Makefile.host"
.PATH: ${.CURDIR}/../../lib/libc/gen