mirror of
https://git.yoctoproject.org/meta-arm
synced 2026-07-19 04:47:08 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2e2dbc2587 | |||
| ab574b084e | |||
| b4f52f2642 | |||
| 2d22a1f7ae | |||
| ba86aeb31f | |||
| 48524c32d5 | |||
| 4b1a0c7484 | |||
| 2824f6a58b | |||
| 0a64644bc9 | |||
| 491cac17fe | |||
| 328d95e27d | |||
| 99b9ee4470 |
@@ -0,0 +1 @@
|
|||||||
|
__pycache__
|
||||||
+4
-1
@@ -27,6 +27,7 @@ stages:
|
|||||||
- mkdir --verbose --parents $KAS_WORK_DIR $KAS_REPO_REF_DIR $SSTATE_DIR $DL_DIR $TOOLCHAIN_DIR $TOOLCHAIN_LINK_DIR
|
- mkdir --verbose --parents $KAS_WORK_DIR $KAS_REPO_REF_DIR $SSTATE_DIR $DL_DIR $TOOLCHAIN_DIR $TOOLCHAIN_LINK_DIR
|
||||||
# Must do this here, as it's the only way to make sure the toolchain is installed on the same builder
|
# Must do this here, as it's the only way to make sure the toolchain is installed on the same builder
|
||||||
- ./ci/get-binary-toolchains $DL_DIR $TOOLCHAIN_DIR $TOOLCHAIN_LINK_DIR
|
- ./ci/get-binary-toolchains $DL_DIR $TOOLCHAIN_DIR $TOOLCHAIN_LINK_DIR
|
||||||
|
- sudo apt update && sudo apt install telnet -y
|
||||||
|
|
||||||
# Generalised fragment to do a Kas build
|
# Generalised fragment to do a Kas build
|
||||||
.build:
|
.build:
|
||||||
@@ -108,8 +109,10 @@ corstone700-fvp:
|
|||||||
corstone700-mps3:
|
corstone700-mps3:
|
||||||
extends: .build
|
extends: .build
|
||||||
|
|
||||||
fvp-base:
|
fvp-base/testimage:
|
||||||
extends: .build
|
extends: .build
|
||||||
|
tags:
|
||||||
|
- x86_64
|
||||||
|
|
||||||
fvp-base-arm32:
|
fvp-base-arm32:
|
||||||
extends: .build
|
extends: .build
|
||||||
|
|||||||
+1
-1
@@ -41,7 +41,7 @@ local_conf_header:
|
|||||||
BB_HASHSERVE_UPSTREAM = "typhoon.yocto.io:8687"
|
BB_HASHSERVE_UPSTREAM = "typhoon.yocto.io:8687"
|
||||||
BB_HASHSERVE = "auto"
|
BB_HASHSERVE = "auto"
|
||||||
BB_SIGNATURE_HANDLER = "OEEquivHash"
|
BB_SIGNATURE_HANDLER = "OEEquivHash"
|
||||||
SSTATE_MIRRORS = "file://.* https://sstate.yoctoproject.org/dev/PATH;downloadfilename=PATH"
|
SSTATE_MIRRORS = "file://.* http://sstate.yoctoproject.org/dev/PATH;downloadfilename=PATH"
|
||||||
|
|
||||||
machine: unset
|
machine: unset
|
||||||
|
|
||||||
|
|||||||
@@ -5,3 +5,12 @@ header:
|
|||||||
|
|
||||||
machine: fvp-base
|
machine: fvp-base
|
||||||
|
|
||||||
|
local_conf_header:
|
||||||
|
testimagefvp: |
|
||||||
|
INHERIT = "fvpboot"
|
||||||
|
# This fails but we can't add to the ignorelist from meta-arm yet
|
||||||
|
# https://bugzilla.yoctoproject.org/show_bug.cgi?id=14604
|
||||||
|
TEST_SUITES:remove = "parselogs"
|
||||||
|
# Tell testimage to connect to localhost:8022, and forward that to SSH in the FVP.
|
||||||
|
TEST_TARGET_IP = "localhost:8022"
|
||||||
|
FVP_CONFIG[bp.virtio_net.hostbridge.userNetPorts] ?= "8022=22"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ machine: fvp-baser-aemv8r64
|
|||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
repos:
|
repos:
|
||||||
refspec: master
|
refspec: honister
|
||||||
|
|
||||||
repos:
|
repos:
|
||||||
meta-arm:
|
meta-arm:
|
||||||
|
|||||||
@@ -25,3 +25,5 @@ EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot"
|
|||||||
# initialise) and install the pre-generated keys.
|
# initialise) and install the pre-generated keys.
|
||||||
PACKAGECONFIG:remove:pn-openssh = "rng-tools"
|
PACKAGECONFIG:remove:pn-openssh = "rng-tools"
|
||||||
MACHINE_EXTRA_RRECOMMENDS += "ssh-pregen-hostkeys"
|
MACHINE_EXTRA_RRECOMMENDS += "ssh-pregen-hostkeys"
|
||||||
|
|
||||||
|
TEST_TARGET = "OEFVPTarget"
|
||||||
|
|||||||
+1
-2
@@ -1,14 +1,13 @@
|
|||||||
include features/input/input.scc
|
include features/input/input.scc
|
||||||
include cfg/timer/no_hz.scc
|
include cfg/timer/no_hz.scc
|
||||||
|
include cfg/virtio.scc
|
||||||
|
|
||||||
kconf hardware fvp-arm32/fvp-board.cfg
|
kconf hardware fvp-arm32/fvp-board.cfg
|
||||||
kconf hardware fvp-arm32/fvp-features.cfg
|
kconf hardware fvp-arm32/fvp-features.cfg
|
||||||
kconf hardware fvp/fvp-net.cfg
|
kconf hardware fvp/fvp-net.cfg
|
||||||
kconf hardware fvp/fvp-rtc.cfg
|
kconf hardware fvp/fvp-rtc.cfg
|
||||||
kconf hardware fvp/fvp-serial.cfg
|
kconf hardware fvp/fvp-serial.cfg
|
||||||
kconf hardware fvp/fvp-virtio.cfg
|
|
||||||
kconf hardware fvp/fvp-cfi.cfg
|
kconf hardware fvp/fvp-cfi.cfg
|
||||||
kconf hardware fvp/fvp-drm.cfg
|
kconf hardware fvp/fvp-drm.cfg
|
||||||
kconf hardware fvp/fvp-timer.cfg
|
kconf hardware fvp/fvp-timer.cfg
|
||||||
kconf hardware fvp/fvp-virtio.cfg
|
|
||||||
kconf hardware fvp/fvp-watchdog.cfg
|
kconf hardware fvp/fvp-watchdog.cfg
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
include features/input/input.scc
|
include features/input/input.scc
|
||||||
include features/net/net.scc
|
include features/net/net.scc
|
||||||
include cfg/timer/no_hz.scc
|
include cfg/timer/no_hz.scc
|
||||||
|
include cfg/virtio.scc
|
||||||
|
|
||||||
kconf hardware fvp/fvp-board.cfg
|
kconf hardware fvp/fvp-board.cfg
|
||||||
kconf hardware fvp/fvp-net.cfg
|
kconf hardware fvp/fvp-net.cfg
|
||||||
kconf hardware fvp/fvp-rtc.cfg
|
kconf hardware fvp/fvp-rtc.cfg
|
||||||
kconf hardware fvp/fvp-serial.cfg
|
kconf hardware fvp/fvp-serial.cfg
|
||||||
kconf hardware fvp/fvp-virtio.cfg
|
|
||||||
kconf hardware fvp/fvp-cfi.cfg
|
kconf hardware fvp/fvp-cfi.cfg
|
||||||
kconf hardware fvp/fvp-drm.cfg
|
kconf hardware fvp/fvp-drm.cfg
|
||||||
kconf hardware fvp/fvp-timer.cfg
|
kconf hardware fvp/fvp-timer.cfg
|
||||||
kconf hardware fvp/fvp-virtio.cfg
|
|
||||||
kconf hardware fvp/fvp-watchdog.cfg
|
kconf hardware fvp/fvp-watchdog.cfg
|
||||||
|
|||||||
-4
@@ -1,4 +0,0 @@
|
|||||||
CONFIG_VIRTIO=y
|
|
||||||
CONFIG_VIRTIO_MMIO=y
|
|
||||||
CONFIG_BLOCK=y
|
|
||||||
CONFIG_VIRTIO_BLK=y
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# This is needed so that multiple locations can provide the same package
|
||||||
|
from pkgutil import extend_path
|
||||||
|
__path__ = extend_path(__path__, __name__)
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
import asyncio
|
||||||
|
import os
|
||||||
|
import pathlib
|
||||||
|
import signal
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
import oeqa.core.target.ssh
|
||||||
|
|
||||||
|
class OEFVPTarget(oeqa.core.target.ssh.OESSHTarget):
|
||||||
|
|
||||||
|
# meta-arm/scripts isn't on PATH, so work out where it is
|
||||||
|
metaarm = pathlib.Path(__file__).parents[4]
|
||||||
|
|
||||||
|
def __init__(self, logger, target_ip, server_ip, timeout=300, user='root',
|
||||||
|
port=None, server_port=0, dir_image=None, rootfs=None, bootlog=None,
|
||||||
|
**kwargs):
|
||||||
|
super().__init__(logger, target_ip, server_ip, timeout, user, port)
|
||||||
|
image_dir = pathlib.Path(dir_image)
|
||||||
|
basename = pathlib.Path(rootfs).stem
|
||||||
|
self.fvpconf = image_dir / (basename + ".fvpconf")
|
||||||
|
|
||||||
|
if not self.fvpconf.exists():
|
||||||
|
raise FileNotFoundError(f"Cannot find {self.fvpconf}")
|
||||||
|
# FVPs boot slowly, so allow ten minutes
|
||||||
|
self.boot_timeout = 10 * 60
|
||||||
|
|
||||||
|
self.logfile = bootlog and open(bootlog, "wb") or None
|
||||||
|
|
||||||
|
async def boot_fvp(self):
|
||||||
|
cmd = [OEFVPTarget.metaarm / "scripts" / "runfvp", "--console", "--verbose", self.fvpconf]
|
||||||
|
# Python 3.7 needs the command items to be str
|
||||||
|
cmd = [str(c) for c in cmd]
|
||||||
|
self.logger.debug(f"Starting {cmd}")
|
||||||
|
|
||||||
|
# TODO: refactor runfvp so this can import it and directly hook to the
|
||||||
|
# console callback, then use telnetlib directly to access the console.
|
||||||
|
|
||||||
|
# As we're using --console, telnet expects stdin to be readable too.
|
||||||
|
self.fvp = await asyncio.create_subprocess_exec(*cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, stdin=subprocess.PIPE)
|
||||||
|
self.logger.debug(f"Started runfvp PID {self.fvp.pid}")
|
||||||
|
|
||||||
|
async def wait_for_login():
|
||||||
|
bootlog = bytearray()
|
||||||
|
while True:
|
||||||
|
line = await self.fvp.stdout.read(1024)
|
||||||
|
if not line:
|
||||||
|
self.logger.debug("runfvp terminated")
|
||||||
|
return False, bootlog
|
||||||
|
|
||||||
|
self.logger.debug(f"Read line [{line}]")
|
||||||
|
|
||||||
|
bootlog += line
|
||||||
|
if self.logfile:
|
||||||
|
self.logfile.write(line)
|
||||||
|
|
||||||
|
if b" login:" in bootlog:
|
||||||
|
self.logger.debug("Found login prompt")
|
||||||
|
return True, bootlog
|
||||||
|
return False, bootlog
|
||||||
|
|
||||||
|
try:
|
||||||
|
found, bootlog = await asyncio.wait_for(wait_for_login(), self.boot_timeout)
|
||||||
|
if found:
|
||||||
|
return
|
||||||
|
except asyncio.TimeoutError:
|
||||||
|
self.logger.info("Timed out waiting for login prompt.")
|
||||||
|
self.logger.info(b"".join(bootlog.splitlines()[-20:]).decode("utf-8", errors="replace"))
|
||||||
|
raise RuntimeError("Failed to start FVP.")
|
||||||
|
|
||||||
|
def start(self, **kwargs):
|
||||||
|
# When we can assume Py3.7+, this can simply be asyncio.run()
|
||||||
|
loop = asyncio.get_event_loop()
|
||||||
|
loop.run_until_complete(asyncio.gather(self.boot_fvp()))
|
||||||
|
|
||||||
|
def stop(self, **kwargs):
|
||||||
|
loop = asyncio.get_event_loop()
|
||||||
|
|
||||||
|
# Kill the process group so that the telnet and FVP die too
|
||||||
|
gid = os.getpgid(self.fvp.pid)
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.logger.debug(f"Sending SIGTERM to {gid}")
|
||||||
|
os.killpg(gid, signal.SIGTERM)
|
||||||
|
loop.run_until_complete(asyncio.wait_for(self.fvp.wait(), 10))
|
||||||
|
except TimeoutError:
|
||||||
|
self.logger.debug(f"Timed out, sending SIGKILL to {gid}")
|
||||||
|
os.killpg(gid, signal.SIGKILL)
|
||||||
@@ -69,8 +69,8 @@ python() {
|
|||||||
|
|
||||||
PACKAGECONFIG ??= "cc-gnuarm"
|
PACKAGECONFIG ??= "cc-gnuarm"
|
||||||
# What compiler to use
|
# What compiler to use
|
||||||
PACKAGECONFIG[cc-gnuarm] = "-DTFM_TOOLCHAIN_FILE=toolchain_GNUARM.cmake,,gcc-arm-none-eabi-native"
|
PACKAGECONFIG[cc-gnuarm] = "-DTFM_TOOLCHAIN_FILE=${S}/toolchain_GNUARM.cmake,,gcc-arm-none-eabi-native"
|
||||||
PACKAGECONFIG[cc-armclang] = "-DTFM_TOOLCHAIN_FILE=toolchain_ARMCLANG.cmake,,armcompiler-native"
|
PACKAGECONFIG[cc-armclang] = "-DTFM_TOOLCHAIN_FILE=${S}/toolchain_ARMCLANG.cmake,,armcompiler-native"
|
||||||
# Whether to integrate the test suite
|
# Whether to integrate the test suite
|
||||||
PACKAGECONFIG[test-secure] = "-DTEST_S=ON,-DTEST_S=OFF"
|
PACKAGECONFIG[test-secure] = "-DTEST_S=ON,-DTEST_S=OFF"
|
||||||
PACKAGECONFIG[test-nonsecure] = "-DTEST_NS=ON,-DTEST_NS=OFF"
|
PACKAGECONFIG[test-nonsecure] = "-DTEST_NS=ON,-DTEST_NS=OFF"
|
||||||
@@ -101,7 +101,7 @@ do_patch[postfuncs] += "apply_local_patches"
|
|||||||
|
|
||||||
do_configure[cleandirs] = "${B}"
|
do_configure[cleandirs] = "${B}"
|
||||||
do_configure() {
|
do_configure() {
|
||||||
cmake -G"Unix Makefiles" -S ${S} -B ${B} ${EXTRA_OECMAKE}
|
cmake -G"Unix Makefiles" -S ${S} -B ${B} ${EXTRA_OECMAKE} ${PACKAGECONFIG_CONFARGS}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Invoke install here as there's no point in splitting compile from install: the
|
# Invoke install here as there's no point in splitting compile from install: the
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ inherit scons native
|
|||||||
# google protobuf
|
# google protobuf
|
||||||
# pkgconfig
|
# pkgconfig
|
||||||
# hdf5
|
# hdf5
|
||||||
DEPENDS += "python3-six-native protobuf-native hdf5-native pkgconfig-native \
|
DEPENDS += "m4-native python3-six-native protobuf-native hdf5-native pkgconfig-native \
|
||||||
boost-native libpng-native"
|
boost-native libpng-native"
|
||||||
|
|
||||||
EXTRA_OESCONS = "${GEM5_SCONS_ARGS}"
|
EXTRA_OESCONS = "${GEM5_SCONS_ARGS}"
|
||||||
|
|||||||
@@ -217,6 +217,9 @@ def runfvp(cli_args):
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
try:
|
try:
|
||||||
|
# Set the process group so that it's possible to kill runfvp and
|
||||||
|
# everything it spawns easily.
|
||||||
|
os.setpgid(0, 0)
|
||||||
runfvp(sys.argv[1:])
|
runfvp(sys.argv[1:])
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user