--- /dev/null
+include etc/mic.conf.in
+
armv5tel
armv5tejl
armv7tnhl
+ riscv64
"
pkgmgr_values="
yum
r"Intel 80[0-9]86": "i686",
r"x86-64": "x86_64",
r"ARM": "arm",
+ r"RISC-V": "riscv64",
}
for path in chkfiles:
qemu_emulators = misc.setup_qemu_emulator(chrootdir, "arm")
elif arch == "mipsel":
qemu_emulators = misc.setup_qemu_emulator(chrootdir, "mipsel")
+ elif arch == "riscv64":
+ qemu_emulators = misc.setup_qemu_emulator(chrootdir, "riscv64")
else:
qemu_emulators = []
"\tYou can disable vdso with following command before "
"starting image build:\n"
"\techo 0 | sudo tee /proc/sys/vm/vdso_enabled")
+ elif self.target_arch == "riscv64":
+ for dep in self._dep_checks:
+ if dep == "extlinux":
+ self._dep_checks.remove(dep)
+
+ if not os.path.exists("/usr/bin/qemu-riscv64") or \
+ not misc.is_statically_linked("/usr/bin/qemu-riscv64"):
+ self._dep_checks.append("qemu-riscv64-static")
+
+ if os.path.exists("/proc/sys/vm/vdso_enabled"):
+ vdso_fh = open("/proc/sys/vm/vdso_enabled","r")
+ vdso_value = vdso_fh.read().strip()
+ vdso_fh.close()
+ if (int)(vdso_value) == 1:
+ msger.warning("vdso is enabled on your host, which might "
+ "cause problems with riscv64 emulations.\n"
+ "\tYou can disable vdso with following command before "
+ "starting image build:\n"
+ "\techo 0 | sudo tee /proc/sys/vm/vdso_enabled")
# make sure the specified tmpdir and cachedir exist
if not os.path.exists(self.tmpdir):
fs.makedirs(self._instroot + d)
if self.target_arch and self.target_arch.startswith("arm") or \
- self.target_arch == "aarch64":
+ self.target_arch == "aarch64" or self.target_arch == "riscv64":
self.qemu_emulators = misc.setup_qemu_emulator(self._instroot,
self.target_arch)
def _write_image_xml(self):
imgarch = "i686"
- if self.target_arch and self.target_arch.startswith("arm"):
- imgarch = "arm"
+ if self.target_arch:
+ if self.target_arch.startswith("arm"):
+ imgarch = "arm"
+ elif self.target_arch == "riscv64":
+ imgarch = "riscv64"
xml = "<image>\n"
name_attributes = ""
arm_binary = "qemu-mipsel-static"
if not os.path.exists("/usr/bin/%s" % arm_binary):
raise CreatorError("Please install a statically-linked %s" % arm_binary)
+ elif arch == "riscv64":
+ node = "/proc/sys/fs/binfmt_misc/riscv64"
+ arm_binary = "qemu-riscv64"
+ if os.path.exists("/usr/bin/qemu-riscv64") and is_statically_linked("/usr/bin/qemu-riscv64"):
+ arm_binary = "qemu-riscv64"
+ elif os.path.exists("/usr/bin/qemu-riscv64-static"):
+ arm_binary = "qemu-riscv64-static"
+ else:
+ raise CreatorError("Please install a statically-linked %s" % arm_binary)
else:
node = "/proc/sys/fs/binfmt_misc/arm"
arm_binary = "qemu-arm"
qemu_arm_string = ":aarch64:M::\\x7fELF\\x02\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\xb7:\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xfe\\xff\\xff:%s:\n" % qemu_emulator
elif arch == "mipsel":
qemu_arm_string = ":mipsel:M::\\x7fELF\\x01\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x08\\x00:\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\xfe\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xfe\\xff\\xff\\xff:%s:\n" % qemu_emulator
+ elif arch == "riscv64":
+ qemu_arm_string = ":riscv64:M::\\x7fELF\\x02\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\xf3\\x00:\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xfe\\xff\\xff\\xff:%s:\n" % qemu_emulator
else:
qemu_arm_string = ":arm:M::\\x7fELF\\x01\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x28\\x00:\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xfa\\xff\\xff\\xff:%s:\n" % qemu_emulator
"armv5tel": "armv5tel:armv5l:armv4tl:armv4l:armv3l",
"armv5l": "armv5l:armv4tl:armv4l:armv3l",
"mipsel": "mipsel",
+ "riscv64": "riscv64",
}
# dict mapping arch -> ( multicompat, best personality, biarch personality )
"ia64": "noarch",
"mipsel": "mipsel",
+
+ "riscv64": "noarch",
}
def isMultiLibArch(arch=None):