diff options
-rwxr-xr-x | buildos | 6 | ||||
-rwxr-xr-x | init | 8 |
2 files changed, 14 insertions, 0 deletions
@@ -249,6 +249,11 @@ function print () echo done + + echo "host key:" + echo + + openssl rsa -pubout -in /state/etc/host-key.pem 2>/dev/null } print | email "starting build os monitor" @@ -760,6 +765,7 @@ function bbot_start () # <toolchain-name> <toolchain-index> # sed -i -r \ -e "s/%[iI]/$tn/g" \ + -e "s#^(Environment=AUTH_KEY)=.*#\1=/state/etc/host-key.pem#" \ -e "s/^(Environment=CPU)=.*/\1=$cpu_slice/" \ -e "s/^(Environment=RAM)=.*/\1=$ram_slice/" \ -e "s/^(Environment=TOOLCHAIN_ID)=.*/\1=$ts/" \ @@ -383,6 +383,14 @@ o="nodev,noexec,nosuid,size=512M" o+=",mode=0755,uid=$(id -u build),gid=$(id -g build)" echo "tmpfs /build/tftp tmpfs $o 0 0" >>$fstab +# Generate a host key. Used, for example, by the bbot agent to authenticate +# with a controller. +# +mkdir -p /state/etc +if [ ! -e /state/etc/host-key.pem ]; then + openssl genrsa 4096 >/state/etc/host-key.pem +fi + # Configure Postfix. # cat <<<"$hname" >/etc/mailname |