aboutsummaryrefslogtreecommitdiffstats
path: root/xen
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2013-01-21 12:40:31 +0000
committerIan Campbell <ian.campbell@citrix.com>2013-01-21 12:40:31 +0000
commit43a5f79e8b42610dec7d65eaa084573771b69206 (patch)
tree214fad2ebfafcb4ae88077c592fcfe64df3da45b /xen
parent31bea35e1dccb0ceda03dbbf834577cb4419f4e8 (diff)
downloadxen-43a5f79e8b42610dec7d65eaa084573771b69206.tar.gz
xen-43a5f79e8b42610dec7d65eaa084573771b69206.tar.bz2
xen-43a5f79e8b42610dec7d65eaa084573771b69206.zip
arm: use module provided command line for domain 0 command line
Fallback to xen,dom0-bootargs if this isn't present. Ideally this would use module1-args iff the kernel came from the modules and the existing xen,dom0-bootargs if the kernel came from flash, but this approach is simpler and has the same effect in practice. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'xen')
-rw-r--r--xen/arch/arm/domain_build.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 96c3464169..6abbb03df4 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -86,8 +86,13 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
int node, const char *name, int depth,
u32 address_cells, u32 size_cells)
{
+ const char *bootargs = NULL;
int prop;
+ if ( early_info.modules.nr_mods >= 1 &&
+ early_info.modules.module[1].cmdline[0] )
+ bootargs = &early_info.modules.module[1].cmdline[0];
+
for ( prop = fdt_first_property_offset(fdt, node);
prop >= 0;
prop = fdt_next_property_offset(fdt, prop) )
@@ -104,15 +109,22 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
prop_len = fdt32_to_cpu(p->len);
/*
- * In chosen node: replace bootargs with value from
- * xen,dom0-bootargs.
+ * In chosen node:
+ *
+ * * remember xen,dom0-bootargs if we don't already have
+ * bootargs (from module #1, above).
+ * * remove bootargs and xen,dom0-bootargs.
*/
if ( device_tree_node_matches(fdt, node, "chosen") )
{
if ( strcmp(prop_name, "bootargs") == 0 )
continue;
- if ( strcmp(prop_name, "xen,dom0-bootargs") == 0 )
- prop_name = "bootargs";
+ else if ( strcmp(prop_name, "xen,dom0-bootargs") == 0 )
+ {
+ if ( !bootargs )
+ bootargs = prop_data;
+ continue;
+ }
}
/*
* In a memory node: adjust reg property.
@@ -147,6 +159,14 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
xfree(new_data);
}
+ if ( device_tree_node_matches(fdt, node, "chosen") && bootargs )
+ fdt_property(kinfo->fdt, "bootargs", bootargs, strlen(bootargs) + 1);
+
+ /*
+ * XXX should populate /chosen/linux,initrd-{start,end} here if we
+ * have module[2]
+ */
+
if ( prop == -FDT_ERR_NOTFOUND )
return 0;
return prop;