Browse Source

DISK_STEPPING is not used, and in any event, is not global to all disks

prepare dodisk* script functions for a 7th argument, what I call disk stepping,
the number to add from rd0a to rd1a minor numbers, defaulted to 16; some archs
*cough*macppc*cough* still have 8 for cdroms and such
OPENBSD_3_1
todd 23 years ago
parent
commit
090d1a7094
2 changed files with 16 additions and 12 deletions
  1. +7
    -8
      src/etc/MAKEDEV.mi
  2. +9
    -4
      src/etc/MAKEDEV.sub

+ 7
- 8
src/etc/MAKEDEV.mi View File

@ -1,6 +1,6 @@
include(MAKEDEV.sub)dnl
dnl
vers(a,{-$OpenBSD: MAKEDEV.mi,v 1.4 2002/01/07 06:13:30 todd Exp $-})dnl
vers(a,{-$OpenBSD: MAKEDEV.mi,v 1.5 2002/01/07 06:25:32 todd Exp $-})dnl
dnl
divert(1)dnl
{-#-}
@ -575,9 +575,6 @@ dnl
divert(1)dnl
include(etc.MACHINE/MAKEDEV.md)dnl
dnl
dnl define DISK_STEPPING in the above file if other than 16
dnl
ifdef({-DISK_STEPPING-},,{-define({-DISK_STEPPING-},{-16-})-})dnl
dnl
divert(0)dnl
#!/bin/sh -
@ -635,11 +632,12 @@ unt()
echo $arg
}
dnl
dnl dodisk(name,unit,blkmaj,chrmaj,unit,off)
dnl dodisk(name,unit,blkmaj,chrmaj,unit,off[,stepping])
dnl arg: 1 2 3 4 5 6 7
dnl
dodisk()
{
n=Add(Mult(${5},DISK_STEPPING),${6}) count=0
n=Add(Mult(${5},${7:-16}),${6}) count=0
RMlist="$RMlist {-$-}1{-$-}2? r{-$-}1{-$-}2?"
for d in a b c d e f g h i j k l m n o p
do
@ -650,7 +648,7 @@ dodisk()
MKlist="$MKlist;chown root.operator {-$-}1{-$-}2? r{-$-}1{-$-}2?"
}
dnl
dnl dodisk2(name,unit,blkmaj,chrmaj,unit,off)
dnl dodisk2(name,unit,blkmaj,chrmaj,unit,off[,stepping])
dnl
dnl 1. name - prefix name of the device
dnl 2. unit - beginning unit number for block devices
@ -658,10 +656,11 @@ dnl 3. blkmaj - block device major number
dnl 4. chrmaj - character device major number
dnl 5. unit - beginning unit number for character devices
dnl 6. off - offset from 0 for all minor numbers (see svnd for an example)
dnl 7. step - optional, defaults to 16, number of partitions per device
dnl
dodisk2()
{
n=Add(Mult({-$-}5,DISK_STEPPING),{-$-}6)
n=Add(Mult({-$-}5,${7:-16}),{-$-}6)
M {-$-}1{-$-}2a b {-$-}3 $n 640 operator
M r{-$-}1{-$-}2a c {-$-}4 $n 640 operator
n=Add($n,2)


+ 9
- 4
src/etc/MAKEDEV.sub View File

@ -1,4 +1,4 @@
dnl $OpenBSD: MAKEDEV.sub,v 1.2 2002/01/07 06:06:40 todd Exp $
dnl $OpenBSD: MAKEDEV.sub,v 1.3 2002/01/07 06:25:32 todd Exp $
dnl
dnl Copyright (c) 2001 Todd T. Fries <todd@OpenBSD.org>
dnl All rights reserved.
@ -74,8 +74,8 @@ dnl store a version string for 'this' file
dnl
dnl vers ( uniqueidstring, versionstring, subdir )
dnl
dnl example1: vers(__file__,{-$OpenBSD: MAKEDEV.sub,v 1.2 2002/01/07 06:06:40 todd Exp $-})
dnl example2: vers(__file__,{-$OpenBSD: MAKEDEV.sub,v 1.2 2002/01/07 06:06:40 todd Exp $-},etc.MACHINE)
dnl example1: vers(__file__,{-$OpenBSD: MAKEDEV.sub,v 1.3 2002/01/07 06:25:32 todd Exp $-})
dnl example2: vers(__file__,{-$OpenBSD: MAKEDEV.sub,v 1.3 2002/01/07 06:25:32 todd Exp $-},etc.MACHINE)
dnl
dnl if subdir is defined, prepend it to the filename in the version string
dnl
@ -86,7 +86,7 @@ define({-vers-},
dnl
dnl Version info for this file:
dnl
vers(__file__,{-$OpenBSD: MAKEDEV.sub,v 1.2 2002/01/07 06:06:40 todd Exp $-})dnl
vers(__file__,{-$OpenBSD: MAKEDEV.sub,v 1.3 2002/01/07 06:25:32 todd Exp $-})dnl
dnl
dnl
define({-_addsubdir-},
@ -298,3 +298,8 @@ dnl undefined at the end
dnl _di -> 'iteration' string .. the string used in this iteration, is empty if
dnl the device does not exist
dnl
dnl
dnl ifstep(devstr)
dnl .. if stepping is defined for the particular device, emit ' step', else
dnl nothing
define({-ifstep-},{-ifdef({-step_$1-},{- -}step_$1)-})dnl

Loading…
Cancel
Save