diff options
| author | Jordan K. Hubbard <jkh@FreeBSD.org> | 1998-10-10 08:12:24 +0000 |
|---|---|---|
| committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 1998-10-10 08:12:24 +0000 |
| commit | a33b93ff3121e1b61800c5385f7fd392f9d3c09c (patch) | |
| tree | fc2ccd003d2590ecbda77a4a5380217f23975389 | |
| parent | c9a5e211005cd20480b08e129107802fc52f030b (diff) | |
Notes
| -rw-r--r-- | sys/amd64/amd64/autoconf.c | 31 | ||||
| -rw-r--r-- | sys/i386/i386/autoconf.c | 31 | ||||
| -rw-r--r-- | sys/ufs/mfs/mfs_vfsops.c | 22 |
3 files changed, 48 insertions, 36 deletions
diff --git a/sys/amd64/amd64/autoconf.c b/sys/amd64/amd64/autoconf.c index 1a70760dafaf..dd97021f3667 100644 --- a/sys/amd64/amd64/autoconf.c +++ b/sys/amd64/amd64/autoconf.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91 - * $Id: autoconf.c,v 1.106 1998/09/15 10:03:42 gibbs Exp $ + * $Id: autoconf.c,v 1.108 1998/10/05 21:09:21 obrien Exp $ */ /* @@ -173,6 +173,10 @@ find_cdrom_root() extern void xpt_init __P((void)); +#ifdef MFS_ROOT +extern u_char *mfs_getimage __P((void)); +#endif + static void configure_start() { @@ -326,17 +330,20 @@ cpu_rootconf() if (!mountrootfsname) { if (bootverbose) printf("Considering MFS root f/s.\n"); - mountrootfsname = "mfs"; - /* - * Ignore the -a flag if this kernel isn't compiled - * with a generic root/swap configuration: if we skip - * setroot() and we aren't a generic kernel, chaos - * will ensue because setconf() will be a no-op. - * (rootdev is always initialized to NODEV in a - * generic configuration, so we test for that.) - */ - if ((boothowto & RB_ASKNAME) == 0 || rootdev != NODEV) - setroot(); + if (mfs_getimage()) { + mountrootfsname = "mfs"; + /* + * Ignore the -a flag if this kernel isn't compiled + * with a generic root/swap configuration: if we skip + * setroot() and we aren't a generic kernel, chaos + * will ensue because setconf() will be a no-op. + * (rootdev is always initialized to NODEV in a + * generic configuration, so we test for that.) + */ + if ((boothowto & RB_ASKNAME) == 0 || rootdev != NODEV) + setroot(); + } else if (bootverbose) + printf("No MFS image available as root f/s.\n"); } #endif diff --git a/sys/i386/i386/autoconf.c b/sys/i386/i386/autoconf.c index 1a70760dafaf..dd97021f3667 100644 --- a/sys/i386/i386/autoconf.c +++ b/sys/i386/i386/autoconf.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91 - * $Id: autoconf.c,v 1.106 1998/09/15 10:03:42 gibbs Exp $ + * $Id: autoconf.c,v 1.108 1998/10/05 21:09:21 obrien Exp $ */ /* @@ -173,6 +173,10 @@ find_cdrom_root() extern void xpt_init __P((void)); +#ifdef MFS_ROOT +extern u_char *mfs_getimage __P((void)); +#endif + static void configure_start() { @@ -326,17 +330,20 @@ cpu_rootconf() if (!mountrootfsname) { if (bootverbose) printf("Considering MFS root f/s.\n"); - mountrootfsname = "mfs"; - /* - * Ignore the -a flag if this kernel isn't compiled - * with a generic root/swap configuration: if we skip - * setroot() and we aren't a generic kernel, chaos - * will ensue because setconf() will be a no-op. - * (rootdev is always initialized to NODEV in a - * generic configuration, so we test for that.) - */ - if ((boothowto & RB_ASKNAME) == 0 || rootdev != NODEV) - setroot(); + if (mfs_getimage()) { + mountrootfsname = "mfs"; + /* + * Ignore the -a flag if this kernel isn't compiled + * with a generic root/swap configuration: if we skip + * setroot() and we aren't a generic kernel, chaos + * will ensue because setconf() will be a no-op. + * (rootdev is always initialized to NODEV in a + * generic configuration, so we test for that.) + */ + if ((boothowto & RB_ASKNAME) == 0 || rootdev != NODEV) + setroot(); + } else if (bootverbose) + printf("No MFS image available as root f/s.\n"); } #endif diff --git a/sys/ufs/mfs/mfs_vfsops.c b/sys/ufs/mfs/mfs_vfsops.c index efd0e69cfd57..208580c4bd44 100644 --- a/sys/ufs/mfs/mfs_vfsops.c +++ b/sys/ufs/mfs/mfs_vfsops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)mfs_vfsops.c 8.11 (Berkeley) 6/19/95 - * $Id: mfs_vfsops.c,v 1.48 1998/10/09 06:21:12 jkh Exp $ + * $Id: mfs_vfsops.c,v 1.49 1998/10/09 23:37:37 peter Exp $ */ @@ -100,17 +100,20 @@ static struct vfsops mfs_vfsops = { VFS_SET(mfs_vfsops, mfs, 0); #ifdef MFS_ROOT -#ifdef MFS_ROOT_SIZE +#ifdef MFS_ROOT_SIZE /* Image was already written into mfs_root */ static u_char mfs_root[MFS_ROOT_SIZE*1024] = "MFS Filesystem goes here"; static u_char end_mfs_root[] = "MFS Filesystem had better STOP here"; +#endif -#else /* load it from preload area */ - -static u_char * +u_char * mfs_getimage(void) { +#ifdef MFS_ROOT_SIZE + /* Get it from compiled-in code */ + return mfs_root; +#else caddr_t p; vm_offset_t *q; @@ -121,9 +124,9 @@ mfs_getimage(void) if (!q) return NULL; return (u_char *)*q; +#endif } -#endif /* MFS_ROOT_SIZE */ #endif /* MFS_ROOT */ /* @@ -192,15 +195,10 @@ mfs_mount(mp, path, data, ndp, p) */ #ifdef MFS_ROOT -#ifdef MFS_ROOT_SIZE - /* Get it from compiled-in code */ - base = mfs_root; -#else /* Get it from preload area */ base = mfs_getimage(); if (!base) - panic("No module of type mfs_root loaded; can't continue!"); -#endif /* MFS_ROOT_SIZE */ + panic("No mfs_root image loaded; can't continue!"); fs = (struct fs *)(base + SBOFF); /* check for valid super block */ if (fs->fs_magic != FS_MAGIC || fs->fs_bsize > MAXBSIZE || |
