blob: 633541161d8e166aac2c0f6b10360e887342ea7f [file] [log] [blame]
Brad Bishopbec4ebc2022-08-03 09:55:16 -04001#!/bin/bash
2
3# Get parameters from bitbake configuration
4
5source <(bitbake -e gem5-aarch64-native | grep \
6 -e "^STAGING_.*_NATIVE=" \
7 -e "^DEPLOY_DIR.*=" \
8 -e "^GEM5_RUN.*=")
9
10export M5_PATH="${DEPLOY_DIR_IMAGE}"
11
12args=""
13
14if [ -n "${GEM5_RUN_KERNEL}" ]; then
15 kernfile=$(readlink -f ${DEPLOY_DIR_IMAGE}/${GEM5_RUN_KERNEL})
16 args="$args --kernel=$kernfile"
17fi
18
19if [ -n "${GEM5_RUN_DISK}" ]; then
20 diskfile=$(readlink -f ${DEPLOY_DIR_IMAGE}/${GEM5_RUN_DISK})
21 args="$args --disk-image=$diskfile"
22fi
23
24if [ -n "${GEM5_RUN_DTB}" ]; then
25 dtbfile=$(readlink -f ${DEPLOY_DIR_IMAGE}/${GEM5_RUN_DTB})
26 args="$args --dtb=$dtbfile"
27fi
28
29if [ -n "${GEM5_RUN_CMDLINE}" ]; then
30 args="$args --command-line='${GEM5_RUN_CMDLINE}'"
31fi
32
33if [ -n "${GEM5_RUN_EXTRA}" ]; then
34 args="$args ${GEM5_RUN_EXTRA}"
35fi
36
37oe-run-native gem5-aarch64-native ${GEM5_RUN_CONFIG} \
38 ${STAGING_DATADIR_NATIVE}/gem5/${GEM5_RUN_PROFILE} ${args} "$@"
39