1
0
mirror of https://github.com/openbsd/src.git synced 2026-04-30 00:56:33 +00:00

Oops, in the maxpartitions=52 case, the correct multiplier is 64

Noticed by krw and myself at the same time
This commit is contained in:
deraadt
2025-10-15 17:53:23 +00:00
parent f8ec15daa0
commit f63d007a93

View File

@@ -1,7 +1,7 @@
define(COMM,`#')dnl
include(MAKEDEV.sub)dnl
dnl
vers(a, {-$OpenBSD: MAKEDEV.mi,v 1.86 2025/10/15 00:24:40 deraadt Exp $-})dnl
vers(a, {-$OpenBSD: MAKEDEV.mi,v 1.87 2025/10/15 17:53:23 deraadt Exp $-})dnl
dnl
divert(1)dnl
{-#-}
@@ -66,7 +66,8 @@ show_vers()dnl <-- now that all files are included, show versions
dnl
divert(2)dnl
PATH=/sbin:/usr/sbin:/bin:/usr/bin
MAXPARTITIONS=`sysctl -n kern.maxpartitions`
UNITMULT=`sysctl -n kern.maxpartitions`
[ $UNITMULT == 52 ] && UNITMULT=64
T=$0
# set this to echo for Echo-Only debugging
@@ -137,9 +138,9 @@ dnl
dodisk()
{
[ "$DEBUG" ] && set -x
n=Add(Mult(${5}, ${7:-$MAXPARTITIONS}), ${6}) count=0
n=Add(Mult(${5}, ${7:-$UNITMULT}), ${6}) count=0
_extra=
[ $MAXPARTITIONS == 64 ] && _extra="q r s t u v w x y z \
[ $UNITMULT == 64 ] && _extra="q r s t u v w x y z \
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"
for d in a b c d e f g h i j k l m n o p $_extra
do
@@ -157,12 +158,12 @@ 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
dnl 7. step - optional, defaults to $MAXPARTITIONS, creating 16 or 52 nodes per device
dnl 7. step - optional, defaults to $UNITMULT, creating 16 or 52 nodes per device
dnl
dodisk2()
{
n=Add(Mult({-$-}5, ${7:-$MAXPARTITIONS}), {-$-}6)
n=Add(Mult({-$-}5, ${7:-$UNITMULT}), {-$-}6)
M {-$-}1{-$-}2a b {-$-}3 $n 640 operator
M r{-$-}1{-$-}2a c {-$-}4 $n 640 operator
n=Add($n, 2)