From owner-svn-src-user@FreeBSD.ORG Sun Jun 1 20:08:38 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DAF42588; Sun, 1 Jun 2014 20:08:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA09A2C46; Sun, 1 Jun 2014 20:08:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s51K8coS051830; Sun, 1 Jun 2014 20:08:38 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s51K8bvD051826; Sun, 1 Jun 2014 20:08:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201406012008.s51K8bvD051826@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 1 Jun 2014 20:08:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r266954 - user/nwhitehorn/bsdinstall_zfspartedit/partedit X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18 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, 01 Jun 2014 20:08:38 -0000 Author: nwhitehorn Date: Sun Jun 1 20:08:37 2014 New Revision: 266954 URL: http://svnweb.freebsd.org/changeset/base/266954 Log: Diff reduction to HEAD: cut this down just to ZFS-related bits. Modified: user/nwhitehorn/bsdinstall_zfspartedit/partedit/gpart_ops.c user/nwhitehorn/bsdinstall_zfspartedit/partedit/part_wizard.c user/nwhitehorn/bsdinstall_zfspartedit/partedit/partedit.c Modified: user/nwhitehorn/bsdinstall_zfspartedit/partedit/gpart_ops.c ============================================================================== --- user/nwhitehorn/bsdinstall_zfspartedit/partedit/gpart_ops.c Sun Jun 1 18:52:21 2014 (r266953) +++ user/nwhitehorn/bsdinstall_zfspartedit/partedit/gpart_ops.c Sun Jun 1 20:08:37 2014 (r266954) @@ -399,11 +399,7 @@ gpart_partcode(struct gprovider *pp, con /* Shell out to gpart for partcode for now */ sprintf(command, "gpart bootcode -p %s -i %s %s", partcode_path(scheme, fstype), indexstr, pp->lg_geom->lg_name); - sprintf(message, "(echo %s; %s) >>%s 2>>%s", - command, command, getenv("BSDINSTALL_LOG"), - getenv("BSDINSTALL_LOG")); - - if (system(message) != 0) { + if (system(command) != 0) { sprintf(message, "Error installing partcode on partition %s", pp->lg_name); dialog_msgbox("Error", message, 0, 0, TRUE); @@ -623,7 +619,7 @@ set_default_part_metadata(const char *na if (newfs != NULL && newfs[0] != '\0') { md->newfs = malloc(strlen(newfs) + strlen(" /dev/") + - strlen(name) + strlen(".nop") + 1); + strlen(name) + 1); sprintf(md->newfs, "%s /dev/%s", newfs, name); } } @@ -1031,11 +1027,6 @@ addpartform: snprintf(sizestr, sizeof(sizestr), "%jd", bootpart_size(scheme) / sector); gctl_ro_param(r, "size", -1, sizestr); -#if 0 -// XXX I don't understand the following part of the patch -+ if (34 == firstfree) -+ firstfree += 30+64; /* round to 64K boundary */ -#endif snprintf(startstr, sizeof(startstr), "%jd", firstfree); gctl_ro_param(r, "start", -1, startstr); gctl_rw_param(r, "output", sizeof(output), output); Modified: user/nwhitehorn/bsdinstall_zfspartedit/partedit/part_wizard.c ============================================================================== --- user/nwhitehorn/bsdinstall_zfspartedit/partedit/part_wizard.c Sun Jun 1 18:52:21 2014 (r266953) +++ user/nwhitehorn/bsdinstall_zfspartedit/partedit/part_wizard.c Sun Jun 1 20:08:37 2014 (r266954) @@ -45,21 +45,18 @@ static char *boot_disk(struct gmesh *mesh); static char *wizard_partition(struct gmesh *mesh, const char *disk); -static intmax_t calc_swapsize(void); int part_wizard(const char *fsreq) { int error; struct gmesh mesh; - char *disk, *schemeroot, *fstype; - char *fstypes[] = {"ufs", "zfs"}; + char *disk, *schemeroot; + const char *fstype; - if (fsreq != NULL && strcmp(fsreq, "zfs") == 0) { - fstype = fstypes[1]; - } else { - /* default to UFS */ - fstype = fstypes[0]; - } + if (fsreq != NULL) + fstype = fsreq; + else + fstype = "ufs"; startwizard: error = geom_gettree(&mesh); @@ -293,30 +290,6 @@ query: return (retval); } -intmax_t -calc_swapsize(void) -{ - size_t physmem; - size_t physmemlen = sizeof(physmem); - intmax_t swapsize; - - sysctlbyname("hw.physmem", &physmem, &physmemlen, NULL, 0); - fprintf(stderr, "system physmem = %ld\n", physmem); - swapsize = physmem; - if (physmem > 1024 * 1024 * 1024) { - swapsize += 1024LL * 1024 * 1024 + 1024LL * 1024; - fprintf(stderr, "swapsize before rounding = %ld\n", swapsize); - swapsize = swapsize & 0xFFFFFFFFC0000000LL; // GB - } else { - swapsize += 2LL * 1024 * 1024; - fprintf(stderr, "swapsize before rounding = %ld\n", swapsize); - swapsize = swapsize & 0xFFFFFFFFFFF00000LL; // MB - } - fprintf(stderr, "rounded swapsize = %ld\n", swapsize); - - return swapsize; -} - int wizard_makeparts(struct gmesh *mesh, const char *disk, const char *fstype, int interactive) { @@ -367,7 +340,7 @@ wizard_makeparts(struct gmesh *mesh, con return (!retval); /* Editor -> return 0 */ } - swapsize = calc_swapsize(); + swapsize = SWAP_SIZE(available); humanize_number(swapsizestr, 7, swapsize, "B", HN_AUTOSCALE, HN_NOSPACE | HN_DECIMAL); humanize_number(rootsizestr, 7, available - swapsize - 1024*1024, Modified: user/nwhitehorn/bsdinstall_zfspartedit/partedit/partedit.c ============================================================================== --- user/nwhitehorn/bsdinstall_zfspartedit/partedit/partedit.c Sun Jun 1 18:52:21 2014 (r266953) +++ user/nwhitehorn/bsdinstall_zfspartedit/partedit/partedit.c Sun Jun 1 20:08:37 2014 (r266954) @@ -95,7 +95,8 @@ main(int argc, const char **argv) if (strcmp(basename(argv[0]), "autopart") == 0) { /* Guided */ prompt = "Please review the disk setup. When complete, press " "the Finish button."; - if (argc > 1 && strcmp(basename(argv[1]), "zfs") == 0) { + /* Experimental ZFS autopartition support */ + if (argc > 1 && strcmp(argv[1], "zfs") == 0) { part_wizard("zfs"); } else { part_wizard("ufs"); @@ -166,7 +167,7 @@ main(int argc, const char **argv) init_fstab_metadata(); break; case 4: /* Auto */ - part_wizard("zfs"); + part_wizard("ufs"); break; }