svn commit: r249777 - projects/amd64_xen_pv/sys/amd64/xen

Cherry G. Mathew cherry at FreeBSD.org
Mon Apr 22 19:38:57 UTC 2013


Author: cherry
Date: Mon Apr 22 19:38:56 2013
New Revision: 249777
URL: http://svnweb.freebsd.org/changeset/base/249777

Log:
  Set the root device from the domU "root=/dev/xxx" string.
  Setting "vfs.root.mountfrom=/dev/xxx" would work so far,  but
  "root=dev/xxx" is the "standard" mechanism in the xen ecosystem.
  
  Approved by: gibbs(implicit)

Modified:
  projects/amd64_xen_pv/sys/amd64/xen/machdep.c

Modified: projects/amd64_xen_pv/sys/amd64/xen/machdep.c
==============================================================================
--- projects/amd64_xen_pv/sys/amd64/xen/machdep.c	Mon Apr 22 19:02:37 2013	(r249776)
+++ projects/amd64_xen_pv/sys/amd64/xen/machdep.c	Mon Apr 22 19:38:56 2013	(r249777)
@@ -366,6 +366,26 @@ xen_boothowto(char *envp)
 	return howto;
 }
 
+static void
+xen_rootconf(void)
+{
+	
+	char *rdevpath;
+
+	rdevpath = getenv("root");
+
+	if (rdevpath == NULL) {
+		return;
+	}
+
+	/* Do not overwrite existing variable */
+	if (getenv("vfs.root.mountfrom") == NULL) {
+		setenv("vfs.root.mountfrom", rdevpath);
+	}
+}
+
+SYSINIT(xen_rootconf, SI_SUB_ROOT_CONF, SI_ORDER_ANY, xen_rootconf, NULL);
+
 /* 
  * Setup early kernel environment, based on start_info passed to us by
  * xen


More information about the svn-src-projects mailing list