|
|
1.1 ! root 1: #!/bin/sh - ! 2: # ! 3: # Copyright (c) 1988 Regents of the University of California. ! 4: # All rights reserved. ! 5: # ! 6: # Redistribution and use in source and binary forms are permitted ! 7: # provided that the above copyright notice and this paragraph are ! 8: # duplicated in all such forms and that any documentation, ! 9: # advertising materials, and other materials related to such ! 10: # distribution and use acknowledge that the software was developed ! 11: # by the University of California, Berkeley. The name of the ! 12: # University may not be used to endorse or promote products derived ! 13: # from this software without specific prior written permission. ! 14: # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 15: # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 16: # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 17: # ! 18: # @(#)get 1.5 (Berkeley) 7/7/88 ! 19: # ! 20: # Shell script to build a mini-root file system in preparation for building ! 21: # a distribution tape. The file system created here is image copied onto ! 22: # tape, then image copied onto disk as the "first" step in a cold boot of ! 23: # 4.3BSD systems. ! 24: # ! 25: DISTROOT=/nbsd ! 26: # ! 27: if [ `pwd` = '/' ] ! 28: then ! 29: echo You just '(almost)' destroyed the root ! 30: exit ! 31: fi ! 32: ! 33: # copy in kernel ! 34: cp $DISTROOT/sys/GENERIC/vmunix . ! 35: ! 36: # create necessary directories ! 37: DIRLIST="bin dev etc a tmp stand" ! 38: rm -rf $DIRLIST ! 39: mkdir $DIRLIST ! 40: ! 41: # copy in files from /etc ! 42: ETCFILE="disklabel disktab fsck ifconfig init mknod mount newfs restore \ ! 43: rrestore umount" ! 44: for i in $ETCFILE; do ! 45: cp $DISTROOT/etc/$i etc/$i ! 46: done ! 47: ! 48: # copy in files from /bin ! 49: BINFILE="[ awk cat cp dd echo ed expr ls make mkdir mt mv rcp rm sh stty \ ! 50: sync" ! 51: for i in $BINFILE; do ! 52: cp $DISTROOT/bin/$i bin/$i ! 53: done ! 54: ln bin/stty bin/STTY ! 55: ! 56: # copy in files from /stand ! 57: STANDFILE="copy vdformat" ! 58: for i in $STANDFILE; do ! 59: cp $DISTROOT/stand/$i stand/$i ! 60: done ! 61: ! 62: # copy in files from / ! 63: #DOTFILE=".profile boot fppoc fppwcs poc poc1 poc2 wcs" ! 64: DOTFILE=".profile boot wcs" ! 65: for i in $DOTFILE; do ! 66: cp $DISTROOT/$i $i ! 67: done ! 68: ! 69: # initialize /dev ! 70: cp $DISTROOT/dev/MAKEDEV dev/MAKEDEV ! 71: chmod +x dev/MAKEDEV ! 72: cp /dev/null dev/MAKEDEV.local ! 73: (cd dev; ./MAKEDEV std dk0; ./MAKEDEV cy0; mv rmt12 cy0; rm *mt*) ! 74: ! 75: # initialize /etc/passwd ! 76: cat >etc/passwd <<EOF ! 77: root::0:10::/:/bin/sh ! 78: EOF ! 79: ! 80: # initialize /etc/group ! 81: cat >etc/group <<EOF ! 82: wheel:*:0: ! 83: staff:*:10: ! 84: EOF ! 85: ! 86: # initialize /etc/fstab ! 87: cat >etc/fstab <<EOF ! 88: /dev/xfd0a:/a:xx:1:1 ! 89: /dev/dk0a:/a:xx:1:1 ! 90: EOF ! 91: ! 92: # create xtr script ! 93: cat >xtr <<'EOF' ! 94: #!/bin/sh -e ! 95: : ${disk?'Usage: disk=xx0 tape=yy xtr'} ! 96: : ${tape?'Usage: disk=xx0 tape=yy xtr'} ! 97: echo 'Build root file system' ! 98: newfs ${disk}a ! 99: sync ! 100: echo 'Check the file system' ! 101: fsck /dev/r${disk}a ! 102: mount /dev/${disk}a /a ! 103: cd /a ! 104: echo 'Rewind tape' ! 105: mt -f /dev/${tape}0 rew ! 106: echo 'Restore the dump image of the root' ! 107: restore rsf 3 /dev/${tape}0 ! 108: cd / ! 109: sync ! 110: umount /dev/${disk}a ! 111: sync ! 112: fsck /dev/r${disk}a ! 113: echo 'Root filesystem extracted' ! 114: EOF ! 115: ! 116: # make xtr script executable ! 117: chmod +x xtr ! 118: ! 119: sync
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.