NetBSD Problem Report #8745

Received: (qmail 19656 invoked from network); 4 Nov 1999 16:22:05 -0000
Message-Id: <199911041618.IAA14963@nooksack.ldc.cs.wwu.edu>
Date: Thu, 4 Nov 1999 08:18:13 -0800 (PST)
From: bsh@grotto.iijnet.or.jp
Reply-To: bsh@grotto.iijnet.or.jp
To: gnats-bugs@gnats.netbsd.org
Subject: nfs install fails when distribution directory is not remote export point.
X-Send-Pr-Version: www-1.0

>Number:         8745
>Category:       install
>Synopsis:       nfs install fails when distribution directory is not remote export point.
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    install-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 04 08:24:01 +0000 1999
>Closed-Date:    Sun Jun 06 20:02:31 +0000 2004
>Last-Modified:  Sun Jun 06 20:02:31 +0000 2004
>Originator:     Hiro Bessho
>Release:        1.4K
>Organization:
Not organized
>Environment:
NetBSD kamasu.grotto.iijnet.or.jp 1.4K NetBSD 1.4K (KAMASU) #3: Mon Oct 11 02:55:27 JST 1999     bsh@kamasu.grotto.iijnet.or.jp:/usr/src/netbsd/sys/arch/i386/compile/KAMASU i386


>Description:
In installation via nfs, sysinst asks user remote hostname and directory
where distribution tar balls live, then mounts host:directory.  This is ok
if either the directory is exact remote exported point, or the directory
is exported with -alldirs option.  Sysinst fails to mount when the 
distribution directory is some levels down under exported directory.

>How-To-Repeat:
Make a directory on nfs server, say /usr/distrib/foo/bar, and copy
distribution sets into it.  Export /usr/distrib from the server without
-alldirs option.  Then try to install from this directory via nfs.
>Fix:
Here is a patch to add a new item to nfs menu for user to enter
remote file system on nfs server.

An alternative fix is to let sysinst find a valid mount point by try and error.

cvs diff: Diffing .
Index: defs.h
===================================================================
RCS file: /usr/cvs/netbsd/distrib/utils/sysinst/defs.h,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 defs.h
--- 1.1.1.3	1999/08/27 03:36:14
+++ defs.h	1999/11/04 15:19:41
@@ -184,6 +184,7 @@

 EXTERN char nfs_host[STRSIZE] INIT("");
 EXTERN char nfs_dir[STRSIZE] INIT("");
+EXTERN char nfs_remote_fs[STRSIZE] INIT("");

 EXTERN char cdrom_dev[SSTRSIZE] INIT("cd0");
 EXTERN char cdrom_dir[STRSIZE] INIT("/");
Index: menus.mi.en
===================================================================
RCS file: /usr/cvs/netbsd/distrib/utils/sysinst/menus.mi.en,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 menus.mi.en
--- 1.1.1.1	1999/08/26 16:11:13
+++ menus.mi.en	1999/11/04 15:20:46
@@ -243,9 +243,11 @@

 menu nfssource, title "Change";
 	display action
-		{ msg_display (MSG_nfssource, nfs_host, nfs_dir); };
+		{ msg_display (MSG_nfssource, nfs_host, nfs_remote_fs, nfs_dir); };
 	option "Host", action
 		{ msg_prompt (MSG_host, NULL, nfs_host, 255); };
+	option "Remote file system", action
+		{ msg_prompt (MSG_remotefs, NULL, nfs_remote_fs, 255); };
 	option "Directory", action
 		{ msg_prompt (MSG_dir, NULL, nfs_dir, 255); };
 	option "Continue", exit;
Index: msg.mi.en
===================================================================
RCS file: /usr/cvs/netbsd/distrib/utils/sysinst/msg.mi.en,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 msg.mi.en
--- 1.1.1.2	1999/08/27 03:36:16
+++ msg.mi.en	1999/11/04 14:52:11
@@ -381,6 +381,9 @@
 message dir
 {directory}

+message remotefs
+{remote file system}
+
 message user
 {user}

@@ -393,12 +396,18 @@
 message dev
 {device}

+/* Note that a space after %s is important in the next message.
+   a space followed by \n causes line break.
+ */
+
 message nfssource
-{Enter the nfs host and server directory where the distribution is
-located.  Remember, the directory should contain the .tgz files and
-must be nfs mountable.

-host:		%s
+{Enter the nfs host, remote file system and relative path to server
+directory where the distribution is located.  Remember, the directory
+should contain the .tgz files and must be nfs mountable.
+
+host:		%s 
+remote fs:	%s 
 directory:	%s
 }

Index: net.c
===================================================================
RCS file: /usr/cvs/netbsd/distrib/utils/sysinst/net.c,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 net.c
--- 1.1.1.3	1999/09/07 17:56:45
+++ net.c	1999/11/04 15:21:07
@@ -562,8 +562,8 @@
 	/* Mount it */
 	if (run_prog(0, 0, NULL, 
 	    "/sbin/mount -r -o -i,-r=1024 -t nfs %s:%s /mnt2",
-	    nfs_host, nfs_dir)) {
-		msg_display(MSG_nfsbadmount, nfs_host, nfs_dir);
+	    nfs_host, nfs_remote_fs)) {
+		msg_display(MSG_nfsbadmount, nfs_host, nfs_remote_fs);
 		process_menu(MENU_nfsbadmount);
 		if (!yesno)
 			return (0);
@@ -571,10 +571,18 @@
 			goto again;
 	}

+	if( nfs_dir[0] )
+		snprintf(ext_dir, sizeof ext_dir, "/mnt2/%s", nfs_dir );
+	else 
+		strcpy(ext_dir, "/mnt2");
+
 	/* Verify distribution files exist.  */
-	if (distribution_sets_exist_p("/mnt2") == 0) {
-		msg_display(MSG_badsetdir, "/mnt2");
+	if (distribution_sets_exist_p(ext_dir) == 0) {
+		msg_display(MSG_badsetdir, ext_dir);
 		process_menu (MENU_nfsbadmount);
+
+		ext_dir[0] = '\0';
+
 		if (!yesno)
 			return (0);
 		if (!ignorerror)
@@ -582,7 +590,6 @@
 	}

 	/* return location, don't clean... */
-	strcpy(ext_dir, "/mnt2");
 	clean_dist_dir = 0;
 	mnt2_mounted = 1;
 	return 1;


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: dsl 
State-Changed-When: Sun Jun 6 20:01:38 UTC 2004 
State-Changed-Why:  
An extra directory stage has been added to all the sysinst menus 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.