From owner-freebsd-current Fri Mar 2 8:20:15 2001 Delivered-To: freebsd-current@freebsd.org Received: from blizzard.sabbo.net (blizzard.sabbo.net [193.193.218.18]) by hub.freebsd.org (Postfix) with ESMTP id A3CDE37B71A; Fri, 2 Mar 2001 08:19:49 -0800 (PST) (envelope-from sobomax@FreeBSD.org) Received: from vic.sabbo.net (root@vic.sabbo.net [193.193.218.112]) by blizzard.sabbo.net (8.10.1/8.10.1) with ESMTP id f22GJia04983; Fri, 2 Mar 2001 18:19:46 +0200 Received: from FreeBSD.org (big_brother.vega.com [192.168.1.1]) by vic.sabbo.net (8.11.2/8.11.2) with ESMTP id f22GJlN64225; Fri, 2 Mar 2001 18:19:47 +0200 (EET) (envelope-from sobomax@FreeBSD.org) Message-ID: <3A9FC81E.1B2EDCC7@FreeBSD.org> Date: Fri, 02 Mar 2001 18:19:43 +0200 From: Maxim Sobolev Organization: Vega International Capital X-Mailer: Mozilla 4.76 [en] (WinNT; U) X-Accept-Language: uk,ru,en MIME-Version: 1.0 To: jkh@FreeBSD.org Cc: current@FreeBSD.org Subject: Labeling Vinum partitions in the sysinstall(8) [patch] Content-Type: multipart/mixed; boundary="------------A9805AA2D47C2FC02223933A" Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. --------------A9805AA2D47C2FC02223933A Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Hi folks, I'm currently creating a Vinum(4) configuration wizard for sysinstall(8), which would simplify Vinum configuration procedure for the vinum newbies. So far I finished a patch that allows create vinum partitions using sysinstall's disklabel editor and would like to commit it. Please review attached patches. Thanks! -Maxim --------------A9805AA2D47C2FC02223933A Content-Type: text/plain; charset=koi8-r; name="si.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="si.diff" Index: label.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/sysinstall/label.c,v retrieving revision 1.102 diff -d -u -r1.102 label.c --- label.c 2001/02/07 11:26:41 1.102 +++ label.c 2001/03/02 14:12:59 @@ -277,6 +277,8 @@ if (c2->type == part) { if (c2->subtype == FS_SWAP) label_chunk_info[j].type = PART_SWAP; + else if (c2->subtype == FS_VINUM) + label_chunk_info[j].type = PART_VINUM; else label_chunk_info[j].type = PART_FILESYSTEM; label_chunk_info[j].c = c2; @@ -383,19 +385,24 @@ "A file system", "Swap", "A swap partition.", + "Vinum", + "A vinum subdisk." }; WINDOW *w = savescr(); i = dialog_menu("Please choose a partition type", "If you want to use this partition for swap space, select Swap.\n" - "If you want to put a filesystem on it, choose FS.", - -1, -1, 2, 2, fs_types, selection, NULL, NULL); + "If you want to put a filesystem on it, choose FS.\n" + "If you want to use it as a subdisk in a Vinum plex, choose Vinum.", + -1, -1, 3, 3, fs_types, selection, NULL, NULL); restorescr(w); if (!i) { if (!strcmp(selection, "FS")) return PART_FILESYSTEM; else if (!strcmp(selection, "Swap")) return PART_SWAP; + else if (!strcmp(selection, "Vinum")) + return PART_VINUM; } return PART_NONE; } @@ -571,6 +578,8 @@ mountpoint = ((PartInfo *)label_chunk_info[i].c->private_data)->mountpoint; else if (label_chunk_info[i].type == PART_SWAP) mountpoint = "swap"; + else if (label_chunk_info[i].type == PART_VINUM) + mountpoint = "vinum"; else mountpoint = ""; @@ -581,6 +590,8 @@ newfs = ((PartInfo *)label_chunk_info[i].c->private_data)->newfs ? "UFS Y" : "UFS N"; else if (label_chunk_info[i].type == PART_SWAP) newfs = "SWAP"; + else if (label_chunk_info[i].type == PART_VINUM) + newfs = "VINUM"; else newfs = "*"; for (j = 0; j < MAX_MOUNT_NAME && mountpoint[j]; j++) @@ -895,6 +906,7 @@ else { char *val; int size; + int subtype; struct chunk *tmp; char osize[80]; u_long flags = 0; @@ -959,17 +971,26 @@ "partitions should usually be at least %dMB in size", ROOT_MIN_SIZE); } } + switch (type) { + case PART_SWAP: + subtype = FS_SWAP; + break; + case PART_VINUM: + subtype = FS_VINUM; + break; + default: + subtype = FS_BSDFFS; + break; + } tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, - size, part, - (type == PART_SWAP) ? FS_SWAP : FS_BSDFFS, - flags); + size, part, subtype, flags); if (!tmp) { msgConfirm("Unable to create the partition. Too big?"); clear_wins(); break; } - if (type != PART_SWAP) { + if (type != PART_SWAP && type != PART_VINUM) { /* This is needed to tell the newfs -u about the size */ tmp->private_data = new_part(p->mountpoint, p->newfs, tmp->size); safe_free(p); @@ -1021,6 +1042,10 @@ case PART_SWAP: msg = "You don't need to specify a mountpoint for a swap partition."; + break; + + case PART_VINUM: + msg = "You don't need to specify a mountpoint for a vinum subdisk."; break; case PART_FAT: Index: sysinstall.h =================================================================== RCS file: /home/ncvs/src/usr.sbin/sysinstall/sysinstall.h,v retrieving revision 1.202 diff -d -u -r1.202 sysinstall.h --- sysinstall.h 2001/03/02 08:15:40 1.202 +++ sysinstall.h 2001/03/02 14:13:01 @@ -245,7 +245,7 @@ DEVICE_TYPE_UFS, DEVICE_TYPE_NFS, DEVICE_TYPE_ANY, - DEVICE_TYPE_HTTP, + DEVICE_TYPE_HTTP } DeviceType; /* CDROM mount codes */ @@ -274,6 +274,7 @@ PART_SWAP, PART_FILESYSTEM, PART_FAT, + PART_VINUM } PartType; /* The longest newfs command we'll hand to system() */ --------------A9805AA2D47C2FC02223933A-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message