mirror of
https://github.com/systemd/systemd.git
synced 2025-03-31 14:50:15 +03:00
Merge pull request #21857 from loongarch64/dev-pr1
LoongArch: dmi, virt detection and testcase
This commit is contained in:
commit
c99d5efc2d
@ -139,7 +139,7 @@ static int detect_vm_device_tree(void) {
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)
|
||||
#if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || defined(__loongarch64)
|
||||
static int detect_vm_dmi_vendor(void) {
|
||||
static const char *const dmi_vendors[] = {
|
||||
"/sys/class/dmi/id/product_name", /* Test this before sys_vendor to detect KVM over QEMU */
|
||||
@ -226,10 +226,10 @@ static int detect_vm_smbios(void) {
|
||||
log_debug("DMI BIOS Extension table does not indicate virtualization.");
|
||||
return SMBIOS_VM_BIT_UNSET;
|
||||
}
|
||||
#endif /* defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) */
|
||||
#endif /* defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || defined(__loongarch64) */
|
||||
|
||||
static int detect_vm_dmi(void) {
|
||||
#if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)
|
||||
#if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || defined(__loongarch64)
|
||||
|
||||
int r;
|
||||
r = detect_vm_dmi_vendor();
|
||||
|
@ -381,6 +381,8 @@ static void test_exec_personality(Manager *m) {
|
||||
|
||||
#elif defined(__i386__)
|
||||
test(m, "exec-personality-x86.service", 0, CLD_EXITED);
|
||||
#elif defined(__loongarch64)
|
||||
test(m, "exec-personality-loongarch64.service", 0, CLD_EXITED);
|
||||
#else
|
||||
log_notice("Unknown personality, skipping %s", __func__);
|
||||
#endif
|
||||
|
@ -133,7 +133,7 @@ udev_progs = [['ata_id/ata_id.c'],
|
||||
'mtd_probe/mtd_probe.h',
|
||||
'mtd_probe/probe_smartmedia.c']]
|
||||
|
||||
dmi_arches = ['x86', 'x86_64', 'aarch64', 'arm', 'ia64', 'mips']
|
||||
dmi_arches = ['x86', 'x86_64', 'aarch64', 'arm', 'ia64', 'loongarch64', 'mips']
|
||||
if dmi_arches.contains(host_machine.cpu_family())
|
||||
udev_progs += [['dmi_memory_id/dmi_memory_id.c']]
|
||||
endif
|
||||
|
7
test/test-execute/exec-personality-loongarch64.service
Normal file
7
test/test-execute/exec-personality-loongarch64.service
Normal file
@ -0,0 +1,7 @@
|
||||
[Unit]
|
||||
Description=Test for Personality=loongarch64
|
||||
|
||||
[Service]
|
||||
ExecStart=/bin/sh -c 'echo $(uname -m); exit $(test $(uname -m) = "loongarch64")'
|
||||
Type=oneshot
|
||||
Personality=loongarch64
|
Loading…
x
Reference in New Issue
Block a user