From: Ian Campbell Subject: [PATCH OSSTEST v3 09/19] Debian: Refactor installation of overlays, so it can be used for guests too Date: Mon, 1 Dec 2014 12:57:26 +0000 Message-ID: <1417438656-15451-9-git-send-email-ian.campbell@citrix.com> References: <1417438571.29138.22.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1417438571.29138.22.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: Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Signed-off-by: Ian Campbell --- v3: New patch --- Osstest/Debian.pm | 57 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm index c985913..8ec4a3b 100644 --- a/Osstest/Debian.pm +++ b/Osstest/Debian.pm @@ -36,7 +36,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 = ( ); @@ -565,26 +567,6 @@ sub preseed_create ($$;@) { my $disk= $xopts{DiskDevice} || '/dev/sda'; my $suite= $xopts{Suite} || $c{DebianSuite}; - 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 foreach my $kp (keys %{ $ho->{Flags} }) { @@ -788,6 +765,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, <