From owner-p4-projects@FreeBSD.ORG Thu Jul 21 12:40:36 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AAC4A16A421; Thu, 21 Jul 2005 12:40:35 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6AFB316A41F for ; Thu, 21 Jul 2005 12:40:35 +0000 (GMT) (envelope-from soc-andrew@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A378F43D60 for ; Thu, 21 Jul 2005 12:40:33 +0000 (GMT) (envelope-from soc-andrew@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j6LCeXqf080108 for ; Thu, 21 Jul 2005 12:40:33 GMT (envelope-from soc-andrew@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j6LCeXmC080105 for perforce@freebsd.org; Thu, 21 Jul 2005 12:40:33 GMT (envelope-from soc-andrew@freebsd.org) Date: Thu, 21 Jul 2005 12:40:33 GMT Message-Id: <200507211240.j6LCeXmC080105@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to soc-andrew@freebsd.org using -f From: soc-andrew To: Perforce Change Reviews Cc: Subject: PERFORCE change 80667 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2005 12:40:36 -0000 http://perforce.freebsd.org/chv.cgi?CH=80667 Change 80667 by soc-andrew@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"); }