From: Ian Campbell Subject: [PATCH OSSTEST v5 06/24] Debian: Refactor installation of overlays, so it can be used for guests too Date: Wed, 15 Apr 2015 11:35:31 +0100 Message-ID: <1429094149-6849-6-git-send-email-ian.campbell@citrix.com> References: <1429094135.15516.187.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1429094135.15516.187.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: ian.jackson@eu.citrix.com Cc: longtaox.pang@intel.com, Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Signed-off-by: Ian Campbell Acked-by: Ian Jackson Cc: longtaox.pang@intel.com --- v5: OverLay local now handled preseed_base since all callers called it v3: New patch fixup: Move OverlayLocal to preseed_base --- Osstest/Debian.pm | 58 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm index 5daa19f..a0aedfa 100644 --- a/Osstest/Debian.pm +++ b/Osstest/Debian.pm @@ -38,7 +38,9 @@ BEGIN { preseed_base preseed_create preseed_ssh - preseed_hook_command preseed_hook_installscript preseed_hook_cmds + preseed_hook_command preseed_hook_installscript + preseed_hook_overlay + preseed_hook_cmds di_installcmdline_core ); %EXPORT_TAGS = ( ); @@ -610,6 +612,7 @@ sub preseed_base ($$$$;@) { my ($ho,$suite,$sfx,$extra_packages,%xopts) = @_; preseed_ssh($ho, $sfx); + preseed_hook_overlay($ho, $sfx, $c{OverlayLocal}, 'overlay-local.tar'); my $preseed = <<"END"; d-i mirror/suite string $suite @@ -702,26 +705,6 @@ sub preseed_create ($$;@) { my $d_i= $ho->{Tftp}{Path}.'/'.$ho->{Tftp}{DiBase}.'/'.$r{arch}.'/'. $c{TftpDiVersion}.'-'.$ho->{Suite}; - my $overlays= ''; - my $create_overlay= sub { - my ($srcdir, $tfilename) = @_; - my $url= create_webfile($ho, "$tfilename$sfx", sub { - my ($fh) = @_; - contents_make_cpio($fh, 'ustar', $srcdir); - }); - $overlays .= <('overlay', 'overlay.tar'); - $create_overlay->($c{OverlayLocal}, 'overlay-local.tar'); - preseed_hook_installscript($ho, $sfx, '/lib/partman/init.d', '000override-parted-devices', <> /target/etc/lsb-base-logging.sh - -$overlays - -echo latecmd done. END my $dtbs = "$d_i/dtbs.tar.gz"; @@ -966,6 +944,30 @@ chmod +x '$installer_pathname' END } +sub preseed_hook_overlay ($$$$) { + my ($ho, $sfx, $srcdir, $tfilename) = @_; + my $url= create_webfile($ho, "$tfilename$sfx", sub { + my ($fh) = @_; + contents_make_cpio($fh, 'ustar', $srcdir); + }); + preseed_hook_command($ho, 'late_command', $sfx, <