]> xenbits.xensource.com Git - people/dariof/osstest.git/commitdiff
Osstest/Debian.pm: Refactor common kernel cmdline setup.
authorIan Campbell <ian.campbell@citrix.com>
Thu, 22 Jan 2015 11:04:59 +0000 (11:04 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 26 Jan 2015 11:01:24 +0000 (11:01 +0000)
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/Debian.pm

index 0b047df338050dc797a778927e9d813a84cfee5d..1f7a4f02c0cfdae697330adf367d795d2cd137fa 100644 (file)
@@ -114,6 +114,19 @@ sub bl_getmenu_open ($$$) {
     return $f;
 }
 
+sub uboot_common_kernel_bootargs ($)
+{
+    my ($ho) = @_;
+
+    my $root= target_guest_lv_name($ho,"root");
+
+    my @bootargs;
+    push @bootargs, "ro";
+    push @bootargs, "root=$root";
+
+    return @bootargs;
+}
+
 sub uboot_scr_load_dtb () {
     return <<'END';
 if test -z "\${fdt_addr}" && test -n "\${fdtfile}" ; then
@@ -134,12 +147,8 @@ sub setupboot_uboot ($$$) {
        my $kern = "vmlinuz-$want_kernver";
        my $initrd = "initrd.img-$want_kernver";
 
-       my $root= target_guest_lv_name($ho,"root");
-
-       my @xenkopt;
+       my @xenkopt = uboot_common_kernel_bootargs($ho);
        push @xenkopt, $xenkopt;
-       push @xenkopt, "ro";
-       push @xenkopt, "root=$root";
 
        $xenkopt = join ' ', @xenkopt;
 
@@ -698,12 +707,10 @@ END
     }
 
     if ( $ho->{Flags}{'need-uboot-bootscr'} ) {
-       my @bootargs;
+       my @bootargs = uboot_common_kernel_bootargs($ho);
 
-       my $root=target_guest_lv_name($ho,"root");
        my $console=get_host_native_linux_console($ho);
 
-       push @bootargs, "root=$root";
        push @bootargs, "console=$console" unless $console eq "NONE";
 
        my $bootargs = join ' ', @bootargs;