• Stars
    star
    243
  • Rank 166,489 (Top 4 %)
  • Language
    Shell
  • License
    MIT License
  • Created about 10 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Raspberry Pi cross-compiler and sysroot in a Docker container.

CircleCI

Raspberry Pi Cross-Compiler in a Docker Container

An easy-to-use all-in-one cross compiler for the Raspberry Pi.

This project is available as sdthirlwall/raspberry-pi-cross-compiler on Docker Hub, and as sdt/docker-raspberry-pi-cross-compiler on GitHub.

Please raise any issues on the GitHub issue tracker as I don't get notified about Docker Hub comments.

Contents

Features

Installation

This image is not intended to be run manually. Instead, there is a helper script which comes bundled with the image.

To install the helper script, run the image with no arguments, and redirect the output to a file.

eg.

docker run sdthirlwall/raspberry-pi-cross-compiler > ~/bin/rpxc
chmod +x ~/bin/rpxc

Usage

rpxc [command] [args...]

Execute the given command-line inside the container.

If the command matches one of the rpxc built-in commands (see below), that will be executed locally, otherwise the command is executed inside the container.

rpxc -- [command] [args...]

To force a command to run inside the container (in case of a name clash with a built-in command), use -- before the command.

Built-in commands

install-debian

rpxc install-debian [--update] package packages...

Install native packages into the docker image. Changes are committed back to the sdthirlwall/raspberry-pi-cross-compiler image.

install-raspbian

rpxc install-raspbian [--update] package packages...

Install raspbian packages from the raspbian repositories into the sysroot of thedocker image. Changes are committed back to the sdthirlwall/raspberry-pi-cross-compiler image.

update-image

rpxc update-image

Pull the latest version of the docker image.

If a new docker image is available, any extra packages installed with install-debian or install-raspbian will be lost.

update-script

rpxc update-script

Update the installed rpxc script with the one bundled in the image.

update

rpxc update

Update both the docker image and the rpxc script.

Configuration

The following command-line options and environment variables are used. In all cases, the command-line option overrides the environment variable.

RPXC_CONFIG / --config <path-to-config-file>

This file is sourced if it exists.

Default: ~/.rpxc

RPXC_IMAGE / --image <docker-image-name>

The docker image to run.

Default: sdthirlwall/raspberry-pi-cross-compiler

RPXC_ARGS / --args <docker-run-args>

Extra arguments to pass to the docker run command.

Custom Images

Using rpxc install-debian and rpxc install-raspbian are really only intended for getting a build environment together. Once you've figured out which debian and raspbian packages you need, it's better to create a custom downstream image that has all your tools and development packages built in.

Create a Dockerfile

FROM sdthirlwall/raspberry-pi-cross-compiler

# Install some native build-time tools
RUN install-debian scons

# Install raspbian development libraries
RUN install-raspbian libboost-dev-all

Name your image with an RPXC_IMAGE variable and build the image

export RPXC_IMAGE=my-custom-rpxc-image
docker build -t $RPXC_IMAGE .

With RPXC_IMAGE set, rpxc will automatically use your new image.

# These are typical cross-compilation flags to pass to configure.
# Note the use of single quotes in the shell command-line. We want the
# variables to be interpolated in the container, not in the host system.
rpxc sh -c 'CFLAGS=--sysroot=$SYSROOT ./configure --host=$HOST'
rpxc make

Another way to achieve this is to create a shell script.

#!/bin/sh
CFLAGS=--sysroot=$SYSROOT ./configure --host=$HOST
make

And call it as rpxc ./mymake.sh

Examples

See the examples directory for some real examples.

More Repositories

1

tmux-vim

Bash script to enable a persistent vim pane within tmux
Shell
42
star
2

.dotfiles

Personal unix dotfiles
Shell
7
star
3

docker-hugs

Haskell hugs in a docker container
Shell
6
star
4

divingmule-xbmc-repo-clone

Personal copy of divingmule's xbmc repo at https://code.google.com/p/divingmules-repo/
Python
5
star
5

kodi-emulationstation-launcher

Trivial Kodi plugin that exec's emulationstation
Python
5
star
6

Log-Any-Plugin

Plugins for Log::Any
Perl
2
star
7

FootyTipping

Catalyst application for AFL footy tipping
Perl
2
star
8

Test-SVN-Repo

Authenticated subversion repositories for testing
Perl
2
star
9

Template-Plugin-DataPrinter

Template Toolkit dumper plugin for Data::Printer
Perl
2
star
10

kodi-trivial-launcher

Kodi script that just runs an external command.
Python
1
star
11

mxq

Hacking around with s805 mxq boxes
1
star
12

cake-invaders

Cake Invaders!
GDScript
1
star
13

opensearch-baker

Bake OpenSearch plugins into a static javascript-enabled html page
1
star
14

Log-Any-Adapter-Syslog

Perl
1
star
15

imap-mta

An experimental mail transfer agent that stores emails directly on an IMAP server
Perl
1
star
16

mythtv-scripts

Miscellaneous scripts for my MythTV box
Python
1
star
17

devel-cover-function-parameters-hang

Minimal example of Function::Parameters hanging under Devel::Cover
Perl
1
star
18

bootstrap-a-scheme

Sometimes reinventing a wheel is a good way to learn about wheels.
C
1
star
19

My-Term-ANSIColor

Personal branch of Term::ANSIColor - see http://www.eyrie.org/~eagle/software/ansicolor/
Perl
1
star
20

todo

Things to do one day
1
star
21

My-Test-NoWarnings

Personal branch of http://search.cpan.org/~adamk/Test-NoWarnings-1.04/
Perl
1
star
22

Dist-Zilla-PluginBundle-Include

Use a secondary dist.ini file as a plugin bundle
Perl
1
star
23

App-USelect

Perl reimplementation of the OSSP iselect tool (http://www.ossp.org/pkg/tool/iselect/)
Perl
1
star
24

Object-Chain

Data-driven object chains
Perl
1
star
25

uselect

Python reimplementation of the OSSP iselect tool (http://www.ossp.org/pkg/tool/iselect/)
Python
1
star
26

Term-ANSIColor-Solarized

Solarized color names for Term::ANSIColor
Perl
1
star