Date: Mon, 22 Apr 2013 19:38:56 +0000 (UTC) From: "Cherry G. Mathew" <cherry@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r249777 - projects/amd64_xen_pv/sys/amd64/xen Message-ID: <201304221938.r3MJcuru075508@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201304221938.r3MJcuru075508>