aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorTor Egge <tegge@FreeBSD.org>1997-06-23 22:44:51 +0000
committerTor Egge <tegge@FreeBSD.org>1997-06-23 22:44:51 +0000
commitdc6f8d1bd5a4a121a4ee9aaa10ed65a672fc5f27 (patch)
treed70a0f1b45251e7fdb3ba0a7c7503858738e6414 /sbin
parent135a88d805c2c22e6aa585c586f0c3b5b49ee488 (diff)
Notes
Diffstat (limited to 'sbin')
-rw-r--r--sbin/newfs/newfs.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c
index 71a3dfd14ea2..d0a67d242905 100644
--- a/sbin/newfs/newfs.c
+++ b/sbin/newfs/newfs.c
@@ -211,6 +211,7 @@ main(argc, argv)
register int ch;
register struct partition *pp;
register struct disklabel *lp;
+ struct disklabel mfsfakelabel;
struct disklabel *getdisklabel();
struct partition oldpartition;
struct stat st;
@@ -356,6 +357,35 @@ main(argc, argv)
usage();
special = argv[0];
+ /* Copy the NetBSD way of faking up a disk label */
+ if (mfs && !strcmp(special, "swap")) {
+ /*
+ * it's an MFS, mounted on "swap." fake up a label.
+ * XXX XXX XXX
+ */
+ fso = -1; /* XXX; normally done below. */
+
+ memset(&mfsfakelabel, 0, sizeof(mfsfakelabel));
+ mfsfakelabel.d_secsize = 512;
+ mfsfakelabel.d_nsectors = 64;
+ mfsfakelabel.d_ntracks = 16;
+ mfsfakelabel.d_ncylinders = 16;
+ mfsfakelabel.d_secpercyl = 1024;
+ mfsfakelabel.d_secperunit = 16384;
+ mfsfakelabel.d_rpm = 3600;
+ mfsfakelabel.d_interleave = 1;
+ mfsfakelabel.d_npartitions = 1;
+ mfsfakelabel.d_partitions[0].p_size = 16384;
+ mfsfakelabel.d_partitions[0].p_fsize = 1024;
+ mfsfakelabel.d_partitions[0].p_frag = 8;
+ mfsfakelabel.d_partitions[0].p_cpg = 16;
+
+ lp = &mfsfakelabel;
+ pp = &mfsfakelabel.d_partitions[0];
+
+ goto havelabel;
+ }
+
cp = strrchr(special, '/');
if (cp == 0) {
/*
@@ -430,6 +460,7 @@ main(argc, argv)
fatal("%s: `%c' partition overlaps boot program",
argv[0], *cp);
}
+havelabel:
if (fssize == 0)
fssize = pp->p_size;
if (fssize > pp->p_size && !mfs)