Subject: misc/21724: using newbtconf breaks upgrade
To: None <>
From: None <>
List: netbsd-bugs
Date: 05/30/2003 22:42:30
>Number:         21724
>Category:       misc
>Synopsis:       using newbtconf breaks upgrade
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    misc-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri May 30 22:43:00 UTC 2003
>Originator:     Robby Griffin
>Release:        NetBSD/i386 1.6, 1.6.1
NetBSD gestetner 1.6 NetBSD 1.6 (GENERIC) #0: Sat Nov  9 23:41:11 EST 2002     xela@foiegras:/export/home/xela/usr/src/sys/arch/i386/compile/GENERIC i386

Having used /sbin/newbtconf on a NetBSD 1.6 machine to set up multiple boot configurations, we found it awkward to upgrade the machine to NetBSD 1.6.1. While examining the existing install of 1.6, the 1.6.1 installer could not find etc/fstab on the hard drive ("Help!  No /etc/fstab in target disk wd0.  Aborting upgrade."). This is because etc/fstab is a symlink to etc/etc.current/fstab, and etc/etc.current is a symlink to /etc/etc.mymachine (note the leading slash). This means that, having its own root filesystem on a ramdisk, the installer is following symlinks to /etc/etc.mymachine/fstab, where /etc is on the ramdisk, not on the hard drive.

We were able to do the upgrade by manually changing the etc.current symlink from an installer shell, but this seems awkward. The symlink really should have been relative in the first place.
See description.
Workaround: when upgrading, manually change etc.current to a relative link.

Fix: have the boot-time selector script create a relative link in the first place:

--- /etc/rc.d/	Sun Sep  8 15:33:33 2002
+++ /etc/rc.d/	Fri May 30 18:38:39 2003
@@ -65,7 +65,7 @@
 		rm -f /etc/etc.current
-		ln -s /etc/etc.$conf /etc/etc.current
+		ln -s etc.$conf /etc/etc.current