18c2ecf20Sopenharmony_ci#
28c2ecf20Sopenharmony_ci# Example config for cross compiling
38c2ecf20Sopenharmony_ci#
48c2ecf20Sopenharmony_ci# In this config, it is expected that the tool chains from:
58c2ecf20Sopenharmony_ci#
68c2ecf20Sopenharmony_ci#   https://kernel.org/pub/tools/crosstool/files/bin/x86_64/
78c2ecf20Sopenharmony_ci#
88c2ecf20Sopenharmony_ci# running on a x86_64 system have been downloaded and installed into:
98c2ecf20Sopenharmony_ci#
108c2ecf20Sopenharmony_ci#   /usr/local/
118c2ecf20Sopenharmony_ci#
128c2ecf20Sopenharmony_ci# such that the compiler binaries are something like:
138c2ecf20Sopenharmony_ci#
148c2ecf20Sopenharmony_ci#   /usr/local/gcc-4.5.2-nolibc/mips-linux/bin/mips-linux-gcc
158c2ecf20Sopenharmony_ci#
168c2ecf20Sopenharmony_ci# Some of the archs will use gcc-4.5.1 instead of gcc-4.5.2
178c2ecf20Sopenharmony_ci# this config uses variables to differentiate them.
188c2ecf20Sopenharmony_ci# 
198c2ecf20Sopenharmony_ci# Comments describe some of the options, but full descriptions of
208c2ecf20Sopenharmony_ci# options are described in the samples.conf file.
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci# ${PWD} is defined by ktest.pl to be the directory that the user
238c2ecf20Sopenharmony_ci# was in when they executed ktest.pl. It may be better to hardcode the
248c2ecf20Sopenharmony_ci# path name here. THIS_DIR is the variable used through out the config file
258c2ecf20Sopenharmony_ci# in case you want to change it.
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ciTHIS_DIR := ${PWD}
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci# Update the BUILD_DIR option to the location of your git repo you want to test.
308c2ecf20Sopenharmony_ciBUILD_DIR = ${THIS_DIR}/linux.git
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci# The build will go into this directory. It will be created when you run the test.
338c2ecf20Sopenharmony_ciOUTPUT_DIR = ${THIS_DIR}/cross-compile
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci# The build will be compiled with -j8
368c2ecf20Sopenharmony_ciBUILD_OPTIONS = -j8
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci# The test will not stop when it hits a failure.
398c2ecf20Sopenharmony_ciDIE_ON_FAILURE = 0
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci# If you want to have ktest.pl store the failure somewhere, uncomment this option
428c2ecf20Sopenharmony_ci# and change the directory where ktest should store the failures.
438c2ecf20Sopenharmony_ci#STORE_FAILURES = ${THIS_DIR}/failures
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci# The log file is stored in the OUTPUT_DIR called cross.log
468c2ecf20Sopenharmony_ci# If you enable this, you need to create the OUTPUT_DIR. It wont be created for you.
478c2ecf20Sopenharmony_ciLOG_FILE = ${OUTPUT_DIR}/cross.log
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci# The log file will be cleared each time you run ktest.
508c2ecf20Sopenharmony_ciCLEAR_LOG = 1
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci# As some archs do not build with the defconfig, they have been marked
538c2ecf20Sopenharmony_ci# to be ignored. If you want to test them anyway, change DO_FAILED to 1.
548c2ecf20Sopenharmony_ci# If a test that has been marked as DO_FAILED passes, then you should change
558c2ecf20Sopenharmony_ci# that test to be DO_DEFAULT
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ciDO_FAILED := 0
588c2ecf20Sopenharmony_ciDO_DEFAULT := 1
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci# By setting both DO_FAILED and DO_DEFAULT to zero, you can pick a single
618c2ecf20Sopenharmony_ci# arch that you want to test. (uncomment RUN and chose your arch)
628c2ecf20Sopenharmony_ci#RUN := arm
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci# At the bottom of the config file exists a bisect test. You can update that
658c2ecf20Sopenharmony_ci# test and set DO_FAILED and DO_DEFAULT to zero, and uncomment this variable
668c2ecf20Sopenharmony_ci# to run the bisect on the arch.
678c2ecf20Sopenharmony_ci#RUN := bisect
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci# By default all tests will be running gcc 4.5.2. Some tests are using 4.5.1
708c2ecf20Sopenharmony_ci# and they select that in the test.
718c2ecf20Sopenharmony_ci# Note: GCC_VER is declared as on option and not a variable ('=' instead of ':=')
728c2ecf20Sopenharmony_ci# This is important. A variable is used only in the config file and if it is set
738c2ecf20Sopenharmony_ci# it stays that way for the rest of the config file until it is change again.
748c2ecf20Sopenharmony_ci# Here we want GCC_VER to remain persistent and change for each test, as it is used in
758c2ecf20Sopenharmony_ci# the MAKE_CMD. By using '=' instead of ':=' we achieve our goal.
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ciGCC_VER = 4.5.2
788c2ecf20Sopenharmony_ciMAKE_CMD = PATH=/usr/local/gcc-${GCC_VER}-nolibc/${CROSS}/bin:$PATH CROSS_COMPILE=${CROSS}- make ARCH=${ARCH}
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci# all tests are only doing builds.
818c2ecf20Sopenharmony_ciTEST_TYPE = build
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci# If you want to add configs on top of the defconfig, you can add those configs into
848c2ecf20Sopenharmony_ci# the add-config file and uncomment this option. This is useful if you want to test
858c2ecf20Sopenharmony_ci# all cross compiles with PREEMPT set, or TRACING on, etc.
868c2ecf20Sopenharmony_ci#ADD_CONFIG = ${THIS_DIR}/add-config
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci# All tests are using defconfig
898c2ecf20Sopenharmony_ciBUILD_TYPE = defconfig
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci# The test names will have the arch and cross compiler used. This will be shown in
928c2ecf20Sopenharmony_ci# the results.
938c2ecf20Sopenharmony_ciTEST_NAME = ${ARCH} ${CROSS}
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci# alpha
968c2ecf20Sopenharmony_ciTEST_START IF ${RUN} == alpha || ${DO_DEFAULT}
978c2ecf20Sopenharmony_ci# Notice that CROSS and ARCH are also options and not variables (again '=' instead
988c2ecf20Sopenharmony_ci# of ':='). This is because TEST_NAME and MAKE_CMD wil use them for each test.
998c2ecf20Sopenharmony_ci# Only options are available during runs. Variables are only present in parsing the
1008c2ecf20Sopenharmony_ci# config file.
1018c2ecf20Sopenharmony_ciCROSS = alpha-linux
1028c2ecf20Sopenharmony_ciARCH = alpha
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci# arm
1058c2ecf20Sopenharmony_ciTEST_START IF ${RUN} == arm || ${DO_DEFAULT}
1068c2ecf20Sopenharmony_ciCROSS = arm-unknown-linux-gnueabi
1078c2ecf20Sopenharmony_ciARCH = arm
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ci# ia64
1108c2ecf20Sopenharmony_ciTEST_START IF ${RUN} == ia64 || ${DO_DEFAULT}
1118c2ecf20Sopenharmony_ciCROSS = ia64-linux
1128c2ecf20Sopenharmony_ciARCH = ia64
1138c2ecf20Sopenharmony_ci
1148c2ecf20Sopenharmony_ci# m68k fails with error?
1158c2ecf20Sopenharmony_ciTEST_START IF ${RUN} == m68k || ${DO_DEFAULT}
1168c2ecf20Sopenharmony_ciCROSS = m68k-linux
1178c2ecf20Sopenharmony_ciARCH = m68k
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ci# mips64
1208c2ecf20Sopenharmony_ciTEST_START IF ${RUN} == mips || ${RUN} == mips64 || ${DO_DEFAULT}
1218c2ecf20Sopenharmony_ciCROSS = mips64-linux
1228c2ecf20Sopenharmony_ciARCH = mips
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ci# mips32
1258c2ecf20Sopenharmony_ciTEST_START IF ${RUN} == mips || ${RUN} == mips32 || ${DO_DEFAULT}
1268c2ecf20Sopenharmony_ciCROSS = mips-linux
1278c2ecf20Sopenharmony_ciARCH = mips
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_ci# parisc64 failed?
1308c2ecf20Sopenharmony_ciTEST_START IF ${RUN} == hppa || ${RUN} == hppa64 || ${DO_FAILED}
1318c2ecf20Sopenharmony_ciCROSS = hppa64-linux
1328c2ecf20Sopenharmony_ciARCH = parisc
1338c2ecf20Sopenharmony_ci
1348c2ecf20Sopenharmony_ci# parisc
1358c2ecf20Sopenharmony_ciTEST_START IF ${RUN} == hppa || ${RUN} == hppa32 || ${DO_FAILED}
1368c2ecf20Sopenharmony_ciCROSS = hppa-linux
1378c2ecf20Sopenharmony_ciARCH = parisc
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_ci# ppc
1408c2ecf20Sopenharmony_ciTEST_START IF ${RUN} == ppc || ${RUN} == ppc32 || ${DO_DEFAULT}
1418c2ecf20Sopenharmony_ciCROSS = powerpc-linux
1428c2ecf20Sopenharmony_ciARCH = powerpc
1438c2ecf20Sopenharmony_ci
1448c2ecf20Sopenharmony_ci# ppc64
1458c2ecf20Sopenharmony_ciTEST_START IF ${RUN} == ppc || ${RUN} == ppc64 || ${DO_DEFAULT}
1468c2ecf20Sopenharmony_ciCROSS = powerpc64-linux
1478c2ecf20Sopenharmony_ciARCH = powerpc
1488c2ecf20Sopenharmony_ci
1498c2ecf20Sopenharmony_ci# s390
1508c2ecf20Sopenharmony_ciTEST_START IF ${RUN} == s390 || ${DO_DEFAULT}
1518c2ecf20Sopenharmony_ciCROSS = s390x-linux
1528c2ecf20Sopenharmony_ciARCH = s390
1538c2ecf20Sopenharmony_ci
1548c2ecf20Sopenharmony_ci# sh
1558c2ecf20Sopenharmony_ciTEST_START IF ${RUN} == sh || ${DO_DEFAULT}
1568c2ecf20Sopenharmony_ciCROSS = sh4-linux
1578c2ecf20Sopenharmony_ciARCH = sh
1588c2ecf20Sopenharmony_ci
1598c2ecf20Sopenharmony_ci# sparc64
1608c2ecf20Sopenharmony_ciTEST_START IF ${RUN} == sparc || ${RUN} == sparc64 || ${DO_DEFAULT}
1618c2ecf20Sopenharmony_ciCROSS = sparc64-linux
1628c2ecf20Sopenharmony_ciARCH = sparc64
1638c2ecf20Sopenharmony_ci
1648c2ecf20Sopenharmony_ci# sparc
1658c2ecf20Sopenharmony_ciTEST_START IF ${RUN} == sparc || ${RUN} == sparc32 || ${DO_DEFAULT}
1668c2ecf20Sopenharmony_ciCROSS = sparc-linux
1678c2ecf20Sopenharmony_ciARCH = sparc
1688c2ecf20Sopenharmony_ci
1698c2ecf20Sopenharmony_ci# xtensa failed
1708c2ecf20Sopenharmony_ciTEST_START IF ${RUN} == xtensa || ${DO_FAILED}
1718c2ecf20Sopenharmony_ciCROSS = xtensa-linux
1728c2ecf20Sopenharmony_ciARCH = xtensa
1738c2ecf20Sopenharmony_ci
1748c2ecf20Sopenharmony_ci# UML
1758c2ecf20Sopenharmony_ciTEST_START IF ${RUN} == uml || ${DO_DEFAULT}
1768c2ecf20Sopenharmony_ciMAKE_CMD = make ARCH=um SUBARCH=x86_64
1778c2ecf20Sopenharmony_ciARCH = uml
1788c2ecf20Sopenharmony_ciCROSS =
1798c2ecf20Sopenharmony_ci
1808c2ecf20Sopenharmony_ciTEST_START IF ${RUN} == x86 || ${RUN} == i386 || ${DO_DEFAULT}
1818c2ecf20Sopenharmony_ciMAKE_CMD = make ARCH=i386
1828c2ecf20Sopenharmony_ciARCH = i386
1838c2ecf20Sopenharmony_ciCROSS = 
1848c2ecf20Sopenharmony_ci
1858c2ecf20Sopenharmony_ciTEST_START IF ${RUN} == x86 || ${RUN} == x86_64 || ${DO_DEFAULT}
1868c2ecf20Sopenharmony_ciMAKE_CMD = make ARCH=x86_64
1878c2ecf20Sopenharmony_ciARCH = x86_64
1888c2ecf20Sopenharmony_ciCROSS = 
1898c2ecf20Sopenharmony_ci
1908c2ecf20Sopenharmony_ci#################################
1918c2ecf20Sopenharmony_ci
1928c2ecf20Sopenharmony_ci# This is a bisect if needed. You need to give it a MIN_CONFIG that
1938c2ecf20Sopenharmony_ci# will be the config file it uses. Basically, just copy the created defconfig
1948c2ecf20Sopenharmony_ci# for the arch someplace and point MIN_CONFIG to it.
1958c2ecf20Sopenharmony_ciTEST_START IF ${RUN} == bisect
1968c2ecf20Sopenharmony_ciMIN_CONFIG = ${THIS_DIR}/min-config
1978c2ecf20Sopenharmony_ciCROSS = s390x-linux
1988c2ecf20Sopenharmony_ciARCH = s390
1998c2ecf20Sopenharmony_ciTEST_TYPE = bisect
2008c2ecf20Sopenharmony_ciBISECT_TYPE = build
2018c2ecf20Sopenharmony_ciBISECT_GOOD = v3.1
2028c2ecf20Sopenharmony_ciBISECT_BAD = v3.2
2038c2ecf20Sopenharmony_ciCHECKOUT = v3.2
2048c2ecf20Sopenharmony_ci
2058c2ecf20Sopenharmony_ci#################################
2068c2ecf20Sopenharmony_ci
2078c2ecf20Sopenharmony_ci# These defaults are needed to keep ktest.pl from complaining. They are
2088c2ecf20Sopenharmony_ci# ignored because the test does not go pass the build. No install or
2098c2ecf20Sopenharmony_ci# booting of the target images.
2108c2ecf20Sopenharmony_ci
2118c2ecf20Sopenharmony_ciDEFAULTS
2128c2ecf20Sopenharmony_ciMACHINE = crosstest
2138c2ecf20Sopenharmony_ciSSH_USER = root
2148c2ecf20Sopenharmony_ciBUILD_TARGET = cross
2158c2ecf20Sopenharmony_ciTARGET_IMAGE = image
2168c2ecf20Sopenharmony_ciPOWER_CYCLE = cycle
2178c2ecf20Sopenharmony_ciCONSOLE = console
2188c2ecf20Sopenharmony_ciLOCALVERSION = version
2198c2ecf20Sopenharmony_ciGRUB_MENU = grub
2208c2ecf20Sopenharmony_ci
2218c2ecf20Sopenharmony_ciREBOOT_ON_ERROR = 0
2228c2ecf20Sopenharmony_ciPOWEROFF_ON_ERROR = 0
2238c2ecf20Sopenharmony_ciPOWEROFF_ON_SUCCESS = 0
2248c2ecf20Sopenharmony_ciREBOOT_ON_SUCCESS = 0
2258c2ecf20Sopenharmony_ci
226