Provide target_install_packages_nonfree_nonconcurrent
PATCH 1/3 Provide target_install_packages_nonfree_nonconcurrent
Right now this is only useful with Debian. We will call it from ts-host-install to install the microcode.
We enable and then disable non-free so that we don't install non-free packages unintentionally.
--- Osstest/TestSupport.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
Osstest/TestSupport.pm +16 -0
@@ -71,6 +71,7 @@ BEGIN { target_editfile_kvp_replace target_run_pkgmanager_install target_install_packages target_install_packages_norec + target_install_packages_nonfree_nonconcurrent target_jobdir target_extract_jobdistpath_subdir target_extract_jobdistpath target_extract_distpart target_tftp_prefix
@@ -627,6 +628,21 @@ sub target_install_packages_norec ($@) { my ($ho, @packages) = @_; target_run_pkgmanager_install($ho,\@packages,1); } +sub target_install_packages_nonfree_nonconcurrent ($@) { + # inadequate locking, should be called during installation only + my ($ho, @packages) = @_; + my $slist= '/etc/apt/sources.list'; + my $xsuites= 'contrib non-free'; + target_cmd_root($ho, <<END, 30); + perl -i~ -pe 'next unless m/^deb/; s{ main\$}{\$& $xsuites};' $slist + apt update +END + target_run_pkgmanager_install($ho,\@packages); + target_cmd_root($ho, <<END, 30); + mv $slist~ $slist + apt update +END +} sub tpfcs_core { my ($tputfilef,$ho,$timeout,$filedata, $rdest,$lleaf) = @_;
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH 2/3 Revert "Arrange to upgrade microcode on x86 test hosts."
We are going to do this differently, by installing the packages from Debian. We couldn't do that in 2015 because not every version of Xen supported scanning the dom0 initrd for microcode, but now all supported versions do. So we will do that, in a moment.
This reverts commit 6cedb8c7d76a0ab3820ed0a48a3aebcb18fa0813.
--- Osstest/Debian.pm | 44 ------------------------ mg-cpu-microcode-update | 83 --------------------------------------------- production-config | 5 --- production-config-cambridge | 4 --- ts-xen-install | 7 ---- 5 files changed, 143 deletions(-) delete mode 100755 mg-cpu-microcode-update
Osstest/Debian.pm +0 -44
@@ -753,48 +753,6 @@ chroot /target chown -R \$u.\$u \$h/.ssh END } -sub preseed_microcode($$) -{ - my ($ho,$sfx) = @_; - my $prop = "MicrocodeUpdate".ucfirst($ho->{Arch}); - return unless $c{$prop}; - logm("ucode=$prop $c{$prop}"); - my $ucode = get_filecontents("$c{Images}/$c{$prop}"); - my $cpio_url = create_webfile($ho, "microcode-cpio", - sub { - my $f = "$c{Images}/$c{$prop}"; - copy($f, $_[0]) or die "Copy $f failed: $!"; - }); - - # The ability to prepend from an initramfs-hook was not added - # until Jessie, therefore for Wheezy we use a custom compression - # method which sneaks the necessary cpio onto the front. - my $gzip_url = create_webfile($ho, "microcode-gzip",<<END); -#!/bin/bash -if [ -f /boot/microcode.cpio ]; then - cat /boot/microcode.cpio -fi -exec gzip -END - - preseed_hook_installscript($ho, $sfx, - '/usr/lib/base-installer.d/','osstest-microcode', <<END); -#!/bin/sh -set -ex - -mkdir -p /target/boot -$preseed_wget -O /target/boot/microcode.cpio $cpio_url - -mkdir -p /target/usr/sbin -$preseed_wget -O /target/usr/sbin/osstest-initramfs-gzip $gzip_url -chmod +x /target/usr/sbin/osstest-initramfs-gzip - -mkdir -p /target/etc/initramfs-tools/conf.d/ -echo COMPRESS=/usr/sbin/osstest-initramfs-gzip >> \\ - /target/etc/initramfs-tools/conf.d/osstest-initramfs-gzip.conf -END -} - sub debian_overlays ($$) { my ($ho, $func) = @_; # calls $func->($local_dir, $tarball_leafname);
@@ -1503,8 +1461,6 @@ d-i partman-auto/expert_recipe string \\ END - preseed_microcode($ho,$sfx); - if (get_host_property($ho, "firmware") eq "uefi") { die unless $ho->{Suite} =~ m/jessie|stretch/; # Prevent grub-install from making a new Debian boot entry, so
mg-cpu-microcode-update deleted +0 -83
83 lines not on this page · raw message
production-config +0 -5
@@ -99,11 +99,6 @@ DebianImageVersion_wheezy 7.2.0 DebianImageVersion_jessie 8.2.0 DebianImageVersion_stretch 9.4.0 -# These should normally be the same. -# Update with ./mg-cpu-microcode-update -MicrocodeUpdateAmd64 microcode.x86.2015-06-12.cpio -MicrocodeUpdateI386 microcode.x86.2015-06-12.cpio - # Update with ./mg-netgrub-loader-update TftpGrubVersion XXXX-XX-XX
production-config-cambridge +0 -4
@@ -87,10 +87,6 @@ DebianImageVersion_jessie 8.2.0 DebianExtraPackages_jessie chiark-scripts_6.0.3~citrix1_all.deb -# These should normally be the same. -MicrocodeUpdateAmd64 microcode.x86.2015-06-12.cpio -MicrocodeUpdateI386 microcode.x86.2015-06-12.cpio - XenUsePath /usr/groups/xencore/systems/bin/xenuse XenUseUser osstest
ts-xen-install +0 -7
@@ -209,13 +209,6 @@ sub setupboot () { my $mem = $r{'dom0_mem'} // 512; $xenhopt .= " dom0_mem=${mem}M,max:${mem}M"; } - - # If /boot/microcode.cpio is present then ts-host-install has - # arranged that it will be prepended to the initrd already, all we - # need to do is look for it. - $xenhopt .= " ucode=scan" - if target_file_exists($ho, "/boot/microcode.cpio"); - my $append= $r{xen_boot_append}; $xenhopt .= " $append" if defined $append; $append = get_host_property($ho, 'xen-commandline-append', undef);
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH 3/3 microcode: Install Debian microcode packages and add ucode=scan
In reply to Ian JacksonWe are no longer using the frozen-in-amber microcode from 2015. Now we use current microcode from Debian (or hopefully in future via other distros).
Empirically this fixes the XSA-308 test on rimava1, which was failing and producing very strange symptoms.
--- ts-host-install | 6 ++++++ ts-xen-install | 2 ++ 2 files changed, 8 insertions(+)
ts-host-install +6 -0
@@ -139,6 +139,12 @@ END target_cmd_root($ho, "chmod 2775 /root"); target_install_packages($ho, qw(ed)); + if ($ho->{Arch} =~ m/^(?:i386|amd64)$/) { + # We don't necessarily know the CPU vendor, but the Debian + # packaged microcode doesn't mind us installing both. + target_install_packages_nonfree_nonconcurrent($ho, + qw(amd64-microcode intel-microcode)); + } my $ntpserver = get_target_property($ho, 'NtpServer'); if ($ntpserver) {
ts-xen-install +2 -0
@@ -209,6 +209,8 @@ sub setupboot () { my $mem = $r{'dom0_mem'} // 512; $xenhopt .= " dom0_mem=${mem}M,max:${mem}M"; } + $xenhopt .= " ucode=scan"; + my $append= $r{xen_boot_append}; $xenhopt .= " $append" if defined $append; $append = get_host_property($ho, 'xen-commandline-append', undef);
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [OSSTEST PATCH 3/3] microcode: Install Debian microcode packages and add ucode=scan
Quoted 9 lines · Ian Jackson
We are no longer using the frozen-in-amber microcode from 2015. Now we use current microcode from Debian (or hopefully in future via other distros).
Empirically this fixes the XSA-308 test on rimava1, which was failing and producing very strange symptoms.
CC Andrew Cooper <[email protected]>Signed-off-by Ian Jackson <[email protected]>
This is a definite improvement over the status quo.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel