]> git.proxmox.com Git - pve-container.git/commitdiff
use new PVE::Tools::get_host_arch
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 20 Sep 2018 04:59:17 +0000 (06:59 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 20 Sep 2018 04:59:17 +0000 (06:59 +0200)
src/PVE/LXC/Setup.pm

index ff68dc10577b86d5f0ead49540dac75374e2ebf6..90bbb859cfe5c65123c3baa7917e319d583b1794 100644 (file)
@@ -280,20 +280,6 @@ sub rewrite_ssh_host_keys {
     $self->protected_call($code);
 }    
 
-my $get_host_arch = sub {
-
-    my @uname = POSIX::uname();
-    my $machine = $uname[4];
-
-    if ($machine eq 'x86_64') {
-       return 'amd64';
-    } elsif ($machine eq 'aarch64') {
-       return 'arm64';
-    } else {
-       die "unsupported host architecture '$machine'\n";
-    }
-};
-
 my $container_emulator_path = {
     'amd64' => '/usr/bin/qemu-x86_64-static',
     'arm64' => '/usr/bin/qemu-aarch64-static',
@@ -304,7 +290,7 @@ sub pre_start_hook {
 
     return if !$self->{plugin}; # unmanaged
 
-    my $host_arch = $get_host_arch->();
+    my $host_arch = PVE::Tools::get_host_arch();
 
     my $container_arch = $self->{conf}->{arch};