aboutsummaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-06-05 17:50:26 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-06-05 17:50:26 +0200
commit968e8234c77087025b77be5f22a6268914d88e62 (patch)
tree0e791a2718e67d0df7959b68d108f728f21edd5e /init
parentbb6d0002c924dbb74674585ff05ee23c436f2a32 (diff)
Add support for host key generation
Diffstat (limited to 'init')
-rwxr-xr-xinit8
1 files changed, 8 insertions, 0 deletions
diff --git a/init b/init
index 35838e5..83a4c27 100755
--- a/init
+++ b/init
@@ -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