Skip site navigation (1)Skip section navigation (2)
Date:      Tue,  5 Dec 2006 23:27:53 +0900 (JST)
From:      n-kogane@syd.odn.ne.jp
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   misc/106376: can't upgrade install if /boot/kernel.prev exit
Message-ID:  <20061205142753.DD55E2843D@kcesx30.koganemaru.co.jp>
Resent-Message-ID: <200612051430.kB5EUANs043496@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         106376
>Category:       misc
>Synopsis:       can't upgrade install if /boot/kernel.prev exit
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 05 14:30:09 GMT 2006
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061205142753.DD55E2843D>