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