Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Thanassis Tsiodras
RTEMS-build-workflows
Commits
8d63553a
Commit
8d63553a
authored
Apr 12, 2016
by
Thanassis Tsiodras
Browse files
Add script to automatically build RTEMS OAR
parent
9bade077
Pipeline
#81
skipped
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
OAR/contrib/build.rtems.4.11.sh
0 → 100755
View file @
8d63553a
#!/bin/bash
#
# This script builds the RTEMS4.11/Sparc cross-compiler
# and Leon2/3 BSPs.
#
# To have a reproducible setup, we suggest you execute
# this script under a Debian jessie chroot, bootstrapped
# via the following:
#
# mkdir /opt/jessie-chroot
# debootstrap jessie /opt/jessie-chroot
# mount -t proc none /opt/jessie-chroot/proc/
# mount -t sysfs none /opt/jessie-chroot/sys/
# mount -o bind /dev /opt/jessie-chroot/dev/
# mount -o bind /dev/pts /opt/jessie-chroot/dev/pts/
# chroot /opt/jessie-chroot
# apt-get update
# apt-get build-dep binutils gcc g++ gdb unzip git python2.7-dev pax
#
# Then chroot inside it and run this script:
#
# chroot /opt/jessie-chroot
# /path/to/build.rtems.4.11.sh
# Stop on any error
set
-e
DATE
=
$(
date
+
"%Y.%m.%d"
)
mkdir
-p
/root/rtems.build.logs
BUILD_LOG
=
/root/rtems.build.logs/
${
DATE
}
.log
[
-f
${
BUILD_LOG
}
]
&&
{
echo
"There's already a build log:"
echo
" "
${
BUILD_LOG
}
echo
Remove it to
continue
.
exit
1
}
# Record the output in $BUILD_LOG (see matching brace)
{
# Begin by checking out the RTEMS Source Builder
mkdir
-p
/root/development/rtems/src
RSB
=
/root/development/rtems/src/rtems-source-builder-
${
DATE
}
RTPREFIX
=
/opt/rtems-4.11-
${
DATE
}
rm
-rf
${
RTPREFIX
}
[
!
-d
$RSB
]
&&
{
cd
/root/development/rtems/src/
git clone git://git.rtems.org/rtems-source-builder.git rtems-source-builder-
${
DATE
}
}
cd
$RSB
git checkout
-f
4.11
# Verify that we have all we need to build
source-builder/sb-check
# Your network firewall may or may not be an issue at this point:
# Many of the source tarballs needed by the RSB are fetched over
# PASV-enabled FTP servers.
# If your network is like the one in ESA/ESTEC and this is forbidden,
# you'll have to fetch these tarballs and hardlink to them each time
# (so no FTP action is triggered by the RTEMS RSB builder).
# This is how I do it - adapt according to your needs:
#
# cd rtems
# [ ! -d sources ] && {
# mkdir -p sources
# cd sources
# cp -al /root/development/rtems/src/rtems-source-builder.working/rtems/sources/* .
# cd ..
# for i in config/tools/*cfg ; do
# cat "$i" | sed 's,ftp://ftp.gnu.org,http://ftp.gnu.org,;s,ftp://gcc.gnu.org,http://gcc.gnu.org,;' > "$i".new && mv "$i".new "$i"
# done
# }
# Build the cross compiler
# (we're in the master branch, which is currently the "unofficial" 4.11)
../source-builder/sb-set-builder
--log
=
stage1.log
--prefix
=
${
RTPREFIX
}
4.11/rtems-sparc
# Add the cross compiler to the PATH and checkout RTEMS
export
PATH
=
${
RTPREFIX
}
/bin:
$PATH
cd
..
[
!
-d
rtems-git
]
&&
{
git clone https://github.com/RTEMS/rtems.git rtems-git
}
cd
rtems-git
# Checkout the revision Sebastian asked for
# git checkout -f 9d1f39434585e8d3f8897d95a2bfe1ddccb79aec
# git checkout -f 03b900d3ed120ea919ea3eded7edbece3488cff3
git checkout
-f
4.11
./bootstrap
cd
..
rm
-rf
build.
${
DATE
}
mkdir
build.
${
DATE
}
cd
build.
${
DATE
}
../rtems-git/configure
\
--target
=
sparc-rtems4.11
--prefix
=
${
RTPREFIX
}
\
--enable-rtemsbsp
=
"leon2 leon3"
--enable-posix
\
--enable-cxx
--enable-networking
make all
make
install
}
|&
tee
${
BUILD_LOG
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment