diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-05-13 08:49:38 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-05-13 08:49:38 +0000 |
commit | 3d54d0aee2771dd6783f8947cd587525ed034ae6 (patch) | |
tree | b675893d221d83aa10968ed030755693e2d4a133 /sys/arch/sparc | |
parent | 3f20525a98af3c8daf6c2c3d7f47ce63e8a5a5b2 (diff) |
fake -s and -e options to indicate start of the /boot in cd9660 land.
Later on this should be replaced by proper cd9660 groking code.
Diffstat (limited to 'sys/arch/sparc')
-rw-r--r-- | sys/arch/sparc/stand/installboot.c | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/sys/arch/sparc/stand/installboot.c b/sys/arch/sparc/stand/installboot.c index 959de4a341d..74912114fba 100644 --- a/sys/arch/sparc/stand/installboot.c +++ b/sys/arch/sparc/stand/installboot.c @@ -67,6 +67,8 @@ int32_t max_block_count; char *karch; char cpumodel[100]; +int isofsblk = 0; +int isofseblk = 0; char *loadprotoblocks __P((char *, long *)); int loadblocknums __P((char *, int)); @@ -79,7 +81,8 @@ static void usage() { fprintf(stderr, - "usage: installboot [-n] [-v] [-h] [-a <karch>] <boot> <proto> <device>\n"); + "usage: installboot [-n] [-v] [-h] [-s isofsblk -e isofseblk]" + "[-a <karch>] <boot> <proto> <device>\n"); exit(1); } @@ -95,7 +98,7 @@ main(argc, argv) int mib[2]; size_t size; - while ((c = getopt(argc, argv, "a:vnh")) != -1) { + while ((c = getopt(argc, argv, "a:vnhs:e:")) != -1) { switch (c) { case 'a': karch = optarg; @@ -112,6 +115,12 @@ main(argc, argv) /* Chat */ verbose = 1; break; + case 's': + isofsblk = atoi(optarg); + break; + case 'e': + isofseblk = atoi(optarg); + break; default: usage(); } @@ -346,6 +355,26 @@ int devfd; if (fstatfs(fd, &statfsbuf) != 0) err(1, "statfs: %s", boot); + if (isofsblk) { + int i; + + *block_size_p = 512; + *block_count_p = (isofseblk - isofsblk) * (2048/512); + if (*block_count_p > max_block_count) + errx(1, "%s: Too many blocks", boot); + if (verbose) + printf("%s: %d block numbers: ", boot, *block_count_p); + for (i = 0; i < *block_count_p; i++) { + blk = (isofsblk * (2048/512)) + i; + block_table[i] = blk; + if (verbose) + printf("%d ", blk); + } + if (verbose) + printf("\n"); + return 0; + } + if (strncmp(statfsbuf.f_fstypename, "ffs", MFSNAMELEN) && strncmp(statfsbuf.f_fstypename, "ufs", MFSNAMELEN)) { errx(1, "%s: must be on an FFS filesystem", boot); |