Skip to contentSkip to conversation

fixes to ts-debian-hvm-install

PATCH In review Ian Campbell 2 participants 6 messages Jul 27, 2015 – Aug 5, 2015

lore
Share & tools
lore
#1 lore raw

PATCH v2 1/3 ts-debian-hvm-install: Remove VGA console runes.

I don't think there is any point in these since c60b6d20b0fd "ts-debian-hvm-install: Arrange for installed guest to use a serial console" and they represent an unexplained difference between the islinux and grub cases.

---
 ts-debian-hvm-install | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
ts-debian-hvm-install +2 -2
index f05b1a7..0c94c7e 100755
@@ -105,7 +105,7 @@ set default="0"
 set timeout=5
 
 menuentry 'debian guest auto Install' {
-    linux /install.amd/vmlinuz console=vga preseed/file=/preseed.cfg console=ttyS0,115200n8 -- console=ttyS0,115200n8
+    linux /install.amd/vmlinuz preseed/file=/preseed.cfg console=ttyS0,115200n8 -- console=ttyS0,115200n8
     initrd /install.amd/initrd.gz
 }
 END
@@ -121,7 +121,7 @@ sub isolinux_cfg () {
 
     label autoinstall
         kernel /install.amd/vmlinuz
-        append video=vesa:ywrap,mtrr vga=788 preseed/file=/preseed.cfg initrd=/install.amd/initrd.gz console=ttyS0,115200n8 -- console=ttyS0,115200n8
+        append preseed/file=/preseed.cfg initrd=/install.amd/initrd.gz console=ttyS0,115200n8 -- console=ttyS0,115200n8
 END
 }
 
Signature · 1 line
2.1.4
#2 lore raw

PATCH v2 2/3 ts-debian-hvm-install: use di_installcmdline_core

This is primarily to get DEBIAN_FRONTEND=test, 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.

---
v2: Refactor to use gcmdline to contain the repetitive bit.

---
 Osstest/Debian.pm     |  4 +++-
 ts-debian-hvm-install | 28 +++++++++++++++++++++++-----
 2 files changed, 26 insertions(+), 6 deletions(-)
Osstest/Debian.pm +3 -1
index 7ce5d67..f0bcf06 100644
@@ -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"
                );
ts-debian-hvm-install +23 -5
index 0c94c7e..d4639b3 100755
@@ -97,23 +97,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
@@ -121,7 +139,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
 }
 
Signature · 1 line
2.1.4
Acked-by on v2 2/3
#3 lore raw

Re: [PATCH v2 2/3] ts-debian-hvm-install: use di_installcmdline_core

Ian Campbell writes ("[PATCH v2 2/3] ts-debian-hvm-install: use di_installcmdline_core"):

Quoted 2 lines

This is primarily to get DEBIAN_FRONTEND=test, for easier to read logging.

                                           ^^^^ text

Aside from that,

Ian.

#4 lore raw

Re: [PATCH v2 2/3] ts-debian-hvm-install: use di_installcmdline_core

Quoted 9 lines · Ian Jackson

Ian Campbell writes ("[PATCH v2 2/3] ts-debian-hvm-install: use di_installcmdline_core"):

Quoted 2 lines

This is primarily to get DEBIAN_FRONTEND=test, for easier to read logging.

                                           ^^^^ text

Aside from that,

Thanks, I fixed the typo and push the series to pretest.

#5 lore raw

PATCH v2 3/3 ts-debian-hvm-install: Use xargs -0 to avoid massive filelist in logs.

In reply to Ian Campbell

The current arrangement is a bit odd, I'm not sure why it would be that way and it results in a huge list of files in the middle of the log which is rather boring to scroll through.

---
 ts-debian-hvm-install | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ts-debian-hvm-install +1 -1
index d4639b3..8198a7a 100755
@@ -155,7 +155,7 @@ sub prepare_initrd ($$$) {
       cd -
       rm -rf $initrddir
       cd $newiso
-      md5sum `find -L -type f -print0 | xargs -0` > md5sum.txt
+      find -L -type f -print0 | xargs -0 md5sum > md5sum.txt
       cd -
 END
 }
Signature · 1 line
2.1.4