diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2005-03-23 17:10:25 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2005-03-23 17:10:25 +0000 |
commit | f4bdac6fc5f73a1ab3135e8401016f07fd7e4028 (patch) | |
tree | c5e9678109d6f403d835e5075b58f99fdabce233 | |
parent | cfa4b709d213a906bf950f27ebf352df7ca1ca0f (diff) |
Kill the sparc-specific mountroot hooks (which are run before the root
filesystem is mounted, unlike the MI mountroot hooks). They were only
used to allow root on floppy in the long dead two-floppies installation
method.
-rw-r--r-- | sys/arch/sparc/dev/fd.c | 36 | ||||
-rw-r--r-- | sys/arch/sparc/include/autoconf.h | 5 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/autoconf.c | 52 |
3 files changed, 4 insertions, 89 deletions
diff --git a/sys/arch/sparc/dev/fd.c b/sys/arch/sparc/dev/fd.c index 1d88fcd7b3a..bfbff8f15fa 100644 --- a/sys/arch/sparc/dev/fd.c +++ b/sys/arch/sparc/dev/fd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fd.c,v 1.40 2005/03/12 00:09:01 miod Exp $ */ +/* $OpenBSD: fd.c,v 1.41 2005/03/23 17:10:22 miod Exp $ */ /* $NetBSD: fd.c,v 1.51 1997/05/24 20:16:19 pk Exp $ */ /*- @@ -276,7 +276,6 @@ void fdcretry(struct fdc_softc *fdc); void fdfinish(struct fd_softc *fd, struct buf *bp); int fdformat(dev_t, struct fd_formb *, struct proc *); void fd_do_eject(struct fd_softc *); -void fd_mountroot_hook(struct device *); static int fdconf(struct fdc_softc *); #if IPL_FDSOFT == 4 @@ -679,12 +678,6 @@ fdattach(parent, self, aux) if (fa->fa_bootpath) fa->fa_bootpath->dev = &fd->sc_dv; - /* - * Establish a mountroot_hook anyway in case we booted - * with RB_ASKNAME and get selected as the boot device. - */ - mountroot_hook_establish(fd_mountroot_hook, &fd->sc_dv); - /* Make sure the drive motor gets turned off at shutdown time. */ fd->sc_sdhook = shutdownhook_establish(fd_motor_off, fd); @@ -2020,30 +2013,3 @@ fd_do_eject(fd) return; } } - -/* - * The mountroot_hook is called once the root and swap device have been - * established. NULL implies that we may have been the boot device but - * haven't been elected for the root device. - */ - -/* ARGSUSED */ -void -fd_mountroot_hook(dev) - struct device *dev; -{ - int c; - - if (dev) { - fd_do_eject((struct fd_softc *)dev); - - printf("Insert filesystem floppy and press return."); - for (;;) { - c = cngetc(); - if ((c == '\r') || (c == '\n')) { - printf("\n"); - break; - } - } - } -} diff --git a/sys/arch/sparc/include/autoconf.h b/sys/arch/sparc/include/autoconf.h index a8ff8e3e515..32a341192d2 100644 --- a/sys/arch/sparc/include/autoconf.h +++ b/sys/arch/sparc/include/autoconf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.h,v 1.13 2005/03/15 18:46:30 miod Exp $ */ +/* $OpenBSD: autoconf.h,v 1.14 2005/03/23 17:10:24 miod Exp $ */ /* $NetBSD: autoconf.h,v 1.20 1997/05/24 20:03:03 pk Exp $ */ /* @@ -191,9 +191,6 @@ int sd_crazymap(int); /* Parse a disk string into a dev_t, return device struct pointer */ struct device *parsedisk(char *, int, int, dev_t *); -/* Establish a mountroot_hook, for benefit of floppy drive, mostly. */ -void mountroot_hook_establish(void (*)(struct device *), struct device *); - void bootstrap(void); int firstchild(int); int nextsibling(int); diff --git a/sys/arch/sparc/sparc/autoconf.c b/sys/arch/sparc/sparc/autoconf.c index af2ea638247..a79e80175d1 100644 --- a/sys/arch/sparc/sparc/autoconf.c +++ b/sys/arch/sparc/sparc/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.63 2005/03/21 22:41:30 miod Exp $ */ +/* $OpenBSD: autoconf.c,v 1.64 2005/03/23 17:10:24 miod Exp $ */ /* $NetBSD: autoconf.c,v 1.73 1997/07/29 09:41:53 fair Exp $ */ /* @@ -120,18 +120,6 @@ static void bootpath_print(struct bootpath *); int search_prom(int, char *); char mainbus_model[30]; -/* - * The mountroot_hook is provided as a mechanism for devices to perform - * a special function if they're the root device, such as the floppy - * drive ejecting the current disk and prompting for a filesystem floppy. - */ -struct mountroot_hook { - LIST_ENTRY(mountroot_hook) mr_link; - struct device *mr_device; - void (*mr_func)(struct device *); -}; -LIST_HEAD(, mountroot_hook) mrh_list; - #ifdef RAMDISK_HOOKS static struct device fakerdrootdev = { DV_DISK, {}, NULL, 0, "rd0", NULL }; #endif @@ -764,9 +752,6 @@ cpu_configure() int s; extern struct user *proc0paddr; - /* Initialize the mountroot_hook list. */ - LIST_INIT(&mrh_list); - /* build the bootpath */ bootpath_build(); @@ -1887,24 +1872,6 @@ gotdisk: return (dv); } -void -mountroot_hook_establish(func, dev) - void (*func)(struct device *); - struct device *dev; -{ - struct mountroot_hook *mrhp; - - mrhp = (struct mountroot_hook *)malloc(sizeof(struct mountroot_hook), - M_DEVBUF, M_NOWAIT); - if (mrhp == NULL) - panic("no memory for mountroot_hook"); - - bzero(mrhp, sizeof(struct mountroot_hook)); - mrhp->mr_device = dev; - mrhp->mr_func = func; - LIST_INSERT_HEAD(&mrh_list, mrhp, mr_link); -} - /* * Attempt to find the device from which we were booted. * If we can do so, and not instructed not to do so, @@ -1923,7 +1890,6 @@ setroot() dev_t nrootdev, nswapdev = NODEV; char buf[128]; dev_t temp; - struct mountroot_hook *mrhp; struct device *bootdv; struct bootpath *bp; #if defined(NFSCLIENT) @@ -2074,7 +2040,7 @@ gotswap: majdev = major(rootdev); unit = DISKUNIT(rootdev); part = DISKPART(rootdev); - goto gotroot; + return; } switch (bootdv->dv_class) { @@ -2118,20 +2084,6 @@ gotswap: if (temp == dumpdev) dumpdev = swdevt[0].sw_dev; } - -gotroot: - /* - * Find mountroot hook and execute. - */ - LIST_FOREACH(mrhp, &mrh_list, mr_link) - if (mrhp->mr_device == bootdv) { - if (findblkmajor(mrhp->mr_device) == major(rootdev)) - (*mrhp->mr_func)(bootdv); - else - (*mrhp->mr_func)(NULL); - break; - } - } static int |