Date:        Mon, 6 Jun 2016 18:35:43 +0200
    From:        Edgar =?iso-8859-1?B?RnXf?= <[email protected]>
    Message-ID:  <[email protected]>

  | > ie /dev/wd1 is a link to /dev/wd1d on i386 (etc) or /dev/wd1c (on sparc 
etc)
  | YES.

I offer attached alternate patches, the first makes /dev/wd0 as a chrdev
and the second as a link.

I do not have all the various architectures that have the various different
strategies for naming and minor-numbering disk devices to test this thoroughly
though, but what I have tested seems to work, and the changes (both versions)
are so simple they seem unlikely to fail (and if they do, the effect would
just be that the new nodes would not be correct, all the ones we're used to
having would be fine, so simply removing the bogus ones would return the
universe to its current state.)

I prefer the chrdev version ... it is robust against removal of the ?dNx
node names, which (sometime later, after tools/scripts have been adapted
not to seek out the ?dN[cd] device names explicitly) might be something to
do on a system using GPT and wedges (or even disklabel wedge autodiscovery).
It also will provoke any lingering bugs if anything is currently relying on
vnode locking for device exclusivity (with two different vnodes for the same
underlying device).    But either version should work (only one of them
of course!)

Either version consumes 2 more names, and inodes, per disk device configured.

Opinions?

kre


Index: MAKEDEV.tmpl
===================================================================
RCS file: /cvsroot/src/etc/MAKEDEV.tmpl,v
retrieving revision 1.180
diff -u -r1.180 MAKEDEV.tmpl
--- MAKEDEV.tmpl        4 Jun 2016 16:11:50 -0000       1.180
+++ MAKEDEV.tmpl        7 Jun 2016 08:40:25 -0000
@@ -2252,6 +2252,10 @@
 {
        name="$1"; unit="$2"; blk="$3"; chr="$4"
 
+       ro=%RAWDISK_OFF%
+       mkdev ${name}${unit}    b $blk $(($unit * 8 + $ro))     640 $g_operator
+       mkdev r${name}${unit}   c $chr $(($unit * 8 + $ro))     640 $g_operator
+
        mkdev ${name}${unit}a   b $blk $(($unit * 8 + 0))       640 $g_operator
        mkdev ${name}${unit}b   b $blk $(($unit * 8 + 1))       640 $g_operator
        mkdev ${name}${unit}c   b $blk $(($unit * 8 + 2))       640 $g_operator
@@ -2275,6 +2279,10 @@
        ho=524280       # offset for partition 9 to 11 (same as ...p16high)
        name="$1"; unit="$2"; blk="$3"; chr="$4"
 
+       ro=%RAWDISK_OFF%
+       mkdev ${name}${unit}    b $blk $(($unit * 8 + $ro))     640 $g_operator
+       mkdev r${name}${unit}   c $chr $(($unit * 8 + $ro))     640 $g_operator
+
        mkdev ${name}${unit}a   b $blk $(($unit * 8 + 0))       640 $g_operator
        mkdev ${name}${unit}b   b $blk $(($unit * 8 + 1))       640 $g_operator
        mkdev ${name}${unit}c   b $blk $(($unit * 8 + 2))       640 $g_operator
@@ -2305,6 +2313,10 @@
 {
        name="$1"; unit="$2"; blk="$3"; chr="$4"
 
+       ro=%RAWDISK_OFF%
+       mkdev ${name}${unit}    b $blk $(($unit * 16 + $ro))    640 $g_operator
+       mkdev r${name}${unit}   c $chr $(($unit * 16 + $ro))    640 $g_operator
+
        mkdev ${name}${unit}a   b $blk $(($unit * 16 + 0))      640 $g_operator
        mkdev ${name}${unit}b   b $blk $(($unit * 16 + 1))      640 $g_operator
        mkdev ${name}${unit}c   b $blk $(($unit * 16 + 2))      640 $g_operator
@@ -2344,6 +2356,10 @@
        ho=524280       # offset for partition 9 to 16
        name="$1"; unit="$2"; blk="$3"; chr="$4"
 
+       ro=%RAWDISK_OFF%
+       mkdev ${name}${unit}    b $blk $(($unit * 8 + $ro))     640 $g_operator
+       mkdev r${name}${unit}   c $chr $(($unit * 8 + $ro))     640 $g_operator
+
        mkdev ${name}${unit}a   b $blk $(($unit * 8 + 0))       640 $g_operator
        mkdev ${name}${unit}b   b $blk $(($unit * 8 + 1))       640 $g_operator
        mkdev ${name}${unit}c   b $blk $(($unit * 8 + 2))       640 $g_operator
@@ -2387,6 +2403,9 @@
        ro=%RAWDISK_OFF%
        rn=%RAWDISK_NAME%
 
+       mkdev ${name}${unit}    b $blk $(($unit * $doff + $ro)) 640 $g_operator
+       mkdev r${name}${unit}   c $chr $(($unit * $doff + $ro)) 640 $g_operator
+
        mkdev ${name}${unit}a   b $blk $(($unit * $doff + 0))   640 $g_operator
        mkdev ${name}${unit}$rn b $blk $(($unit * $doff + $ro)) 640 $g_operator
        mkdev r${name}${unit}a  c $chr $(($unit * $doff + 0))   640 $g_operator
Index: MAKEDEV.tmpl
===================================================================
RCS file: /cvsroot/src/etc/MAKEDEV.tmpl,v
retrieving revision 1.180
diff -u -r1.180 MAKEDEV.tmpl
--- MAKEDEV.tmpl        4 Jun 2016 16:11:50 -0000       1.180
+++ MAKEDEV.tmpl        7 Jun 2016 08:38:53 -0000
@@ -2268,6 +2268,10 @@
        mkdev r${name}${unit}f  c $chr $(($unit * 8 + 5))       640 $g_operator
        mkdev r${name}${unit}g  c $chr $(($unit * 8 + 6))       640 $g_operator
        mkdev r${name}${unit}h  c $chr $(($unit * 8 + 7))       640 $g_operator
+
+       rn=%RAWDISK_NAME%
+       lndev ${name}${unit}$rn ${name}${unit}
+       lndev r${name}${unit}$rn r${name}${unit}
 }
 
 makedisk_p12high()
@@ -2299,6 +2303,10 @@
        mkdev r${name}${unit}j  c $chr $(($unit * 8 + $ho + 9)) 640 $g_operator
        mkdev r${name}${unit}k  c $chr $(($unit * 8 + $ho + 10)) 640 $g_operator
        mkdev r${name}${unit}l  c $chr $(($unit * 8 + $ho + 11)) 640 $g_operator
+
+       rn=%RAWDISK_NAME%
+       lndev ${name}${unit}$rn ${name}${unit}
+       lndev r${name}${unit}$rn r${name}${unit}
 }
 
 makedisk_p16()
