PERFORCE change 80667 for review
soc-andrew
soc-andrew at FreeBSD.org
Thu Jul 21 12:40:36 GMT 2005
http://perforce.freebsd.org/chv.cgi?CH=80667
Change 80667 by soc-andrew at soc-andrew_serv on 2005/07/21 12:40:25
Add a selector for what dists to install and install them
Affected files ...
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/installer/flow.c#3 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/lib/installer/functions.c#3 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/lib/installer/functions.h#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/usr.sbin/bsdinstaller/backend/extra_flow.c#1 add
.. //depot/projects/soc2005/bsdinstaller/src/usr.sbin/bsdinstaller/backend/extra_flow.h#1 add
.. //depot/projects/soc2005/bsdinstaller/src/usr.sbin/bsdinstaller/backend/fn_install_freebsd.c#4 edit
Differences ...
==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/installer/flow.c#3 (text+ko) ====
@@ -1163,7 +1163,7 @@
fn_create_subpartitions(a);
if (a->result) {
/* state = state_install_os; */
- state = state_select_distros;
+ state = state_select_dists;
} else {
state = disk_get_formatted(storage_get_selected_disk(a->s)) ?
state_select_disk : state_select_slice;
@@ -1200,7 +1200,7 @@
"p", "special", "dfinstaller_install_os",
"a", "ok", _("Begin Installing Files"), "", "",
- "a", "cancel", _("Return to Create Subpartitions"), "", "",
+ "a", "cancel", _("Return to Select Distributions"), "", "",
"p", "accelerator", "ESC",
NULL
@@ -1210,7 +1210,8 @@
abort_backend();
if (strcmp(dfui_response_get_action_id(r), "cancel") == 0) {
- state = state_create_subpartitions;
+ /* state = state_create_subpartitions; */
+ state = state_select_dists;
} else {
fn_install_os(a);
if (a->result)
==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/lib/installer/functions.c#3 (text+ko) ====
@@ -75,6 +75,7 @@
a->tmp = NULL;
a->temp_files = NULL;
a->cmd_names = NULL;
+ a->dists = NULL;
asprintf(&filename, "%sinstall.log", def_tmp_dir);
a->log = fopen(filename, "w");
@@ -146,6 +147,9 @@
if (a->log != NULL) {
fclose(a->log);
}
+ if (a->dists != NULL) {
+ aura_dict_free(a->dists);
+ }
AURA_FREE(a, i_fn_args);
}
}
==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/lib/installer/functions.h#2 (text+ko) ====
@@ -64,6 +64,7 @@
int result; /* result of function */
FILE *log; /* file to log to */
struct aura_dict *temp_files; /* names of files to delete on exit */
+ struct aura_dict *dists; /* the dists to install */
struct config_vars *cmd_names; /* names (and paths) of commands to use */
int booted_from_livecd; /* system is running from livecd */
int upgrade_menu_toggle; /* toggle the experimental upgrade option */
==== //depot/projects/soc2005/bsdinstaller/src/usr.sbin/bsdinstaller/backend/fn_install_freebsd.c#4 (text+ko) ====
@@ -161,6 +161,10 @@
do_install(struct i_fn_args *a)
{
char base[PATH_MAX];
+ /* This should be big enough as the largest dist name is ~9 */
+ char dist_name[32];
+ void *rv, *rk;
+ size_t rv_len, rk_len;
struct utsname name;
uname(&name);
@@ -169,7 +173,22 @@
i_log(a, "<<< Extracting distrubutions from %s", base);
dist_set_base(base);
dist_set_location("/mnt");
- dist_extract(a->c, "base");
+
+ aura_dict_rewind(a->dists);
+ /*
+ * Install the selected dists
+ */
+ while (!aura_dict_eof(a->dists)) {
+ aura_dict_get_current_key(a->dists, &rk, &rk_len);
+ strlcpy(dist_name, rk, 32);
+ if (rk_len < 32)
+ dist_name[rk_len] = '\0';
+
+ printf("+%s\n", dist_name);
+ dist_extract(a->c, dist_name);
+ aura_dict_next(a->dists);
+ }
+
i_log(a, ">>> Done");
return 1;
}
@@ -352,12 +371,9 @@
void
fn_install_os(struct i_fn_args *a)
{
- i_log(a, "1111");
+ /* XXX Check the return value of these */
pre_install(a);
- i_log(a, "2222");
do_install(a);
- i_log(a, "3333");
post_install(a);
- i_log(a, "4444");
}
More information about the p4-projects
mailing list