Skip to contentSkip to conversation

ts-debian-hvm-install: use text installer frontend

PATCH Superseded Wei Liu 2 participants 5 messages May 14, 2014 – May 15, 2014

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH v2 1/1 ts-debian-hvm-install: use text installer frontend

Factor out di_installcmdline_base in Debian.pm and use that in ts-debian-hvm-install. This should improve readability of d-i log in various Debian HVM testcases.

Cc Ian Jackson <[email protected]>
Cc Ian Campbell <[email protected]>

---
Per:
https://www.debian.org/releases/stable/amd64/apbs02.html.en
I didn't see "preseed" on that page so I left that one untouched.

---
 Osstest/Debian.pm     |   31 ++++++++++++++++++++-----------
 ts-debian-hvm-install |    9 +++++++--
 2 files changed, 27 insertions(+), 13 deletions(-)
Osstest/Debian.pm +20 -11
index ab09abb..4f2b584 100644
@@ -36,6 +36,7 @@ BEGIN {
                       preseed_base
                       preseed_create
                       preseed_hook_command preseed_hook_installscript
+                      di_installcmdline_base
                       di_installcmdline_core
                       );
     %EXPORT_TAGS = ( );
@@ -398,6 +399,23 @@ END
 our %preseed_cmds;
 # $preseed_cmds{$di_key}[]= $cmd
 
