summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Smith <msmith@FreeBSD.org>1999-11-04 01:40:18 +0000
committerMike Smith <msmith@FreeBSD.org>1999-11-04 01:40:18 +0000
commit90ebaea9797758edee5b74511df87df53e83d64f (patch)
tree3d86d4da1371cd7c83b31f3c437858651e50ce1c
parent870c4cf8eb85824e65342be49c2efd2117030a06 (diff)
Notes
-rw-r--r--sys/kern/vfs_conf.c24
-rw-r--r--sys/kern/vfs_mount.c24
2 files changed, 48 insertions, 0 deletions
diff --git a/sys/kern/vfs_conf.c b/sys/kern/vfs_conf.c
index b0f3646d8869..fa3ee4f22e19 100644
--- a/sys/kern/vfs_conf.c
+++ b/sys/kern/vfs_conf.c
@@ -61,6 +61,16 @@ MALLOC_DEFINE(M_MOUNT, "mount", "vfs mount structure");
struct vnode *rootvnode;
+/*
+ * The root specifiers we will try if RB_CDROM is specified.
+ */
+static char *cdrom_rootdevnames[] = {
+ "cd9660:cd0a",
+ "cd9660:acd0a",
+ "cd9660:wcd0a",
+ NULL
+};
+
static void vfs_mountroot(void *junk);
static int vfs_mountroot_try(char *mountfrom);
static int vfs_mountroot_ask(void);
@@ -78,6 +88,8 @@ SYSINIT(mountroot, SI_SUB_MOUNT_ROOT, SI_ORDER_SECOND, vfs_mountroot, NULL);
static void
vfs_mountroot(void *junk)
{
+ int i;
+
/*
* The root filesystem information is compiled in, and we are
* booted with instructions to use it.
@@ -97,6 +109,18 @@ vfs_mountroot(void *junk)
}
/*
+ * We've been given the generic "use CDROM as root" flag. This is
+ * necessary because one media may be used in many different
+ * devices, so we need to search for them.
+ */
+ if (boothowto & RB_CDROM) {
+ for (i = 0; cdrom_rootdevnames[i] != NULL; i++) {
+ if (!vfs_mountroot_try(cdrom_rootdevnames[i]))
+ return;
+ }
+ }
+
+ /*
* Try to use the value read by the loader from /etc/fstab, or
* supplied via some other means. This is the preferred
* mechanism.
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index b0f3646d8869..fa3ee4f22e19 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -61,6 +61,16 @@ MALLOC_DEFINE(M_MOUNT, "mount", "vfs mount structure");
struct vnode *rootvnode;
+/*
+ * The root specifiers we will try if RB_CDROM is specified.
+ */
+static char *cdrom_rootdevnames[] = {
+ "cd9660:cd0a",
+ "cd9660:acd0a",
+ "cd9660:wcd0a",
+ NULL
+};
+
static void vfs_mountroot(void *junk);
static int vfs_mountroot_try(char *mountfrom);
static int vfs_mountroot_ask(void);
@@ -78,6 +88,8 @@ SYSINIT(mountroot, SI_SUB_MOUNT_ROOT, SI_ORDER_SECOND, vfs_mountroot, NULL);
static void
vfs_mountroot(void *junk)
{
+ int i;
+
/*
* The root filesystem information is compiled in, and we are
* booted with instructions to use it.
@@ -97,6 +109,18 @@ vfs_mountroot(void *junk)
}
/*
+ * We've been given the generic "use CDROM as root" flag. This is
+ * necessary because one media may be used in many different
+ * devices, so we need to search for them.
+ */
+ if (boothowto & RB_CDROM) {
+ for (i = 0; cdrom_rootdevnames[i] != NULL; i++) {
+ if (!vfs_mountroot_try(cdrom_rootdevnames[i]))
+ return;
+ }
+ }
+
+ /*
* Try to use the value read by the loader from /etc/fstab, or
* supplied via some other means. This is the preferred
* mechanism.