Module Name: src
Committed By: abs
Date: Mon Jul 2 22:42:18 UTC 2012
Modified Files:
src/distrib/vax/miniroot: Makefile.inc
src/sys/arch/vax/include: disklabel.h types.h
src/sys/sys: bootblock.h
Log Message:
- Increase MAXPARTITIONS for vax from 8 to 16, using the standard NetBSD
mechanism to ensure all existing /dev nodes continue to work
- Adjust boot block layout to fit additional partitions
- Adjust number of inodes on install media
To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/distrib/vax/miniroot/Makefile.inc
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/vax/include/disklabel.h
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/vax/include/types.h
cvs rdiff -u -r1.53 -r1.54 src/sys/sys/bootblock.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/distrib/vax/miniroot/Makefile.inc
diff -u src/distrib/vax/miniroot/Makefile.inc:1.20 src/distrib/vax/miniroot/Makefile.inc:1.21
--- src/distrib/vax/miniroot/Makefile.inc:1.20 Thu Feb 11 09:06:51 2010
+++ src/distrib/vax/miniroot/Makefile.inc Mon Jul 2 22:42:18 2012
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile.inc,v 1.20 2010/02/11 09:06:51 roy Exp $
+# $NetBSD: Makefile.inc,v 1.21 2012/07/02 22:42:18 abs Exp $
IMAGESIZE= 7m
-MAKEFS_FLAGS= -o density=4k
+MAKEFS_FLAGS= -o density=3k
IMAGEENDIAN= le
MAKEDEVTARGETS= all
LISTS+= ${DISTRIBDIR}/common/list.sysinst
Index: src/sys/arch/vax/include/disklabel.h
diff -u src/sys/arch/vax/include/disklabel.h:1.5 src/sys/arch/vax/include/disklabel.h:1.6
--- src/sys/arch/vax/include/disklabel.h:1.5 Tue Aug 30 12:39:59 2011
+++ src/sys/arch/vax/include/disklabel.h Mon Jul 2 22:42:18 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: disklabel.h,v 1.5 2011/08/30 12:39:59 bouyer Exp $ */
+/* $NetBSD: disklabel.h,v 1.6 2012/07/02 22:42:18 abs Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@@ -33,11 +33,25 @@
#ifndef _MACHINE_DISKLABEL_H_
#define _MACHINE_DISKLABEL_H_
-#define LABELUSESMBR 0 /* no MBR partitionning */
-#define LABELSECTOR 0 /* sector containing label */
-#define LABELOFFSET 64 /* offset of label in sector */
-#define MAXPARTITIONS 8 /* number of partitions */
-#define RAW_PART 2 /* raw partition: xx?c */
+#define LABELUSESMBR 0 /* no MBR partitionning */
+#define LABELSECTOR 0 /* sector containing label */
+#define LABELOFFSET 64 /* offset of label in sector */
+#define MAXPARTITIONS 16 /* number of partitions */
+#define OLDMAXPARTITIONS 8 /* number of partitions before nb-6 */
+#define RAW_PART 2 /* raw partition: xx?c */
+
+/*
+ * We use the highest bit of the minor number for the partition number.
+ * This maintains backward compatibility with device nodes created before
+ * MAXPARTITIONS was increased.
+ */
+#define __VAX_MAXDISKS ((1 << 20) / MAXPARTITIONS)
+#define DISKUNIT(dev) ((minor(dev) / OLDMAXPARTITIONS) % __VAX_MAXDISKS)
+#define DISKPART(dev) ((minor(dev) % OLDMAXPARTITIONS) + \
+ ((minor(dev) / (__VAX_MAXDISKS * OLDMAXPARTITIONS)) * OLDMAXPARTITIONS))
+#define DISKMINOR(unit, part) \
+ (((unit) * OLDMAXPARTITIONS) + ((part) % OLDMAXPARTITIONS) + \
+ ((part) / OLDMAXPARTITIONS) * (__VAX_MAXDISKS * OLDMAXPARTITIONS))
/* Just a dummy */
#ifndef _LOCORE
Index: src/sys/arch/vax/include/types.h
diff -u src/sys/arch/vax/include/types.h:1.45 src/sys/arch/vax/include/types.h:1.46
--- src/sys/arch/vax/include/types.h:1.45 Fri May 25 12:32:48 2012
+++ src/sys/arch/vax/include/types.h Mon Jul 2 22:42:18 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: types.h,v 1.45 2012/05/25 12:32:48 matt Exp $ */
+/* $NetBSD: types.h,v 1.46 2012/07/02 22:42:18 abs Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -78,6 +78,7 @@ typedef volatile char __cpu_simple_lock_
#define __HAVE_CPU_DATA_FIRST
#define __HAVE_MM_MD_READWRITE
#define __HAVE_MM_MD_DIRECT_MAPPED_PHYS
+#define __HAVE_OLD_DISKLABEL
#ifdef _KERNEL
#define __HAVE_RAS
#endif
Index: src/sys/sys/bootblock.h
diff -u src/sys/sys/bootblock.h:1.53 src/sys/sys/bootblock.h:1.54
--- src/sys/sys/bootblock.h:1.53 Mon Apr 2 18:53:54 2012
+++ src/sys/sys/bootblock.h Mon Jul 2 22:42:18 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: bootblock.h,v 1.53 2012/04/02 18:53:54 christos Exp $ */
+/* $NetBSD: bootblock.h,v 1.54 2012/07/02 22:42:18 abs Exp $ */
/*-
* Copyright (c) 2002-2004 The NetBSD Foundation, Inc.
@@ -1409,7 +1409,8 @@ struct vax_boot_block {
uint8_t bb_mbone; /* must be one */
uint16_t bb_lbn_hi; /* lbn (hi word) of bootstrap */
uint16_t bb_lbn_low; /* lbn (low word) of bootstrap */
- uint8_t pad1[332];
+ uint8_t pad1[460];
+ /* disklabel offset is 64 from base, or 56 from start of pad1 */
/* The rest of these fields are identification area and describe
* the secondary block for uVAX VMB.
@@ -1431,7 +1432,7 @@ struct vax_boot_block {
/* The rest is unused.
*/
- uint8_t pad2[148];
+ uint8_t pad2[20];
} __packed;
#define VAX_BOOT_MAGIC1 0x18 /* size of BB info? */