From n-kogane@syd.odn.ne.jp  Tue Dec  5 14:28:15 2006
Return-Path: <n-kogane@syd.odn.ne.jp>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id B25AD16A416
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  5 Dec 2006 14:28:15 +0000 (UTC)
	(envelope-from n-kogane@syd.odn.ne.jp)
Received: from cmta101.odn.ne.jp (mta101.odn.ne.jp [143.90.14.133])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 9280B43CA2
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  5 Dec 2006 14:27:35 +0000 (GMT)
	(envelope-from n-kogane@syd.odn.ne.jp)
Received: from vmta101.odn.ne.jp by cmta101.odn.ne.jp with ESMTP
          id <20061205142812673.IJAV.10260.cmta101.odn.ne.jp@mta101.odn.ne.jp>
          for <FreeBSD-gnats-submit@freebsd.org>;
          Tue, 5 Dec 2006 23:28:12 +0900
Received: from emta101.odn.ne.jp by vmta101.odn.ne.jp with ESMTP
          id <20061205142812627.BXXA.12721.vmta101.odn.ne.jp@mta101.odn.ne.jp>
          for <FreeBSD-gnats-submit@freebsd.org>;
          Tue, 5 Dec 2006 23:28:12 +0900
Received: from kcesx30.koganemaru.co.jp ([210.252.255.63] [210.252.255.63])
          by emta101.odn.ne.jp with ESMTP
          id <20061205142812534.VGGV.2510.emta101.odn.ne.jp@mta101.odn.ne.jp>
          for <FreeBSD-gnats-submit@freebsd.org>;
          Tue, 5 Dec 2006 23:28:12 +0900
Received: by kcesx30.koganemaru.co.jp (Postfix, from userid 100)
	id DD55E2843D; Tue,  5 Dec 2006 23:27:53 +0900 (JST)
Message-Id: <20061205142753.DD55E2843D@kcesx30.koganemaru.co.jp>
Date: Tue,  5 Dec 2006 23:27:53 +0900 (JST)
From: n-kogane@syd.odn.ne.jp
Reply-To: n-kogane@syd.odn.ne.jp
To: FreeBSD-gnats-submit@freebsd.org
Subject: can't upgrade install if /boot/kernel.prev exit
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         106376
>Category:       bin
>Synopsis:       [sysinstall] [patch] can't upgrade install if /boot/kernel.prev exists
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    ceri
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 05 14:30:09 GMT 2006
>Closed-Date:    Sun Jan 21 17:42:42 GMT 2007
>Last-Modified:  Sun Jan 21 17:42:42 GMT 2007
>Originator:     Nobuyuki Koganemaru
>Release:        FreeBSD 6.2-RC1 i386
>Organization:
KOGANEMARU Computer Engineering Service Corporation.
>Environment:
System: FreeBSD kcesx34.koganemaru.co.jp 6.2-RC1 FreeBSD 6.2-RC1 #0: Thu Nov 16 05:12:08 UTC 2006 root@opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386


>Description:
	The kernel of old FreeBSD was /kernel, and it was possible to move with
	"mv /kernel /kernel.prev".
	It was overwrited if /kernel.prev existed.

	Currently, /boot/kernel.prev is a directory, and when already
	/boot/kernel.prev exists, it becomes an error in
	"mv /boot/kernel /boot/kernel.prev".
	It is necessary to remove "/boot/kernel.prev" before it moves.

>How-To-Repeat:
	When /boot/kernel.prev exit,
	do upgrade install.

>Fix:
	I not tested, but perhaps ok.

