Annotation of coherent/b/kernel/us/config.mwc, revision 1.1.1.1

1.1       root        1: # config.mwc
                      2: #      configure a Coherent kernel for the AT
                      3: #
                      4: # usage: config [help]
                      5: #       config [stand=fha0]
                      6: #       config [stand=fva0]
                      7: #       config [stand=fha0] [standard] [root=DRV] [DRV ...]
                      8: #       config [stand=fva0] [standard] [root=DRV] [DRV ...]
                      9: #
                     10: # $Log:        config.mwc,v $
                     11: # Revision 1.1  92/07/17  15:29:52  bin
                     12: # Initial revision
                     13: #
                     14: #
                     15: #      initialize variables
                     16: #
                     17: ATSTANDARD=" fl lp mm "
                     18: ATKERNEL=atkernel.o
                     19: 
                     20: #
                     21: #      set default keyboard layout for nkb driver
                     22: #
                     23: KEYBOARD=/conf/kbd/us
                     24: 
                     25: STANDARD="${ATSTANDARD}"
                     26: KERNEL="${ATKERNEL}"
                     27: LIBS="lib/tty.a lib/support.a"
                     28: BUILD=0
                     29: DEV=/tmp/dev
                     30: PASS1=""
                     31: PASS2=""
                     32: UNDEF=""
                     33: PATCH=""
                     34: ROOTDEV=""
                     35: INSTALL=""
                     36: 
                     37: case "$#" in
                     38: 0)     /bin/echo
                     39:        /bin/echo       "The following can be used as arguments to config:"
                     40:        /bin/echo
                     41:        /bin/cat doc/*
                     42:        exit 0
                     43:        ;;
                     44: esac
                     45: 
                     46: # Pass 1 - "help", "ibm-at"
                     47: for ARG in $*
                     48: do
                     49:        case "${ARG}" in
                     50:        help)
                     51:                /bin/echo
                     52:                /bin/echo "The following can be used as arguments to config:"
                     53:                /bin/echo
                     54:                /bin/cat doc/*
                     55:                exit 0
                     56:                ;;
                     57:        ibm-at)
                     58:                STANDARD="${ATSTANDARD}"
                     59:                KERNEL="${ATKERNEL}"
                     60:                ;;
                     61:        *)
                     62:                PASS1="${PASS1} ${ARG}"
                     63:                ;;
                     64:        esac
                     65: done
                     66: 
                     67: # Pass 2 - "standard", "stand=...", "DEV=..."
                     68: for ARG in ${PASS1}
                     69: do
                     70:        case "${ARG}" in
                     71:        standard)
                     72:                PASS2="${STANDARD} ${PASS2}"
                     73:                ;;
                     74:        stand\=fha0)
                     75:                /etc/umount /dev/fha0 2> /dev/null
                     76:                echo -n "Insert 5.25 high capacity floppy into drive 0, press return [y to format]: "
                     77:                read x
                     78:                case "x$x" in
                     79:                xy)     echo Formatting/verifying floppy:
                     80:                        /etc/fdformat -a -i 6 -v /dev/fha0 || exit 1 ;;
                     81:                esac
                     82:                /etc/mkfs  /dev/fha0 2400               || exit 1
                     83:                /bin/cp /conf/boot.fha /dev/fha0        || exit 1
                     84:                /etc/mount /dev/fha0 /f0                || exit 1
                     85:                /bin/mkdir /f0/bin /f0/dev /f0/etc /f0/mnt /f0/tmp || exit 1
                     86:                umask 011
                     87:                /etc/mknod /f0/dev/null c 0 0           || exit 1
                     88:                /bin/ln -f /f0/dev/null /f0/dev/swap    || exit 1
                     89:                umask 077
                     90:                /etc/mknod /f0/dev/mem  c 0 1           || exit 1
                     91:                /etc/mknod /f0/dev/kmem c 0 2           || exit 1
                     92:                /bin/chmod 777 /f0/tmp                  || exit 1
                     93:                umask 022
                     94: 
                     95:                echo Copying files to floppy:
                     96:                /bin/cp /bin/bad /bin/cat /bin/cp /bin/cpdir \
                     97:                        /bin/db /bin/dd /bin/df /bin/du \
                     98:                        /bin/echo /bin/kill \
                     99:                        /bin/ls /bin/mkdir /bin/mv /bin/ncheck \
                    100:                        /bin/rm /bin/sh /bin/stty /bin/sync \
                    101:                        /bin/time /bin/true /f0/bin || exit 1
                    102:                /bin/cp /etc/fsck /etc/init /etc/badscan /etc/clri \
                    103:                        /etc/fdisk /etc/mkfs \
                    104:                        /etc/mknod /etc/mount /etc/umount /f0/etc || exit 1
                    105: 
                    106:                DEV=/f0/dev
                    107:                :
                    108:                : Place a Coherent image out on drive 0.
                    109:                : Add a floppy root patched version as a file called 'stand'.
                    110:                :
                    111:                INSTALL="umask 022; set -e ; /bin/cp coherent /f0 ; \
                    112:                        /conf/patch coherent 'rootdev_=makedev(4,14)' ; \
                    113:                        /conf/patch coherent 'pipedev_=makedev(4,14)' ; \
                    114:                        /bin/cp coherent /f0/stand ; \
                    115:                        /etc/umount /dev/fha0 ; /bin/df /dev/fha0"
                    116: 
                    117:                case "$#" in
                    118:                1) eval ${INSTALL} ; exit 0 ;;
                    119:                esac
                    120:                ;;
                    121: 
                    122:        stand\=fva0)
                    123:                /etc/umount /dev/fva0 2> /dev/null
                    124:                echo -n "Insert high density 3.5 floppy into drive 0, press return [y to format]: "
                    125:                read x
                    126:                case "x$x" in
                    127:                xy)     echo Formatting/verifying floppy:
                    128:                        /etc/fdformat -a -i 6 -v /dev/fva0 || exit 1 ;;
                    129:                esac
                    130:                /etc/mkfs  /dev/fva0 2880               || exit 1
                    131:                /bin/cp /conf/boot.fva /dev/fva0        || exit 1
                    132:                /etc/mount /dev/fva0 /f0                || exit 1
                    133:                /bin/mkdir /f0/bin /f0/dev /f0/etc /f0/mnt /f0/tmp || exit 1
                    134:                umask 011
                    135:                /etc/mknod /f0/dev/null c 0 0           || exit 1
                    136:                /bin/ln -f /f0/dev/null /f0/dev/swap    || exit 1
                    137:                umask 077
                    138:                /etc/mknod /f0/dev/mem  c 0 1           || exit 1
                    139:                /etc/mknod /f0/dev/kmem c 0 2           || exit 1
                    140:                /bin/chmod 777 /f0/tmp                  || exit 1
                    141:                umask 022
                    142: 
                    143:                echo Copying files to floppy:
                    144:                /bin/cp /bin/bad /bin/cat /bin/cp /bin/cpdir \
                    145:                        /bin/db /bin/dd /bin/df /bin/du \
                    146:                        /bin/echo /bin/kill \
                    147:                        /bin/ls /bin/mkdir /bin/mv /bin/ncheck \
                    148:                        /bin/rm /bin/sh /bin/stty /bin/sync \
                    149:                        /bin/time /bin/true /f0/bin || exit 1
                    150:                /bin/cp /etc/fsck /etc/init /etc/badscan /etc/clri \
                    151:                        /etc/fdisk /etc/mkfs \
                    152:                        /etc/mknod /etc/mount /etc/umount /f0/etc || exit 1
                    153: 
                    154:                case ${KB-kb} in
                    155:                nkb)
                    156:                        echo Adding keyboard support files to floppy
                    157:                        /bin/mkdir /f0/conf /f0/conf/kbd        || exit 1
                    158:                        /bin/cp -d $KEYBOARD /f0/conf/kbd       || exit 1
                    159:                        echo $KEYBOARD >/f0/etc/brc             || exit 1
                    160:                        echo "exit 1" >>/f0/etc/brc             || exit 1
                    161:                        chmod 555 /f0/etc/brc                   || exit 1
                    162:                        ;;
                    163:                esac
                    164: 
                    165:                DEV=/f0/dev
                    166:                :
                    167:                : Place a Coherent image out on drive 0.
                    168:                : Add a floppy root patched version as a file called 'stand'.
                    169:                :
                    170:                INSTALL="umask 022; set -e ; /bin/cp coherent /f0 ; \
                    171:                        /conf/patch coherent 'rootdev_=makedev(4,15)' ; \
                    172:                        /conf/patch coherent 'pipedev_=makedev(4,15)' ; \
                    173:                        /bin/cp coherent /f0/stand ; \
                    174:                        /etc/umount /dev/fva0 ; /bin/df /dev/fva0"
                    175: 
                    176:                case "$#" in
                    177:                1) eval ${INSTALL} ; exit 0 ;;
                    178:                esac
                    179:                ;;
                    180: 
                    181:        DEV\=*)
                    182:                DEV=`/bin/echo "${ARG}" | /bin/sed -e 's/^....//'`
                    183:                ;;
                    184:        *)
                    185:                PASS2="${PASS2} ${ARG}"
                    186:                ;;
                    187:        esac
                    188: done
                    189: 
                    190: #      get the proper driver information
                    191: #
                    192: 
                    193: for ARG in ${PASS2}
                    194: do
                    195:        case "$ARG" in
                    196: 
                    197:        root\=fva0)
                    198:                ROOTDEV="makedev(4,15)"
                    199:                . confdrv/fl
                    200:                ;;
                    201:        root\=fha0)
                    202:                ROOTDEV="makedev(4,14)"
                    203:                . confdrv/fl
                    204:                ;;
                    205:        root\=None)
                    206:                ROOTDEV="makedev(0,0)"
                    207:                ;;
                    208:        root\=*)
                    209:                ARG=`/bin/echo "${ARG}" | /bin/sed -e 's/^.....//'`
                    210: 
                    211:                case "${ARG}" in
                    212:                *[0123][abcdx])
                    213:                        FILE=`/bin/echo "${ARG}" | /bin/sed -e 's/..$//'`
                    214:                        if [ $FILE = "sd" ]
                    215:                        then
                    216:                                FILE=${HD?Environment variable HD not set}
                    217:                        fi
                    218:                        ;;
                    219:                *)
                    220:                        FILE="${ARG}"
                    221:                        ;;
                    222:                esac
                    223: 
                    224:                if /bin/test -r confdrv/${FILE}
                    225:                then
                    226:                        . confdrv/${FILE}
                    227:                        ROOTDEV="${MAKEDEV}"
                    228: /bin/echo "'confdrv/${FILE}' executing"
                    229:                else
                    230:                        /bin/echo "'confdrv/${FILE}' does not exist"
                    231:                        exit 1
                    232:                fi
                    233:                ;;
                    234: 
                    235:        swap)
                    236:                ;;
                    237: 
                    238:        swap\=*)
                    239:                ARG=`/bin/echo "${ARG}" | /bin/sed -e 's/^.....//'`
                    240: 
                    241:                case "${ARG}" in
                    242:                *[0123][abcdx])
                    243:                        FILE=`/bin/echo "${ARG}" | /bin/sed -e 's/..$//'`
                    244:                        if [ $FILE = "sd" ]
                    245:                        then
                    246:                                FILE=${HD?Environment variable HD not set}
                    247:                        fi
                    248:                        if [ -d "${DEV-/dev}" ]
                    249:                        then
                    250:                                /bin/ln -f ${DEV-/dev}/${ARG} ${DEV-/dev}/swap
                    251:                        fi
                    252:                        ;;
                    253:                *)
                    254:                        FILE="${ARG}"
                    255:                        ;;
                    256:                esac
                    257: 
                    258:                if /bin/test -r confdrv/${FILE}
                    259:                then
                    260:                        . confdrv/${FILE}
                    261:                        PATCH="${PATCH} swapdev_=${MAKEDEV}"
                    262:                        /bin/echo "Swap device will be ${DEV-/dev}/${ARG}"
                    263:                        /bin/echo "See documentation before enabling"
                    264:                else
                    265:                        /bin/echo "'confdrv/${FILE}' does not exist"
                    266:                        exit 1
                    267:                fi
                    268:                ;;
                    269: 
                    270:        *\=*)
                    271:                PATCH="${PATCH} ${ARG}"
                    272:                ;;
                    273: 
                    274:        *)
                    275:                case "${ARG}" in
                    276:                *[0123][abcdx])
                    277:                        FILE=`/bin/echo "${ARG}" | /bin/sed -e 's/..$//'`
                    278:                        if [ $FILE = "sd" ]
                    279:                        then
                    280:                                FILE=${HD?Environment variable HD not set}
                    281:                        fi
                    282:                        ;;
                    283:                *)
                    284:                        FILE="${ARG}"
                    285:                        ;;
                    286:                esac
                    287: 
                    288:                if /bin/test -r confdrv/${FILE}
                    289:                then
                    290:                        . confdrv/${FILE}
                    291:                        case "${ROOTDEV}" in
                    292:                        ?*)     ;;
                    293:                        *)      ROOTDEV="${MAKEDEV}" ;;
                    294:                        esac
                    295:                else
                    296:                        /bin/echo "'confdrv/${FILE}' does not exist"
                    297:                        exit 1
                    298:                fi
                    299:                ;;
                    300:        esac
                    301: done
                    302: ROOTDEV="${ROOTDEV-makedev(0,0)}"
                    303: 
                    304: #      include stub drivers
                    305: #
                    306: UNDEF="${UNDEF} ${LIBS}"
                    307: 
                    308: #      make the proper root and pipe devices
                    309: #
                    310: PATCH="${PATCH} rootdev_=${ROOTDEV} pipedev_=${ROOTDEV}"
                    311: 
                    312: set -x
                    313: #
                    314: #      create a kernel with the desired device drivers
                    315: #
                    316: /bin/ld -i -x -o coherent ${KERNEL} ${UNDEF} -lc || exit 1
                    317: #
                    318: #      enable the desired device drivers
                    319: #
                    320: /conf/patch coherent ALLSIZE_=16384 NBUF_=32 NCLIST_=24 ${PATCH}
                    321: /bin/chmod 644 coherent
                    322: /bin/chown sys coherent
                    323: /bin/chgrp sys coherent
                    324: /bin/sync
                    325: #
                    326: eval ${INSTALL}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.