test_dtbocfg.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import os
  2. import infra.basetest
  3. class TestDtbocfg(infra.basetest.BRTest):
  4. config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
  5. """
  6. BR2_LINUX_KERNEL=y
  7. BR2_LINUX_KERNEL_CUSTOM_VERSION=y
  8. BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.10.7"
  9. BR2_LINUX_KERNEL_USE_DEFCONFIG=y
  10. BR2_LINUX_KERNEL_DEFCONFIG="vexpress"
  11. BR2_PACKAGE_DTBOCFG=y
  12. BR2_TARGET_ROOTFS_CPIO=y
  13. # BR2_TARGET_ROOTFS_TAR is not set
  14. """
  15. def test_run(self):
  16. img = os.path.join(self.builddir, "images", "rootfs.cpio")
  17. kernel = os.path.join(self.builddir, "images", "zImage")
  18. kernel_cmdline = ["console=ttyAMA0"]
  19. dtb = infra.download(self.downloaddir, "vexpress-v2p-ca9.dtb")
  20. options = ["-M", "vexpress-a9", "-dtb", dtb, "-initrd", img]
  21. self.emulator.boot(arch="armv7", kernel=kernel,
  22. kernel_cmdline=kernel_cmdline,
  23. options=options)
  24. self.emulator.login()
  25. self.assertRunOk("modprobe dtbocfg.ko")
  26. self.assertRunOk("mkdir /tmp/config && mount -t configfs none /tmp/config")
  27. # Check that overlays directory is present.
  28. # From dtbocfg site (https://github.com/ikwzm/dtbocfg):
  29. # If /config/device-tree/overlays is created, it is ready to use
  30. # dtbocfg
  31. self.assertRunOk("ls /tmp/config/device-tree/overlays/")