From owner-svn-src-all@freebsd.org Mon Sep 5 08:42:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E41E0A9D76E; Mon, 5 Sep 2016 08:42:37 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 9D297E6B; Mon, 5 Sep 2016 08:42:37 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u858gaAO093191; Mon, 5 Sep 2016 08:42:36 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u858galT093190; Mon, 5 Sep 2016 08:42:36 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201609050842.u858galT093190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Mon, 5 Sep 2016 08:42:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305415 - head/usr.sbin/bsdinstall/partedit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Sep 2016 08:42:38 -0000 Author: wma Date: Mon Sep 5 08:42:36 2016 New Revision: 305415 URL: https://svnweb.freebsd.org/changeset/base/305415 Log: bsdinstall: add warning when unsupported partition is modified Right now is possible to modify bootable partition type to non-bootable type without getting warning from partedit. Example: if you auto parition drive for arm64, you will get freebsd-ufs as bootable partition; now you are able to change bootable partition type to freebsd-zfs; there will be no warning and the system will install but will not be bootable afterwards. After this fix, partedit will issue the same warning it does when user attempts to create bootable partition of not supported type, notyfing a user about incoming problem and allowing to think the decision over before commiting the schema. This has been tested on amd64 and arm64. Obtained from: Semihalf Submitted by: Dominik Ermel Sponsored by: Cavium Reviewed by: nwhitehorn Differential Revision: https://reviews.freebsd.org/D6879 Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/gpart_ops.c Mon Sep 5 08:27:04 2016 (r305414) +++ head/usr.sbin/bsdinstall/partedit/gpart_ops.c Mon Sep 5 08:42:36 2016 (r305415) @@ -617,6 +617,20 @@ editpart: if (choice) /* Cancel pressed */ goto endedit; + /* If this is the root partition, check that this fs is bootable */ + if (strcmp(items[2].text, "/") == 0 && !is_fs_bootable(scheme, + items[0].text)) { + char message[512]; + sprintf(message, "This file system (%s) is not bootable " + "on this system. Are you sure you want to proceed?", + items[0].text); + dialog_vars.defaultno = TRUE; + choice = dialog_yesno("Warning", message, 0, 0); + dialog_vars.defaultno = FALSE; + if (choice == 1) /* cancel */ + goto editpart; + } + /* Check if the label has a / in it */ if (strchr(items[3].text, '/') != NULL) { dialog_msgbox("Error", "Label contains a /, which is not an "