From owner-cvs-src@FreeBSD.ORG Tue Jun 5 22:17:21 2007 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B53B116A59F; Tue, 5 Jun 2007 22:17:21 +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 B8A7013C447; Tue, 5 Jun 2007 22:17:20 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.13.8/8.13.4) with ESMTP id l55MEKvC048412; Tue, 5 Jun 2007 16:14:23 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Tue, 05 Jun 2007 16:14:42 -0600 (MDT) Message-Id: <20070605.161442.1723940823.imp@bsdimp.com> To: ceri@submonkey.net From: "M. Warner Losh" In-Reply-To: <20070605190601.GC1834@submonkey.net> References: <200706050544.l555ifKp014690@repoman.freebsd.org> <20070605190601.GC1834@submonkey.net> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Tue, 05 Jun 2007 16:14:23 -0600 (MDT) Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, delphij@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.sbin/sysinstall installUpgrade.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2007 22:17:21 -0000 In message: <20070605190601.GC1834@submonkey.net> Ceri Davies writes: : On Tue, Jun 05, 2007 at 05:44:41AM +0000, Xin LI wrote: : > delphij 2007-06-05 05:44:41 UTC : > : > FreeBSD src repository : > : > Modified files: : > usr.sbin/sysinstall installUpgrade.c : > Log: : > Write to slice name instead of directly to the disk device. : > This fixes writing boot code upon upgrade. : : > | @@ -363,7 +363,7 @@ media: : > | } : > | : > | if (extractingBin) : > | - vsystem("disklabel -B `awk '$2~/\\/$/ {print substr($1, 6, 3)}' /etc/fstab`"); : > | + vsystem("disklabel -B `awk '$2~/\\/$/ {print substr($1, 6, 5)}' /etc/fstab`"); : > | msgNotify("First stage of upgrade completed successfully!\n\n" : > | "Next comes stage 2, where we attempt to resurrect your /etc\n" : > | "directory!"); : : Well it doesn't fix anything actually; what if my root partition is ad12s2a ? : (which is not contrived; it is). : : We actually need something more like: : : vsystem("disklabel -B `awk \ : '$1~/\\dev\\/(aacd|ad|afd|amrd|ar|da|idad|ipsd|mfid|mlxd|twed)/ && \ : $2~/\\/$/ {print substr($1, 1, index($1, \"s\") - 1)}' /etc/fstab`"); : : where the regex is built from every device name in device_names (which : even then doesn't cater for GEOM where devices might be called : anything). This is something that would require a build tool, which is : why I haven't done it yet. "mmcsd" is also a disk. Warner