Make BOOTP work again.

Submitted by:	Doug Ambrisko <ambrisko@whistle.com>
This commit is contained in:
Matthew Dillon 1999-11-29 18:51:04 +00:00
parent a1d4589f76
commit 99e659dcfa
4 changed files with 20 additions and 4 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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);

View File

@ -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);