@@ -2337,6 +2345,10 @@
        mkdev r${name}${unit}n  c $chr $(($unit * 16 + 13))     640 $g_operator
        mkdev r${name}${unit}o  c $chr $(($unit * 16 + 14))     640 $g_operator
        mkdev r${name}${unit}p  c $chr $(($unit * 16 + 15))     640 $g_operator
+
+       rn=%RAWDISK_NAME%
+       lndev ${name}${unit}$rn ${name}${unit}
+       lndev r${name}${unit}$rn r${name}${unit}
 }
 
 makedisk_p16high()
@@ -2376,6 +2388,10 @@
        mkdev r${name}${unit}n  c $chr $(($unit * 8 + $ho + 13)) 640 $g_operator
        mkdev r${name}${unit}o  c $chr $(($unit * 8 + $ho + 14)) 640 $g_operator
        mkdev r${name}${unit}p  c $chr $(($unit * 8 + $ho + 15)) 640 $g_operator
+
+       rn=%RAWDISK_NAME%
+       lndev ${name}${unit}$rn ${name}${unit}
+       lndev r${name}${unit}$rn r${name}${unit}
 }
 
 # make only the very few basic disk device nodes - 'a' partition
@@ -2391,6 +2407,9 @@
        mkdev ${name}${unit}$rn b $blk $(($unit * $doff + $ro)) 640 $g_operator
        mkdev r${name}${unit}a  c $chr $(($unit * $doff + 0))   640 $g_operator
        mkdev r${name}${unit}$rn c $chr $(($unit * $doff + $ro)) 640 $g_operator
+
+       lndev ${name}${unit}$rn ${name}${unit}
+       lndev r${name}${unit}$rn r${name}${unit}
 }
 
 # create_mfs_dev nodes

Reply via email to