From owner-freebsd-bugs Tue Jul 16 7:20:13 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3E32337B400 for ; Tue, 16 Jul 2002 07:20:03 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5ED5F43E6A for ; Tue, 16 Jul 2002 07:20:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g6GEK2JU003777 for ; Tue, 16 Jul 2002 07:20:02 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g6GEK2TA003776; Tue, 16 Jul 2002 07:20:02 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F1AD237B400 for ; Tue, 16 Jul 2002 07:12:50 -0700 (PDT) Received: from smtp.www-service.de (smtp.www-service.de [212.77.161.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id DCEAF43E31 for ; Tue, 16 Jul 2002 07:12:49 -0700 (PDT) (envelope-from thz@Lennartz-electronic.de) Received: from swd2.tue.le (pD95033C1.dip.t-dialin.net [217.80.51.193]) by smtp.www-service.de (8.11.6/8.11.6) with ESMTP id g6GFVrX20483 for ; Tue, 16 Jul 2002 17:31:53 +0200 Received: from mezcal.tue.le (mezcal.tue.le [192.168.201.20]) by swd2.tue.le (8.12.3/8.12.3) with ESMTP id g6GECdD0049749 for ; Tue, 16 Jul 2002 16:12:39 +0200 (CEST) (envelope-from thz@mezcal.tue.le) Received: from mezcal.tue.le (localhost [127.0.0.1]) by mezcal.tue.le (8.12.3/8.12.3) with ESMTP id g6GECdUM072884 for ; Tue, 16 Jul 2002 16:12:39 +0200 (CEST) (envelope-from thz@mezcal.tue.le) Received: (from thz@localhost) by mezcal.tue.le (8.12.3/8.12.3/Submit) id g6GECcss072883; Tue, 16 Jul 2002 16:12:38 +0200 (CEST) (envelope-from thz) Message-Id: <200207161412.g6GECcss072883@mezcal.tue.le> Date: Tue, 16 Jul 2002 16:12:38 +0200 (CEST) From: Thomas Zenker Reply-To: Thomas Zenker To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/40656: patch: sysinstall: scripted deletion of slices Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 40656 >Category: bin >Synopsis: patch: sysinstall: scripted deletion of slices >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Jul 16 07:20:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Thomas Zenker >Release: FreeBSD 4.6-RELEASE i386 >Organization: >Environment: System: FreeBSD mezcal.tue.le 4.6-RELEASE FreeBSD 4.6-RELEASE #8: Mon Jun 10 11:22:51 CEST 2002 thz@mezcal.tue.le:/usr/obj/usr/src/sys/MEZCAL i386 all versions of sysinstall >Description: for automated installations it is often necessary to delete the previously existing fdisk partitions (slices) from the script, otherwise the results are not as expected. >How-To-Repeat: a previously fdisk partitioned disk prevents successfull re-partitioning of a disk. >Fix: introduce a new variable for sysinstall "deletePartition". For the moment it is only possible to give a argument of "all", which means to delete all slices. For deleting of a specific slice, it would be necessary to figure out how to a access it. The patch applies to current and stable. Man page update included. Index: usr.sbin/sysinstall/disks.c =================================================================== RCS file: /usr/cvs/FreeBSD/src/usr.sbin/sysinstall/disks.c,v retrieving revision 1.132 diff -u -r1.132 disks.c --- usr.sbin/sysinstall/disks.c 31 May 2002 17:03:01 -0000 1.132 +++ usr.sbin/sysinstall/disks.c 16 Jul 2002 13:12:09 -0000 @@ -869,6 +869,16 @@ d->bios_sect = strtol(cp + 1, 0, 0); } + cp = variable_get(VAR_DELPARTITION); + if (cp) { + if (strcmp(cp, "all") == 0) { + for (i = 0; chunk_info[i]; i++) + Delete_Chunk(d, chunk_info[i]); + variable_unset(VAR_DELPARTITION); + record_chunks(d); + } + } + cp = variable_get(VAR_PARTITION); if (cp) { if (!strcmp(cp, "free")) { Index: usr.sbin/sysinstall/sysinstall.h =================================================================== RCS file: /usr/cvs/FreeBSD/src/usr.sbin/sysinstall/sysinstall.h,v retrieving revision 1.228 diff -u -r1.228 sysinstall.h --- usr.sbin/sysinstall/sysinstall.h 1 Jun 2002 14:50:14 -0000 1.228 +++ usr.sbin/sysinstall/sysinstall.h 16 Jul 2002 13:12:09 -0000 @@ -91,6 +91,7 @@ #define VAR_BROWSER_PACKAGE "browserPackage" #define VAR_CPIO_VERBOSITY "cpioVerbose" #define VAR_DEBUG "debug" +#define VAR_DELPARTITION "deletePartition" #define VAR_DESKSTYLE "_deskStyle" #define VAR_DISK "disk" #define VAR_DISKINTERACTIVE "diskInteractive" Index: usr.sbin/sysinstall/sysinstall.8 =================================================================== RCS file: /usr/cvs/FreeBSD/src/usr.sbin/sysinstall/sysinstall.8,v retrieving revision 1.53 diff -u -r1.53 sysinstall.8 --- usr.sbin/sysinstall/sysinstall.8 14 Jul 2002 14:46:26 -0000 1.53 +++ usr.sbin/sysinstall/sysinstall.8 16 Jul 2002 13:12:09 -0000 @@ -287,6 +287,11 @@ Default: none. .It diskInteractive If set, bring up the interactive disk partition editor. +.It deletePartition +can be set to +.Ar all +to delete all previously existing partitions. +Default: nothing deleted. .El .Pp Note: Nothing is actually written to disk by this function, a explicit call to >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message