@@ -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) = @_;
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. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> --- Osstest/TestSupport.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)