|
|
1.1 root 1: # Floppy - script to make a bootable COHERENT diskette
2: #
3: # Usage: see below
4: #
5:
6: # process command arguments
7: RONFLAG=n
8: if [ "x$1" = "x-r" ]
9: then
10: RONFLAG=y
11: shift
12: fi
13:
14: DRVNUM=0
15:
16: case "$1" in
17: fha)
18: DRVDEV=$1
19: BOOT="/conf/boot."${1}
20: ROOTPATCH="rootdev=makedev(4,14)"
21: PRPATCH="pipedev=makedev(4,14) ronflag=0"
22: shift
23: ;;
24: fva)
25: DRVDEV=$1
26: BOOT="/conf/boot."${1}
27: ROOTPATCH="rootdev=makedev(4,15)"
28: PRPATCH="pipedev=makedev(4,15) ronflag=0"
29: shift
30: ;;
31: *)
32: echo "Usage: Floppy [-r] {fha|fva} {0|1} kernel-name"
33: exit 1
34: esac
35:
36: case "$1" in
37: 0)
38: DRVNUM=0
39: shift
40: ;;
41: 1)
42: DRVNUM=1
43: shift
44: ;;
45: esac
46:
47: F=/f${DRVNUM}
48: DRV="/dev/"${DRVDEV}${DRVNUM}
49: RDRV="/dev/r"${DRVDEV}${DRVNUM}
50:
51: if [ $# -ne 1 ]
52: then
53: echo "Usage: Floppy [-r] {fha|fva} {0|1} kernel-name"
54: exit 1
55: fi
56:
57: if [ $RONFLAG = "y" ]
58: then
59: PRPATCH="pipedev=makedev(8,131) ronflag=1"
60: fi
61: KER=$1
62: /bin/mount
63: echo
64: echo "There must be a floppy disk in drive $DRV, mounted to $F."
65: echo
66: echo -n "Press Enter to continue, Ctrl-C to exit. "
67: read junk
68:
69: # copy kernel to floppy
70: # copy master boot block to floppy
71: # patch rootdev, pipedev, and ronflag on floppy kernel
72: # copy some key files to floppy
73: echo "Copying files ..."
74: cpio -pdm $F << EOF
75: /bin/echo
76: /bin/ls
77: /bin/mount
78: /bin/sh
79: /bin/sync
80: /bin/umount
81: /conf/kbd/us
82: /etc/init
83: /etc/mkfs
84: /etc/mount
85: /etc/umount
86: /mnt
87: /tboot
88: /tmp
89: EOF
90:
91: >$F/etc/brc
92:
93: if [ $RONFLAG = "y" ]
94: then
95: cat >> $F/etc/brc << EOF2
96: /etc/mkfs /dev/ram1 384
97: /etc/mount /dev/ram1 /tmp
98: EOF2
99: fi
100:
101: cat >> $F/etc/brc << EOF3
102: echo "/etc/brc from floppy"
103: /conf/kbd/us > /dev/null
104: exit 1
105: EOF3
106:
107: ls /dev/at* /dev/co* /dev/f* /dev/mono* /dev/null /dev/ram* /dev/sd* \
108: 2> /dev/null | cpio -pdm $F
109: cp $KER $F/coherent
110: cp $BOOT $DRV
111: /conf/patch $F/coherent $ROOTPATCH $PRPATCH
112: chmog 400 sys sys $F/coherent
113: echo "System files copied to disk and patched."
114: echo
115: echo "The diskette is still mounted"
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.