Spotter-VM/_build/install-toolchain.sh
2019-03-19 11:32:31 +01:00

40 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
set -ev
cd $(realpath $(dirname "${0}"))
# Install basic build tools
apk update
apk add git file htop less openssh-client openssh-server openssh-sftp-server tar xz
# Install Alpine SDK
apk add alpine-sdk
# Install Sphinx support
apk-add py3-sphinx
pip3 install recommonmark sphinx-markdown-tables
# Copy root profile files and settings
mkdir -p /root/.config/htop /root/.ssh
cp root/.profile /root/.profile
cp root/.ssh/authorized_keys /root/.ssh/authorized_keys
cp root/.config/htop/htoprc /root/.config/htop/htoprc
# Start SSH
rc-update add sshd boot
service sshd start
# Prepare abuild toolchain
adduser root abuild
cp etc/abuild.conf /etc/abuild.conf
# Prepare LXC build toolchain
cp usr/bin/fix-apk /usr/bin/fix-apk
cp usr/bin/lxc-build /usr/bin/lxc-build
cp usr/bin/lxc-pack /usr/bin/lxc-pack
# Supply abuild key
# echo '/srv/build/repokey.rsa' | abuild-keygen
# Supply LXC build key
# openssl ecparam -genkey -name secp384r1 -out /srv/build/packages.key
# openssl ec -in /srv/build/packages.key -pubout -out /srv/build/packages.pub