BSD 4_2 development
[unix-history] / usr / src / sys / mdec / installboot.c
CommitLineData
e2f2e851
C
1/* installboot.c 6.1 83/07/29 */
2
3#include "../h/param.h"
4#include "../h/fs.h"
5
6char bootimage[BBSIZE];
7
8main(argc, argv)
9 int argc;
10 char *argv[];
11{
12 int fd;
13
14 if (argc != 4) {
15 printf("Usage: installboot bootblock bootprog device\n");
16 exit(1);
17 }
18 fd = open(argv[1], 0);
19 if (fd < 0) {
20 perror(argv[1]);
21 exit(1);
22 }
23 read(fd, bootimage, DEV_BSIZE);
24 close(fd);
25 fd = open(argv[2], 0);
26 if (fd < 0) {
27 perror(argv[2]);
28 exit(1);
29 }
30 read(fd, &bootimage[DEV_BSIZE], BBSIZE - DEV_BSIZE);
31 close(fd);
32 fd = open(argv[3], 1);
33 if (fd < 0) {
34 perror(argv[3]);
35 exit(1);
36 }
37 write(fd, bootimage, BBSIZE);
38 close(fd);
39}