Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Add -p option to suppress creating the partition table.



details:   https://anonhg.NetBSD.org/src/rev/7ddb373ae109
branches:  trunk
changeset: 518923:7ddb373ae109
user:      minoura <minoura%NetBSD.org@localhost>
date:      Sat Dec 08 00:51:03 2001 +0000

description:
Add -p option to suppress creating the partition table.

diffstat:

 share/man/man8/man8.x68k/newdisk.8    |   6 ++++--
 sys/arch/x68k/stand/newdisk/newdisk.c |  30 +++++++++++++++++-------------
 2 files changed, 21 insertions(+), 15 deletions(-)

diffs (91 lines):

diff -r 53424918e32e -r 7ddb373ae109 share/man/man8/man8.x68k/newdisk.8
--- a/share/man/man8/man8.x68k/newdisk.8        Sat Dec 08 00:37:07 2001 +0000
+++ b/share/man/man8/man8.x68k/newdisk.8        Sat Dec 08 00:51:03 2001 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: newdisk.8,v 1.3 2001/09/10 23:32:30 wiz Exp $
+.\"    $NetBSD: newdisk.8,v 1.4 2001/12/08 00:51:03 minoura Exp $
 .\"
 .\" Copyright (c) 1998 MINOURA Makoto.
 .\" All rights reserved.
@@ -36,7 +36,7 @@
 .Nd "Prepare a new disk to be usable for X680x0"
 .Sh SYNOPSIS
 .Nm
-.Op Fl vnfc
+.Op Fl vnfcp
 .Op Fl m Ar mboot
 .Ar raw_device
 .Sh DESCRIPTION
@@ -62,6 +62,8 @@
 Check only.
 .Nm
 looks at the disk wheter it is already marked.
+.It Fl p
+Do not create the partition table.
 .It Fl m Ar mboot
 Specifies the mboot program to be written.
 .El
diff -r 53424918e32e -r 7ddb373ae109 sys/arch/x68k/stand/newdisk/newdisk.c
--- a/sys/arch/x68k/stand/newdisk/newdisk.c     Sat Dec 08 00:37:07 2001 +0000
+++ b/sys/arch/x68k/stand/newdisk/newdisk.c     Sat Dec 08 00:51:03 2001 +0000
@@ -51,10 +51,9 @@
 char dev[MAXPATHLEN];
 char buf[4096 + 1];
 
-const char copyright[] = "NetBSD/x68k SCSI Primary Boot. "
-                        "(C) 1999 by The NetBSD Foundation, Inc.";
+const char copyright[] = "NetBSD/x68k SCSI Primary Boot. ";
 
-int verbose = 0, dry_run = 0, force = 0, check_only = 0;
+int verbose = 0, dry_run = 0, force = 0, check_only = 0, mark_only = 0;
 
 volatile void usage __P((void));
 int main __P((int, char *[]));
@@ -80,7 +79,7 @@
     struct disklabel label;
 
     prog = argv[0];
-    while ((ch = getopt(argc, argv, "vnfcm:")) != -1) {
+    while ((ch = getopt(argc, argv, "vnfcm:p")) != -1) {
        switch (ch) {
        case 'v':
            verbose = 1;
@@ -97,6 +96,9 @@
        case 'm':
            mboot = optarg;
            break;
+       case 'p':
+           mark_only = 1;
+           break;
        default:
            usage();
        }
@@ -156,17 +158,19 @@
     if (verbose)
        fprintf(stderr, "done.\n");
 
-    if (verbose)
-       fprintf(stderr, "Creating an empty partition table... ");
+    if (!mark_only) {
+       if (verbose)
+           fprintf(stderr, "Creating an empty partition table... ");
 #define n (label.d_secperunit/2)
-    sprintf(buf+2048,
-           "X68K%c%c%c%c%c%c%c%c%c%c%c%c",
-           0, 0, 0, 32,
-           (n/16777215)%256, (n/65536)%256, (n/256)%256, n%256,
-           (n/16777215)%256, (n/65536)%256, (n/256)%256, n%256);
+       sprintf(buf+2048,
+               "X68K%c%c%c%c%c%c%c%c%c%c%c%c",
+               0, 0, 0, 32,
+               (n/16777215)%256, (n/65536)%256, (n/256)%256, n%256,
+               (n/16777215)%256, (n/65536)%256, (n/256)%256, n%256);
 #undef n
-    if (verbose)
-       fprintf(stderr, "done.\n");
+       if (verbose)
+           fprintf(stderr, "done.\n");
+    }
 
     if (dry_run) {
        char filename[MAXPATHLEN] = "/tmp/diskmarkXXXXX";



Home | Main Index | Thread Index | Old Index