HIYA!
 
Attached is a set of diffs against /usr/src to allow
sysinstall to handle drives that are > 1TB in size.
Since we cannot make filesystems > 1TB we need to be 
able to at least partition them, however that was
not possible before due to some sign errors.

This allows us to handle up to 2TB devices
at which point we run out of bits in the disklabel
and bootblock fdisk table.

I have 2 x 1,6TB and 1 x 1.8 TB arrays I need to 
partition so I needed this. (it now works).

I have not yet attacked fdisk(8) and disklabel(8).

If I get no complaints I'll commit these to 4.x.
It's all different in 5.x so an MFC doesn't really work..

Index: lib/libdisk/chunk.c
===================================================================
RCS file: /usr/cvs/src/lib/libdisk/chunk.c,v
retrieving revision 1.21.2.6
diff -u -r1.21.2.6 chunk.c
--- lib/libdisk/chunk.c 7 Jan 2002 07:53:29 -0000       1.21.2.6
+++ lib/libdisk/chunk.c 14 Nov 2002 20:07:36 -0000
@@ -339,10 +339,10 @@
        putchar('>');
        for(; i < 10; i++) putchar(' ');
 #ifdef PC98
-       printf("%p %8ld %8lu %8lu %-8s %-16s %-8s 0x%02x %s",
+       printf("%p %8lu %8lu %8lu %-8s %-16s %-8s 0x%02x %s",
                c1, c1->offset, c1->size, c1->end, c1->name, c1->sname,
 #else
-       printf("%p %8ld %8lu %8lu %-8s %-8s 0x%02x %s",
+       printf("%p %8lu %8lu %8lu %-8s %-8s 0x%02x %s",
                c1, c1->offset, c1->size, c1->end, c1->name,
 #endif
                chunk_n[c1->type], c1->subtype,
Index: lib/libdisk/libdisk.h
===================================================================
RCS file: /usr/cvs/src/lib/libdisk/libdisk.h,v
retrieving revision 1.32.2.8
diff -u -r1.32.2.8 libdisk.h
--- lib/libdisk/libdisk.h       7 Jan 2002 07:53:29 -0000       1.32.2.8
+++ lib/libdisk/libdisk.h       14 Nov 2002 19:51:28 -0000
@@ -55,7 +55,7 @@
        struct chunk    *next;
        struct chunk    *part;
        struct disk     *disk;
-       long            offset;
+       u_long          offset;
        u_long          size;
        u_long          end;
 #ifdef PC98
Index: lib/libdisk/rules.c
===================================================================
RCS file: /usr/cvs/src/lib/libdisk/rules.c,v
retrieving revision 1.16.2.4
diff -u -r1.16.2.4 rules.c
--- lib/libdisk/rules.c 13 May 2001 20:16:32 -0000      1.16.2.4
+++ lib/libdisk/rules.c 14 Nov 2002 20:09:16 -0000
@@ -130,9 +130,9 @@
 #endif
                        sprintf(msg + strlen(msg),
 #ifdef PC98
-                   "chunk '%s' [%ld..%ld] does not start on a cylinder boundary\n",
+                   "chunk '%s' [%lu..%lu] does not start on a cylinder boundary\n",
 #else
-                   "chunk '%s' [%ld..%ld] does not start on a track boundary\n",
+                   "chunk '%s' [%lu..%lu] does not start on a track boundary\n",
 #endif
                                c1->name, c1->offset, c1->end);
                if ((c->type == whole || c->end == c1->end)
@@ -140,7 +140,7 @@
                        ;
                else
                        sprintf(msg + strlen(msg),
-                   "chunk '%s' [%ld..%ld] does not end on a cylinder boundary\n",
+                   "chunk '%s' [%lu..%lu] does not end on a cylinder boundary\n",
                                c1->name, c1->offset, c1->end);
        }
 }
Index: release/sysinstall/disks.c
===================================================================
RCS file: /usr/cvs/src/release/sysinstall/Attic/disks.c,v
retrieving revision 1.118.2.14
diff -u -r1.118.2.14 disks.c
--- release/sysinstall/disks.c  24 Oct 2002 13:03:44 -0000      1.118.2.14
+++ release/sysinstall/disks.c  14 Nov 2002 19:56:39 -0000
@@ -142,7 +142,7 @@
        }
        if (i == current_chunk)
            attrset(ATTR_SELECTED);
-       mvprintw(row, 0, "%10ld %10lu %10lu %8s %6d %10s %8d\t%-6s",
+       mvprintw(row, 0, "%10lu %10lu %10lu %8s %6d %10s %8d\t%-6s",
                 chunk_info[i]->offset, sz,
                 chunk_info[i]->end, chunk_info[i]->name,
                 chunk_info[i]->type, 
Index: release/sysinstall/label.c
===================================================================
RCS file: /usr/cvs/src/release/sysinstall/Attic/label.c,v
retrieving revision 1.98.2.12
diff -u -r1.98.2.12 label.c
--- release/sysinstall/label.c  3 Jul 2002 00:01:08 -0000       1.98.2.12
+++ release/sysinstall/label.c  14 Nov 2002 20:21:18 -0000
@@ -248,7 +248,7 @@
 space_free(struct chunk *c)
 {
     struct chunk *c1;
-    int sz = c->size;
+    unsigned int sz = c->size;
 
     for (c1 = c->part; c1; c1 = c1->next) {
        if (c1->type != unused)
@@ -706,7 +706,8 @@
 static int
 diskLabel(Device *dev)
 {
-    int sz, key = 0;
+    uint sz;
+    int  key = 0;
     Boolean labeling;
     char *msg = NULL;
     PartInfo *p, *oldp;
@@ -846,7 +847,7 @@
                char osize[80];
                u_long flags = 0;
 
-               sprintf(osize, "%d", sz);
+               sprintf(osize, "%lu", sz);
                val = msgGetInput(osize,
                                  "Please specify the partition size in blocks or 
append a trailing G for\n"
                                  "gigabytes, M for megabytes, or C for cylinders.\n"
@@ -1177,7 +1178,7 @@
 static char *
 try_auto_label(Device **devs, Device *dev, int perc, int *req)
 {
-    int sz;
+    unsigned int sz;
     struct chunk *root_chunk = NULL;
     struct chunk *swap_chunk = NULL;
     struct chunk *usr_chunk = NULL;
@@ -1395,10 +1396,11 @@
            while (entries) {
                snprintf(name, sizeof name, "%s-%d", c1->name, entries);
                if ((cp = variable_get(name)) != NULL) {
-                   int sz, soft = 0;
+                   unsigned int sz;
+                   int soft = 0;
                    char typ[10], mpoint[50];
 
-                   if (sscanf(cp, "%s %d %s %d", typ, &sz, mpoint, &soft) < 3) {
+                   if (sscanf(cp, "%s %u %s %d", typ, &sz, mpoint, &soft) < 3) {
                        msgConfirm("For slice entry %s, got an invalid detail entry 
of: %s",  c1->name, cp);
                        status = DITEM_FAILURE;
                        continue;

Reply via email to