+sub di_installcmdline_base($;@) {
+    my ($tho, %xopts) = @_;
+    my @cl = qw(
+                auto=true
+                hw-detect/load_firmware=false
+                DEBCONF_DEBUG=5
+                );
+    my $difront = get_host_property($tho,'DIFrontend','text');
+    push @cl, ("DEBIAN_FRONTEND=$difront");
+
+    my $debconf_priority= $xopts{DebconfPriority};
+    push @cl, "debconf/priority=$debconf_priority"
+        if defined $debconf_priority;
+
+    return @cl
+}
+
 sub di_installcmdline_core ($$;@) {
     my ($tho, $ps_url, %xopts) = @_;
 
@@ -405,24 +423,15 @@ sub di_installcmdline_core ($$;@) {
 
     my $netcfg_interface= get_host_property($tho,'interface force','auto');
 
-    my @cl= qw(
-               auto=true preseed
-               hw-detect/load_firmware=false
-               DEBCONF_DEBUG=5
-               );
-    my $difront = get_host_property($tho,'DIFrontend','text');
+    my @cl = di_installcmdline_base($tho, %xopts);
     push @cl, (
-               "DEBIAN_FRONTEND=$difront",
+               "preseed",
                "hostname=$tho->{Name}",
                "url=$ps_url",
                "netcfg/dhcp_timeout=150",
                "netcfg/choose_interface=$netcfg_interface"
                );
 
-    my $debconf_priority= $xopts{DebconfPriority};
-    push @cl, "debconf/priority=$debconf_priority"
-        if defined $debconf_priority;
-
     return @cl;
 }
 
ts-debian-hvm-install +7 -2
index fec24f7..a9c658a 100755
@@ -86,18 +86,23 @@ END
 
 sub grub_cfg () {
 
+    my $cmdline = join ' ' , di_installcmdline_base($gho);
+
     return <<"END";
 set default="0"
 set timeout=5
 
 menuentry 'debian guest auto Install' {
-    linux /install.amd/vmlinuz console=vga console=ttyS0,115200n8 preseed/file=/preseed.cfg
+    linux /install.amd/vmlinuz $cmdline console=ttyS0,115200n8 preseed/file=/preseed.cfg
     initrd /install.amd/initrd.gz
 }
 END
 }
 
 sub isolinux_cfg () {
+
+    my $cmdline = join ' ' , di_installcmdline_base($gho);
+
     return <<"END";
     default autoinstall
     prompt 0
@@ -105,7 +110,7 @@ sub isolinux_cfg () {
 
     label autoinstall
         kernel /install.amd/vmlinuz
-        append video=vesa:ywrap,mtrr vga=788 console=ttyS0,115200n8 preseed/file=/preseed.cfg initrd=/install.amd/initrd.gz
+        append $cmdline console=ttyS0,115200n8 preseed/file=/preseed.cfg initrd=/install.amd/initrd.gz
 END
 }
 
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 11 lines · Wei Liu

Factor out di_installcmdline_base in Debian.pm and use that in ts-debian-hvm-install. This should improve readability of d-i log in various Debian HVM testcases.

Cc Ian Jackson <[email protected]>
Cc Ian Campbell <[email protected]>

---
Per:
https://www.debian.org/releases/stable/amd64/apbs02.html.en
I didn't see "preseed" on that page so I left that one untouched.

I'm about 99% certain that preseed doesn't do anything.

Quoted 18 lines
---
 Osstest/Debian.pm     |   31 ++++++++++++++++++++-----------
 ts-debian-hvm-install |    9 +++++++--
 2 files changed, 27 insertions(+), 13 deletions(-)
Osstest/Debian.pm +1 -0
index ab09abb..4f2b584 100644
@@ -36,6 +36,7 @@ BEGIN {
                       preseed_base
                       preseed_create
                       preseed_hook_command preseed_hook_installscript
+                      di_installcmdline_base
                       di_installcmdline_core
                       );
     %EXPORT_TAGS = ( );

Osstest/Debian.pm END · line 405

Quoted 7 lines
Osstest/Debian.pm +4 -0
@@ -398,6 +399,23 @@ END
 our %preseed_cmds;
 # $preseed_cmds{$di_key}[]= $cmd
 
+sub di_installcmdline_base($;@) {
+    my ($tho, %xopts) = @_;
+    my @cl = qw(
+                auto=true

I don't think it makes sense to move this but not the url=. I'd suggest either leaving this in the caller or doing:

       push @cl, ("auto=true", "url=$xopts{PreseedURL}") if $xopts{PreseedURL});

and setting PreseedURL in the callers as appropriate.

Also, FWIW, you can just say "auto" without the =true. No need to make that change here/now though.

Ian.

author
#2 lore raw
Quoted 44 lines · Ian Campbell
Quoted 11 lines · Wei Liu

Factor out di_installcmdline_base in Debian.pm and use that in ts-debian-hvm-install. This should improve readability of d-i log in various Debian HVM testcases.

Cc Ian Jackson <[email protected]>
Cc Ian Campbell <[email protected]>

---
Per:
https://www.debian.org/releases/stable/amd64/apbs02.html.en
I didn't see "preseed" on that page so I left that one untouched.

I'm about 99% certain that preseed doesn't do anything.

Quoted 18 lines
---
 Osstest/Debian.pm     |   31 ++++++++++++++++++++-----------
 ts-debian-hvm-install |    9 +++++++--
 2 files changed, 27 insertions(+), 13 deletions(-)
Osstest/Debian.pm +1 -0
index ab09abb..4f2b584 100644
@@ -36,6 +36,7 @@ BEGIN {
                       preseed_base
                       preseed_create
                       preseed_hook_command preseed_hook_installscript
+                      di_installcmdline_base
                       di_installcmdline_core
                       );
     %EXPORT_TAGS = ( );

Osstest/Debian.pm END · line 405

Quoted 7 lines
Osstest/Debian.pm +4 -0
@@ -398,6 +399,23 @@ END
 our %preseed_cmds;
 # $preseed_cmds{$di_key}[]= $cmd
 
+sub di_installcmdline_base($;@) {
+    my ($tho, %xopts) = @_;
+    my @cl = qw(
+                auto=true

I don't think it makes sense to move this but not the url=. I'd suggest either leaving this in the caller or doing:

Quoted 3 lines
       push @cl, ("auto=true", "url=$xopts{PreseedURL}") if $xopts{PreseedURL});

and setting PreseedURL in the callers as appropriate.

I moved it because ts-debian-hvm-install is also doing preseed installation. That is, both host and guest install need some basic pressed options. You first suggestion makes ts-debian-hvm-install have to duplicate "auto=true", your later suggestion doesn't work for ts-debian-hvm-install as it requires a file not url...

Quoted 3 lines

Also, FWIW, you can just say "auto" without the =true. No need to make that change here/now though.

Not really, as per that webpage:

"The auto boot choice is not yet defined on all arches. The same effect may be achieved by simply adding the two parameters auto=true priority=critical to the kernel command line."

Wei.

Quoted 1 line

Ian.

#3 lore raw
Quoted 49 lines · Wei Liu
Quoted 44 lines · Ian Campbell
Quoted 11 lines · Wei Liu

Factor out di_installcmdline_base in Debian.pm and use that in ts-debian-hvm-install. This should improve readability of d-i log in various Debian HVM testcases.

Cc Ian Jackson <[email protected]>
Cc Ian Campbell <[email protected]>

---
Per:
https://www.debian.org/releases/stable/amd64/apbs02.html.en
I didn't see "preseed" on that page so I left that one untouched.

I'm about 99% certain that preseed doesn't do anything.

Quoted 18 lines
---
 Osstest/Debian.pm     |   31 ++++++++++++++++++++-----------
 ts-debian-hvm-install |    9 +++++++--
 2 files changed, 27 insertions(+), 13 deletions(-)
Osstest/Debian.pm +1 -0
index ab09abb..4f2b584 100644
@@ -36,6 +36,7 @@ BEGIN {
                       preseed_base
                       preseed_create
                       preseed_hook_command preseed_hook_installscript
+                      di_installcmdline_base
                       di_installcmdline_core
                       );
     %EXPORT_TAGS = ( );

Osstest/Debian.pm END · line 405

Quoted 7 lines
Osstest/Debian.pm +4 -0
@@ -398,6 +399,23 @@ END
 our %preseed_cmds;
 # $preseed_cmds{$di_key}[]= $cmd
 
+sub di_installcmdline_base($;@) {
+    my ($tho, %xopts) = @_;
+    my @cl = qw(
+                auto=true

I don't think it makes sense to move this but not the url=. I'd suggest either leaving this in the caller or doing:

Quoted 3 lines
       push @cl, ("auto=true", "url=$xopts{PreseedURL}") if $xopts{PreseedURL});

and setting PreseedURL in the callers as appropriate.

Quoted 5 lines

I moved it because ts-debian-hvm-install is also doing preseed installation. That is, both host and guest install need some basic pressed options. You first suggestion makes ts-debian-hvm-install have to duplicate "auto=true", your later suggestion doesn't work for ts-debian-hvm-install as it requires a file not url...

Having the auto=true and the preseed file (whether it is url= or file=) in different places doesn't make sense IMHO, they should either both be in the caller or both in this helper.

Quoted 10 lines
Quoted 4 lines

Also, FWIW, you can just say "auto" without the =true. No need to make that change here/now though.

Not really, as per that webpage:

"The auto boot choice is not yet defined on all arches. The same effect may be achieved by simply adding the two parameters auto=true priority=critical to the kernel command line."

Ah, auto is actually a syslinux entry not a kernel command line, I misread it.

Ian.

author
#4 lore raw
Quoted 56 lines · Ian Campbell
Quoted 49 lines · Wei Liu
Quoted 44 lines · Ian Campbell
Quoted 11 lines · Wei Liu

Factor out di_installcmdline_base in Debian.pm and use that in ts-debian-hvm-install. This should improve readability of d-i log in various Debian HVM testcases.

Cc Ian Jackson <[email protected]>
Cc Ian Campbell <[email protected]>

---
Per:
https://www.debian.org/releases/stable/amd64/apbs02.html.en
I didn't see "preseed" on that page so I left that one untouched.

I'm about 99% certain that preseed doesn't do anything.

Quoted 18 lines
---
 Osstest/Debian.pm     |   31 ++++++++++++++++++++-----------
 ts-debian-hvm-install |    9 +++++++--
 2 files changed, 27 insertions(+), 13 deletions(-)
Osstest/Debian.pm +1 -0
index ab09abb..4f2b584 100644
@@ -36,6 +36,7 @@ BEGIN {
                       preseed_base
                       preseed_create
                       preseed_hook_command preseed_hook_installscript
+                      di_installcmdline_base
                       di_installcmdline_core
                       );
     %EXPORT_TAGS = ( );

Osstest/Debian.pm END · line 405

Quoted 7 lines
Osstest/Debian.pm +4 -0
@@ -398,6 +399,23 @@ END
 our %preseed_cmds;
 # $preseed_cmds{$di_key}[]= $cmd
 
+sub di_installcmdline_base($;@) {
+    my ($tho, %xopts) = @_;
+    my @cl = qw(
+                auto=true

I don't think it makes sense to move this but not the url=. I'd suggest either leaving this in the caller or doing:

Quoted 3 lines
       push @cl, ("auto=true", "url=$xopts{PreseedURL}") if $xopts{PreseedURL});

and setting PreseedURL in the callers as appropriate.

Quoted 5 lines

I moved it because ts-debian-hvm-install is also doing preseed installation. That is, both host and guest install need some basic pressed options. You first suggestion makes ts-debian-hvm-install have to duplicate "auto=true", your later suggestion doesn't work for ts-debian-hvm-install as it requires a file not url...

Quoted 4 lines

Having the auto=true and the preseed file (whether it is url= or file=) in different places doesn't make sense IMHO, they should either both be in the caller or both in this helper.

Quoted 1 line

OK, I will come up with a new version this afternoon.