Initial Commit

- initial default booting image
This commit is contained in:
2026-11-06 20:45:42 +01:00
commit b8783708ae
15201 changed files with 602532 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
config BR2_PACKAGE_KVM_UNIT_TESTS_ARCH_SUPPORTS
bool
# On ARM, it needs virtualization extensions and little endian CPUs
default y if BR2_arm && \
(BR2_cortex_a7 || BR2_cortex_a12 || \
BR2_cortex_a15 || BR2_cortex_a15_a7 || \
BR2_cortex_a17 || BR2_cortex_a17_a7 || \
BR2_cortex_a76 || BR2_cortex_a76_a55)
# For AArch64 we can assume all v8.0+ support virtualization
default y if BR2_aarch64
default y if BR2_riscv
default y if BR2_i386 || BR2_x86_64
default y if BR2_powerpc64 || BR2_powerpc64le
default y if BR2_s390x
config BR2_PACKAGE_KVM_UNIT_TESTS
bool "kvm-unit-tests"
depends on BR2_PACKAGE_KVM_UNIT_TESTS_ARCH_SUPPORTS
# on i386 and x86-64, __builtin_reachable is used, so we need
# gcc 4.5 at least. on i386, we use the target gcc, while on
# x86-64 we use the host gcc (see .mk file for details)
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_5 || !BR2_i386
depends on BR2_HOSTARCH = "x86_64" || !BR2_x86_64
select BR2_HOSTARCH_NEEDS_IA32_COMPILER if BR2_x86_64
help
kvm-unit-tests is a project as old as KVM. As its name
suggests, it's purpose is to provide unit tests for KVM. The
unit tests are tiny guest operating systems that generally
execute only tens of lines of C and assembler test code in
order to obtain its PASS/FAIL result. Unit tests provide KVM
and virt hardware functional testing by targeting the
features through minimal implementations of their use per
the hardware specification. The simplicity of unit tests
make them easy to verify they are correct, easy to maintain,
and easy to use in timing measurements. Unit tests are also
often used for quick and dirty bug reproducers. The
reproducers may then be kept as regression tests. It's
strongly encouraged that patches implementing new KVM
features are submitted with accompanying unit tests.
http://www.linux-kvm.org/page/KVM-unit-tests
comment "kvm-unit-tests needs a toolchain w/ gcc >= 4.5"
depends on BR2_i386
depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_4_5

View File

@@ -0,0 +1,4 @@
# Locally computed
sha256 0d3b588163064be2188b668abdebb4183ac211eab83d0a3cdc9a93f463686bc3 kvm-unit-tests-v2026-04-17.tar.bz2
sha256 b3c9ca9e257f2eaae070cf0ccdf8770764f05a947a39a835e633413750a5777b COPYRIGHT
sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 LICENSE

View File

@@ -0,0 +1,67 @@
################################################################################
#
# kvm-unit-tests
#
################################################################################
KVM_UNIT_TESTS_VERSION = 2026-04-17
KVM_UNIT_TESTS_SOURCE = kvm-unit-tests-v$(KVM_UNIT_TESTS_VERSION).tar.bz2
KVM_UNIT_TESTS_SITE = https://gitlab.com/kvm-unit-tests/kvm-unit-tests/-/archive/v$(KVM_UNIT_TESTS_VERSION)
KVM_UNIT_TESTS_LICENSE = GPL-2.0, LGPL-2.0
KVM_UNIT_TESTS_LICENSE_FILES = COPYRIGHT LICENSE
ifeq ($(BR2_aarch64)$(BR2_aarch64_be),y)
KVM_UNIT_TESTS_ARCH = aarch64
else ifeq ($(BR2_arm),y)
KVM_UNIT_TESTS_ARCH = arm
else ifeq ($(BR2_i386),y)
KVM_UNIT_TESTS_ARCH = i386
else ifeq ($(BR2_powerpc64)$(BR2_powerpc64le),y)
KVM_UNIT_TESTS_ARCH = ppc64
else ifeq ($(BR2_RISCV_32),y)
KVM_UNIT_TESTS_ARCH = riscv32
else ifeq ($(BR2_RISCV_64),y)
KVM_UNIT_TESTS_ARCH = riscv64
else ifeq ($(BR2_s390x),y)
KVM_UNIT_TESTS_ARCH = s390x
else ifeq ($(BR2_x86_64),y)
KVM_UNIT_TESTS_ARCH = x86_64
endif
ifeq ($(BR2_ENDIAN),"LITTLE")
KVM_UNIT_TESTS_ENDIAN = little
else
KVM_UNIT_TESTS_ENDIAN = big
endif
KVM_UNIT_TESTS_CONF_OPTS =\
--disable-werror \
--arch="$(KVM_UNIT_TESTS_ARCH)" \
--processor="$(GCC_TARGET_CPU)" \
--endian="$(KVM_UNIT_TESTS_ENDIAN)"
# For all architectures but x86-64, we use the target
# compiler. However, for x86-64, we use the host compiler, as
# kvm-unit-tests builds 32 bit code, which Buildroot toolchains for
# x86-64 cannot do.
ifeq ($(BR2_x86_64),)
KVM_UNIT_TESTS_CONF_OPTS += --cross-prefix="$(TARGET_CROSS)"
endif
define KVM_UNIT_TESTS_CONFIGURE_CMDS
cd $(@D) && ./configure $(KVM_UNIT_TESTS_CONF_OPTS)
endef
define KVM_UNIT_TESTS_BUILD_CMDS
$(TARGET_MAKE_ENV) $(MAKE) $(KVM_UNIT_TESTS_MAKE_OPTS) -C $(@D) \
standalone
endef
define KVM_UNIT_TESTS_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) $(KVM_UNIT_TESTS_MAKE_OPTS) -C $(@D) \
DESTDIR=$(TARGET_DIR)/usr/share/kvm-unit-tests/ \
install
endef
# Does use configure script but not an autotools one
$(eval $(generic-package))