pmb: enable riscv64 architecture (MR 2215)

Enable pmbootstrap to work on riscv64 packages, and at the same time
also expand the alpine_to_hostspec list to match upstream (adding
riscv32 and loongarch*).
This commit is contained in:
Luca Weiss 2022-10-14 00:12:37 +02:00 committed by Oliver Smith
parent 61ce6069ed
commit dfada2a522
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
2 changed files with 9 additions and 2 deletions

View File

@ -262,7 +262,7 @@ chroot_outdated = 3600 * 24 * 2
# specify architectures supported by Alpine here. For cross-compiling,
# we need to generate the "musl-$ARCH", "binutils-$ARCH" and "gcc-$ARCH"
# packages (use "pmbootstrap aportgen musl-armhf" etc.).
build_device_architectures = ["armhf", "armv7", "aarch64", "x86_64", "x86"]
build_device_architectures = ["armhf", "armv7", "aarch64", "x86_64", "x86", "riscv64"]
# Packages that will be installed in a chroot before it builds packages
# for the first time
@ -1004,7 +1004,7 @@ newapkbuild_arguments_switches_other = [
# Patterns of package names to ignore for automatic pmaport upgrading
# ("pmbootstrap aportupgrade --all")
upgrade_ignore = ["device-*", "firmware-*", "linux-*", "postmarketos-*",
"*-aarch64", "*-armhf", "*-armv7"]
"*-aarch64", "*-armhf", "*-armv7", "*-riscv64"]
#
# SIDELOAD

View File

@ -36,6 +36,7 @@ def from_chroot_suffix(args, suffix):
def alpine_to_qemu(arch):
"""
Convert the architecture to the string used in the QEMU packaging.
This corresponds to the package name of e.g. qemu-system-aarch64.
"""
mapping = {
@ -44,6 +45,7 @@ def alpine_to_qemu(arch):
"armhf": "arm",
"armv7": "arm",
"aarch64": "aarch64",
"riscv64": "riscv64",
}
for pattern, arch_qemu in mapping.items():
if fnmatch.fnmatch(arch, pattern):
@ -78,6 +80,9 @@ def alpine_to_hostspec(arch):
"armel": "armv5-alpine-linux-musleabi",
"armhf": "armv6-alpine-linux-musleabihf",
"armv7": "armv7-alpine-linux-musleabihf",
"loongarch32": "loongarch32-alpine-linux-musl",
"loongarchx32": "loongarchx32-alpine-linux-musl",
"loongarch64": "loongarch64-alpine-linux-musl",
"mips": "mips-alpine-linux-musl",
"mips64": "mips64-alpine-linux-musl",
"mipsel": "mipsel-alpine-linux-musl",
@ -85,6 +90,8 @@ def alpine_to_hostspec(arch):
"ppc": "powerpc-alpine-linux-musl",
"ppc64": "powerpc64-alpine-linux-musl",
"ppc64le": "powerpc64le-alpine-linux-musl",
"riscv32": "riscv32-alpine-linux-musl",
"riscv64": "riscv64-alpine-linux-musl",
"s390x": "s390x-alpine-linux-musl",
"x86": "i586-alpine-linux-musl",
"x86_64": "x86_64-alpine-linux-musl",