--- usr.sbin/sysinstall/installUpgrade.c.orig	Tue Jul 18 07:25:29 2006
+++ usr.sbin/sysinstall/installUpgrade.c	Tue Dec  5 23:07:31 2006
@@ -301,6 +301,11 @@
 
 	if (directory_exists("/boot/kernel")) {
 	    msgNotify("Moving old kernel to /boot/kernel.prev");
+	    if (directory_exists("/boot/kernel.prev")) {
+		if (system("rm -rf /boot/kernel.prev")) {
+		    msgConfirm("Can't remove /boot/kernel.prev!");
+		}
+	    }
 	    if (system("mv /boot/kernel /boot/kernel.prev")) {
 		if (!msgYesNo("Hmmm!  I couldn't move the old kernel over!  Do you want to\n"
 			      "treat this as a big problem and abort the upgrade?  Due to the\n"


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->ceri 
Responsible-Changed-By: ru 
Responsible-Changed-When: Tue Dec 5 15:55:43 UTC 2006 
Responsible-Changed-Why:  
Ceri has been recently committing to this area, see if he's still 
interested. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106376 

From: Ceri Davies <ceri@submonkey.net>
To: n-kogane@syd.odn.ne.jp
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: misc/106376: can't upgrade install if /boot/kernel.prev exit
Date: Tue, 5 Dec 2006 16:31:00 +0000

 --2oS5YaxWCcQjTEyO
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 On Tue, Dec 05, 2006 at 11:27:53PM +0900, n-kogane@syd.odn.ne.jp wrote:
 
 > >Description:
 > 	The kernel of old FreeBSD was /kernel, and it was possible to move with
 > 	"mv /kernel /kernel.prev".
 > 	It was overwrited if /kernel.prev existed.
 >=20
 > 	Currently, /boot/kernel.prev is a directory, and when already
 > 	/boot/kernel.prev exists, it becomes an error in
 > 	"mv /boot/kernel /boot/kernel.prev".
 > 	It is necessary to remove "/boot/kernel.prev" before it moves.
 
 I don't currently see why; is /boot/kernel.prev readonly on your
 system?  Could you please post the output of "ls -ldo /boot/kernel*"?
 
 Of course, you're correct that putting the old kernel under
 /boot/kernel.prev/kernel is not strictly correct, but I don't understand
 why it would cause the upgrade to fail which is what I want to get at.
 
 Thanks,
 
 Ceri
 --=20
 That must be wonderful!  I don't understand it at all.
                                                   -- Moliere
 
 --2oS5YaxWCcQjTEyO
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.5 (FreeBSD)
 
 iD8DBQFFdZ7DocfcwTS3JF8RAnQFAJ9nS/E3OQoknJKsLR0+XTrYOUtu4wCcCxey
 WShD98WeTqH8Dy0wWv8A79k=
 =OPXd
 -----END PGP SIGNATURE-----
 
 --2oS5YaxWCcQjTEyO--

From: n-kogane@syd.odn.ne.jp (Nobuyuki Koganemaru)
To: ceri@submonkey.net
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: misc/106376: can't upgrade install if /boot/kernel.prev exit
Date: Wed,  6 Dec 2006 03:19:21 +0900 (JST)

 >From ceri@submonkey.net  Wed Dec  6 02:35:36 2006
 >Date: Tue, 5 Dec 2006 16:31:00 +0000
 >From: Ceri Davies <ceri@submonkey.net>
 >To: n-kogane@syd.odn.ne.jp
 >Cc: FreeBSD-gnats-submit@freebsd.org
 >Subject: Re: misc/106376: can't upgrade install if /boot/kernel.prev exit
 >Sender: Ceri Davies <ceri@submonkey.net>
 >
 >
 >--2oS5YaxWCcQjTEyO
 >Content-Type: text/plain; charset=us-ascii
 >Content-Disposition: inline
 >Content-Transfer-Encoding: quoted-printable
 >
 >On Tue, Dec 05, 2006 at 11:27:53PM +0900, n-kogane@syd.odn.ne.jp wrote:
 >
 >> >Description:
 >> 	The kernel of old FreeBSD was /kernel, and it was possible to move with
 >> 	"mv /kernel /kernel.prev".
 >> 	It was overwrited if /kernel.prev existed.
 >>=20
 >> 	Currently, /boot/kernel.prev is a directory, and when already
 >> 	/boot/kernel.prev exists, it becomes an error in
 >> 	"mv /boot/kernel /boot/kernel.prev".
 >> 	It is necessary to remove "/boot/kernel.prev" before it moves.
 >
 >I don't currently see why; is /boot/kernel.prev readonly on your
 >system?  Could you please post the output of "ls -ldo /boot/kernel*"?
 >
 >Of course, you're correct that putting the old kernel under
 >/boot/kernel.prev/kernel is not strictly correct, but I don't understand
 >why it would cause the upgrade to fail which is what I want to get at.
 >
 >Thanks,
 >
 >Ceri
 
 /boot/kernel and /boot/kernel.prev are both directories. 
 
 Actual kernels are in /boot/kernel/kernel and /boot/kernel.prev/kernel. 
 
 --
 KOGANEMARU Computer Engineering Service Corporation.
 	(Ohnojou-shi, Fukuoka Japan)
 	Nobuyuki Koganemaru

From: Ceri Davies <ceri@submonkey.net>
To: Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: misc/106376: can't upgrade install if /boot/kernel.prev exit
Date: Tue, 5 Dec 2006 20:00:51 +0000

 On Wed, Dec 06, 2006 at 03:19:21AM +0900, Nobuyuki Koganemaru wrote:
 > >From ceri@submonkey.net  Wed Dec  6 02:35:36 2006
 > >Date: Tue, 5 Dec 2006 16:31:00 +0000
 > >From: Ceri Davies <ceri@submonkey.net>
 > >To: n-kogane@syd.odn.ne.jp
 > >Cc: FreeBSD-gnats-submit@freebsd.org
 > >Subject: Re: misc/106376: can't upgrade install if /boot/kernel.prev exit
 > >Sender: Ceri Davies <ceri@submonkey.net>
 > >
 > >
 > >--2oS5YaxWCcQjTEyO
 > >Content-Type: text/plain; charset=us-ascii
 > >Content-Disposition: inline
 > >Content-Transfer-Encoding: quoted-printable
 > >
 > >On Tue, Dec 05, 2006 at 11:27:53PM +0900, n-kogane@syd.odn.ne.jp wrote:
 > >
 > >> >Description:
 > >> 	The kernel of old FreeBSD was /kernel, and it was possible to move with
 > >> 	"mv /kernel /kernel.prev".
 > >> 	It was overwrited if /kernel.prev existed.
 > >>=20
 > >> 	Currently, /boot/kernel.prev is a directory, and when already
 > >> 	/boot/kernel.prev exists, it becomes an error in
 > >> 	"mv /boot/kernel /boot/kernel.prev".
 > >> 	It is necessary to remove "/boot/kernel.prev" before it moves.
 > >
 > >I don't currently see why; is /boot/kernel.prev readonly on your
 > >system?  Could you please post the output of "ls -ldo /boot/kernel*"?
 > >
 > >Of course, you're correct that putting the old kernel under
 > >/boot/kernel.prev/kernel is not strictly correct, but I don't understand
 > >why it would cause the upgrade to fail which is what I want to get at.
 > >
 > >Thanks,
 > >
 > >Ceri
 > 
 > /boot/kernel and /boot/kernel.prev are both directories. 
 > 
 > Actual kernels are in /boot/kernel/kernel and /boot/kernel.prev/kernel. 
 
 Yes, of course.  Thanks.
 
 Ceri
 -- 
 That must be wonderful!  I don't understand it at all.
                                                   -- Moliere
State-Changed-From-To: open->patched 
State-Changed-By: ceri 
State-Changed-When: Mon Jan 1 17:22:30 UTC 2007 
State-Changed-Why:  
Patched in -HEAD, thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106376 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/106376: commit references a PR
Date: Mon,  1 Jan 2007 17:26:04 +0000 (UTC)

 ceri        2007-01-01 17:25:51 UTC
 
   FreeBSD src repository
 
   Modified files:
     usr.sbin/sysinstall  installUpgrade.c 
   Log:
   During an upgrade, if /boot/kernel.prev exists then the backup of
   /boot/kernel can fail.  Try to remove /boot/kernel.prev and cope the
   best we can if that fails.
   
   PR:             bin/106376
   Submitted by:   Nobuyuki Koganemaru
   Approved by:    ru
   MFC after:      2 weeks
   
   Revision  Changes    Path
   1.95      +18 -0     src/usr.sbin/sysinstall/installUpgrade.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: ceri 
State-Changed-When: Sun Jan 21 17:42:26 UTC 2007 
State-Changed-Why:  
MFC'd, thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106376 
>Unformatted:
