📄 build-redboot
字号:
#!/bin/sh## Script to build RedBoot from sources.# Sources are based on eCos 1.3.1 with changes made by Tensilica# to support the Xtensa architecture and related development boards.## Requires Tensilica Tools (RB-2007.2 or later) and associated core package# for the Tensilica core you are targeting. The core package must have been# built with support for the relevant board, in order for the RedBoot# linker script tarball to be present in the Tensilica core package# (in <xtensa_root>/xtensa-elf/src/redboot/mlt_<board>_files.tar).## Requires Tcl (only version 8.4 has been tested).## Requires the ecosconfig binary (x86 linux-2.6 version provided).## To build, edit the script to properly set these variables:# board, ecosconfig, mlt_path, build# then just execute the script in the directory containing the# redboot-src.tgz package.# The resulting redboot binaries are in $build/install/bin .# Verify that Tensilica Tools are accessible.# XTENSA_SYSTEM and XTENSA_CORE environment variables must be properly set,# and Tensilica Tools must be in the PATH.#xtensa_root=`xt-xcc --show-config=config`if [ -z "$xtensa_root" ]; then echo "ERROR:" echo "Tensilica Tools were not found or are not properly configured." echo "Please put Tensilica Tools on your PATH, and set the XTENSA_SYSTEM" echo "and XTENSA_CORE environment variables appropriately for your core." exit 1;fi# Find the RedBoot linker-script overlay tarball.# Normally comes from a Tensilica core package in# <xtensa_root>/xtensa-elf/src/redboot/mlt_{xtav60,xtav200,xt2000}_files.tar#mlt_path=`ls ${xtensa_root}/xtensa-elf/src/redboot/mlt_*_files.tar 2>/dev/null`if [ -z "$mlt_path" ]; then echo "ERROR:" echo "The RedBoot linker scripts overlay was not found in your selected" echo "Tensilica core package. This probably means that your Tensilica" echo "core configuration is not compatible with RedBoot." exit 1;fiif [ "x.`basename $mlt_path`" = "x.mlt_unknown_files.tar" ]; then tar tf $mlt_path mlt_xtensa_unknown_redboot.h > /dev/null 2>&1 if [ $? -ne 0 ]; then echo "WARNING:" echo "The RedBoot linker scripts overlay is incomplete." echo "This probably means the core package was not built targeting a" echo "specific board such as XTAV60 (LX60), XTAV200 (LX200), or XT2000." echo "Using the Diamond 232L Standard Core version of the overlay instead;" echo "THIS MAY NOT CORRESPOND TO YOUR CORE CONFIGURATION, AND MAY NOT WORK." echo -n "Press <ENTER> to continue " read mlt_path=${PWD}/mlt_xtav60_dc232b.tar fifiecho "mlt_path is $mlt_path ."# Edit this to select the board you are targeting with RedBoot.# Must be one of: xtav60, xtav200, xt2000 (legacy).#board=xtav60# Point this to your ecosconfig executable.# If the linux executable provided here does not work on your host,# you need to rebuild it from sources yourself.#ecosconfig=${PWD}/linux2.6-x86/run_ecosconfig# Set this to point to your build directory.#build=${PWD}/build################# Hopefully, you don't need to edit anything past this point.# The ECOS_REPOSITORY environment variable is required by ecosconfig.#ECOS_REPOSITORY=${PWD}/srcexport ECOS_REPOSITORY# These definitions are fixed based on the source tree layout.import=$ECOS_REPOSITORY/hal/xtensa/$board/current/misc/redboot_REDBOOT.ecm#pkgconf=$ECOS_REPOSITORY/hal/xtensa/$board/current/include/pkgconfpkgconf=$build/install/include/pkgconf#exit 0echo ""echo "Unpack the source package"rm -rf srcmkdir srctar xfz redboot-src.tgz -C srcecho ""echo "Configure RedBoot for $board"rm -rf $buildmkdir $buildpushd $build$ecosconfig new $board redboot$ecosconfig import $import$ecosconfig treepopdecho ""echo "Overlay provided memory maps for $board"tar xf $mlt_path -C $pkgconfrename xtav60 $board $pkgconf/mlt_xtensa_*rename xtav200 $board $pkgconf/mlt_xtensa_*rename xt2000 $board $pkgconf/mlt_xtensa_*rename unknown $board $pkgconf/mlt_xtensa_*echo ""echo "Build RedBoot"make -C $build CC=xt-xccif [ $? -eq 0 ]; then echo "" echo "Build succeeded (binaries are in $build/install/bin)."else echo "" echo "Build FAILED."fiexit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -