Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
arch => {
optional => 1,
type => 'string',
- enum => ['amd64', 'i386', 'arm64', 'armhf'],
+ enum => ['amd64', 'i386', 'arm64', 'armhf', 'riscv32', 'riscv64'],
description => "OS architecture type.",
default => 'amd64',
},
0x3e => 'amd64',
0x28 => 'armhf',
0xb7 => 'arm64',
+ 0xf3 => 'riscv',
};
my $elf_fn = '/bin/sh'; # '/bin/sh' is POSIX mandatory
die "'$elf_fn' has unknown ELF machine '$machine'!\n"
if !defined($arch);
+ if ($arch eq 'riscv') {
+ if ($class eq 1) {
+ $arch = 'riscv32';
+ } elsif ($class eq 2) {
+ $arch = 'riscv64';
+ } else {
+ die "'$elf_fn' has invalid class '$class'!\n";
+ }
+ }
+
return $arch;
};