diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-02-09 17:01:42 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-02-09 17:01:42 +0000 |
commit | d0a6f523f03c177cf0bc56febb97740b3efcecdd (patch) | |
tree | 304e3fff531d4d7ae1dff64e450e5cac8b1134d9 /etc/etc.mvme68k | |
parent | 815ed051a4405acf4d28d3b4f6db151312bf2a69 (diff) |
sync, and update, to make "ramdisk" target disk
Diffstat (limited to 'etc/etc.mvme68k')
-rw-r--r-- | etc/etc.mvme68k/MAKEDEV | 186 |
1 files changed, 183 insertions, 3 deletions
diff --git a/etc/etc.mvme68k/MAKEDEV b/etc/etc.mvme68k/MAKEDEV index 3fa19997479..cf7386c729e 100644 --- a/etc/etc.mvme68k/MAKEDEV +++ b/etc/etc.mvme68k/MAKEDEV @@ -1,6 +1,38 @@ #!/bin/sh - # -# $OpenBSD: MAKEDEV,v 1.34 2002/01/04 03:00:44 deraadt Exp $ +# THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. +# generated from: +# +# OpenBSD: MAKEDEV.mi,v 1.23 2002/02/08 20:26:36 todd Exp +# OpenBSD: MAKEDEV.sub,v 1.5 2002/01/23 06:02:19 todd Exp +# +# $OpenBSD: MAKEDEV,v 1.35 2002/02/09 17:01:41 deraadt Exp $ +# +# Copyright (c) 2001 Todd T. Fries <todd@OpenBSD.org> +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +# THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +#!/bin/sh - +# +# $OpenBSD: MAKEDEV,v 1.35 2002/02/09 17:01:41 deraadt Exp $ # # Copyright (c) 1990 The Regents of the University of California. # All rights reserved. @@ -33,7 +65,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $OpenBSD: MAKEDEV,v 1.34 2002/01/04 03:00:44 deraadt Exp $ +# $OpenBSD: MAKEDEV,v 1.35 2002/02/09 17:01:41 deraadt Exp $ # # Device "make" file. Valid arguments: # all makes all known devices, including local devices, @@ -119,7 +151,7 @@ std) mknod ksyms c 43 0 ; chmod 640 ksyms ; chown root.kmem ksyms ;; -raminst) +ramdisk) sh MAKEDEV std fd st0 ttya rd0 sh MAKEDEV tty00 tty01 tty02 tty03 sh MAKEDEV sd0 sd1 sd2 sd3 sd4 sd5 sd6 sd7 sd8 sd9 @@ -501,3 +533,151 @@ local) ;; esac done +PATH=/sbin:/usr/sbin:/bin:/usr/bin +T=$0 + +# set this to echo for Echo-Only debugging +[ "$eo" ] || eo= + +hex() +{ + case $1 in + [0-9]) echo -n $1;; + 10) echo -n a;; + 11) echo -n b;; + 12) echo -n c;; + 13) echo -n d;; + 14) echo -n e;; + 15) echo -n f;; + esac +} +trunc() +{ + # XXX pdksh can't seem to deal with locally scoped variables + # in ${foo#$bar} expansions + arg1="$1" + arg2="$2" + case $3 in + l) echo ${arg2#$arg1} ;; + r|*) echo ${arg1#$arg2} ;; + esac +} +unt() +{ + # XXX pdksh can't seem to deal with locally scoped variables + # in ${foo#$bar} expansions + arg="$1" + tmp="${arg#[a-zA-Z]*}" + tmp="${tmp%*[a-zA-Z]}" + while [ "$tmp" != "$arg" ] + do + arg=$tmp + tmp="${arg#[a-zA-Z]*}" + tmp="${tmp%*[a-zA-Z]}" + done + echo $arg +} +dodisk() +{ + n=$(($((${5}*${7:-16}))+${6})) count=0 + RMlist="$RMlist $1$2? r$1$2?" + [ 0$7 -ne 8 ] && l="i j k l m n o p" + for d in a b c d e f g h $l + do + M $1$2$d b $3 $(($n+$count)) 640 + M r$1$2$d c $4 $(($n+$count)) 640 + let count=count+1 + done + MKlist="$MKlist;chown root.operator $1$2? r$1$2?" +} +dodisk2() +{ + n=$(($(($5*${7:-16}))+$6)) + M $1$2a b $3 $n 640 operator + M r$1$2a c $4 $n 640 operator + n=$(($n+2)) + M $1$2c b $3 $n 640 operator + M r$1$2c c $4 $n 640 operator +} + +# M name b/c major minor [mode] [group] +RMlist="rm -f" +MKlist=":" +mkl() { + [ "${mklist[$1]}" ] && { + mklist[$1]="${mklist[$1]};mknod -m $1 $2 $3 $4 $5" + } || { + mklist[$1]="mknod -m $1 $2 $3 $4 $5" + modes="$modes $1" + } +} +M() { + RMlist="$RMlist $1" + mkl ${5-666} $1 $2 $3 $4 + mklist="$mklist $1" + G=${6:-wheel} + [ "$7" ] && { + MKlist="$MKlist;chown $7.$G $1" + } || { + case $G in + wheel)g=0;;kmem)g=2;;operator)g=5;;tty)g=4;;dialer)g=117;; + esac + [ "${grplist[$g]}" ] && { + grplist[$g]="${grplist[$g]} $1" + } || { + groups="$groups $g" + grplist[$g]="chgrp $G $1" + } + } + return 0 +} +R() { +[ "$DEBUG" ] && set -x +for i in "$@" +do +U=`unt $i` +[ "$U" ] || U=0 + +case $i in + +) + case $i in + esac + ;; + +*) + echo $i: unknown device + ;; +esac +done +} +R "$@" +if [ "$os" = "SunOS" ]; then + eo=transform + transform() { + case $mode in + 600) mask=077;; + 640) mask=027;; + 660) mask=007;; + 644) mask=022;; + 666) mask=0;; + 440) mask=227;; + esac + echo `echo "$@"|sed \ + 's/mknod -m \([0-9]*\) /umask '$mask';mknod /;s/-m [0-9]* //g;\ + s/operator/5/g;s/root.kmem/root.2/g;s/root\./root:/g'` + } +fi +list="$RMlist" +for mode in $modes; do + list="$list;${mklist[$mode]}" +done +for group in $groups; do + list="$list;${grplist[$group]}" +done +list="$list;$MKlist" +if [ "$eo" = "echo" -o "$eo" = "transform" ]; then + $eo "$list" +else + echo "$list" | sh +fi |