* Add local definition of DISKLABEL_CMD to arch/i386/md.h.
* Remove default definition from disk.c. Ports that don't support dislabels (e.g., amiga) can now just not define DISKLABEL_CMD.
This commit is contained in:
parent
c176a3646e
commit
3b987e7971
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: md.h,v 1.4 1997/10/29 01:07:08 phil Exp $ */
|
||||
/* $NetBSD: md.h,v 1.5 1997/11/09 04:14:16 jonathan Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
|
@ -53,7 +53,15 @@ EXTERN int activepart;
|
|||
EXTERN int bsdpart;
|
||||
EXTERN int usefull;
|
||||
|
||||
/* Definition of files to retreive from ftp. */
|
||||
/*
|
||||
* Default filesets to fetch and install during installation
|
||||
* or upgrade. The standard sets are:
|
||||
* base, etc, comp, games, man, misc, text,
|
||||
* xbase, xfont, xserver, xcontrib, xcomp.
|
||||
*
|
||||
* i386 has the MD set kern first, because generic kernels are too
|
||||
* big to fit on install floppies. i386 does not yet include the x sets.
|
||||
*/
|
||||
EXTERN char ftp_prefix[STRSIZE] INIT("/binary/Tarfiles");
|
||||
EXTERN char dist_postfix[STRSIZE] INIT(".tar.gz");
|
||||
EXTERN distinfo dist_list[]
|
||||
|
@ -71,21 +79,54 @@ EXTERN distinfo dist_list[]
|
|||
#endif
|
||||
;
|
||||
|
||||
/* Disk information */
|
||||
|
||||
/*
|
||||
* Disk names accepted as valid targets for a from-scratch installation.
|
||||
*
|
||||
* On i386, we allow "wd" ST-506/IDE disks and "sd" scsi disks.
|
||||
*/
|
||||
EXTERN char *disk_names[]
|
||||
#ifdef MAIN
|
||||
= {"wd", "sd", NULL}
|
||||
#endif
|
||||
;
|
||||
|
||||
EXTERN char *fdtype INIT("msdos");
|
||||
|
||||
/* Legal start character for a disk for checking input. */
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*
|
||||
* On i386, that means matching 'w' for st-506/ide and 's' for sd.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 'w' || dn == 's')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* For example, i386 uses "/sbin/disklabel -w -r", just like i386
|
||||
* miniroot scripts, though this may leave a bogus incore label.
|
||||
* Sun ports should probably use DISKLABEL_CMD "/sbin/disklabel -w"
|
||||
* to get incore to ondisk inode translation for the Sun proms.
|
||||
* If not defined, we assume the port does not support disklabels and
|
||||
* hand-edited disklabel will NOT be written by MI code.
|
||||
*
|
||||
* On i386, do what the 1.2 install scripts did.
|
||||
*/
|
||||
#define DISKLABEL_CMD "disklabel -w -r"
|
||||
|
||||
|
||||
/*
|
||||
* Default fileystem type for floppy disks.
|
||||
* On i386, that is msdos.
|
||||
*/
|
||||
EXTERN char *fdtype INIT("msdos");
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* prototypes for MD code.
|
||||
*/
|
||||
|
||||
/* prototypes */
|
||||
|
||||
/* from fdisk.c */
|
||||
void set_fdisk_geom (void);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: disks.c,v 1.12 1997/11/05 22:49:06 mhitch Exp $ */
|
||||
/* $NetBSD: disks.c,v 1.13 1997/11/09 04:14:10 jonathan Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
|
@ -58,17 +58,6 @@
|
|||
#include "txtwalk.h"
|
||||
|
||||
|
||||
/*
|
||||
* Default command to use for disklabel. Some ports may need to override this.
|
||||
*/
|
||||
#ifndef DISLABEL_CMD
|
||||
#if 1
|
||||
# define DISKLABEL_CMD "/sbin/disklabel -w -r" /* Works on i386. */
|
||||
#else
|
||||
# define DISKLABEL_CMD "/sbin/disklabel -w" /* On sun proms, -r loses. */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
static void get_disks (void);
|
||||
|
@ -272,11 +261,26 @@ void scsi_fake (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* Label a disk using an MD-specific string DISKLABEL_CMD for
|
||||
* to invoke disklabel.
|
||||
* if MD code does not define DISKLABEL_CMD, this is a no-op.
|
||||
*
|
||||
* i386 port uses "/sbin/disklabel -w -r", just like i386
|
||||
* miniroot scripts, though this may leave a bogus incore label.
|
||||
*
|
||||
* Sun ports should use DISKLABEL_CMD "/sbin/disklabel -w"
|
||||
* to get incore to ondisk inode translation for the Sun proms.
|
||||
*/
|
||||
void write_disklabel (void)
|
||||
{
|
||||
|
||||
#ifdef DISKLABEL_CMD
|
||||
/* disklabel the disk */
|
||||
printf ("%s", msg_string (MSG_dodisklabel));
|
||||
run_prog_or_continue ("%s %s %s", DISKLABEL_CMD, diskdev, bsddiskname);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue