forked from mozilla/DeepSpeech
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alexandre Lissy
committed
Apr 28, 2021
1 parent
510d161
commit 0068437
Showing
24 changed files
with
1,111 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: "chroot bind mount" | ||
description: "Bind mount into chroot" | ||
inputs: | ||
mounts: | ||
description: "Path to consider" | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- id: install_qemu | ||
run: | | ||
sudo apt-get update -y | ||
sudo apt-get install -y --no-install-recommends qemu-user-static | ||
shell: bash | ||
- id: bind_mount_chroot | ||
run: | | ||
set -xe | ||
# Bind-mount so that we have the same tree inside the chroot | ||
for dev in ${{ github.workspace }} ${{ inputs.mounts }}; | ||
do | ||
sudo mount -o bind ${dev} ${{ env.SYSTEM_RASPBIAN }}${dev} | ||
done; | ||
for dev in ${{ inputs.mounts }}; | ||
do | ||
sudo mount -o bind /${dev} ${{ env.SYSTEM_RASPBIAN }}/${dev} | ||
done; | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
name: "Host build lib" | ||
description: "Host build of lib" | ||
name: "Run build lib" | ||
description: "Run build of lib" | ||
inputs: | ||
arch: | ||
description: "Target arch for loading script (host/armv7/aarch64)" | ||
required: false | ||
default: "host" | ||
flavor: | ||
description: "Build flavor" | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- run: ./ci_scripts/host-build.sh ${{ inputs.flavor }} | ||
- run: ./ci_scripts/${{ inputs.arch }}-build.sh ${{ inputs.flavor }} | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: "xldd install" | ||
description: "Install xldd" | ||
inputs: | ||
target: | ||
description: "System target" | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- id: install_xldd | ||
run: | | ||
source ./ci_scripts/all-vars.sh | ||
# -s required to avoid the noisy output like "Entering / Leaving directories" | ||
toolchain=$(make -s -C ${DS_DSDIR}/native_client/ TARGET=${{ inputs.target }} TFDIR=${DS_TFDIR} print-toolchain) | ||
if [ ! -x "${toolchain}ldd" ]; then | ||
cp "${DS_DSDIR}/native_client/xldd" "${toolchain}ldd" && chmod +x "${toolchain}ldd" | ||
fi | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: "multistrap install" | ||
description: "Install a system root using multistrap" | ||
inputs: | ||
arch: | ||
description: "Target arch" | ||
required: true | ||
packages: | ||
description: "Extra packages to install" | ||
required: false | ||
default: "" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- id: install_multistrap | ||
run: | | ||
sudo apt-get update -y | ||
sudo apt-get install -y --no-install-recommends multistrap qemu-user-static | ||
shell: bash | ||
- id: create_chroot | ||
run: | | ||
set -xe | ||
multistrap_conf="" | ||
if [ "${{ inputs.arch }}" = "armv7" ]; then | ||
multistrap_conf=multistrap_raspbian_buster.conf | ||
wget http://archive.raspbian.org/raspbian/pool/main/r/raspbian-archive-keyring/raspbian-archive-keyring_20120528.2_all.deb && sudo dpkg -i raspbian-archive-keyring_20120528.2_all.deb | ||
fi | ||
if [ "${{ inputs.arch }}" = "aarch64" ]; then | ||
multistrap_conf=multistrap_armbian64_buster.conf | ||
fi | ||
multistrap -d ${{ env.SYSTEM_RASPBIAN }} -f ${{ github.workspace }}/native_client/${multistrap_conf} | ||
if [ ! -z "${{ inputs.packages }}" ]; then | ||
TO_MOUNT=${{ github.workspace }} | ||
# Prepare target directory to bind-mount the github tree | ||
mkdir -p ${{ env.SYSTEM_RASPBIAN }}/${{ github.workspace }} | ||
# Bind-mount so that we have the same tree inside the chroot | ||
for dev in ${TO_MOUNT}; | ||
do | ||
sudo mount -o bind ${dev} ${{ env.SYSTEM_RASPBIAN }}${dev} | ||
done; | ||
# Copy some host data: | ||
# resolv.conf: for getting DNS working | ||
# passwd, group, shadow: to have user accounts and apt-get install working | ||
for ff in resolv.conf passwd group shadow; | ||
do | ||
sudo cp /etc/${ff} ${{ env.SYSTEM_RASPBIAN }}/etc/ | ||
done; | ||
# Perform apt steps. | ||
# Preserving the env is required | ||
sudo --preserve-env chroot ${{ env.SYSTEM_RASPBIAN }}/ apt-get update -y | ||
sudo --preserve-env chroot ${{ env.SYSTEM_RASPBIAN }}/ apt-get install -y --no-install-recommends ${{ inputs.packages }} | ||
# Cleanup apt info to save space | ||
sudo --preserve-env chroot ${{ env.SYSTEM_RASPBIAN }}/ rm -fr /var/cache/apt/* /var/lib/apt/lists/* | ||
# Unmount what has been mounted | ||
for dev in ${TO_MOUNT}; | ||
do | ||
sudo umount ${{ env.SYSTEM_RASPBIAN }}${dev} | ||
done; | ||
fi | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: "nodejs install" | ||
description: "Install nodejs in a chroot" | ||
inputs: | ||
node: | ||
description: "NodeJS version" | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- id: add_apt_source | ||
run: | | ||
set -ex | ||
(echo "Package: nodejs" && echo "Pin: origin deb.nodesource.com" && echo "Pin-Priority: 999") > ${{ env.SYSTEM_RASPBIAN }}/etc/apt/preferences | ||
echo "deb http://deb.nodesource.com/node_${{ inputs.node }}.x buster main" > ${{ env.SYSTEM_RASPBIAN }}/etc/apt/sources.list.d/nodesource.list | ||
wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo --preserve-env chroot ${{ env.SYSTEM_RASPBIAN }}/ apt-key add - | ||
shell: bash | ||
- id: install_nodejs | ||
run: | | ||
set -ex | ||
sudo --preserve-env chroot ${{ env.SYSTEM_RASPBIAN }}/ apt-get update -y | ||
sudo --preserve-env chroot ${{ env.SYSTEM_RASPBIAN }}/ apt-get install -y nodejs | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.