summaryrefslogtreecommitdiffstats
path: root/sys/boot/alpha
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>1999-07-21 00:08:54 +0000
committermsmith <msmith@FreeBSD.org>1999-07-21 00:08:54 +0000
commit22f56109bab1f14a1a0843f99d13408802e847b0 (patch)
tree14a0bc66886d1bd81367b200e253b2e4af5f1c6b /sys/boot/alpha
parent7c71676effa00a366c7a8176221f108e37d74043 (diff)
downloadFreeBSD-src-22f56109bab1f14a1a0843f99d13408802e847b0.zip
FreeBSD-src-22f56109bab1f14a1a0843f99d13408802e847b0.tar.gz
Walk around the end of all the silly guessing of device types and unit
numbers that we have been doing in the past, and read /etc/fstab off the proposed root filesystem to determine the actual device name and vfs type for the root filesystem. These are then exported to the kernel via the environment variable vfs.root.mountfrom.
Diffstat (limited to 'sys/boot/alpha')
-rw-r--r--sys/boot/alpha/libalpha/bootinfo.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/boot/alpha/libalpha/bootinfo.c b/sys/boot/alpha/libalpha/bootinfo.c
index f4318c9..fa0842b 100644
--- a/sys/boot/alpha/libalpha/bootinfo.c
+++ b/sys/boot/alpha/libalpha/bootinfo.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bootinfo.c,v 1.4 1999/03/08 11:05:42 dcs Exp $
+ * $Id: bootinfo.c,v 1.6 1999/03/20 14:13:09 dcs Exp $
*/
#include <stand.h>
@@ -153,12 +153,30 @@ int
bi_load(struct bootinfo_v1 *bi, vm_offset_t *ffp_save,
struct loaded_module *mp)
{
+ char *rootdevname;
+ struct alpha_devdesc *rootdev;
struct loaded_module *xp;
vm_offset_t addr, bootinfo_addr;
u_int pad;
vm_offset_t ssym, esym;
struct module_metadata *md;
+ /*
+ * Allow the environment variable 'rootdev' to override the supplied device
+ * This should perhaps go to MI code and/or have $rootdev tested/set by
+ * MI code before launching the kernel.
+ */
+ rootdevname = getenv("rootdev");
+ alpha_getdev((void **)(&rootdev), rootdevname, NULL);
+ if (rootdev == NULL) { /* bad $rootdev/$currdev */
+ printf("can't determine root device\n");
+ return(EINVAL);
+ }
+
+ /* Try reading the /etc/fstab file to select the root device */
+ getrootmount(alpha_fmtdev((void *)rootdev));
+ free(rootdev);
+
ssym = esym = 0;
if ((md = mod_findmetadata(mp, MODINFOMD_SSYM)) != NULL)
ssym = *((vm_offset_t *)&(md->md_data));
OpenPOWER on IntegriCloud