[PC-BSD Commits] r7783 - pcbsd-projects/txt-sysinstall

svn at pcbsd.org svn at pcbsd.org
Tue Oct 12 18:12:11 PDT 2010


Author: johnh
Date: 2010-10-12 18:12:11 -0700 (Tue, 12 Oct 2010)
New Revision: 7783

Modified:
   pcbsd-projects/txt-sysinstall/label.c
   pcbsd-projects/txt-sysinstall/partsel.c
   pcbsd-projects/txt-sysinstall/txt-sysinstall.h
Log:
Added partscheme.


Modified: pcbsd-projects/txt-sysinstall/label.c
===================================================================
--- pcbsd-projects/txt-sysinstall/label.c	2010-10-12 22:32:13 UTC (rev 7782)
+++ pcbsd-projects/txt-sysinstall/label.c	2010-10-13 01:12:11 UTC (rev 7783)
@@ -727,7 +727,7 @@
 
 	buf = safe_malloc(BUFSZ+1);
 	status = run_pcsysinstall(buf, BUFSZ, "sys-mem", NULL);
-	swap = atoi(buf) * 2 + 2048;
+	swap = atoi(buf) * 2 + 32;
 	free(buf);
 
 	screen_clear(MODULE);

Modified: pcbsd-projects/txt-sysinstall/partsel.c
===================================================================
--- pcbsd-projects/txt-sysinstall/partsel.c	2010-10-12 22:32:13 UTC (rev 7782)
+++ pcbsd-projects/txt-sysinstall/partsel.c	2010-10-13 01:12:11 UTC (rev 7783)
@@ -42,11 +42,20 @@
 	USENEW  = 2
 };
 
+enum {
+	SCHEME_MBR = 1,
+	SCHEME_GPT = 2
+};
+
 struct mirror_disk {
 	char disk[128];
 	char balance[128];
 };
 
+struct partscheme {
+	char scheme[4];
+};
+
 static int
 part_fire(dialogMenuItem *self)
 {
@@ -199,6 +208,54 @@
 	}
 }
 
+static int
+partscheme_fire(dialogMenuItem *self)
+{
+	struct partscheme *ps = self->data;
+
+	strcpy(ps->scheme, self->prompt);
+	return (DITEM_SUCCESS);
+}
+
+static int
+partscheme_checked(dialogMenuItem *self)
+{
+	struct partscheme *ps = self->data;
+
+	if (strcmp(ps->scheme, self->prompt) == 0)
+		return (TRUE);
+
+	return (FALSE);
+}
+
+void
+dialog_partscheme(void)
+{
+	dialogMenuItem *menus;
+	struct partscheme *ps;
+	int i;
+
+	ps = safe_malloc(sizeof(*ps));
+	menus = safe_malloc(sizeof(*menus) * 4);
+
+	i = 0;
+	DMENUF(&menus[i++], "Next", NULL, NULL);
+	DMENUF(&menus[i++], "Back", NULL, NULL);
+	RDMENUFCD(&menus[i++], "GPT", "", &partscheme_fire,
+		&partscheme_checked, ps);
+	RDMENUFCD(&menus[i++], "MBR", "", &partscheme_fire,
+		&partscheme_checked, ps);
+
+	screen_clear("Partscheme");
+	dialog_radiolist("Partscheme", "Partscheme",
+		7+i-2, 60, i-2, -i+2, menus+2, NULL);
+
+	partscheme(ps->scheme);
+
+	free(menus);
+	free(ps);
+}
+
 int
 dialog_partsel(void)
 {
@@ -271,6 +328,7 @@
 
 	dialog_bootloader();
 	dialog_mirror();
+	dialog_partscheme();
 
 	commitDiskPart();
 	return (0);

Modified: pcbsd-projects/txt-sysinstall/txt-sysinstall.h
===================================================================
--- pcbsd-projects/txt-sysinstall/txt-sysinstall.h	2010-10-12 22:32:13 UTC (rev 7782)
+++ pcbsd-projects/txt-sysinstall/txt-sysinstall.h	2010-10-13 01:12:11 UTC (rev 7783)
@@ -148,6 +148,7 @@
 
 void		dialog_bootloader(void);
 void		dialog_mirror(void);
+void		dialog_partscheme(void);
 
 /* utility functions */
 void		sysinstall_init(void);
@@ -195,6 +196,7 @@
 
 #define	partition(x)            appendconfig("partition", x)
 #define	bootManager(x)          appendconfig("bootManager", x)
+#define partscheme(x)           appendconfig("partscheme", x)
 
 #define	mirror(x)               appendconfig("mirror", x)
 #define	mirrorbal(x)            appendconfig("mirrorbal", x)



More information about the Commits mailing list