projects
/
pve-common.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fbd10e0
)
new helper get_host_arch
author
Dietmar Maurer
<dietmar@proxmox.com>
Thu, 20 Sep 2018 04:21:55 +0000
(06:21 +0200)
committer
Dietmar Maurer
<dietmar@proxmox.com>
Thu, 20 Sep 2018 04:21:55 +0000
(06:21 +0200)
src/PVE/Tools.pm
patch
|
blob
|
blame
|
history
diff --git
a/src/PVE/Tools.pm
b/src/PVE/Tools.pm
index 06da78be0d38a8ecc465d9a1363628b46e5cfb53..d4ab2ad30c41b6c3be8119749512b3ed44085a86 100644
(file)
--- a/
src/PVE/Tools.pm
+++ b/
src/PVE/Tools.pm
@@
-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;