aboutsummaryrefslogtreecommitdiff
path: root/lib/libdisk
diff options
context:
space:
mode:
authorDoug Rabson <dfr@FreeBSD.org>1999-05-08 21:24:08 +0000
committerDoug Rabson <dfr@FreeBSD.org>1999-05-08 21:24:08 +0000
commit89c4cb151ab76fee346de3d86260bc5faf18aa72 (patch)
treeae8d4665269574418eaadfa3308dce51454a5d57 /lib/libdisk
parent2fb750faa428edcfe2f5e265726db67d0cb37c2f (diff)
Notes
Diffstat (limited to 'lib/libdisk')
-rw-r--r--lib/libdisk/create_chunk.c4
-rw-r--r--lib/libdisk/disk.c3
-rw-r--r--lib/libdisk/tst01.c4
-rw-r--r--lib/libdisk/write_disk.c12
4 files changed, 18 insertions, 5 deletions
diff --git a/lib/libdisk/create_chunk.c b/lib/libdisk/create_chunk.c
index 9bb8dd51f9da..5b9c6f4cb2b3 100644
--- a/lib/libdisk/create_chunk.c
+++ b/lib/libdisk/create_chunk.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: create_chunk.c,v 1.33 1999/01/08 00:32:19 jkh Exp $
+ * $Id: create_chunk.c,v 1.34 1999/01/14 21:48:13 phk Exp $
*
*/
@@ -260,6 +260,8 @@ MakeDev(struct chunk *c1, const char *path)
if (!strncmp(p, "wd", 2))
bmaj = 0, cmaj = 3, p += 2;
+ if (!strncmp(p, "ad", 2)) /* XXX change if "ad' moves */
+ bmaj = 0, cmaj = 3, p += 2;
else if (!strncmp(p, "sd", 2))
bmaj = 4, cmaj = 13, p += 2;
else if (!strncmp(p, "wfd", 3))
diff --git a/lib/libdisk/disk.c b/lib/libdisk/disk.c
index 42cebbe58a84..9189057de1d7 100644
--- a/lib/libdisk/disk.c
+++ b/lib/libdisk/disk.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: disk.c,v 1.39 1998/12/19 18:48:33 phk Exp $
+ * $Id: disk.c,v 1.39.2.1 1999/05/08 19:10:14 dfr Exp $
*
*/
@@ -241,6 +241,7 @@ Int_Open_Disk(const char *name, u_long size)
strcpy(pname,"/dev/r");
strcat(pname,name);
+ strcat(pname,"c");
j = open(pname,O_RDONLY);
if (j < 0) {
#ifdef DEBUG
diff --git a/lib/libdisk/tst01.c b/lib/libdisk/tst01.c
index f1fb5ebbd28a..280106ade788 100644
--- a/lib/libdisk/tst01.c
+++ b/lib/libdisk/tst01.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id$
+ * $Id: tst01.c,v 1.21 1997/02/22 15:06:39 peter Exp $
*
*/
@@ -252,10 +252,12 @@ main(int argc, char **argv)
Set_Boot_Mgr(d,mbr);
continue;
}
+#ifndef __alpha__ /* don't think this compiles on i386 either */
if (!strcasecmp(*cmds,"boot")) {
Set_Boot_Blocks(d,boot1,boot2);
continue;
}
+#endif
if (!strcasecmp(*cmds,"write")) {
printf("Write=%d\n",
Write_Disk(d));
diff --git a/lib/libdisk/write_disk.c b/lib/libdisk/write_disk.c
index b27d17b2c79e..088b3236347a 100644
--- a/lib/libdisk/write_disk.c
+++ b/lib/libdisk/write_disk.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: write_disk.c,v 1.24 1998/10/27 21:14:03 msmith Exp $
+ * $Id: write_disk.c,v 1.25 1999/01/08 00:32:19 jkh Exp $
*
*/
@@ -64,7 +64,11 @@ Write_FreeBSD(int fd, struct disk *new, struct disk *old, struct chunk *c1)
for(c2=c1->part;c2;c2=c2->next) {
if (c2->type == unused) continue;
if (!strcmp(c2->name,"X")) continue;
+#ifdef __alpha__
+ j = c2->name[strlen(c2->name) - 1] - 'a';
+#else
j = c2->name[strlen(new->name) + 2] - 'a';
+#endif
if (j < 0 || j >= MAXPARTITIONS || j == RAW_PART) {
#ifdef DEBUG
warn("Weird parititon letter %c",c2->name[strlen(new->name) + 2]);
@@ -180,16 +184,19 @@ Write_Disk(struct disk *d1)
for (c1=d1->chunks->part; c1 ; c1 = c1->next) {
if (c1->type == unused) continue;
if (!strcmp(c1->name,"X")) continue;
+#ifndef __alpha__
j = c1->name[4] - '1';
j = c1->name[strlen(d1->name) + 1] - '1';
if (j < 0 || j > 3)
continue;
s[j]++;
+#endif
if (c1->type == extended)
ret += Write_Extended(fd, d1,old,c1);
if (c1->type == freebsd)
ret += Write_FreeBSD(fd, d1,old,c1);
+#ifndef __alpha__
Write_Int32(&dp[j].dp_start, c1->offset);
Write_Int32(&dp[j].dp_size, c1->size);
@@ -237,7 +244,9 @@ Write_Disk(struct disk *d1)
dp[j].dp_flag = 0x80;
else
dp[j].dp_flag = 0;
+#endif
}
+#ifndef __alpha__
j = 0;
for(i=0;i<NDOSPART;i++) {
if (!s[i])
@@ -250,7 +259,6 @@ Write_Disk(struct disk *d1)
if (dp[i].dp_typ == 0xa5)
dp[i].dp_flag = 0x80;
-#ifndef __alpha__
mbr = read_block(fd,WHERE(0,d1));
if (d1->bootmgr)
memcpy(mbr,d1->bootmgr,DOSPARTOFF);