summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/common/fs/vfs.c7
-rw-r--r--usr/src/uts/common/io/strplumb.c20
2 files changed, 17 insertions, 10 deletions
diff --git a/usr/src/uts/common/fs/vfs.c b/usr/src/uts/common/fs/vfs.c
index 56834594fe..c50fe824ad 100644
--- a/usr/src/uts/common/fs/vfs.c
+++ b/usr/src/uts/common/fs/vfs.c
@@ -4631,7 +4631,6 @@ getfsname(char *askfor, char *name, size_t namelen)
static void
getrootfs(char **fstypp, char **fsmodp)
{
- extern char *strplumb_get_netdev_path(void);
char *propstr = NULL;
/*
@@ -4681,11 +4680,7 @@ getrootfs(char **fstypp, char **fsmodp)
(void) strncpy(rootfs.bo_name, propstr, BO_MAXOBJNAME);
ddi_prop_free(propstr);
} else {
- /* attempt to determine netdev_path via boot_mac address */
- netdev_path = strplumb_get_netdev_path();
- if (netdev_path == NULL)
- panic("cannot find boot network interface");
- (void) strncpy(rootfs.bo_name, netdev_path, BO_MAXOBJNAME);
+ rootfs.bo_name[0] = '\0';
}
*fstypp = rootfs.bo_fstype;
*fsmodp = "nfs";
diff --git a/usr/src/uts/common/io/strplumb.c b/usr/src/uts/common/io/strplumb.c
index 1a3cb37248..d57bc150f5 100644
--- a/usr/src/uts/common/io/strplumb.c
+++ b/usr/src/uts/common/io/strplumb.c
@@ -214,8 +214,13 @@ int ndev_unit = 0;
/*
* If we booted diskless then strplumb() will have been called from
- * swapgeneric.c:rootconf(). All we can do in that case is plumb the
- * network device that we booted from.
+ * either:
+ * in case of x86 NEWBOOT: vfs.c:rootconf()
+ * in case of nfs root, the rootfs.bo_name is reset from /ramdisk:a
+ * to empty string and we will copy netdev_path there.
+ * or
+ * in case of sparc: swapgeneric.c:rootconf().
+ * All we can do in that case is plumb the network device that we booted from.
*
* If we booted from a local disk, we will have been called from main(),
* and normally we defer the plumbing of interfaces until network/physical.
@@ -232,10 +237,17 @@ resolve_boot_path(void)
char stripped_path[OBP_MAXPATHLEN];
#endif
- if (strncmp(rootfs.bo_fstype, "nfs", 3) == 0)
+ if (strncmp(rootfs.bo_fstype, "nfs", 3) == 0 &&
+ rootfs.bo_name[0] != '\0') {
devpath = rootfs.bo_name;
- else
+ } else {
devpath = strplumb_get_netdev_path();
+ netdev_path = devpath;
+ if (netdev_path != NULL) {
+ (void) strncpy(rootfs.bo_name, netdev_path,
+ BO_MAXOBJNAME);
+ }
+ }
if (devpath != NULL) {
DBG1("resolving boot-path: %s\n", devpath);