[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 40/62] preseed_base: break out debian_overlays_fixup_cmd



We are going to want this for guests too.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 Osstest/Debian.pm | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index d76dd03d..78d242e4 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -36,7 +36,7 @@ BEGIN {
     @EXPORT      = qw(debian_boot_setup
                       di_installer_path di_special_kernel
                       setupboot_bootloader_edited_rune
-                      debian_overlays
+                      debian_overlays debian_overlays_fixup_cmd
                       debian_guest_suite debian_guest_di_version
                       %preseed_cmds
                       preseed_base
@@ -815,6 +815,14 @@ sub debian_overlays ($$) {
     $maybe->("$c{OverlayLocal}-$suite", 'overlay-local-$suite.tar');
 }
 
+sub debian_overlays_fixup_cmd ($;$) {
+    my ($ho, $subdir) = @_;
+    $subdir //= '';
+    return <<END;
+chmod 600 $subdir/etc/ssh/ssh_host_*_key ||:
+END
+}
+
 sub preseed_base ($$$;@) {
     my ($ho,$sfx,$extra_packages,%xopts) = @_;
 
@@ -873,10 +881,10 @@ END
 
     # Host private keys in the overlays have to be group-readable
     # at least, or no-one can use them.  But ssh is very fussy.
-    preseed_hook_command($ho, 'late_command', $sfx, <<END);
+    preseed_hook_command($ho, 'late_command', $sfx,
+                        <<END. debian_overlays_fixup_cmd($ho, '/target'));
 #!/bin/sh
 set -ex
-chmod 600 /target/etc/ssh/ssh_host_*_key ||:
 END
 
     my $preseed = <<"END";
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.