diff options
author | dillon <dillon@FreeBSD.org> | 1999-11-29 18:51:04 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 1999-11-29 18:51:04 +0000 |
commit | be8594a1e7170240592eb897aecc4f6090dec1be (patch) | |
tree | 9834e82c87caa267f89b20b7a7bf51b6f9fe2fb0 | |
parent | 6ea8f09ae9fc1e857fd70fa71319d8c2daacd48d (diff) | |
download | FreeBSD-src-be8594a1e7170240592eb897aecc4f6090dec1be.zip FreeBSD-src-be8594a1e7170240592eb897aecc4f6090dec1be.tar.gz |
Make BOOTP work again.
Submitted by: Doug Ambrisko <ambrisko@whistle.com>
-rw-r--r-- | sys/amd64/amd64/autoconf.c | 10 | ||||
-rw-r--r-- | sys/i386/i386/autoconf.c | 10 | ||||
-rw-r--r-- | sys/kern/vfs_conf.c | 2 | ||||
-rw-r--r-- | sys/kern/vfs_mount.c | 2 |
4 files changed, 20 insertions, 4 deletions
diff --git a/sys/amd64/amd64/autoconf.c b/sys/amd64/amd64/autoconf.c index 9fa03c3..4f12924 100644 --- a/sys/amd64/amd64/autoconf.c +++ b/sys/amd64/amd64/autoconf.c @@ -48,6 +48,7 @@ #include "opt_bootp.h" #include "opt_ffs.h" #include "opt_cd9660.h" +#include "opt_nfs.h" #include "opt_nfsroot.h" #include "opt_bus.h" #include "opt_rootdevname.h" @@ -213,12 +214,18 @@ configure_final(dummy) cold = 0; } +#ifdef BOOTP +extern void bootpc_init(void); +#endif /* * Do legacy root filesystem discovery. */ void cpu_rootconf() { +#ifdef BOOTP + bootpc_init(); +#endif #if defined(NFS) && defined(NFS_ROOT) #if !defined(BOOTP_NFSROOT) if (nfs_diskless_valid) @@ -226,7 +233,8 @@ cpu_rootconf() rootdevnames[0] = "nfs:"; #endif #if defined(FFS) && defined(FFS_ROOT) - setroot(); + if (!rootdevnames[0]) + setroot(); #endif } SYSINIT(cpu_rootconf, SI_SUB_ROOT_CONF, SI_ORDER_FIRST, cpu_rootconf, NULL) diff --git a/sys/i386/i386/autoconf.c b/sys/i386/i386/autoconf.c index 9fa03c3..4f12924 100644 --- a/sys/i386/i386/autoconf.c +++ b/sys/i386/i386/autoconf.c @@ -48,6 +48,7 @@ #include "opt_bootp.h" #include "opt_ffs.h" #include "opt_cd9660.h" +#include "opt_nfs.h" #include "opt_nfsroot.h" #include "opt_bus.h" #include "opt_rootdevname.h" @@ -213,12 +214,18 @@ configure_final(dummy) cold = 0; } +#ifdef BOOTP +extern void bootpc_init(void); +#endif /* * Do legacy root filesystem discovery. */ void cpu_rootconf() { +#ifdef BOOTP + bootpc_init(); +#endif #if defined(NFS) && defined(NFS_ROOT) #if !defined(BOOTP_NFSROOT) if (nfs_diskless_valid) @@ -226,7 +233,8 @@ cpu_rootconf() rootdevnames[0] = "nfs:"; #endif #if defined(FFS) && defined(FFS_ROOT) - setroot(); + if (!rootdevnames[0]) + setroot(); #endif } SYSINIT(cpu_rootconf, SI_SUB_ROOT_CONF, SI_ORDER_FIRST, cpu_rootconf, NULL) diff --git a/sys/kern/vfs_conf.c b/sys/kern/vfs_conf.c index afa6fa5..f3d39f0 100644 --- a/sys/kern/vfs_conf.c +++ b/sys/kern/vfs_conf.c @@ -200,7 +200,7 @@ vfs_mountroot_try(char *mountfrom) printf("setrootbyname failed\n"); /* If the root device is a type "memory disk", mount RW */ - if (devsw(rootdev) && (devsw(rootdev)->d_flags & D_MEMDISK)) + if (rootdev != NODEV && devsw(rootdev) && (devsw(rootdev)->d_flags & D_MEMDISK)) mp->mnt_flag &= ~MNT_RDONLY; error = VFS_MOUNT(mp, NULL, NULL, NULL, curproc); diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index afa6fa5..f3d39f0 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -200,7 +200,7 @@ vfs_mountroot_try(char *mountfrom) printf("setrootbyname failed\n"); /* If the root device is a type "memory disk", mount RW */ - if (devsw(rootdev) && (devsw(rootdev)->d_flags & D_MEMDISK)) + if (rootdev != NODEV && devsw(rootdev) && (devsw(rootdev)->d_flags & D_MEMDISK)) mp->mnt_flag &= ~MNT_RDONLY; error = VFS_MOUNT(mp, NULL, NULL, NULL, curproc); |