diff options
author | ru <ru@FreeBSD.org> | 2006-08-23 12:12:56 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2006-08-23 12:12:56 +0000 |
commit | aa1113efeac4967bde68a5bfe0a4d71645df8c2d (patch) | |
tree | e023655c23405d4cc96c02a952364de070070e61 /lib/libdisk | |
parent | 266d19dde4623a7ff15746d6f0c550664635f2db (diff) | |
download | FreeBSD-src-aa1113efeac4967bde68a5bfe0a4d71645df8c2d.zip FreeBSD-src-aa1113efeac4967bde68a5bfe0a4d71645df8c2d.tar.gz |
Remove alpha-specific stuff.
Diffstat (limited to 'lib/libdisk')
-rw-r--r-- | lib/libdisk/write_alpha_disk.c | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/lib/libdisk/write_alpha_disk.c b/lib/libdisk/write_alpha_disk.c deleted file mode 100644 index 251282e..0000000 --- a/lib/libdisk/write_alpha_disk.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * ---------------------------------------------------------------------------- - * "THE BEER-WARE LICENSE" (Revision 42): - * <phk@FreeBSD.org> wrote this file. As long as you retain this notice you - * can do whatever you want with this stuff. If we meet some day, and you think - * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp - * ---------------------------------------------------------------------------- - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <string.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/ioctl.h> -#include <sys/disklabel.h> -#include <paths.h> -#include "libdisk.h" - -/* - * XXX: A lot of hardcoded 512s probably should be foo->sector_size; - * I'm not sure which, so I leave it like it worked before. --schweikh - */ -int -Write_Disk(const struct disk *d1) -{ - u_char buf[BBSIZE]; - char device[64]; - struct chunk *c1; - struct disklabel *dl; - void *p; - uint64_t *lp, sum; - int fd, i; - - strcpy(device, _PATH_DEV); - strcat(device, d1->name); - - fd = open(device, O_RDWR); - if (fd < 0) - return (1); - - c1 = d1->chunks->part; - if (!strcmp(c1->name, "X") || c1->type != freebsd) { - close (fd); - return (0); - } - - for (i = 0; i < BBSIZE/512; i++) { - if (!(p = read_block(fd, i + c1->offset, 512))) { - close (fd); - return (1); - } - memcpy(buf + 512 * i, p, 512); - free(p); - } - if (d1->boot1) - memcpy(buf + 512, d1->boot1, BBSIZE - 512); - - dl = (struct disklabel *)(buf + 512 * LABELSECTOR + LABELOFFSET); - Fill_Disklabel(dl, d1, c1); - - /* - * Tell SRM where the bootstrap is. - */ - lp = (uint64_t *)buf; - lp[60] = (BBSIZE - 512) / 512; /* Length */ - lp[61] = 1; /* Start */ - lp[62] = 0; /* Flags */ - - /* - * Generate the bootblock checksum for the SRM console. - */ - sum = 0; - for (i = 0; i < 63; i++) - sum += lp[i]; - lp[63] = sum; - - for (i = 0; i < BBSIZE / 512; i++) - write_block(fd, i + c1->offset, buf + 512 * i, 512); - close(fd); - - return (0); -} |