[pve-devel] [RFC pve-container 2/2] enable emulation of arm64 based containers
Dietmar Maurer
dietmar at proxmox.com
Fri Sep 14 13:31:03 CEST 2018
You need to install package qemu-user-static which provides
the emulation toolkit.
Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
src/PVE/LXC/Setup.pm | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/PVE/LXC/Setup.pm b/src/PVE/LXC/Setup.pm
index 1b89f28..7d522cc 100644
--- a/src/PVE/LXC/Setup.pm
+++ b/src/PVE/LXC/Setup.pm
@@ -285,7 +285,19 @@ sub pre_start_hook {
return if !$self->{plugin}; # unmanaged
+ my $emul;
+ my $emul_data;
+ if ($self->{conf}->{arch} eq 'arm64') {
+ $emul = "/usr/bin/qemu-aarch64-static";
+ $emul_data = PVE::Tools::file_get_contents($emul, 10*1024*1024) if -f $emul;
+ }
+
my $code = sub {
+
+ if ($emul && $emul_data) {
+ $self->{plugin}->ct_file_set_contents($emul, $emul_data, 0755);
+ }
+
# Create /fastboot to skip run fsck
$self->{plugin}->ct_file_set_contents('/fastboot', '');
--
2.11.0
More information about the pve-devel
mailing list