From bb7bd86df3e26073c74e2cd83761371c6468b816 Mon Sep 17 00:00:00 2001 From: Stefan Profanter Date: Sun, 27 Oct 2019 08:15:14 +0100 Subject: [PATCH] Update readme to use git release --- README.md | 30 +++++++++++++++++++++++++----- azure-pipelines.yml | 16 ++++++++-------- build_toolchain.sh | 3 --- copy_to_host.sh | 6 ------ 4 files changed, 33 insertions(+), 22 deletions(-) delete mode 100755 build_toolchain.sh delete mode 100755 copy_to_host.sh diff --git a/README.md b/README.md index be743b2..b512dc5 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,31 @@ https://gist.github.com/tttapa/534fb671c5f6cced0e1722d3e4aec987 A corresponding Blog post can be found here: https://solarianprogrammer.com/2018/05/06/building-gcc-cross-compiler-raspberry-pi/ -## How to build the toolchain +## How to get the toolchain -To build the toolchain, just clone this repository and then execute the build script `build.sh`. +You have two options: -Alternatively call: +- Use the prebuilt toolchain attached to every github release (recommended) +- Build the toolchain yourself + +### Use pre-built toolchain + +Every github release has a pre-build toolchain attached. +See + +1. Download the toolchain: +```bash +wget https://github.com/Pro/raspi-toolchain/releases/latest/download/raspi-toolchain.tar.gz +``` +2. Extract it. Note: The toolchain has to be in `/opt/cross-pi-gcc` since it's not location independent. +```bash +sudo tar xfz raspi-toolchain.tar.gz --strip-components=1 -C /opt +``` +3. You are done! + +### Build the toolchain from source + +To build the toolchain, just clone this repository and then call: ```bash docker build -f Dockerfile --network=host -t gcc9-rpi-zero . @@ -32,11 +52,11 @@ To run the docker container, use docker run -it gcc9-rpi-zero bash ``` -## Install the toolchain on your host +### Install from source after building To get the toolchain from the docker container into your host, just copy the files: -``` +```bash CONTAINER_ID=$(docker ps -aqf "name=gcc9-rpi-zero") docker cp $CONTAINER_ID:/opt/cross-pi-gcc /opt/cross-pi-gcc ``` diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8c1f1af..a004631 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -32,23 +32,23 @@ jobs: ArtifactName: libopen62541-debian # publishing artifacts from PRs from a fork is currently blocked condition: succeeded() - displayName: "Publish Artifact: open62541 Debian Packages" + displayName: "Publish Artifact: Toolchain package" # See https://github.com/microsoft/azure-pipelines-tasks/issues/11260#issuecomment-527343172 - #- bash: echo "##vso[task.setvariable variable=TAG]${BUILD_SOURCEBRANCH##refs/tags/}" - # displayName: Set TAG variable for $(Build.SourceBranch) - # condition: startswith(variables['Build.SourceBranch'], 'refs/tags/') + - bash: echo "##vso[task.setvariable variable=TAG]${BUILD_SOURCEBRANCH##refs/tags/}" + displayName: Set TAG variable for $(Build.SourceBranch) + condition: startswith(variables['Build.SourceBranch'], 'refs/tags/') - task: GitHubRelease@0 # Only execute this task if a tags build - #condition: startswith(variables['Build.SourceBranch'], 'refs/tags/') + condition: startswith(variables['Build.SourceBranch'], 'refs/tags/') inputs: gitHubConnection: 'pro-raspi-toolchain' repositoryName: '$(Build.Repository.Name)' - action: 'create' # Options: create, edit, delete + action: 'edit' # Options: create, edit, delete target: '$(Build.SourceVersion)' # Required when action == Create || Action == Edit - tagSource: 'auto' + tagSource: 'Git tag' #tagPattern: # Optional - #tag: $(TAG) # Required when action == Edit || Action == Delete || TagSource == Manual + tag: $(TAG) # Required when action == Edit || Action == Delete || TagSource == Manual #title: # Optional #releaseNotesSource: 'file' # Optional. Options: file, input #releaseNotesFile: # Optional diff --git a/build_toolchain.sh b/build_toolchain.sh deleted file mode 100755 index 87bf0e9..0000000 --- a/build_toolchain.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -docker build -f Dockerfile --network=host -t gcc9-rpi-zero . diff --git a/copy_to_host.sh b/copy_to_host.sh deleted file mode 100755 index 0e62e6c..0000000 --- a/copy_to_host.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - - -CONTAINER_ID=$(docker create gcc9-rpi-zero) -sudo docker cp $CONTAINER_ID:/opt/cross-pi-gcc /opt/cross-pi-gcc -