diff options
author | msmith <msmith@FreeBSD.org> | 1999-11-04 01:40:18 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 1999-11-04 01:40:18 +0000 |
commit | bd93bea6821466ff234e59740c17fcc9069d1680 (patch) | |
tree | 3d86d4da1371cd7c83b31f3c437858651e50ce1c /sys/kern/vfs_mount.c | |
parent | bcba2990f6a91d0d17dec4f2a80284c96614b615 (diff) | |
download | FreeBSD-src-bd93bea6821466ff234e59740c17fcc9069d1680.zip FreeBSD-src-bd93bea6821466ff234e59740c17fcc9069d1680.tar.gz |
Re-implement the handing of RB_CDROM in a machine-independant fashion.
We currently only search SCSI and IDE CDROMs; if there's felt to be a
need for supporting the very old and rare soundcard etc. drives for this
application they can be trivially added.
Diffstat (limited to 'sys/kern/vfs_mount.c')
-rw-r--r-- | sys/kern/vfs_mount.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index b0f3646..fa3ee4f 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. |