From owner-svn-src-user@FreeBSD.ORG Sun Jan 9 06:12:33 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6165F106566C; Sun, 9 Jan 2011 06:12:33 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5197F8FC08; Sun, 9 Jan 2011 06:12:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p096CXor031675; Sun, 9 Jan 2011 06:12:33 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p096CXCM031673; Sun, 9 Jan 2011 06:12:33 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101090612.p096CXCM031673@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 9 Jan 2011 06:12:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217183 - user/nwhitehorn/bsdinstall/scripts X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jan 2011 06:12:33 -0000 Author: nwhitehorn Date: Sun Jan 9 06:12:33 2011 New Revision: 217183 URL: http://svn.freebsd.org/changeset/base/217183 Log: Nothing between distextract and config need succeed, so allow the user to cancel these with impunity. Suggested by: brucec Modified: user/nwhitehorn/bsdinstall/scripts/auto Modified: user/nwhitehorn/bsdinstall/scripts/auto ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/auto Sun Jan 9 06:05:48 2011 (r217182) +++ user/nwhitehorn/bsdinstall/scripts/auto Sun Jan 9 06:12:33 2011 (r217183) @@ -44,13 +44,13 @@ if [ ! -z $FETCH_DISTRIBUTIONS ]; then fi bsdinstall distextract || error -bsdinstall rootpass || error +bsdinstall rootpass if [ "$NETCONFIG_DONE" != yes ]; then bsdinstall netconfig # Don't check for errors -- the user may cancel fi -bsdinstall time || error -bsdinstall services || error -bsdinstall adduser || error +bsdinstall time +bsdinstall services +bsdinstall adduser bsdinstall config || error cdialog --backtitle "FreeBSD Installer" --title "Complete" --msgbox "Installation of FreeBSD complete!" 0 0 From owner-svn-src-user@FreeBSD.ORG Sun Jan 9 15:32:01 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B764A106566B; Sun, 9 Jan 2011 15:32:01 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A78C28FC0A; Sun, 9 Jan 2011 15:32:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p09FW1en047420; Sun, 9 Jan 2011 15:32:01 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p09FW14u047418; Sun, 9 Jan 2011 15:32:01 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101091532.p09FW14u047418@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 9 Jan 2011 15:32:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217196 - user/nwhitehorn/bsdinstall/scripts X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jan 2011 15:32:01 -0000 Author: nwhitehorn Date: Sun Jan 9 15:32:01 2011 New Revision: 217196 URL: http://svn.freebsd.org/changeset/base/217196 Log: Remove duplicated welcome message, and turn off SIGINT, which causes enormous problems. Submitted by: joel Modified: user/nwhitehorn/bsdinstall/scripts/auto Modified: user/nwhitehorn/bsdinstall/scripts/auto ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/auto Sun Jan 9 14:34:56 2011 (r217195) +++ user/nwhitehorn/bsdinstall/scripts/auto Sun Jan 9 15:32:01 2011 (r217196) @@ -2,7 +2,7 @@ echo "Begun Installation at $(date)" > $BSDINSTALL_LOG -cdialog --backtitle "FreeBSD Installer" --title "Welcome" --msgbox "Welcome to the FreeBSD Installer." 0 0 +trap "" SIGINT # Ignore cntrl-C here error() { cdialog --backtitle "FreeBSD Installer" --title "Abort" \ From owner-svn-src-user@FreeBSD.ORG Sun Jan 9 15:59:52 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C10D6106566B; Sun, 9 Jan 2011 15:59:52 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A57DF8FC14; Sun, 9 Jan 2011 15:59:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p09FxqaO048158; Sun, 9 Jan 2011 15:59:52 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p09Fxqnd048156; Sun, 9 Jan 2011 15:59:52 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101091559.p09Fxqnd048156@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 9 Jan 2011 15:59:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217197 - user/nwhitehorn/bsdinstall/partedit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jan 2011 15:59:52 -0000 Author: nwhitehorn Date: Sun Jan 9 15:59:52 2011 New Revision: 217197 URL: http://svn.freebsd.org/changeset/base/217197 Log: If the user enters a size larger than the available space, either deliberately or through rounding errors in expand_number(), or if the size field is left blank, use the largest available size. Also only show the Label field of Add/Edit partition dialogs when using a partition scheme that supports labeling. Requested by: joel Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Sun Jan 9 15:32:01 2011 (r217196) +++ user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Sun Jan 9 15:59:52 2011 (r217197) @@ -256,7 +256,7 @@ gpart_edit(struct gprovider *pp) struct partition_metadata *md; char sizestr[32]; intmax_t index; - int hadlabel, choice, junk; + int hadlabel, choice, junk, nitems; unsigned i; DIALOG_FORMITEM items[] = { @@ -266,12 +266,12 @@ gpart_edit(struct gprovider *pp) {0, "Size:", 5, 1, 0, FALSE, "", 11, 1, 12, 0, 0, FALSE, "Partition size. Append K, M, G for kilobytes, " "megabytes or gigabytes.", FALSE}, - {0, "Label:", 7, 2, 0, FALSE, "", 11, 2, 12, 15, 0, FALSE, - "Partition name. Not all partition schemes support this.", - FALSE}, - {0, "Mountpoint:", 11, 3, 0, FALSE, "", 11, 3, 12, 15, 0, + {0, "Mountpoint:", 11, 2, 0, FALSE, "", 11, 2, 12, 15, 0, FALSE, "Path at which to mount this partition (leave blank " "for swap)", FALSE}, + {0, "Label:", 7, 3, 0, FALSE, "", 11, 3, 12, 15, 0, FALSE, + "Partition name. Not all partition schemes support this.", + FALSE}, }; /* @@ -341,6 +341,12 @@ gpart_edit(struct gprovider *pp) } } + /* Labels only supported on GPT and APM */ + if (strcmp(scheme, "GPT") == 0 || strcmp(scheme, "APM") == 0) + nitems = 4; + else + nitems = 3; + /* Edit editable parameters of a partition */ hadlabel = 0; LIST_FOREACH(gc, &pp->lg_config, lg_config) { @@ -350,7 +356,7 @@ gpart_edit(struct gprovider *pp) } if (strcmp(gc->lg_name, "label") == 0) { hadlabel = 1; - items[2].text = gc->lg_val; + items[3].text = gc->lg_val; } if (strcmp(gc->lg_name, "index") == 0) index = atoi(gc->lg_val); @@ -359,7 +365,7 @@ gpart_edit(struct gprovider *pp) TAILQ_FOREACH(md, &part_metadata, metadata) { if (md->name != NULL && strcmp(md->name, pp->lg_name) == 0) { if (md->fstab != NULL) - items[3].text = md->fstab->fs_file; + items[2].text = md->fstab->fs_file; break; } } @@ -369,8 +375,7 @@ gpart_edit(struct gprovider *pp) items[1].text = sizestr; editpart: - choice = dlg_form("Edit Partition", "", 0, 0, 0, - sizeof(items) / sizeof(items[0]), items, &junk); + choice = dlg_form("Edit Partition", "", 0, 0, 0, nitems, items, &junk); if (choice) /* Cancel pressed */ return; @@ -391,8 +396,8 @@ editpart: gctl_ro_param(r, "flags", -1, GPART_FLAGS); gctl_ro_param(r, "verb", -1, "modify"); gctl_ro_param(r, "index", sizeof(index), &index); - if (hadlabel || items[2].text[0] != '\0') - gctl_ro_param(r, "label", -1, items[2].text); + if (hadlabel || items[3].text[0] != '\0') + gctl_ro_param(r, "label", -1, items[3].text); gctl_ro_param(r, "type", -1, items[0].text); errstr = gctl_issue(r); if (errstr != NULL && errstr[0] != '\0') { @@ -402,7 +407,7 @@ editpart: } gctl_free(r); - set_part_metadata(pp->lg_name, scheme, items[0].text, items[3].text, + set_part_metadata(pp->lg_name, scheme, items[0].text, items[2].text, strcmp(oldtype, items[0].text) != 0); for (i = 0; i < (sizeof(items) / sizeof(items[0])); i++) @@ -496,9 +501,9 @@ gpart_create(struct gprovider *pp) struct ggeom *geom; const char *errstr, *scheme; char sizestr[32], startstr[32], output[64]; - intmax_t size, start, end, sector, firstfree, stripe; + intmax_t maxsize, size, start, end, sector, firstfree, stripe; uint64_t bytes; - int choice, junk; + int nitems, choice, junk; unsigned i; DIALOG_FORMITEM items[] = { @@ -508,12 +513,12 @@ gpart_create(struct gprovider *pp) {0, "Size:", 5, 1, 0, FALSE, "", 11, 1, 12, 15, 0, FALSE, "Partition size. Append K, M, G for kilobytes, " "megabytes or gigabytes.", FALSE}, - {0, "Label:", 7, 2, 0, FALSE, "", 11, 2, 12, 15, 0, FALSE, - "Partition name. Not all partition schemes support this.", - FALSE}, - {0, "Mountpoint:", 11, 3, 0, FALSE, "", 11, 3, 12, 15, 0, + {0, "Mountpoint:", 11, 2, 0, FALSE, "", 11, 2, 12, 15, 0, FALSE, "Path at which to mount this partition (leave blank " "for swap)", FALSE}, + {0, "Label:", 7, 3, 0, FALSE, "", 11, 3, 12, 15, 0, FALSE, + "Partition name. Not all partition schemes support this.", + FALSE}, }; /* Record sector and stripe sizes */ @@ -580,7 +585,7 @@ gpart_create(struct gprovider *pp) if (stripe > 0 && (firstfree*sector % stripe) != 0) firstfree += (stripe - ((firstfree*sector) % stripe)) / sector; - size = end - firstfree; + size = maxsize = end - firstfree; if (size <= 0) { dialog_msgbox("Error", "No free space left on device.", 0, 0, TRUE); @@ -599,23 +604,32 @@ gpart_create(struct gprovider *pp) if (strcmp(scheme, "MBR") == 0 || strcmp(scheme, "PC98") == 0) items[0].text = "freebsd"; + /* Labels only supported on GPT and APM */ + if (strcmp(scheme, "GPT") == 0 || strcmp(scheme, "APM") == 0) + nitems = 4; + else + nitems = 3; + addpartform: - choice = dlg_form("Add Partition", "", 0, 0, 0, - sizeof(items) / sizeof(items[0]), items, &junk); + choice = dlg_form("Add Partition", "", 0, 0, 0, nitems, items, &junk); if (choice) /* Cancel pressed */ return; - if (expand_number(items[1].text, &bytes) != 0) { - char error[512]; - sprintf(error, "Invalid size: %s\n", strerror(errno)); - dialog_msgbox("Error", error, 0, 0, TRUE); - goto addpartform; + size = maxsize; + if (strlen(items[1].text) > 0) { + if (expand_number(items[1].text, &bytes) != 0) { + char error[512]; + + sprintf(error, "Invalid size: %s\n", strerror(errno)); + dialog_msgbox("Error", error, 0, 0, TRUE); + goto addpartform; + } + size = MIN((intmax_t)(bytes/sector), maxsize); } - size = bytes/sector; /* If this is the root partition, check that this scheme is bootable */ - if (strcmp(items[3].text, "/") == 0 && !is_scheme_bootable(scheme)) { + if (strcmp(items[2].text, "/") == 0 && !is_scheme_bootable(scheme)) { char message[512]; sprintf(message, "This partition scheme (%s) is not bootable " "on this platform. Are you sure you want to proceed?", @@ -631,7 +645,7 @@ addpartform: * If this is the root partition, and we need a boot partition, ask * the user to add one. */ - if (strcmp(items[3].text, "/") == 0 && bootpart_size(scheme) > 0) { + if (strcmp(items[2].text, "/") == 0 && bootpart_size(scheme) > 0) { choice = dialog_yesno("Boot Partition", "This partition scheme " "requires a boot partition for the disk to be bootable. " "Would you like to make one now?", 0, 0); @@ -675,8 +689,8 @@ addpartform: gctl_ro_param(r, "size", -1, sizestr); snprintf(startstr, sizeof(startstr), "%jd", firstfree); gctl_ro_param(r, "start", -1, startstr); - if (items[2].text[0] != '\0') - gctl_ro_param(r, "label", -1, items[2].text); + if (items[3].text[0] != '\0') + gctl_ro_param(r, "label", -1, items[3].text); gctl_rw_param(r, "output", sizeof(output), output); errstr = gctl_issue(r); @@ -692,7 +706,7 @@ addpartform: gpart_partition(strtok(output, " "), "BSD"); else set_part_metadata(strtok(output, " "), scheme, items[0].text, - items[3].text, 1); + items[2].text, 1); for (i = 0; i < (sizeof(items) / sizeof(items[0])); i++) if (items[i].text_free) From owner-svn-src-user@FreeBSD.ORG Sun Jan 9 16:32:44 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77B3E106564A; Sun, 9 Jan 2011 16:32:44 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 66F908FC15; Sun, 9 Jan 2011 16:32:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p09GWiw9049143; Sun, 9 Jan 2011 16:32:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p09GWi37049139; Sun, 9 Jan 2011 16:32:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101091632.p09GWi37049139@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 9 Jan 2011 16:32:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217198 - in user/nwhitehorn/bsdinstall: partedit scripts X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jan 2011 16:32:44 -0000 Author: nwhitehorn Date: Sun Jan 9 16:32:44 2011 New Revision: 217198 URL: http://svn.freebsd.org/changeset/base/217198 Log: Make it slightly more difficult to shoot yourself in the foot by not specifying mountpoints, not making a / partition, or having a partition mounted deep in the hierarchy. Suggested by: Michael Ross Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c user/nwhitehorn/bsdinstall/partedit/partedit.c user/nwhitehorn/bsdinstall/scripts/mount Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Sun Jan 9 15:59:52 2011 (r217197) +++ user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Sun Jan 9 16:32:44 2011 (r217198) @@ -268,7 +268,7 @@ gpart_edit(struct gprovider *pp) "megabytes or gigabytes.", FALSE}, {0, "Mountpoint:", 11, 2, 0, FALSE, "", 11, 2, 12, 15, 0, FALSE, "Path at which to mount this partition (leave blank " - "for swap)", FALSE}, + "for swap, set to / for root filesystem)", FALSE}, {0, "Label:", 7, 3, 0, FALSE, "", 11, 3, 12, 15, 0, FALSE, "Partition name. Not all partition schemes support this.", FALSE}, @@ -514,8 +514,8 @@ gpart_create(struct gprovider *pp) FALSE, "Partition size. Append K, M, G for kilobytes, " "megabytes or gigabytes.", FALSE}, {0, "Mountpoint:", 11, 2, 0, FALSE, "", 11, 2, 12, 15, 0, - FALSE, "Path at which to mount this partition (leave blank " - "for swap)", FALSE}, + FALSE, "Path at which to mount partition (blank for " + "swap, / for root filesystem)", FALSE}, {0, "Label:", 7, 3, 0, FALSE, "", 11, 3, 12, 15, 0, FALSE, "Partition name. Not all partition schemes support this.", FALSE}, @@ -575,13 +575,12 @@ gpart_create(struct gprovider *pp) intmax_t partend; partend = strtoimax(gc->lg_val, NULL, 0); if (partend > firstfree) - firstfree = partend; + firstfree = partend + 1; } } } /* Compute beginning of new partition and maximum available space */ - firstfree++; if (stripe > 0 && (firstfree*sector % stripe) != 0) firstfree += (stripe - ((firstfree*sector) % stripe)) / sector; @@ -628,6 +627,21 @@ addpartform: size = MIN((intmax_t)(bytes/sector), maxsize); } + /* Warn if no mountpoint set */ + if (strcmp(items[0].text, "freebsd-ufs") == 0 && + items[2].text[0] != '/') { + dialog_vars.defaultno = TRUE; + choice = dialog_yesno("Warning", + "This partition does not have a valid mountpoint " + "(for the partition from which you intend to boot the " + "operating system, the mountpoint should be /). Are you " + "sure you want to continue?" + , 0, 0); + dialog_vars.defaultno = FALSE; + if (choice == 1) /* cancel */ + goto addpartform; + } + /* If this is the root partition, check that this scheme is bootable */ if (strcmp(items[2].text, "/") == 0 && !is_scheme_bootable(scheme)) { char message[512]; Modified: user/nwhitehorn/bsdinstall/partedit/partedit.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/partedit.c Sun Jan 9 15:59:52 2011 (r217197) +++ user/nwhitehorn/bsdinstall/partedit/partedit.c Sun Jan 9 16:32:44 2011 (r217198) @@ -19,6 +19,7 @@ static void add_geom_children(struct gge struct partedit_item **items, int *nitems); static void init_fstab_metadata(void); static void get_mount_points(struct partedit_item *items, int nitems); +static int validate_setup(void); int main(void) { @@ -84,7 +85,7 @@ main(void) { } error = 0; - if (op == 4) { /* Finished */ + if (op == 4 && validate_setup()) { /* Finished */ dialog_vars.extra_button = TRUE; dialog_vars.extra_label = "Don't Save"; dialog_vars.ok_label = "Save"; @@ -159,7 +160,30 @@ delete_part_metadata(const char *name) { } } } - + +static int +validate_setup(void) +{ + struct partition_metadata *md; + int root_found = FALSE; + + TAILQ_FOREACH(md, &part_metadata, metadata) { + if (md->fstab != NULL && strcmp(md->fstab->fs_file, "/") == 0) + root_found = TRUE; + + /* XXX: Check for duplicate mountpoints */ + } + + if (!root_found) { + dialog_msgbox("Error", "No root partition was found. " + "The root FreeBSD partition must have a mountpoint of '/'.", + 0, 0, TRUE); + return (FALSE); + } + + return (TRUE); +} + static int apply_changes(struct gmesh *mesh) { Modified: user/nwhitehorn/bsdinstall/scripts/mount ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/mount Sun Jan 9 15:59:52 2011 (r217197) +++ user/nwhitehorn/bsdinstall/scripts/mount Sun Jan 9 16:32:44 2011 (r217198) @@ -15,7 +15,7 @@ cat $PATH_FSTAB | awk -v BSDINSTALL_CHRO FILESYSTEMS=`cat $TMP_FSTAB | awk '/^[^#].*/ {if ($2 ~ "^/.*") printf("%s\n", $2);}' | sort -t /` for i in $FILESYSTEMS; do - mkdir $i 2>/dev/null + mkdir -p $i 2>/dev/null MNTERROR=`mount -F $TMP_FSTAB $i 2>&1` if [ $? -ne 0 ]; then cdialog --backtitle "FreeBSD Installer" --title "Error" \ From owner-svn-src-user@FreeBSD.ORG Sun Jan 9 16:58:39 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11CF1106564A; Sun, 9 Jan 2011 16:58:39 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 011A58FC08; Sun, 9 Jan 2011 16:58:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p09GwcAR049821; Sun, 9 Jan 2011 16:58:38 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p09Gwcg3049819; Sun, 9 Jan 2011 16:58:38 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101091658.p09Gwcg3049819@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 9 Jan 2011 16:58:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217199 - user/nwhitehorn/bsdinstall/partedit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jan 2011 16:58:39 -0000 Author: nwhitehorn Date: Sun Jan 9 16:58:38 2011 New Revision: 217199 URL: http://svn.freebsd.org/changeset/base/217199 Log: Allow deletion of providers with gpart consumers (e.g. MBR slices with bsd labels beneath them). Requested by: brucec Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Sun Jan 9 16:32:44 2011 (r217198) +++ user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Sun Jan 9 16:58:38 2011 (r217199) @@ -244,13 +244,49 @@ gpart_partcode(struct gprovider *pp) } } +static void +gpart_destroy(struct ggeom *lg_geom, int force) +{ + struct gprovider *pp; + struct gctl_req *r; + const char *errstr; + + /* Begin with the hosing: delete all partitions */ + LIST_FOREACH(pp, &lg_geom->lg_provider, lg_provider) + gpart_delete(pp); + + /* Now destroy the geom itself */ + r = gctl_get_handle(); + gctl_ro_param(r, "class", -1, "PART"); + gctl_ro_param(r, "arg0", -1, lg_geom->lg_name); + gctl_ro_param(r, "flags", -1, GPART_FLAGS); + gctl_ro_param(r, "verb", -1, "destroy"); + errstr = gctl_issue(r); + if (errstr != NULL && errstr[0] != '\0') + gpart_show_error("Error", NULL, errstr); + gctl_free(r); + + /* If asked, commit the change */ + r = gctl_get_handle(); + gctl_ro_param(r, "class", -1, "PART"); + gctl_ro_param(r, "arg0", -1, lg_geom->lg_name); + gctl_ro_param(r, "flags", -1, GPART_FLAGS); + gctl_ro_param(r, "verb", -1, "commit"); + errstr = gctl_issue(r); + if (errstr != NULL && errstr[0] != '\0') + gpart_show_error("Error", NULL, errstr); + gctl_free(r); + + /* And any metadata associated with the partition scheme itself */ + delete_part_metadata(lg_geom->lg_name); +} + void gpart_edit(struct gprovider *pp) { struct gctl_req *r; struct gconfig *gc; struct gconsumer *cp; - struct gprovider *spp; struct ggeom *geom; const char *errstr, *oldtype, *scheme; struct partition_metadata *md; @@ -301,24 +337,8 @@ gpart_edit(struct gprovider *pp) if (choice == 1) /* cancel */ return; - /* Begin with the hosing: delete all partitions */ - LIST_FOREACH(spp, &cp->lg_geom->lg_provider, - lg_provider) - gpart_delete(spp); - - /* Now destroy the geom itself */ - r = gctl_get_handle(); - gctl_ro_param(r, "class", -1, "PART"); - gctl_ro_param(r, "arg0", -1, cp->lg_geom->lg_name); - gctl_ro_param(r, "flags", -1, GPART_FLAGS); - gctl_ro_param(r, "verb", -1, "destroy"); - errstr = gctl_issue(r); - if (errstr != NULL && errstr[0] != '\0') - gpart_show_error("Error", NULL, errstr); - gctl_free(r); - - /* And any metadata */ - delete_part_metadata(cp->lg_geom->lg_name); + /* Destroy the geom and all sub-partitions */ + gpart_destroy(cp->lg_geom, 0); /* Now re-partition and return */ gpart_partition(cp->lg_geom->lg_name, NULL); @@ -732,13 +752,59 @@ void gpart_delete(struct gprovider *pp) { struct gconfig *gc; + struct ggeom *geom; + struct gconsumer *cp; struct gctl_req *r; const char *errstr; intmax_t index; + int choice, is_partition; - if (strcmp(pp->lg_geom->lg_class->lg_name, "PART") != 0) { - dialog_msgbox("Error", "Only partitions can be deleted.", 0, 0, - TRUE); + /* Is it a partition? */ + is_partition = (strcmp(pp->lg_geom->lg_class->lg_name, "PART") == 0); + + /* Find out if this is the root of a gpart geom */ + geom = NULL; + LIST_FOREACH(cp, &pp->lg_consumers, lg_consumers) + if (strcmp(cp->lg_geom->lg_class->lg_name, "PART") == 0) { + geom = cp->lg_geom; + break; + } + + /* Destroy all consumers */ + if (geom != NULL) { + if (is_partition) { + char message[512]; + /* + * We have to actually really delete the sub-partition + * tree so that the consumers will go away and the + * partition can be deleted. Warn the user. + */ + + sprintf(message, "Deleting this partition (%s) " + "requires deleting all existing sub-partitions. " + "This will PERMANENTLY ERASE any data stored here " + "and CANNOT BE REVERTED. Are you sure you want to " + "proceed?", cp->lg_geom->lg_name); + dialog_vars.defaultno = TRUE; + choice = dialog_yesno("Warning", message, 0, 0); + dialog_vars.defaultno = FALSE; + + if (choice == 1) /* cancel */ + return; + } + + gpart_destroy(geom, is_partition); + } + + /* + * If this is not a partition, see if that is a problem, complain if + * necessary, and return always, since we need not do anything further, + * error or no. + */ + if (!is_partition) { + if (geom == NULL) + dialog_msgbox("Error", + "Only partitions can be deleted.", 0, 0, TRUE); return; } From owner-svn-src-user@FreeBSD.ORG Sun Jan 9 17:19:05 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23B65106564A; Sun, 9 Jan 2011 17:19:05 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13FC38FC15; Sun, 9 Jan 2011 17:19:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p09HJ48u050453; Sun, 9 Jan 2011 17:19:04 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p09HJ4RT050451; Sun, 9 Jan 2011 17:19:04 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101091719.p09HJ4RT050451@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 9 Jan 2011 17:19:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217201 - user/nwhitehorn/bsdinstall X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jan 2011 17:19:05 -0000 Author: nwhitehorn Date: Sun Jan 9 17:19:04 2011 New Revision: 217201 URL: http://svn.freebsd.org/changeset/base/217201 Log: Some more SIGINT handling. Ideally, bsdinstall auto would learn which steps are skippable and allow cntrl-C to skip them, but that will have to wait until later. Modified: user/nwhitehorn/bsdinstall/rc.local Modified: user/nwhitehorn/bsdinstall/rc.local ============================================================================== --- user/nwhitehorn/bsdinstall/rc.local Sun Jan 9 17:10:06 2011 (r217200) +++ user/nwhitehorn/bsdinstall/rc.local Sun Jan 9 17:19:04 2011 (r217201) @@ -14,6 +14,7 @@ cdialog --backtitle "FreeBSD Installer" case $? in $DIALOG_OK) # Installer BSDINSTALL_CONFIGCURRENT=yes; export BSDINSTALL_CONFIGCURRENT + trap "" SIGINT # Ignore cntrl-C here bsdinstall reboot ;; From owner-svn-src-user@FreeBSD.ORG Sun Jan 9 20:53:13 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF32C1065670; Sun, 9 Jan 2011 20:53:13 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DED7A8FC14; Sun, 9 Jan 2011 20:53:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p09KrDk1056150; Sun, 9 Jan 2011 20:53:13 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p09KrDFk056148; Sun, 9 Jan 2011 20:53:13 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101092053.p09KrDFk056148@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 9 Jan 2011 20:53:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217204 - user/nwhitehorn/bsdinstall X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jan 2011 20:53:14 -0000 Author: nwhitehorn Date: Sun Jan 9 20:53:13 2011 New Revision: 217204 URL: http://svn.freebsd.org/changeset/base/217204 Log: Change "Installer" option to "Install". Modified: user/nwhitehorn/bsdinstall/rc.local Modified: user/nwhitehorn/bsdinstall/rc.local ============================================================================== --- user/nwhitehorn/bsdinstall/rc.local Sun Jan 9 20:40:21 2011 (r217203) +++ user/nwhitehorn/bsdinstall/rc.local Sun Jan 9 20:53:13 2011 (r217204) @@ -9,10 +9,10 @@ TERM=xterm; export TERM # XXX: serial consoles -cdialog --backtitle "FreeBSD Installer" --title "Welcome" --extra-button --extra-label "Shell" --ok-label "Installer" --cancel-label "Live CD" --yesno "Welcome to FreeBSD! Would you like to begin an installation or use the live CD?" 0 0 +cdialog --backtitle "FreeBSD Installer" --title "Welcome" --extra-button --extra-label "Shell" --ok-label "Install" --cancel-label "Live CD" --yesno "Welcome to FreeBSD! Would you like to begin an installation or use the live CD?" 0 0 case $? in -$DIALOG_OK) # Installer +$DIALOG_OK) # Install BSDINSTALL_CONFIGCURRENT=yes; export BSDINSTALL_CONFIGCURRENT trap "" SIGINT # Ignore cntrl-C here bsdinstall From owner-svn-src-user@FreeBSD.ORG Sun Jan 9 21:02:12 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 550951065672; Sun, 9 Jan 2011 21:02:12 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 446A38FC1C; Sun, 9 Jan 2011 21:02:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p09L2CZw056456; Sun, 9 Jan 2011 21:02:12 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p09L2CGY056454; Sun, 9 Jan 2011 21:02:12 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101092102.p09L2CGY056454@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 9 Jan 2011 21:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217205 - user/nwhitehorn/bsdinstall/partedit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jan 2011 21:02:12 -0000 Author: nwhitehorn Date: Sun Jan 9 21:02:11 2011 New Revision: 217205 URL: http://svn.freebsd.org/changeset/base/217205 Log: Made the adjustment to maxsize in the wrong place, which could fail for partition schemes with boot partitions like GPT. Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Sun Jan 9 20:53:13 2011 (r217204) +++ user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Sun Jan 9 21:02:11 2011 (r217205) @@ -604,7 +604,7 @@ gpart_create(struct gprovider *pp) if (stripe > 0 && (firstfree*sector % stripe) != 0) firstfree += (stripe - ((firstfree*sector) % stripe)) / sector; - size = maxsize = end - firstfree; + size = end - firstfree; if (size <= 0) { dialog_msgbox("Error", "No free space left on device.", 0, 0, TRUE); @@ -614,6 +614,7 @@ gpart_create(struct gprovider *pp) /* Leave a free megabyte in case we need to write a boot partition */ if (size*sector >= 1024*1024) size -= 1024*1024/sector; + maxsize = size; humanize_number(sizestr, 7, size*sector, "B", HN_AUTOSCALE, HN_NOSPACE | HN_DECIMAL); From owner-svn-src-user@FreeBSD.ORG Tue Jan 11 05:22:32 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 385EF106564A; Tue, 11 Jan 2011 05:22:32 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 277248FC17; Tue, 11 Jan 2011 05:22:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0B5MWBZ007558; Tue, 11 Jan 2011 05:22:32 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0B5MWEL007554; Tue, 11 Jan 2011 05:22:32 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101110522.p0B5MWEL007554@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 11 Jan 2011 05:22:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217257 - user/nwhitehorn/bsdinstall/partedit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jan 2011 05:22:32 -0000 Author: nwhitehorn Date: Tue Jan 11 05:22:31 2011 New Revision: 217257 URL: http://svn.freebsd.org/changeset/base/217257 Log: More anti-foot-shooting measures: gpart labels do not like to contain slashes, so provide a more helpful error message if the user tries to set one with a slash in it. Submitted by: joel Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Tue Jan 11 04:25:54 2011 (r217256) +++ user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Tue Jan 11 05:22:31 2011 (r217257) @@ -400,6 +400,13 @@ editpart: if (choice) /* Cancel pressed */ return; + /* Check if the label has a / in it */ + if (strchr(items[3].text, '/') != NULL) { + dialog_msgbox("Error", "Label contains a /, which is not an " + "allowed character.", 0, 0, TRUE); + goto editpart; + } + if (strncmp(items[0].text, "freebsd-", 8) != 0 && items[0].text[0] != '\0') { char message[512]; @@ -648,6 +655,13 @@ addpartform: size = MIN((intmax_t)(bytes/sector), maxsize); } + /* Check if the label has a / in it */ + if (strchr(items[3].text, '/') != NULL) { + dialog_msgbox("Error", "Label contains a /, which is not an " + "allowed character.", 0, 0, TRUE); + goto addpartform; + } + /* Warn if no mountpoint set */ if (strcmp(items[0].text, "freebsd-ufs") == 0 && items[2].text[0] != '/') { From owner-svn-src-user@FreeBSD.ORG Tue Jan 11 05:49:03 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BC9F106566B; Tue, 11 Jan 2011 05:49:03 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60AE38FC21; Tue, 11 Jan 2011 05:49:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0B5n3cn008149; Tue, 11 Jan 2011 05:49:03 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0B5n3OS008146; Tue, 11 Jan 2011 05:49:03 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101110549.p0B5n3OS008146@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 11 Jan 2011 05:49:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217258 - in user/nwhitehorn/bsdinstall: . scripts X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jan 2011 05:49:03 -0000 Author: nwhitehorn Date: Tue Jan 11 05:49:03 2011 New Revision: 217258 URL: http://svn.freebsd.org/changeset/base/217258 Log: Provide a little bit friendlier error handling. Instead of just blocking SIGINT, catch it and provide an error message in critical steps. In skippable steps, allow the user to skip them cleanly by application of cntrl-C. Modified: user/nwhitehorn/bsdinstall/rc.local user/nwhitehorn/bsdinstall/scripts/auto Modified: user/nwhitehorn/bsdinstall/rc.local ============================================================================== --- user/nwhitehorn/bsdinstall/rc.local Tue Jan 11 05:22:31 2011 (r217257) +++ user/nwhitehorn/bsdinstall/rc.local Tue Jan 11 05:49:03 2011 (r217258) @@ -14,7 +14,7 @@ cdialog --backtitle "FreeBSD Installer" case $? in $DIALOG_OK) # Install BSDINSTALL_CONFIGCURRENT=yes; export BSDINSTALL_CONFIGCURRENT - trap "" SIGINT # Ignore cntrl-C here + trap true SIGINT # Ignore cntrl-C here bsdinstall reboot ;; Modified: user/nwhitehorn/bsdinstall/scripts/auto ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/auto Tue Jan 11 05:22:31 2011 (r217257) +++ user/nwhitehorn/bsdinstall/scripts/auto Tue Jan 11 05:49:03 2011 (r217258) @@ -2,8 +2,6 @@ echo "Begun Installation at $(date)" > $BSDINSTALL_LOG -trap "" SIGINT # Ignore cntrl-C here - error() { cdialog --backtitle "FreeBSD Installer" --title "Abort" \ --no-label "Exit" --yes-label "Restart" --yesno \ @@ -15,6 +13,8 @@ error() { fi } +trap error SIGINT # Catch cntrl-C here + rm -rf $BSDINSTALL_TMPETC mkdir $BSDINSTALL_TMPETC bsdinstall hostname || error @@ -44,13 +44,17 @@ if [ ! -z $FETCH_DISTRIBUTIONS ]; then fi bsdinstall distextract || error -bsdinstall rootpass +bsdinstall rootpass || error + +trap true SIGINT # This section is optional if [ "$NETCONFIG_DONE" != yes ]; then bsdinstall netconfig # Don't check for errors -- the user may cancel fi bsdinstall time bsdinstall services bsdinstall adduser + +trap error SIGINT # SIGINT is bad again bsdinstall config || error cdialog --backtitle "FreeBSD Installer" --title "Complete" --msgbox "Installation of FreeBSD complete!" 0 0 From owner-svn-src-user@FreeBSD.ORG Tue Jan 11 06:07:36 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDD3B1065672; Tue, 11 Jan 2011 06:07:36 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A172B8FC19; Tue, 11 Jan 2011 06:07:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0B67aau008565; Tue, 11 Jan 2011 06:07:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0B67acI008560; Tue, 11 Jan 2011 06:07:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101110607.p0B67acI008560@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 11 Jan 2011 06:07:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217259 - user/nwhitehorn/bsdinstall/scripts X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jan 2011 06:07:36 -0000 Author: nwhitehorn Date: Tue Jan 11 06:07:36 2011 New Revision: 217259 URL: http://svn.freebsd.org/changeset/base/217259 Log: Unmount mounted filesystems if the installation is aborted and restarted after filesystems have been initialized and mounted. This prevents the installer from becoming confused. Added: user/nwhitehorn/bsdinstall/scripts/umount - copied, changed from r217257, user/nwhitehorn/bsdinstall/scripts/mount Modified: user/nwhitehorn/bsdinstall/scripts/Makefile user/nwhitehorn/bsdinstall/scripts/auto user/nwhitehorn/bsdinstall/scripts/mount Modified: user/nwhitehorn/bsdinstall/scripts/Makefile ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/Makefile Tue Jan 11 05:49:03 2011 (r217258) +++ user/nwhitehorn/bsdinstall/scripts/Makefile Tue Jan 11 06:07:36 2011 (r217259) @@ -1,6 +1,7 @@ # $FreeBSD $ -SCRIPTS= auto adduser config hostname mount netconfig rootpass services time +SCRIPTS= auto adduser config hostname mount netconfig rootpass services time \ + umount BINDIR= /usr/libexec/bsdinstall NO_MAN= true Modified: user/nwhitehorn/bsdinstall/scripts/auto ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/auto Tue Jan 11 05:49:03 2011 (r217258) +++ user/nwhitehorn/bsdinstall/scripts/auto Tue Jan 11 06:07:36 2011 (r217259) @@ -9,6 +9,7 @@ error() { if [ $? -ne 0 ]; then exit else + test -f $PATH_FSTAB && bsdinstall umount exec $0 fi } Modified: user/nwhitehorn/bsdinstall/scripts/mount ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/mount Tue Jan 11 05:49:03 2011 (r217258) +++ user/nwhitehorn/bsdinstall/scripts/mount Tue Jan 11 06:07:36 2011 (r217259) @@ -25,5 +25,5 @@ for i in $FILESYSTEMS; do done # User might want a shell and require devfs, so mount it -mkdir $BSDINSTALL_CHROOT/dev +mkdir $BSDINSTALL_CHROOT/dev 2>/dev/null mount -t devfs devfs $BSDINSTALL_CHROOT/dev Copied and modified: user/nwhitehorn/bsdinstall/scripts/umount (from r217257, user/nwhitehorn/bsdinstall/scripts/mount) ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/mount Tue Jan 11 05:22:31 2011 (r217257, copy source) +++ user/nwhitehorn/bsdinstall/scripts/umount Tue Jan 11 06:07:36 2011 (r217259) @@ -12,18 +12,5 @@ cat $PATH_FSTAB | awk -v BSDINSTALL_CHRO } }' > $TMP_FSTAB -FILESYSTEMS=`cat $TMP_FSTAB | awk '/^[^#].*/ {if ($2 ~ "^/.*") printf("%s\n", $2);}' | sort -t /` - -for i in $FILESYSTEMS; do - mkdir -p $i 2>/dev/null - MNTERROR=`mount -F $TMP_FSTAB $i 2>&1` - if [ $? -ne 0 ]; then - cdialog --backtitle "FreeBSD Installer" --title "Error" \ - --msgbox "Error mounting partition $i:\n$MNTERROR" 0 0 - exit 1 - fi -done - -# User might want a shell and require devfs, so mount it -mkdir $BSDINSTALL_CHROOT/dev -mount -t devfs devfs $BSDINSTALL_CHROOT/dev +umount $BSDINSTALL_CHROOT/dev 2>/dev/null +umount -F $TMP_FSTAB -a 2>/dev/null From owner-svn-src-user@FreeBSD.ORG Tue Jan 11 14:33:11 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 216DF106564A; Tue, 11 Jan 2011 14:33:11 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 056A48FC14; Tue, 11 Jan 2011 14:33:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0BEXAW0023437; Tue, 11 Jan 2011 14:33:10 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0BEXA05023434; Tue, 11 Jan 2011 14:33:10 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101111433.p0BEXA05023434@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 11 Jan 2011 14:33:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217266 - in user/nwhitehorn/bsdinstall: . release X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jan 2011 14:33:11 -0000 Author: nwhitehorn Date: Tue Jan 11 14:33:10 2011 New Revision: 217266 URL: http://svn.freebsd.org/changeset/base/217266 Log: Make a 'release' directory for those things not actually part of bsdinstall that would eventually show up in /usr/src/release. Added: user/nwhitehorn/bsdinstall/release/ user/nwhitehorn/bsdinstall/release/rc.local - copied unchanged from r217258, user/nwhitehorn/bsdinstall/rc.local user/nwhitehorn/bsdinstall/release/testsystem.sh - copied unchanged from r217257, user/nwhitehorn/bsdinstall/testsystem.sh Deleted: user/nwhitehorn/bsdinstall/rc.local user/nwhitehorn/bsdinstall/testsystem.sh Copied: user/nwhitehorn/bsdinstall/release/rc.local (from r217258, user/nwhitehorn/bsdinstall/rc.local) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/bsdinstall/release/rc.local Tue Jan 11 14:33:10 2011 (r217266, copy of r217258, user/nwhitehorn/bsdinstall/rc.local) @@ -0,0 +1,29 @@ +#!/bin/sh + +: ${DIALOG_OK=0} +: ${DIALOG_CANCEL=1} +: ${DIALOG_HELP=2} +: ${DIALOG_EXTRA=3} +: ${DIALOG_ITEM_HELP=4} +: ${DIALOG_ESC=255} + +TERM=xterm; export TERM # XXX: serial consoles + +cdialog --backtitle "FreeBSD Installer" --title "Welcome" --extra-button --extra-label "Shell" --ok-label "Install" --cancel-label "Live CD" --yesno "Welcome to FreeBSD! Would you like to begin an installation or use the live CD?" 0 0 + +case $? in +$DIALOG_OK) # Install + BSDINSTALL_CONFIGCURRENT=yes; export BSDINSTALL_CONFIGCURRENT + trap true SIGINT # Ignore cntrl-C here + bsdinstall + reboot + ;; +$DIALOG_CANCEL) # Live CD + exit 0 + ;; +$DIALOG_EXTRA) # Shell + /bin/sh + . /etc/rc.local + ;; +esac + Copied: user/nwhitehorn/bsdinstall/release/testsystem.sh (from r217257, user/nwhitehorn/bsdinstall/testsystem.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/bsdinstall/release/testsystem.sh Tue Jan 11 14:33:10 2011 (r217266, copy of r217257, user/nwhitehorn/bsdinstall/testsystem.sh) @@ -0,0 +1,47 @@ +#!/bin/sh + +# testsystem.sh + +mkdir $2 + +# Kernel package +cd /usr/src +mkdir $1 +make installkernel DESTDIR=$1 +cd $1 +tar cvzf $2/kernel.tgz . +chflags -R noschg . +rm -rf $1 + +# Distribution +cd /usr/src +mkdir $1 +make distrib-dirs distribution DESTDIR=$1 +cd $1 +tar cvzf $2/distribution.tgz . +chflags -R noschg . +rm -rf $1 + +# World +cd /usr/src +mkdir $1 +make installworld DESTDIR=$1 +cd $1 +tar cvzf $2/world.tgz . +# Keep world around + +# Make system +cd /usr/src +make installkernel distribution DESTDIR=$1 +mkdir $1/var/dist +cp $2/kernel.tgz $2/world.tgz $2/distribution.tgz $1/var/dist + +# Things for the CD environment +ln -s /tmp/bsdinstall_etc/resolv.conf $1/etc/resolv.conf +echo kernel_options=\"-C\" > $1/boot/loader.conf +echo sendmail_enable=\"NONE\" > $1/etc/rc.conf + +# cdialog is not called dialog yet, except here +ln -s /usr/bin/dialog $1/usr/bin/cdialog + +#mkisoimages.sh -b FreeBSD_Install $3 $1 From owner-svn-src-user@FreeBSD.ORG Wed Jan 12 15:05:31 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 910D61065679; Wed, 12 Jan 2011 15:05:31 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7EA288FC20; Wed, 12 Jan 2011 15:05:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0CF5VgO092985; Wed, 12 Jan 2011 15:05:31 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0CF5VjG092968; Wed, 12 Jan 2011 15:05:31 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101121505.p0CF5VjG092968@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 12 Jan 2011 15:05:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217310 - in user/nwhitehorn/bsdinstall: . distextract distfetch partedit release scripts X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jan 2011 15:05:31 -0000 Author: nwhitehorn Date: Wed Jan 12 15:05:31 2011 New Revision: 217310 URL: http://svn.freebsd.org/changeset/base/217310 Log: Chase dialog import by s/cdialog/dialog. bsdinstall no longer depends on anything not in the base system. Modified: user/nwhitehorn/bsdinstall/README user/nwhitehorn/bsdinstall/distextract/Makefile user/nwhitehorn/bsdinstall/distextract/distextract.c user/nwhitehorn/bsdinstall/distfetch/Makefile user/nwhitehorn/bsdinstall/distfetch/distfetch.c user/nwhitehorn/bsdinstall/partedit/Makefile user/nwhitehorn/bsdinstall/partedit/diskeditor.c user/nwhitehorn/bsdinstall/partedit/gpart_ops.c user/nwhitehorn/bsdinstall/partedit/partedit.c user/nwhitehorn/bsdinstall/release/testsystem.sh user/nwhitehorn/bsdinstall/scripts/adduser user/nwhitehorn/bsdinstall/scripts/auto user/nwhitehorn/bsdinstall/scripts/hostname user/nwhitehorn/bsdinstall/scripts/mount user/nwhitehorn/bsdinstall/scripts/netconfig user/nwhitehorn/bsdinstall/scripts/services Modified: user/nwhitehorn/bsdinstall/README ============================================================================== --- user/nwhitehorn/bsdinstall/README Wed Jan 12 14:55:02 2011 (r217309) +++ user/nwhitehorn/bsdinstall/README Wed Jan 12 15:05:31 2011 (r217310) @@ -1,14 +1,13 @@ FreeBSD Stopgap Installer ========================= Nathan Whitehorn -January 8, 2010 +January 12, 2010 This is designed to be a lightweight replacement for sysinstall until future installers show up, but more modular and easily extended. It is scriptable from shell scripts. The full installer can be run by executing bsdinstall auto, and is intended to be run from a live environment (e.g. a live CD or PXE boot). -bsdinstall must be in PATH. In addition to base tools, Thomas Dickey's new -dialog must be installed (devel/cdialog). +bsdinstall must be in PATH. Status: - Installs working, bootable systems on powerpc, amd64, i386, and sparc64 Modified: user/nwhitehorn/bsdinstall/distextract/Makefile ============================================================================== --- user/nwhitehorn/bsdinstall/distextract/Makefile Wed Jan 12 14:55:02 2011 (r217309) +++ user/nwhitehorn/bsdinstall/distextract/Makefile Wed Jan 12 15:05:31 2011 (r217310) @@ -2,8 +2,7 @@ BINDIR= /usr/libexec/bsdinstall PROG= distextract -LDADD= -larchive -lncursesw -L/usr/local/lib -lcdialog -lm -CFLAGS= -I/usr/local/include +LDADD= -larchive -lncursesw -ldialog -lm WARNS?= 6 NO_MAN= true Modified: user/nwhitehorn/bsdinstall/distextract/distextract.c ============================================================================== --- user/nwhitehorn/bsdinstall/distextract/distextract.c Wed Jan 12 14:55:02 2011 (r217309) +++ user/nwhitehorn/bsdinstall/distextract/distextract.c Wed Jan 12 15:05:31 2011 (r217310) @@ -2,7 +2,7 @@ #include #include #include -#include +#include static int extract_files(int nfiles, const char **files); @@ -47,6 +47,7 @@ extract_files(int nfiles, const char **f int i, err, progress, last_progress; err = 0; + progress = 0; /* Make the transfer list for dialog */ for (i = 0; i < nfiles; i++) { Modified: user/nwhitehorn/bsdinstall/distfetch/Makefile ============================================================================== --- user/nwhitehorn/bsdinstall/distfetch/Makefile Wed Jan 12 14:55:02 2011 (r217309) +++ user/nwhitehorn/bsdinstall/distfetch/Makefile Wed Jan 12 15:05:31 2011 (r217310) @@ -2,8 +2,7 @@ BINDIR= /usr/libexec/bsdinstall PROG= distfetch -LDADD= -lfetch -lncursesw -L/usr/local/lib -lcdialog -lm -CFLAGS= -I/usr/local/include +LDADD= -lfetch -lncursesw -ldialog -lm WARNS?= 6 NO_MAN= true Modified: user/nwhitehorn/bsdinstall/distfetch/distfetch.c ============================================================================== --- user/nwhitehorn/bsdinstall/distfetch/distfetch.c Wed Jan 12 14:55:02 2011 (r217309) +++ user/nwhitehorn/bsdinstall/distfetch/distfetch.c Wed Jan 12 15:05:31 2011 (r217310) @@ -2,7 +2,7 @@ #include #include #include -#include +#include static int fetch_files(int nfiles, char **urls); @@ -31,6 +31,8 @@ main(void) for (i = 0; i < ndists; i++) free(urls[i]); free(urls); + + return (retval); } static int @@ -45,6 +47,8 @@ fetch_files(int nfiles, char **urls) uint8_t block[4096]; size_t chunk, fsize; int i, progress, last_progress; + + progress = 0; /* Make the transfer list for dialog */ items = calloc(sizeof(char *), nfiles * 2); Modified: user/nwhitehorn/bsdinstall/partedit/Makefile ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/Makefile Wed Jan 12 14:55:02 2011 (r217309) +++ user/nwhitehorn/bsdinstall/partedit/Makefile Wed Jan 12 15:05:31 2011 (r217310) @@ -2,8 +2,7 @@ BINDIR= /usr/libexec/bsdinstall PROG= partedit -LDADD= -lgeom -lncursesw -lutil -L/usr/local/lib -lcdialog -lm -CFLAGS= -I/usr/local/include +LDADD= -lgeom -lncursesw -lutil -ldialog -lm PARTEDIT_ARCH= ${MACHINE} .if ${MACHINE} == "i386" || ${MACHINE} == "amd64" Modified: user/nwhitehorn/bsdinstall/partedit/diskeditor.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/diskeditor.c Wed Jan 12 14:55:02 2011 (r217309) +++ user/nwhitehorn/bsdinstall/partedit/diskeditor.c Wed Jan 12 15:05:31 2011 (r217310) @@ -1,8 +1,8 @@ #include #include #include -#include -#include +#include +#include #include "diskeditor.h" Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Wed Jan 12 14:55:02 2011 (r217309) +++ user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Wed Jan 12 15:05:31 2011 (r217310) @@ -4,8 +4,8 @@ #include #include -#include -#include +#include +#include #include "partedit.h" Modified: user/nwhitehorn/bsdinstall/partedit/partedit.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/partedit.c Wed Jan 12 14:55:02 2011 (r217309) +++ user/nwhitehorn/bsdinstall/partedit/partedit.c Wed Jan 12 15:05:31 2011 (r217310) @@ -5,8 +5,8 @@ #include #include -#include -#include +#include +#include #include "diskeditor.h" #include "partedit.h" Modified: user/nwhitehorn/bsdinstall/release/testsystem.sh ============================================================================== --- user/nwhitehorn/bsdinstall/release/testsystem.sh Wed Jan 12 14:55:02 2011 (r217309) +++ user/nwhitehorn/bsdinstall/release/testsystem.sh Wed Jan 12 15:05:31 2011 (r217310) @@ -41,7 +41,4 @@ ln -s /tmp/bsdinstall_etc/resolv.conf $1 echo kernel_options=\"-C\" > $1/boot/loader.conf echo sendmail_enable=\"NONE\" > $1/etc/rc.conf -# cdialog is not called dialog yet, except here -ln -s /usr/bin/dialog $1/usr/bin/cdialog - #mkisoimages.sh -b FreeBSD_Install $3 $1 Modified: user/nwhitehorn/bsdinstall/scripts/adduser ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/adduser Wed Jan 12 14:55:02 2011 (r217309) +++ user/nwhitehorn/bsdinstall/scripts/adduser Wed Jan 12 15:05:31 2011 (r217310) @@ -1,6 +1,6 @@ #!/bin/sh -cdialog --backtitle "FreeBSD Installer" --title "Add User Accounts" --yesno \ +dialog --backtitle "FreeBSD Installer" --title "Add User Accounts" --yesno \ "Would you like to add users to the installed system now?" 0 0 if [ $? -eq 0 ]; then Modified: user/nwhitehorn/bsdinstall/scripts/auto ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/auto Wed Jan 12 14:55:02 2011 (r217309) +++ user/nwhitehorn/bsdinstall/scripts/auto Wed Jan 12 15:05:31 2011 (r217310) @@ -3,7 +3,7 @@ echo "Begun Installation at $(date)" > $BSDINSTALL_LOG error() { - cdialog --backtitle "FreeBSD Installer" --title "Abort" \ + dialog --backtitle "FreeBSD Installer" --title "Abort" \ --no-label "Exit" --yes-label "Restart" --yesno \ "You have canceled an installation step. Would you like to restart the installation or exit the installer?" 0 0 if [ $? -ne 0 ]; then @@ -28,7 +28,7 @@ for dist in $DISTRIBUTIONS; do done if [ ! -z "$FETCH_DISTRIBUTIONS" ]; then - cdialog --backtitle "FreeBSD Installer" --title "Network Installation" --msgbox "No installation files were found on the boot volume. The next few screens will allow you to configure networking so that they can be downloaded from the Internet." 0 0 + dialog --backtitle "FreeBSD Installer" --title "Network Installation" --msgbox "No installation files were found on the boot volume. The next few screens will allow you to configure networking so that they can be downloaded from the Internet." 0 0 bsdinstall netconfig || error NETCONFIG_DONE=yes fi @@ -58,7 +58,7 @@ bsdinstall adduser trap error SIGINT # SIGINT is bad again bsdinstall config || error -cdialog --backtitle "FreeBSD Installer" --title "Complete" --msgbox "Installation of FreeBSD complete!" 0 0 +dialog --backtitle "FreeBSD Installer" --title "Complete" --msgbox "Installation of FreeBSD complete!" 0 0 echo "Installation Completed at $(date)" >> $BSDINSTALL_LOG Modified: user/nwhitehorn/bsdinstall/scripts/hostname ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/hostname Wed Jan 12 14:55:02 2011 (r217309) +++ user/nwhitehorn/bsdinstall/scripts/hostname Wed Jan 12 15:05:31 2011 (r217310) @@ -8,7 +8,7 @@ : ${DIALOG_ESC=255} exec 3>&1 -HOSTNAME=`cdialog --backtitle 'FreeBSD Installer' --title 'Set Hostname' --nocancel --inputbox \ +HOSTNAME=`dialog --backtitle 'FreeBSD Installer' --title 'Set Hostname' --nocancel --inputbox \ 'Please choose a hostname for this machine. If you are running on a managed network, please ask your network administrator for an appropriate name.' \ Modified: user/nwhitehorn/bsdinstall/scripts/mount ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/mount Wed Jan 12 14:55:02 2011 (r217309) +++ user/nwhitehorn/bsdinstall/scripts/mount Wed Jan 12 15:05:31 2011 (r217310) @@ -18,7 +18,7 @@ for i in $FILESYSTEMS; do mkdir -p $i 2>/dev/null MNTERROR=`mount -F $TMP_FSTAB $i 2>&1` if [ $? -ne 0 ]; then - cdialog --backtitle "FreeBSD Installer" --title "Error" \ + dialog --backtitle "FreeBSD Installer" --title "Error" \ --msgbox "Error mounting partition $i:\n$MNTERROR" 0 0 exit 1 fi Modified: user/nwhitehorn/bsdinstall/scripts/netconfig ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/netconfig Wed Jan 12 14:55:02 2011 (r217309) +++ user/nwhitehorn/bsdinstall/scripts/netconfig Wed Jan 12 15:05:31 2011 (r217310) @@ -19,19 +19,19 @@ for IF in `ifconfig -l`; do done exec 3>&1 -INTERFACE=`echo $DIALOG_TAGS | xargs cdialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' --menu 'Please select a network interface to configure:' 0 0 0 2>&1 1>&3` +INTERFACE=`echo $DIALOG_TAGS | xargs dialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' --menu 'Please select a network interface to configure:' 0 0 0 2>&1 1>&3` if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi exec 3>&- -cdialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' --yesno 'Would you like to use DHCP to configure this interface?' 0 0 +dialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' --yesno 'Would you like to use DHCP to configure this interface?' 0 0 if [ $? -eq $DIALOG_OK ]; then echo ifconfig_$INTERFACE=\"DHCP\" >> $BSDINSTALL_TMPETC/rc.conf if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then - cdialog --backtitle 'FreeBSD Installer' --infobox "Acquiring DHCP lease..." 0 0 + dialog --backtitle 'FreeBSD Installer' --infobox "Acquiring DHCP lease..." 0 0 dhclient $INTERFACE 2>> $BSDINSTALL_LOG if [ $? -ne 0 ]; then - cdialog --backtitle 'FreeBSD Installer' --msgbox "DHCP lease acquisition failed." 0 0 + dialog --backtitle 'FreeBSD Installer' --msgbox "DHCP lease acquisition failed." 0 0 exec $0 fi fi @@ -43,7 +43,7 @@ NETMASK=`ifconfig $INTERFACE inet | awk ROUTER=`netstat -rn -f inet | awk '/default/ {printf("%s\n", $2);}'` exec 3>&1 -IF_CONFIG=$(cdialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' --form 'Static Network Interface Configuration' 0 0 0 \ +IF_CONFIG=$(dialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' --form 'Static Network Interface Configuration' 0 0 0 \ 'IP Address' 1 0 "$IP_ADDRESS" 1 20 16 0 \ 'Subnet Mask' 2 0 "$NETMASK" 2 20 16 0 \ 'Default Router' 3 0 "$ROUTER" 3 20 16 0 \ Modified: user/nwhitehorn/bsdinstall/scripts/services ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/services Wed Jan 12 14:55:02 2011 (r217309) +++ user/nwhitehorn/bsdinstall/scripts/services Wed Jan 12 15:05:31 2011 (r217310) @@ -1,7 +1,7 @@ #!/bin/sh exec 3>&1 -DAEMONS=$(cdialog --backtitle "FreeBSD Installer" \ +DAEMONS=$(dialog --backtitle "FreeBSD Installer" \ --title "System Configuration" --nocancel --separate-output \ --checklist "Choose the services you would like to be started at boot:" \ 0 0 0 \ From owner-svn-src-user@FreeBSD.ORG Thu Jan 13 14:41:58 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D11CA1065672; Thu, 13 Jan 2011 14:41:58 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C03D08FC12; Thu, 13 Jan 2011 14:41:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0DEfwi8053729; Thu, 13 Jan 2011 14:41:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0DEfw2P053727; Thu, 13 Jan 2011 14:41:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101131441.p0DEfw2P053727@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 13 Jan 2011 14:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217352 - user/nwhitehorn/bsdinstall/distfetch X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jan 2011 14:41:58 -0000 Author: nwhitehorn Date: Thu Jan 13 14:41:58 2011 New Revision: 217352 URL: http://svn.freebsd.org/changeset/base/217352 Log: Provide better error reporting in distfetch. Modified: user/nwhitehorn/bsdinstall/distfetch/distfetch.c Modified: user/nwhitehorn/bsdinstall/distfetch/distfetch.c ============================================================================== --- user/nwhitehorn/bsdinstall/distfetch/distfetch.c Thu Jan 13 14:22:27 2011 (r217351) +++ user/nwhitehorn/bsdinstall/distfetch/distfetch.c Thu Jan 13 14:41:58 2011 (r217352) @@ -11,7 +11,7 @@ main(void) { char *diststring = strdup(getenv("DISTRIBUTIONS")); char **urls; - int i, retval, ndists = 0; + int i, nfetched, ndists = 0; for (i = 0; diststring[i] != 0; i++) if (isspace(diststring[i]) && !isspace(diststring[i+1])) ndists++; @@ -25,14 +25,14 @@ main(void) } chdir(getenv("BSDINSTALL_DISTDIR")); - retval = fetch_files(ndists, urls); + nfetched = fetch_files(ndists, urls); free(diststring); for (i = 0; i < ndists; i++) free(urls[i]); free(urls); - return (retval); + return ((nfetched == ndists) ? 0 : 1); } static int @@ -47,6 +47,7 @@ fetch_files(int nfiles, char **urls) uint8_t block[4096]; size_t chunk, fsize; int i, progress, last_progress; + int nsuccess = 0; /* Number of files successfully downloaded */ progress = 0; @@ -131,8 +132,6 @@ fetch_files(int nfiles, char **urls) __DECONST(char **, items)); } - items[i*2 + 1] = "Done"; - if (ustat.size > 0 && fsize < (size_t)ustat.size) { if (fetchLastErrCode == 0) snprintf(errormsg, sizeof(errormsg), @@ -145,6 +144,9 @@ fetch_files(int nfiles, char **urls) items[i*2 + 1] = "Failed"; dialog_msgbox("Fetch Error", errormsg, 0, 0, TRUE); + } else { + items[i*2 + 1] = "Done"; + nsuccess++; } fclose(fetch_out); @@ -153,5 +155,5 @@ fetch_files(int nfiles, char **urls) end_dialog(); free(items); - return (0); + return (nsuccess); } From owner-svn-src-user@FreeBSD.ORG Thu Jan 13 17:04:02 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3F31106567A; Thu, 13 Jan 2011 17:04:02 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C320C8FC1E; Thu, 13 Jan 2011 17:04:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0DH42fe057452; Thu, 13 Jan 2011 17:04:02 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0DH42Z1057448; Thu, 13 Jan 2011 17:04:02 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101131704.p0DH42Z1057448@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 13 Jan 2011 17:04:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217362 - user/nwhitehorn/bsdinstall/scripts X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jan 2011 17:04:02 -0000 Author: nwhitehorn Date: Thu Jan 13 17:04:02 2011 New Revision: 217362 URL: http://svn.freebsd.org/changeset/base/217362 Log: Allow user to set their keymap at the beginning of the installation. Does not run on serial console or X installations. Added: user/nwhitehorn/bsdinstall/scripts/keymap (contents, props changed) Modified: user/nwhitehorn/bsdinstall/scripts/Makefile user/nwhitehorn/bsdinstall/scripts/auto Modified: user/nwhitehorn/bsdinstall/scripts/Makefile ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/Makefile Thu Jan 13 17:02:39 2011 (r217361) +++ user/nwhitehorn/bsdinstall/scripts/Makefile Thu Jan 13 17:04:02 2011 (r217362) @@ -1,7 +1,7 @@ # $FreeBSD $ -SCRIPTS= auto adduser config hostname mount netconfig rootpass services time \ - umount +SCRIPTS= auto adduser config hostname keymap mount netconfig rootpass services \ + time umount BINDIR= /usr/libexec/bsdinstall NO_MAN= true Modified: user/nwhitehorn/bsdinstall/scripts/auto ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/auto Thu Jan 13 17:02:39 2011 (r217361) +++ user/nwhitehorn/bsdinstall/scripts/auto Thu Jan 13 17:04:02 2011 (r217362) @@ -14,10 +14,14 @@ error() { fi } -trap error SIGINT # Catch cntrl-C here rm -rf $BSDINSTALL_TMPETC mkdir $BSDINSTALL_TMPETC + +trap true SIGINT # This section is optional +bsdinstall keymap + +trap error SIGINT # Catch cntrl-C here bsdinstall hostname || error FETCH_DISTRIBUTIONS="" Added: user/nwhitehorn/bsdinstall/scripts/keymap ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/bsdinstall/scripts/keymap Thu Jan 13 17:04:02 2011 (r217362) @@ -0,0 +1,6 @@ +#!/bin/sh + +kbdcontrol -d >/dev/null 2>&1 +if [ $? -eq 0 ]; then + kbdmap 3>&2 2>&1 1>&3 | grep 'keymap=' >> $BSDINSTALL_TMPETC/rc.conf +fi From owner-svn-src-user@FreeBSD.ORG Thu Jan 13 17:47:22 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEA3C106566B; Thu, 13 Jan 2011 17:47:22 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC49A8FC15; Thu, 13 Jan 2011 17:47:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0DHlM4p058558; Thu, 13 Jan 2011 17:47:22 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0DHlMgN058553; Thu, 13 Jan 2011 17:47:22 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101131747.p0DHlMgN058553@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 13 Jan 2011 17:47:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217366 - user/nwhitehorn/bsdinstall/partedit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jan 2011 17:47:22 -0000 Author: nwhitehorn Date: Thu Jan 13 17:47:22 2011 New Revision: 217366 URL: http://svn.freebsd.org/changeset/base/217366 Log: Rename some global-shadowing variables, move a function in preparation for a guided partitioning wizard, and add an if that was earlier forgotten. Modified: user/nwhitehorn/bsdinstall/partedit/diskeditor.c user/nwhitehorn/bsdinstall/partedit/gpart_ops.c user/nwhitehorn/bsdinstall/partedit/partedit.c user/nwhitehorn/bsdinstall/partedit/partedit.h Modified: user/nwhitehorn/bsdinstall/partedit/diskeditor.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/diskeditor.c Thu Jan 13 17:32:32 2011 (r217365) +++ user/nwhitehorn/bsdinstall/partedit/diskeditor.c Thu Jan 13 17:47:22 2011 (r217366) @@ -8,11 +8,11 @@ static void print_partedit_item(WINDOW *partitions, struct partedit_item *items, - int item, int scroll, int selected) + int item, int nscroll, int selected) { chtype attr = A_NORMAL; char sizetext[16]; - int y = item - scroll + 1; + int y = item - nscroll + 1; wattrset(partitions, selected ? item_selected_attr : item_attr); wmove(partitions, y, MARGIN + items[item].indentation*2); @@ -32,7 +32,7 @@ print_partedit_item(WINDOW *partitions, int diskeditor_show(const char *title, const char *cprompt, - struct partedit_item *items, int nitems, int *selected, int *scroll) + struct partedit_item *items, int nitems, int *selected, int *nscroll) { WINDOW *dialog, *partitions; char *prompt; @@ -103,8 +103,8 @@ diskeditor_show(const char *title, const if (selected != NULL) cur_part = *selected; - if (scroll != NULL) - cur_scroll = *scroll; + if (nscroll != NULL) + cur_scroll = *nscroll; if (cur_part - cur_scroll >= partlist_height - 2 || cur_part - cur_scroll < 0) cur_scroll = cur_part; @@ -221,8 +221,8 @@ repaint: done: if (selected != NULL) *selected = cur_part; - if (scroll != NULL) - *scroll = cur_scroll; + if (nscroll != NULL) + *nscroll = cur_scroll; dlg_del_window(partitions); dlg_del_window(dialog); Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Thu Jan 13 17:32:32 2011 (r217365) +++ user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Thu Jan 13 17:47:22 2011 (r217366) @@ -11,9 +11,6 @@ #define GPART_FLAGS "x" /* Do not commit changes by default */ -static void set_part_metadata(const char *name, const char *scheme, - const char *type, const char *mountpoint, int newfs); - static void gpart_show_error(const char *title, const char *explanation, const char *errstr) { @@ -114,7 +111,7 @@ gpart_activate(struct gprovider *pp) struct gctl_req *r; const char *errstr, *scheme; const char *attribute = NULL; - intmax_t index; + intmax_t idx; /* * Some partition schemes need this partition to be marked 'active' @@ -135,7 +132,7 @@ gpart_activate(struct gprovider *pp) LIST_FOREACH(gc, &pp->lg_config, lg_config) { if (strcmp(gc->lg_name, "index") == 0) { - index = atoi(gc->lg_val); + idx = atoi(gc->lg_val); break; } } @@ -145,7 +142,7 @@ gpart_activate(struct gprovider *pp) gctl_ro_param(r, "arg0", -1, pp->lg_geom->lg_name); gctl_ro_param(r, "verb", -1, "set"); gctl_ro_param(r, "attrib", -1, attribute); - gctl_ro_param(r, "index", sizeof(index), &index); + gctl_ro_param(r, "index", sizeof(idx), &idx); errstr = gctl_issue(r); if (errstr != NULL && errstr[0] != '\0') @@ -267,15 +264,16 @@ gpart_destroy(struct ggeom *lg_geom, int gctl_free(r); /* If asked, commit the change */ - r = gctl_get_handle(); - gctl_ro_param(r, "class", -1, "PART"); - gctl_ro_param(r, "arg0", -1, lg_geom->lg_name); - gctl_ro_param(r, "flags", -1, GPART_FLAGS); - gctl_ro_param(r, "verb", -1, "commit"); - errstr = gctl_issue(r); - if (errstr != NULL && errstr[0] != '\0') - gpart_show_error("Error", NULL, errstr); - gctl_free(r); + if (force) { + r = gctl_get_handle(); + gctl_ro_param(r, "class", -1, "PART"); + gctl_ro_param(r, "arg0", -1, lg_geom->lg_name); + gctl_ro_param(r, "verb", -1, "commit"); + errstr = gctl_issue(r); + if (errstr != NULL && errstr[0] != '\0') + gpart_show_error("Error", NULL, errstr); + gctl_free(r); + } /* And any metadata associated with the partition scheme itself */ delete_part_metadata(lg_geom->lg_name); @@ -291,7 +289,7 @@ gpart_edit(struct gprovider *pp) const char *errstr, *oldtype, *scheme; struct partition_metadata *md; char sizestr[32]; - intmax_t index; + intmax_t idx; int hadlabel, choice, junk, nitems; unsigned i; @@ -379,7 +377,7 @@ gpart_edit(struct gprovider *pp) items[3].text = gc->lg_val; } if (strcmp(gc->lg_name, "index") == 0) - index = atoi(gc->lg_val); + idx = atoi(gc->lg_val); } TAILQ_FOREACH(md, &part_metadata, metadata) { @@ -422,7 +420,7 @@ editpart: gctl_ro_param(r, "arg0", -1, geom->lg_name); gctl_ro_param(r, "flags", -1, GPART_FLAGS); gctl_ro_param(r, "verb", -1, "modify"); - gctl_ro_param(r, "index", sizeof(index), &index); + gctl_ro_param(r, "index", sizeof(idx), &idx); if (hadlabel || items[3].text[0] != '\0') gctl_ro_param(r, "label", -1, items[3].text); gctl_ro_param(r, "type", -1, items[0].text); @@ -434,17 +432,17 @@ editpart: } gctl_free(r); - set_part_metadata(pp->lg_name, scheme, items[0].text, items[2].text, - strcmp(oldtype, items[0].text) != 0); + set_default_part_metadata(pp->lg_name, scheme, items[0].text, + items[2].text, strcmp(oldtype, items[0].text) != 0); for (i = 0; i < (sizeof(items) / sizeof(items[0])); i++) if (items[i].text_free) free(items[i].text); } -static void -set_part_metadata(const char *name, const char *scheme, const char *type, - const char *mountpoint, int newfs) +void +set_default_part_metadata(const char *name, const char *scheme, + const char *type, const char *mountpoint, int newfs) { struct partition_metadata *md; @@ -754,8 +752,8 @@ addpartform: else if (strcmp(items[0].text, "freebsd") == 0) gpart_partition(strtok(output, " "), "BSD"); else - set_part_metadata(strtok(output, " "), scheme, items[0].text, - items[2].text, 1); + set_default_part_metadata(strtok(output, " "), scheme, + items[0].text, items[2].text, 1); for (i = 0; i < (sizeof(items) / sizeof(items[0])); i++) if (items[i].text_free) @@ -771,7 +769,7 @@ gpart_delete(struct gprovider *pp) struct gconsumer *cp; struct gctl_req *r; const char *errstr; - intmax_t index; + intmax_t idx; int choice, is_partition; /* Is it a partition? */ @@ -831,8 +829,8 @@ gpart_delete(struct gprovider *pp) LIST_FOREACH(gc, &pp->lg_config, lg_config) { if (strcmp(gc->lg_name, "index") == 0) { - index = atoi(gc->lg_val); - gctl_ro_param(r, "index", sizeof(index), &index); + idx = atoi(gc->lg_val); + gctl_ro_param(r, "index", sizeof(idx), &idx); break; } } Modified: user/nwhitehorn/bsdinstall/partedit/partedit.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/partedit.c Thu Jan 13 17:32:32 2011 (r217365) +++ user/nwhitehorn/bsdinstall/partedit/partedit.c Thu Jan 13 17:47:22 2011 (r217366) @@ -26,7 +26,7 @@ main(void) { struct partition_metadata *md; struct partedit_item *items; struct gmesh mesh; - int i, op, nitems, scroll; + int i, op, nitems, nscroll; int error; TAILQ_INIT(&part_metadata); @@ -36,7 +36,7 @@ main(void) { init_dialog(stdin, stdout); dialog_vars.backtitle = __DECONST(char *, "FreeBSD Installer"); dialog_vars.item_help = TRUE; - scroll = i = 0; + nscroll = i = 0; while (1) { error = geom_gettree(&mesh); @@ -50,7 +50,7 @@ main(void) { op = diskeditor_show("Partition Editor", "Create partitions for FreeBSD. No changes will be made " "until you select Finished.", - items, nitems, &i, &scroll); + items, nitems, &i, &nscroll); switch (op) { case 0: /* Create */ @@ -87,8 +87,9 @@ main(void) { error = 0; if (op == 4 && validate_setup()) { /* Finished */ dialog_vars.extra_button = TRUE; - dialog_vars.extra_label = "Don't Save"; - dialog_vars.ok_label = "Save"; + dialog_vars.extra_label = + __DECONST(char *, "Don't Save"); + dialog_vars.ok_label = __DECONST(char *, "Save"); op = dialog_yesno("Confirmation", "Your changes will " "now be written to disk. If you have chosen to " "overwrite existing data, it will be PERMANENTLY " Modified: user/nwhitehorn/bsdinstall/partedit/partedit.h ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/partedit.h Thu Jan 13 17:32:32 2011 (r217365) +++ user/nwhitehorn/bsdinstall/partedit/partedit.h Thu Jan 13 17:47:22 2011 (r217366) @@ -28,6 +28,8 @@ void gpart_create(struct gprovider *pp); void gpart_revert(struct gprovider *pp); void gpart_revert_all(struct gmesh *mesh); void gpart_commit(struct gmesh *mesh); +void set_default_part_metadata(const char *name, const char *scheme, + const char *type, const char *mountpoint, int newfs); /* machine-dependent bootability checks */ int is_scheme_bootable(const char *part_type); From owner-svn-src-user@FreeBSD.ORG Fri Jan 14 05:31:51 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF1831065672; Fri, 14 Jan 2011 05:31:51 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CB9E8FC0C; Fri, 14 Jan 2011 05:31:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0E5VpDm076068; Fri, 14 Jan 2011 05:31:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0E5VpGe076058; Fri, 14 Jan 2011 05:31:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101140531.p0E5VpGe076058@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 14 Jan 2011 05:31:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217390 - user/nwhitehorn/bsdinstall/partedit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jan 2011 05:31:51 -0000 Author: nwhitehorn Date: Fri Jan 14 05:31:51 2011 New Revision: 217390 URL: http://svn.freebsd.org/changeset/base/217390 Log: Add a guided partitioning wizard as a replacement for sysinstall's "Auto Defaults" button. On x86, this uses GPT by default for new disks. Default partitioning layout on all systems is the "One Big /" philosophy. Swap is the second partition for now due to boot loader and BIOS limitations -- it may make sense in the future to make it first, so as to allow the data partition to be extended on systems with resizable disks (RAID, VMs). Added: user/nwhitehorn/bsdinstall/partedit/part_wizard.c Modified: user/nwhitehorn/bsdinstall/partedit/Makefile user/nwhitehorn/bsdinstall/partedit/gpart_ops.c user/nwhitehorn/bsdinstall/partedit/partedit.c user/nwhitehorn/bsdinstall/partedit/partedit.h user/nwhitehorn/bsdinstall/partedit/partedit_pc98.c user/nwhitehorn/bsdinstall/partedit/partedit_powerpc.c user/nwhitehorn/bsdinstall/partedit/partedit_sparc64.c user/nwhitehorn/bsdinstall/partedit/partedit_x86.c Modified: user/nwhitehorn/bsdinstall/partedit/Makefile ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/Makefile Fri Jan 14 05:25:44 2011 (r217389) +++ user/nwhitehorn/bsdinstall/partedit/Makefile Fri Jan 14 05:31:51 2011 (r217390) @@ -15,7 +15,8 @@ PARTEDIT_ARCH= sparc64 PARTEDIT_ARCH= generic .endif -SRCS= diskeditor.c partedit.c gpart_ops.c partedit_${PARTEDIT_ARCH}.c +SRCS= diskeditor.c partedit.c gpart_ops.c partedit_${PARTEDIT_ARCH}.c \ + part_wizard.c WARNS?= 3 NO_MAN= true Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Fri Jan 14 05:25:44 2011 (r217389) +++ user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Fri Jan 14 05:31:51 2011 (r217390) @@ -37,7 +37,7 @@ gpart_show_error(const char *title, cons dialog_msgbox(title, message, 0, 0, TRUE); } -static int +int gpart_partition(const char *lg_name, const char *scheme) { int cancel, choice; @@ -241,7 +241,7 @@ gpart_partcode(struct gprovider *pp) } } -static void +void gpart_destroy(struct ggeom *lg_geom, int force) { struct gprovider *pp; @@ -518,7 +518,8 @@ set_default_part_metadata(const char *na } void -gpart_create(struct gprovider *pp) +gpart_create(struct gprovider *pp, char *default_type, char *default_size, + char *default_mountpoint, char **partname, int interactive) { struct gctl_req *r; struct gconfig *gc; @@ -546,6 +547,9 @@ gpart_create(struct gprovider *pp) FALSE}, }; + if (partname != NULL) + *partname = NULL; + /* Record sector and stripe sizes */ sector = pp->lg_sectorsize; stripe = pp->lg_stripesize; @@ -635,11 +639,20 @@ gpart_create(struct gprovider *pp) else nitems = 3; -addpartform: - choice = dlg_form("Add Partition", "", 0, 0, 0, nitems, items, &junk); + if (default_type != NULL) + items[0].text = default_type; + if (default_size != NULL) + items[1].text = default_size; + if (default_mountpoint != NULL) + items[2].text = default_mountpoint; - if (choice) /* Cancel pressed */ - return; +addpartform: + if (interactive) { + choice = dlg_form("Add Partition", "", 0, 0, 0, nitems, + items, &junk); + if (choice) /* Cancel pressed */ + return; + } size = maxsize; if (strlen(items[1].text) > 0) { @@ -693,9 +706,13 @@ addpartform: * the user to add one. */ if (strcmp(items[2].text, "/") == 0 && bootpart_size(scheme) > 0) { - choice = dialog_yesno("Boot Partition", "This partition scheme " - "requires a boot partition for the disk to be bootable. " - "Would you like to make one now?", 0, 0); + if (interactive) + choice = dialog_yesno("Boot Partition", + "This partition scheme requires a boot partition " + "for the disk to be bootable. Would you like to " + "make one now?", 0, 0); + else + choice = 0; if (choice == 0) { /* yes */ r = gctl_get_handle(); @@ -759,6 +776,9 @@ addpartform: if (items[i].text_free) free(items[i].text); gctl_free(r); + + if (partname != NULL) + *partname = strdup(strtok(output, " ")); } void Added: user/nwhitehorn/bsdinstall/partedit/part_wizard.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/bsdinstall/partedit/part_wizard.c Fri Jan 14 05:31:51 2011 (r217390) @@ -0,0 +1,263 @@ +#include +#include +#include +#include + +#include +#include +#include + +#include "partedit.h" + +#define GPART_FLAGS "x" /* Do not commit changes by default */ + +static char *boot_disk(struct gmesh *mesh); +static char *wizard_partition(struct gmesh *mesh, const char *disk); +static void wizard_makeparts(struct gmesh *mesh, const char *disk); + +int +part_wizard(void) { + int error; + struct gmesh mesh; + char *disk, *schemeroot; + + error = geom_gettree(&mesh); + + dlg_put_backtitle(); + error = geom_gettree(&mesh); + disk = boot_disk(&mesh); + if (disk == NULL) + return (1); + + dlg_clear(); + dlg_put_backtitle(); + schemeroot = wizard_partition(&mesh, disk); + free(disk); + if (schemeroot == NULL) + return (1); + dlg_clear(); + + geom_deletetree(&mesh); + error = geom_gettree(&mesh); + + wizard_makeparts(&mesh, schemeroot); + free(schemeroot); + + geom_deletetree(&mesh); + + return (0); +} + +static char * +boot_disk(struct gmesh *mesh) +{ + struct gclass *classp; + struct ggeom *gp; + struct gprovider *pp; + DIALOG_LISTITEM *disks = NULL; + char diskdesc[512]; + char *chosen; + int i, err, selected, n = 0; + + LIST_FOREACH(classp, &mesh->lg_class, lg_class) { + if (strcmp(classp->lg_name, "DISK") != 0 && + strcmp(classp->lg_name, "MD") != 0) + continue; + + LIST_FOREACH(gp, &classp->lg_geom, lg_geom) { + if (LIST_EMPTY(&gp->lg_provider)) + continue; + + LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { + disks = realloc(disks, (++n)*sizeof(disks[0])); + disks[n-1].name = pp->lg_name; + humanize_number(diskdesc, 7, pp->lg_mediasize, + "B", HN_AUTOSCALE, HN_DECIMAL); + if (strncmp(pp->lg_name, "ad", 2) == 0) + strcat(diskdesc, " ATA Hard Disk"); + else if (strncmp(pp->lg_name, "da", 2) == 0) + strcat(diskdesc, " SCSI Hard Disk"); + else if (strncmp(pp->lg_name, "md", 2) == 0) + strcat(diskdesc, " Memory Disk"); + else if (strncmp(pp->lg_name, "cd", 2) == 0) { + n--; + continue; + } + disks[n-1].text = strdup(diskdesc); + disks[n-1].help = NULL; + disks[n-1].state = 0; + } + } + } + + if (n > 1) { + err = dlg_menu("Partitioning", + "Select the disk on which to install FreeBSD.", 0, 0, 0, + n, disks, &selected, NULL); + + chosen = (err == 0) ? strdup(disks[selected].name) : NULL; + } else if (n == 1) { + chosen = strdup(disks[0].name); + } else { + chosen = NULL; + } + + for (i = 0; i < n; i++) + free(disks[i].text); + + return (chosen); +} + +static struct gprovider * +provider_for_name(struct gmesh *mesh, const char *name) +{ + struct gclass *classp; + struct gprovider *pp = NULL; + struct ggeom *gp; + + LIST_FOREACH(classp, &mesh->lg_class, lg_class) { + if (strcmp(classp->lg_name, "DISK") != 0 && + strcmp(classp->lg_name, "PART") != 0 && + strcmp(classp->lg_name, "MD") != 0) + continue; + + LIST_FOREACH(gp, &classp->lg_geom, lg_geom) { + if (LIST_EMPTY(&gp->lg_provider)) + continue; + + LIST_FOREACH(pp, &gp->lg_provider, lg_provider) + if (strcmp(pp->lg_name, name) == 0) + break; + + if (pp != NULL) break; + } + + if (pp != NULL) break; + } + + return (pp); +} + +static char * +wizard_partition(struct gmesh *mesh, const char *disk) +{ + struct gclass *classp; + struct ggeom *gpart = NULL; + struct gconfig *gc; + char message[512]; + const char *scheme; + char *retval = NULL; + int choice; + + LIST_FOREACH(classp, &mesh->lg_class, lg_class) + if (strcmp(classp->lg_name, "PART") == 0) + break; + + if (classp != NULL) { + LIST_FOREACH(gpart, &classp->lg_geom, lg_geom) + if (strcmp(gpart->lg_name, disk) == 0) + break; + } + + if (gpart != NULL) { + LIST_FOREACH(gc, &gpart->lg_config, lg_config) { + if (strcmp(gc->lg_name, "scheme") == 0) { + scheme = gc->lg_val; + break; + } + } + } + +query: + dialog_vars.yes_label = "Entire Disk"; + dialog_vars.no_label = "Partition"; + if (gpart != NULL) + dialog_vars.defaultno = TRUE; + + snprintf(message, sizeof(message), "Would you like to use this entire " + "disk (%s) for FreeBSD or partition it to share it with other " + "operating systems? Using the entire disk will erase any data " + "currently stored there.", disk); + choice = dialog_yesno("Partition", message, 0, 0); + + dialog_vars.yes_label = NULL; + dialog_vars.no_label = NULL; + dialog_vars.defaultno = FALSE; + + if (choice == 0) { /* Entire disk */ + if (gpart != NULL) { /* Erase partitioned disk */ + choice = dialog_yesno("Confirmation", "This will erase " + "the disk. Are you sure you want to proceed?", 0, 0); + if (choice != 0) + goto query; + + gpart_destroy(gpart, 1); + } + + gpart_partition(disk, default_scheme()); + scheme = default_scheme(); + } + + if (strcmp(scheme, "PC98") == 0 || strcmp(scheme, "MBR") == 0) { + struct gmesh submesh; + geom_gettree(&submesh); + gpart_create(provider_for_name(&submesh, disk), + "freebsd", NULL, NULL, &retval, choice); + geom_deletetree(&submesh); + } else { + retval = strdup(disk); + } + + return (retval); +} + +static void +wizard_makeparts(struct gmesh *mesh, const char *disk) +{ + struct gmesh submesh; + struct gclass *classp; + struct ggeom *gp; + struct gconfig *gc; + const char *scheme; + struct gprovider *pp; + intmax_t start, end; + intmax_t swapsize; + char swapsizestr[10], rootsizestr[10]; + + LIST_FOREACH(classp, &mesh->lg_class, lg_class) + if (strcmp(classp->lg_name, "PART") == 0) + break; + + LIST_FOREACH(gp, &classp->lg_geom, lg_geom) + if (strcmp(gp->lg_name, disk) == 0) + break; + + LIST_FOREACH(gc, &gp->lg_config, lg_config) { + if (strcmp(gc->lg_name, "first") == 0) + start = strtoimax(gc->lg_val, NULL, 0); + if (strcmp(gc->lg_name, "last") == 0) + end = strtoimax(gc->lg_val, NULL, 0); + if (strcmp(gc->lg_name, "scheme") == 0) + scheme = gc->lg_val; + } + + pp = provider_for_name(mesh, disk); + + swapsize = MIN((end - start)*pp->lg_sectorsize/50, + 4*1024*1024*(intmax_t)(1024)); + humanize_number(swapsizestr, 7, swapsize, "B", HN_AUTOSCALE, + HN_NOSPACE | HN_DECIMAL); + humanize_number(rootsizestr, 7, + (end - start)*pp->lg_sectorsize - swapsize - 1024*1024, + "B", HN_AUTOSCALE, HN_NOSPACE | HN_DECIMAL); + + geom_gettree(&submesh); + pp = provider_for_name(&submesh, disk); + gpart_create(pp, "freebsd-ufs", rootsizestr, "/", NULL, 0); + geom_deletetree(&submesh); + + geom_gettree(&submesh); + pp = provider_for_name(&submesh, disk); + gpart_create(pp, "freebsd-swap", swapsizestr, NULL, NULL, 0); + geom_deletetree(&submesh); +} Modified: user/nwhitehorn/bsdinstall/partedit/partedit.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/partedit.c Fri Jan 14 05:25:44 2011 (r217389) +++ user/nwhitehorn/bsdinstall/partedit/partedit.c Fri Jan 14 05:31:51 2011 (r217390) @@ -38,6 +38,19 @@ main(void) { dialog_vars.item_help = TRUE; nscroll = i = 0; + /* Ask about guided vs. manual partitioning */ + dlg_put_backtitle(); + dialog_vars.yes_label = "Guided"; + dialog_vars.no_label = "Manual"; + op = dialog_yesno("Partitioning", "Would you like to use the guided " + "partitioning tool (recommended for beginners) or to set up " + "partitions manual (experts)?", 0, 0); + dialog_vars.yes_label = NULL; + dialog_vars.no_label = NULL; + if (op == 0) /* Guided */ + part_wizard(); + + /* Show the part editor either immediately, or to confirm wizard */ while (1) { error = geom_gettree(&mesh); items = read_geom_mesh(&mesh, &nitems); @@ -54,7 +67,8 @@ main(void) { switch (op) { case 0: /* Create */ - gpart_create((struct gprovider *)(items[i].cookie)); + gpart_create((struct gprovider *)(items[i].cookie), + NULL, NULL, NULL, NULL, 1); break; case 1: /* Delete */ gpart_delete((struct gprovider *)(items[i].cookie)); Modified: user/nwhitehorn/bsdinstall/partedit/partedit.h ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/partedit.h Fri Jan 14 05:25:44 2011 (r217389) +++ user/nwhitehorn/bsdinstall/partedit/partedit.h Fri Jan 14 05:31:51 2011 (r217390) @@ -3,6 +3,7 @@ struct gprovider; struct gmesh; +struct ggeom; TAILQ_HEAD(pmetadata_head, partition_metadata); extern struct pmetadata_head part_metadata; @@ -21,17 +22,23 @@ struct partition_metadata { struct partition_metadata *get_part_metadata(const char *name, int create); void delete_part_metadata(const char *name); +int part_wizard(void); + /* gpart operations */ void gpart_delete(struct gprovider *pp); +void gpart_destroy(struct ggeom *lg_geom, int force); void gpart_edit(struct gprovider *pp); -void gpart_create(struct gprovider *pp); +void gpart_create(struct gprovider *pp, char *default_type, char *default_size, + char *default_mountpoint, char **output, int interactive); void gpart_revert(struct gprovider *pp); void gpart_revert_all(struct gmesh *mesh); void gpart_commit(struct gmesh *mesh); +int gpart_partition(const char *lg_name, const char *scheme); void set_default_part_metadata(const char *name, const char *scheme, const char *type, const char *mountpoint, int newfs); /* machine-dependent bootability checks */ +const char *default_scheme(void); int is_scheme_bootable(const char *part_type); size_t bootpart_size(const char *part_type); const char *bootcode_path(const char *part_type); Modified: user/nwhitehorn/bsdinstall/partedit/partedit_pc98.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/partedit_pc98.c Fri Jan 14 05:25:44 2011 (r217389) +++ user/nwhitehorn/bsdinstall/partedit/partedit_pc98.c Fri Jan 14 05:31:51 2011 (r217390) @@ -2,6 +2,11 @@ #include "partedit.h" +const char * +default_scheme(void) { + return ("PC98"); +} + int is_scheme_bootable(const char *part_type) { if (strcmp(part_type, "PC98") == 0) Modified: user/nwhitehorn/bsdinstall/partedit/partedit_powerpc.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/partedit_powerpc.c Fri Jan 14 05:25:44 2011 (r217389) +++ user/nwhitehorn/bsdinstall/partedit/partedit_powerpc.c Fri Jan 14 05:31:51 2011 (r217390) @@ -2,6 +2,11 @@ #include "partedit.h" +const char * +default_scheme(void) { + return ("APM"); +} + int is_scheme_bootable(const char *part_type) { if (strcmp(part_type, "APM") == 0) Modified: user/nwhitehorn/bsdinstall/partedit/partedit_sparc64.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/partedit_sparc64.c Fri Jan 14 05:25:44 2011 (r217389) +++ user/nwhitehorn/bsdinstall/partedit/partedit_sparc64.c Fri Jan 14 05:31:51 2011 (r217390) @@ -2,6 +2,11 @@ #include "partedit.h" +const char * +default_scheme(void) { + return ("VTOC8"); +} + int is_scheme_bootable(const char *part_type) { if (strcmp(part_type, "VTOC8") == 0) Modified: user/nwhitehorn/bsdinstall/partedit/partedit_x86.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/partedit_x86.c Fri Jan 14 05:25:44 2011 (r217389) +++ user/nwhitehorn/bsdinstall/partedit/partedit_x86.c Fri Jan 14 05:31:51 2011 (r217390) @@ -2,6 +2,11 @@ #include "partedit.h" +const char * +default_scheme(void) { + return ("GPT"); +} + int is_scheme_bootable(const char *part_type) { if (strcmp(part_type, "BSD") == 0) From owner-svn-src-user@FreeBSD.ORG Fri Jan 14 08:21:54 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC557106566B; Fri, 14 Jan 2011 08:21:54 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id 382E38FC1C; Fri, 14 Jan 2011 08:21:54 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id 4EBFEE817F; Fri, 14 Jan 2011 08:21:53 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=mail; bh=M4ycpr64c3Tq tJn8FcFdem3f8js=; b=F+9b4OgdQ3u6bKQCIi4CdZJq/zhaxURQeq+Rj/H0EbOO NMSRDRoCy8bsIC/G8at2QsBVaqkX/I3ue8hHad6NuCLfyN1Ah74AWlvB+g4C9Zw7 Gc+2y9LIiT7at7AhO/5NZ77e7fWdkSHKV3IPO27+WLnP/pYbyP7z3+9Ncy/P9Yo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=date:from:to :cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=mail; b=isR6Jg WGBTrFU71rDt/GV/jzR0i4pWBhxcO+tnAKn3uKI5tikynW9TKhyINYshG3fDiSTJ GdozbZXPO88UNO6fFuQQhInw7MwYZrBQxReKwsAoiJtmFQolOTlMNEsKTA3fTEAz OKLoGmL274e2qBd08zkXsYsrR+Arx+nfy9Pb0= Received: from unknown (client-86-31-196-41.oxfd.adsl.virginmedia.com [86.31.196.41]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id CD593E817E; Fri, 14 Jan 2011 08:21:52 +0000 (GMT) Date: Fri, 14 Jan 2011 08:21:46 +0000 From: Bruce Cran To: Nathan Whitehorn Message-ID: <20110114082146.00000247@unknown> In-Reply-To: <201101140531.p0E5VpGe076058@svn.freebsd.org> References: <201101140531.p0E5VpGe076058@svn.freebsd.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.16.0; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r217390 - user/nwhitehorn/bsdinstall/partedit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jan 2011 08:21:54 -0000 On Fri, 14 Jan 2011 05:31:51 +0000 (UTC) Nathan Whitehorn wrote: > Add a guided partitioning wizard as a replacement for sysinstall's > "Auto Defaults" button. On x86, this uses GPT by default for new > disks. I don't know how many people dual boot but Windows 7 can't boot from GPT from a non-EFI BIOS so it might make sense to default to using the MBR scheme. -- Bruce Cran From owner-svn-src-user@FreeBSD.ORG Fri Jan 14 14:21:38 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86AFA10656A7; Fri, 14 Jan 2011 14:21:38 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id 5CFF08FC18; Fri, 14 Jan 2011 14:21:37 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 5A90F5811D; Fri, 14 Jan 2011 08:21:37 -0600 (CST) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id bey-Kss3tbz5; Fri, 14 Jan 2011 08:21:37 -0600 (CST) Received: from comporellon.tachypleus.net (unknown [76.210.75.5]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 9EF6D5811A; Fri, 14 Jan 2011 08:21:36 -0600 (CST) Message-ID: <4D305BEF.9020005@freebsd.org> Date: Fri, 14 Jan 2011 08:21:35 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101214 Thunderbird/3.1.7 MIME-Version: 1.0 To: Bruce Cran References: <201101140531.p0E5VpGe076058@svn.freebsd.org> <20110114082146.00000247@unknown> In-Reply-To: <20110114082146.00000247@unknown> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r217390 - user/nwhitehorn/bsdinstall/partedit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jan 2011 14:21:38 -0000 On 01/14/11 02:21, Bruce Cran wrote: > On Fri, 14 Jan 2011 05:31:51 +0000 (UTC) > Nathan Whitehorn wrote: > >> Add a guided partitioning wizard as a replacement for sysinstall's >> "Auto Defaults" button. On x86, this uses GPT by default for new >> disks. > I don't know how many people dual boot but Windows 7 can't boot from GPT > from a non-EFI BIOS so it might make sense to default to using the MBR > scheme. It only defaults to GPT if you press the "Use Entire Disk for FreeBSD" option. I felt this was pretty safe. The multi-partition option uses MBR+bsdlabel, as today, for this reason. -Nathan From owner-svn-src-user@FreeBSD.ORG Fri Jan 14 14:29:42 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3168106566B; Fri, 14 Jan 2011 14:29:42 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A71DB8FC08; Fri, 14 Jan 2011 14:29:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0EETgoB090859; Fri, 14 Jan 2011 14:29:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0EETgeh090857; Fri, 14 Jan 2011 14:29:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101141429.p0EETgeh090857@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 14 Jan 2011 14:29:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217404 - user/nwhitehorn/bsdinstall/partedit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jan 2011 14:29:43 -0000 Author: nwhitehorn Date: Fri Jan 14 14:29:42 2011 New Revision: 217404 URL: http://svn.freebsd.org/changeset/base/217404 Log: Clarify some behavior with a comment. Modified: user/nwhitehorn/bsdinstall/partedit/part_wizard.c Modified: user/nwhitehorn/bsdinstall/partedit/part_wizard.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/part_wizard.c Fri Jan 14 14:20:54 2011 (r217403) +++ user/nwhitehorn/bsdinstall/partedit/part_wizard.c Fri Jan 14 14:29:42 2011 (r217404) @@ -202,7 +202,8 @@ query: struct gmesh submesh; geom_gettree(&submesh); gpart_create(provider_for_name(&submesh, disk), - "freebsd", NULL, NULL, &retval, choice); + "freebsd", NULL, NULL, &retval, + choice /* Non-interactive for "Entire Disk" */); geom_deletetree(&submesh); } else { retval = strdup(disk); From owner-svn-src-user@FreeBSD.ORG Fri Jan 14 14:35:23 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69386106566B; Fri, 14 Jan 2011 14:35:23 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58E578FC22; Fri, 14 Jan 2011 14:35:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0EEZNaZ091038; Fri, 14 Jan 2011 14:35:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0EEZN83091036; Fri, 14 Jan 2011 14:35:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101141435.p0EEZN83091036@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 14 Jan 2011 14:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217405 - user/nwhitehorn/bsdinstall/release X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jan 2011 14:35:23 -0000 Author: nwhitehorn Date: Fri Jan 14 14:35:23 2011 New Revision: 217405 URL: http://svn.freebsd.org/changeset/base/217405 Log: Update to new install disk layout. Modified: user/nwhitehorn/bsdinstall/release/testsystem.sh Modified: user/nwhitehorn/bsdinstall/release/testsystem.sh ============================================================================== --- user/nwhitehorn/bsdinstall/release/testsystem.sh Fri Jan 14 14:29:42 2011 (r217404) +++ user/nwhitehorn/bsdinstall/release/testsystem.sh Fri Jan 14 14:35:23 2011 (r217405) @@ -33,12 +33,13 @@ tar cvzf $2/world.tgz . # Make system cd /usr/src make installkernel distribution DESTDIR=$1 -mkdir $1/var/dist -cp $2/kernel.tgz $2/world.tgz $2/distribution.tgz $1/var/dist +mkdir $1/usr/bsdinstall-dist +cp $2/kernel.tgz $2/world.tgz $2/distribution.tgz $1/usr/bsdinstall-dist # Things for the CD environment ln -s /tmp/bsdinstall_etc/resolv.conf $1/etc/resolv.conf echo kernel_options=\"-C\" > $1/boot/loader.conf echo sendmail_enable=\"NONE\" > $1/etc/rc.conf +cp rc.local $1/etc #mkisoimages.sh -b FreeBSD_Install $3 $1 From owner-svn-src-user@FreeBSD.ORG Fri Jan 14 15:10:22 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2069F106567A; Fri, 14 Jan 2011 15:10:22 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9B4A8FC1F; Fri, 14 Jan 2011 15:10:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0EFALGv091899; Fri, 14 Jan 2011 15:10:21 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0EFALt7091895; Fri, 14 Jan 2011 15:10:21 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101141510.p0EFALt7091895@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 14 Jan 2011 15:10:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217406 - in user/nwhitehorn/bsdinstall: . release X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jan 2011 15:10:22 -0000 Author: nwhitehorn Date: Fri Jan 14 15:10:21 2011 New Revision: 217406 URL: http://svn.freebsd.org/changeset/base/217406 Log: Make install CD stuff actually work automatically and update documentation. Modified: user/nwhitehorn/bsdinstall/NOTES user/nwhitehorn/bsdinstall/release/rc.local user/nwhitehorn/bsdinstall/release/testsystem.sh Modified: user/nwhitehorn/bsdinstall/NOTES ============================================================================== --- user/nwhitehorn/bsdinstall/NOTES Fri Jan 14 14:35:23 2011 (r217405) +++ user/nwhitehorn/bsdinstall/NOTES Fri Jan 14 15:10:21 2011 (r217406) @@ -14,8 +14,9 @@ Environment variables affecting modules: are mounted here and files installed to this path. Install CD environment: -- Distfiles in /var/dist +- Distfiles in /usr/bsdinstall-dist - tmpmfs and varmfs turn on automatically due to read-only media -- /etc/resolv.conf symlink to /tmp/etc/resolv.conf (propagates to new system) -- /boot/loader.conf set to run installer +- /etc/resolv.conf symlink to /tmp/bsdinstall_etc/resolv.conf + (propagates to new system) +- rc.local script to run installer Modified: user/nwhitehorn/bsdinstall/release/rc.local ============================================================================== --- user/nwhitehorn/bsdinstall/release/rc.local Fri Jan 14 14:35:23 2011 (r217405) +++ user/nwhitehorn/bsdinstall/release/rc.local Fri Jan 14 15:10:21 2011 (r217406) @@ -9,7 +9,7 @@ TERM=xterm; export TERM # XXX: serial consoles -cdialog --backtitle "FreeBSD Installer" --title "Welcome" --extra-button --extra-label "Shell" --ok-label "Install" --cancel-label "Live CD" --yesno "Welcome to FreeBSD! Would you like to begin an installation or use the live CD?" 0 0 +dialog --backtitle "FreeBSD Installer" --title "Welcome" --extra-button --extra-label "Shell" --ok-label "Install" --cancel-label "Live CD" --yesno "Welcome to FreeBSD! Would you like to begin an installation or use the live CD?" 0 0 case $? in $DIALOG_OK) # Install Modified: user/nwhitehorn/bsdinstall/release/testsystem.sh ============================================================================== --- user/nwhitehorn/bsdinstall/release/testsystem.sh Fri Jan 14 14:35:23 2011 (r217405) +++ user/nwhitehorn/bsdinstall/release/testsystem.sh Fri Jan 14 15:10:21 2011 (r217406) @@ -2,6 +2,8 @@ # testsystem.sh +BSDINSTALL=`pwd`/.. + mkdir $2 # Kernel package @@ -40,6 +42,10 @@ cp $2/kernel.tgz $2/world.tgz $2/distrib ln -s /tmp/bsdinstall_etc/resolv.conf $1/etc/resolv.conf echo kernel_options=\"-C\" > $1/boot/loader.conf echo sendmail_enable=\"NONE\" > $1/etc/rc.conf -cp rc.local $1/etc -#mkisoimages.sh -b FreeBSD_Install $3 $1 +cd $BSDINSTALL +cp release/rc.local $1/etc +mkdir $1/usr/libexec/bsdinstall +make install DESTDIR=$1 + +sh /usr/src/release/i386/mkisoimages.sh -b FreeBSD_Install $3 $1 From owner-svn-src-user@FreeBSD.ORG Fri Jan 14 15:15:34 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 393BC106567A; Fri, 14 Jan 2011 15:15:34 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 28AE68FC14; Fri, 14 Jan 2011 15:15:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0EFFYWb092050; Fri, 14 Jan 2011 15:15:34 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0EFFYYD092048; Fri, 14 Jan 2011 15:15:34 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101141515.p0EFFYYD092048@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 14 Jan 2011 15:15:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217407 - user/nwhitehorn/bsdinstall/partedit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jan 2011 15:15:34 -0000 Author: nwhitehorn Date: Fri Jan 14 15:15:33 2011 New Revision: 217407 URL: http://svn.freebsd.org/changeset/base/217407 Log: Fix spelling error. Modified: user/nwhitehorn/bsdinstall/partedit/partedit.c Modified: user/nwhitehorn/bsdinstall/partedit/partedit.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/partedit.c Fri Jan 14 15:10:21 2011 (r217406) +++ user/nwhitehorn/bsdinstall/partedit/partedit.c Fri Jan 14 15:15:33 2011 (r217407) @@ -44,7 +44,7 @@ main(void) { dialog_vars.no_label = "Manual"; op = dialog_yesno("Partitioning", "Would you like to use the guided " "partitioning tool (recommended for beginners) or to set up " - "partitions manual (experts)?", 0, 0); + "partitions manually (experts)?", 0, 0); dialog_vars.yes_label = NULL; dialog_vars.no_label = NULL; if (op == 0) /* Guided */ From owner-svn-src-user@FreeBSD.ORG Fri Jan 14 16:13:09 2011 Return-Path: Delivered-To: svn-src-user@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86BD31065695; Fri, 14 Jan 2011 16:13:09 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 489208FC17; Fri, 14 Jan 2011 16:13:09 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id p0EG5EmG099714; Fri, 14 Jan 2011 09:05:14 -0700 (MST) (envelope-from imp@bsdimp.com) Message-ID: <4D30743A.2000303@bsdimp.com> Date: Fri, 14 Jan 2011 09:05:14 -0700 From: Warner Losh User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Thunderbird/3.1.6 MIME-Version: 1.0 To: Bruce Cran References: <201101140531.p0E5VpGe076058@svn.freebsd.org> <20110114082146.00000247@unknown> In-Reply-To: <20110114082146.00000247@unknown> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, Nathan Whitehorn , svn-src-user@FreeBSD.org Subject: Re: svn commit: r217390 - user/nwhitehorn/bsdinstall/partedit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jan 2011 16:13:09 -0000 On 01/14/2011 01:21, Bruce Cran wrote: > On Fri, 14 Jan 2011 05:31:51 +0000 (UTC) > Nathan Whitehorn wrote: > >> Add a guided partitioning wizard as a replacement for sysinstall's >> "Auto Defaults" button. On x86, this uses GPT by default for new >> disks. > I don't know how many people dual boot but Windows 7 can't boot from GPT > from a non-EFI BIOS so it might make sense to default to using the MBR > scheme. What do the pc-bsd guys do? PC-BSD can dual boot windows and FreeBSD and it has supported GPT for years. I'm sure that knowledge is codified inside of pc-sysinstall. Warner From owner-svn-src-user@FreeBSD.ORG Sat Jan 15 03:06:04 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E3DF106566B; Sat, 15 Jan 2011 03:06:04 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D3638FC16; Sat, 15 Jan 2011 03:06:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0F3642s011122; Sat, 15 Jan 2011 03:06:04 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0F363fu011118; Sat, 15 Jan 2011 03:06:03 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101150306.p0F363fu011118@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 15 Jan 2011 03:06:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217438 - in user/nwhitehorn/bsdinstall: partedit scripts X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jan 2011 03:06:04 -0000 Author: nwhitehorn Date: Sat Jan 15 03:06:03 2011 New Revision: 217438 URL: http://svn.freebsd.org/changeset/base/217438 Log: Add the ability to escape to a shell and set up partitions entirely by hand. Also add rudimentary ability to use partedit as a replacement for sade. Modified: user/nwhitehorn/bsdinstall/partedit/Makefile user/nwhitehorn/bsdinstall/partedit/partedit.c user/nwhitehorn/bsdinstall/scripts/auto Modified: user/nwhitehorn/bsdinstall/partedit/Makefile ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/Makefile Sat Jan 15 01:03:26 2011 (r217437) +++ user/nwhitehorn/bsdinstall/partedit/Makefile Sat Jan 15 03:06:03 2011 (r217438) @@ -2,6 +2,7 @@ BINDIR= /usr/libexec/bsdinstall PROG= partedit +LINKS= ${BINDIR}/partedit ${BINDIR}/autopart LDADD= -lgeom -lncursesw -lutil -ldialog -lm PARTEDIT_ARCH= ${MACHINE} Modified: user/nwhitehorn/bsdinstall/partedit/partedit.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/partedit.c Sat Jan 15 01:03:26 2011 (r217437) +++ user/nwhitehorn/bsdinstall/partedit/partedit.c Sat Jan 15 03:06:03 2011 (r217438) @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -22,7 +23,7 @@ static void get_mount_points(struct part static int validate_setup(void); int -main(void) { +main(int argc, const char **argv) { struct partition_metadata *md; struct partedit_item *items; struct gmesh mesh; @@ -34,20 +35,12 @@ main(void) { init_fstab_metadata(); init_dialog(stdin, stdout); - dialog_vars.backtitle = __DECONST(char *, "FreeBSD Installer"); + if (strcmp(basename(argv[0]), "sade") != 0) + dialog_vars.backtitle = __DECONST(char *, "FreeBSD Installer"); dialog_vars.item_help = TRUE; nscroll = i = 0; - /* Ask about guided vs. manual partitioning */ - dlg_put_backtitle(); - dialog_vars.yes_label = "Guided"; - dialog_vars.no_label = "Manual"; - op = dialog_yesno("Partitioning", "Would you like to use the guided " - "partitioning tool (recommended for beginners) or to set up " - "partitions manually (experts)?", 0, 0); - dialog_vars.yes_label = NULL; - dialog_vars.no_label = NULL; - if (op == 0) /* Guided */ + if (strcmp(basename(argv[0]), "autopart") == 0) /* Guided */ part_wizard(); /* Show the part editor either immediately, or to confirm wizard */ Modified: user/nwhitehorn/bsdinstall/scripts/auto ============================================================================== --- user/nwhitehorn/bsdinstall/scripts/auto Sat Jan 15 01:03:26 2011 (r217437) +++ user/nwhitehorn/bsdinstall/scripts/auto Sat Jan 15 03:06:03 2011 (r217438) @@ -38,8 +38,29 @@ if [ ! -z "$FETCH_DISTRIBUTIONS" ]; then fi rm $PATH_FSTAB -bsdinstall partedit || error -bsdinstall mount || error + +dialog --backtitle "FreeBSD Installer" --title "Partitioning" --extra-button \ + --extra-label "Manual" --ok-label "Guided" --cancel-label "Shell" \ + --yesno "Would you like to use the guided partitioning tool (recommended for beginners) or to set up partitions manually (experts)? You can also open a shell and set up partitions entirely by hand." 0 0 + +case $? in +0) # Guided + bsdinstall autopart || error + bsdinstall mount || error + ;; +1) # Shell + clear + echo "Use this shell to set up partitions for the new system. When finished, mount the system at $BSDINSTALL_CHROOT and place an fstab file for the new system at $PATH_FSTAB. Then type 'exit'. You can also enter the partition editor at any time by entering 'bsdinstall partedit'." + sh + ;; +3) # Manual + bsdinstall partedit || error + bsdinstall mount || error + ;; +*) + error + ;; +esac if [ ! -z $FETCH_DISTRIBUTIONS ]; then ALL_DISTRIBUTIONS=$DISTRIBUTIONS From owner-svn-src-user@FreeBSD.ORG Sat Jan 15 20:37:57 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A14F106566B; Sat, 15 Jan 2011 20:37:57 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F2EB8FC08; Sat, 15 Jan 2011 20:37:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0FKbu07036790; Sat, 15 Jan 2011 20:37:56 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0FKbucu036788; Sat, 15 Jan 2011 20:37:56 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201101152037.p0FKbucu036788@svn.freebsd.org> From: Doug Barton Date: Sat, 15 Jan 2011 20:37:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217460 - user/dougb/portmaster X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jan 2011 20:37:57 -0000 Author: dougb Date: Sat Jan 15 20:37:56 2011 New Revision: 217460 URL: http://svn.freebsd.org/changeset/base/217460 Log: Fix formatting of get_answer_yn() messages forgotten in the move to let the generic version handle the user input. This will be released as ports version 3.6.1 Modified: user/dougb/portmaster/portmaster Modified: user/dougb/portmaster/portmaster ============================================================================== --- user/dougb/portmaster/portmaster Sat Jan 15 20:18:08 2011 (r217459) +++ user/dougb/portmaster/portmaster Sat Jan 15 20:37:56 2011 (r217460) @@ -977,7 +977,7 @@ IFS=' echo " ===>>> but there is no installed version" echo '' if [ -n "$CHECK_DEPENDS" ]; then - get_answer_yn n Delete this dependency data + get_answer_yn n " ===>>> Delete this dependency data" case "$?" in 0) unset prev_line line ; continue ;; esac else echo " ===>>> Try ${0##*/} --check-depends" @@ -1243,7 +1243,7 @@ if [ -n "$CLEAN_DISTFILES" ]; then for df in `find $DISTDIR -type f | sort`; do f=${df#$DISTDIR} if ! grep -ql $f $DI_FILES; then - get_answer_yn n Delete stale file: ${f} + get_answer_yn n " ===>>> Delete stale file: ${f}" case "$?" in 0) echo " Deleting $f" ; echo '' pm_unlink $df ;; @@ -1286,7 +1286,7 @@ if [ -n "$CLEAN_PACKAGES" ]; then if [ -z "$PM_YES" ]; then if [ ! -d "${pdb}/${pkg_dir}" ]; then echo " ===>>> $pkg_dir is not installed" - get_answer_yn y Delete stale package: ${package##*/} + get_answer_yn y " ===>>> Delete stale package: ${package##*/}" case "$?" in 0) echo " ===>>> Deleting $package" pm_unlink_s $package ;; @@ -1311,7 +1311,7 @@ if [ -n "$CLEAN_PACKAGES" ]; then echo " ===>>> Path: ${package}" - get_answer_yn n Delete stale package: ${package##*/} + get_answer_yn n " ===>>> Delete stale package: ${package##*/}" case "$?" in 0) echo " ===>>> Deleting $package" pm_unlink_s $package ;; @@ -1433,7 +1433,7 @@ if [ -n "$CHECK_PORT_DBDIR" ]; then *:${dbdir}:*) pm_v "Ok" ;; *) pm_v echo " ===>>> $dbdir does not seem to be installed" - get_answer_yn n Delete ${dir} + get_answer_yn n " ===>>> Delete ${dir}" case "$?" in 0) pm_rm_s -rf $dir ;; esac echo '' ;; esac @@ -1978,7 +1978,7 @@ if [ -n "$EXPUNGE" ]; then dep=${dep%/+CON*} ; echo " ${dep##*/}" done echo '' - get_answer_yn n Delete this dependency data + get_answer_yn n " ===>>> Delete this dependency data" case "$?" in 0) for f in $deplist; do update_contents delete $f $origin @@ -2022,7 +2022,7 @@ if [ -n "$CLEAN_STALE" ]; then pkg_info $iport - get_answer_yn n ${iport} is no longer depended on, delete + get_answer_yn n " ===>>> ${iport} is no longer depended on, delete" case "$?" in 0) [ -n "$BACKUP" ] && { init_packages ; pm_pkg_create $pbu $iport; } [ -z "$DONT_SCRUB_DISTFILES" ] && { delete_all_distfiles $origin; delete_dist_list; } @@ -2031,7 +2031,7 @@ if [ -n "$CLEAN_STALE" ]; then pm_pkg_delete_s -f $iport || fail 'pkg_delete failed' exec $0 -s $ARGS ;; - *) get_answer_yn y Delete this dependency data + *) get_answer_yn n " ===>>> Delete this dependency data" case "$?" in 0) pm_unlink_s $file ;; *) no_del_list="${no_del_list}${iport}:" ;;