]> xenbits.xensource.com Git - people/dariof/osstest.git/commitdiff
ts-debian-hvm-install: use di_installcmdline_core
authorIan Campbell <ian.campbell@citrix.com>
Mon, 27 Jul 2015 12:51:26 +0000 (13:51 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 5 Aug 2015 16:08:59 +0000 (17:08 +0100)
This is primarily to get DEBIAN_FRONTEND=text, for easier to read
logging.

Previously the command line consisted of the console and
preseed/file=/preseed.cfg. After this it is more complex.

The preseed file uses file= which is an alias for preseed/file. Extra
options are given including DEBIAN_FRONTEND and DEBCONF_DEBUG and the
following are preseeded via the command line:

Previous implied were "auto=true preseed" which are now explicit.

In addition the following harmless (in this context) options are
added:
    hw-detect/load_firmware=
    hostname=
    netcfg/dhcp_timeout=
    netcfg/choose_interface=

The caller could also cause debconf/priority to be set, but doesn't
here.

ts-debian-di-install in the distro test series also uses
di_installcmdline_core for guest uses.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/Debian.pm
ts-debian-hvm-install

index 7ce5d6700cd53f5cb47b588677df0790acd1cb92..f0bcf069f8692494c62e3375f2589a34a0335392 100644 (file)
@@ -627,6 +627,8 @@ our %preseed_cmds;
 sub di_installcmdline_core ($$;@) {
     my ($tho, $ps_url, %xopts) = @_;
 
+    $xopts{PreseedScheme} //= 'url';
+
     $ps_url =~ s,^http://,,;
 
     my $netcfg_interface= get_host_property($tho,'interface force','auto');
@@ -640,7 +642,7 @@ sub di_installcmdline_core ($$;@) {
     push @cl, (
                "DEBIAN_FRONTEND=$difront",
                "hostname=$tho->{Name}",
-               "url=$ps_url",
+               "$xopts{PreseedScheme}=$ps_url",
                "netcfg/dhcp_timeout=150",
                "netcfg/choose_interface=$netcfg_interface"
                );
index 2c3503d74d64a1a1e58775736bb34903d0b3402f..890c902dc2fa0935c9ea42fd1d7c7fc45f8b022c 100755 (executable)
@@ -104,23 +104,41 @@ END
     return $preseed_file;
 }
 
-sub grub_cfg () {
+sub gcmdline (;$) {
+    my ($extra) = @_;
+    my @dicmdline = ();
+    my $gconsole = "console=ttyS0,115200n8";
+
+    push @dicmdline, $gconsole;
+    push @dicmdline, di_installcmdline_core($gho, '/preseed.cfg',
+                                           PreseedScheme => 'file');
+    push @dicmdline, $extra if $extra;
+
+    push @dicmdline, "--";
     # See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=762007 for
     # why console= is repeated.
+    push @dicmdline, $gconsole;
+
+    return join(" ", @dicmdline);
+}
+
+sub grub_cfg () {
+    my $cmdline = gcmdline();
+
     return <<"END";
 set default="0"
 set timeout=5
 
 menuentry 'debian guest auto Install' {
-    linux /install.amd/vmlinuz preseed/file=/preseed.cfg console=ttyS0,115200n8 -- console=ttyS0,115200n8
+    linux /install.amd/vmlinuz $cmdline
     initrd /install.amd/initrd.gz
 }
 END
 }
 
 sub isolinux_cfg () {
-    # See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=762007 for
-    # why console= is repeated.
+    my $cmdline = gcmdline("initrd=/install.amd/initrd.gz");
+
     return <<"END";
     default autoinstall
     prompt 0
@@ -128,7 +146,7 @@ sub isolinux_cfg () {
 
     label autoinstall
         kernel /install.amd/vmlinuz
-        append preseed/file=/preseed.cfg initrd=/install.amd/initrd.gz console=ttyS0,115200n8 -- console=ttyS0,115200n8
+        append $cmdline
 END
 }