]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/Tools.pm
new helper get_host_arch
[pve-common.git] / src / PVE / Tools.pm
index 06da78be0d38a8ecc465d9a1363628b46e5cfb53..d4ab2ad30c41b6c3be8119749512b3ed44085a86 100644 (file)
@@ -1613,4 +1613,18 @@ sub readline_nointr {
     return $line;
 }
 
+sub get_host_arch {
+
+    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";
+    }
+}
+
 1;