summaryrefslogtreecommitdiff
path: root/board/common/post-build.sh
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@dailly.me>2026-05-30 09:58:45 +0200
committerSébastien Dailly <sebastien@dailly.me>2026-05-30 09:58:45 +0200
commit8b2420f74367e4973be0dd9556c021588abfe591 (patch)
treeb95fbf8d5aefc51f619b2506d8ae75ee9f29b75b /board/common/post-build.sh
Initial commit
Diffstat (limited to 'board/common/post-build.sh')
-rwxr-xr-xboard/common/post-build.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/board/common/post-build.sh b/board/common/post-build.sh
new file mode 100755
index 0000000..d96b74b
--- /dev/null
+++ b/board/common/post-build.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+set -u
+set -e
+
+# Copie des fichiers de clef ssh
+cp -v $BR2_EXTERNAL_BASTION_PATH/local/ssh/* ${TARGET_DIR}/etc/ssh
+chmod go-r ${TARGET_DIR}/etc/ssh/ssh_host_ecdsa_key
+chmod go-r ${TARGET_DIR}/etc/ssh/ssh_host_ed25519_key
+chmod go-r ${TARGET_DIR}/etc/ssh/ssh_host_rsa_key
+if ! grep -qF 'Include /etc/ssh/sshd_config.d/*.conf' "${TARGET_DIR}/etc/ssh/sshd_config"; then
+ cat << __EOF__ >> "${TARGET_DIR}/etc/ssh/sshd_config"
+Include /etc/ssh/sshd_config.d/*.conf
+__EOF__
+fi
+
+
+#touch ${TARGET_DIR}/home/sebastien/test
+
+. "${BR2_EXTERNAL_BASTION_PATH}/board/common/common.sh"
+. "${BR2_EXTERNAL_BASTION_PATH}/board/common/network.sh"
+add_tmpfs '/tmp'
+#
+## Add a console on tty1
+#if [ -e ${TARGET_DIR}/etc/inittab ]; then
+# grep -qE '^tty1::' ${TARGET_DIR}/etc/inittab || \
+# sed -i '/GENERIC_SERIAL/a\
+#tty1::respawn:/sbin/getty -L tty1 0 vt100 # HDMI console' ${TARGET_DIR}/etc/inittab
+#fi
+
+# Put the whole system in readonly
+#sed -ie '/^\/dev\/root/ s/rw 0 1/ro 0 0/' "${TARGET_DIR}/etc/fstab"
+
+mkdir -p "${TARGET_DIR}"/etc/systemd/system/getty.target.wants
+# Add a console on ttyAMA0 and enable auto login
+ln -sf /usr/lib/systemd/system/serial-getty@.service "${TARGET_DIR}"/etc/systemd/system/getty.target.wants/serial-getty@ttyGS0.service
+sed '/^ExecStart=/ s/-o .-p -- ..u./--skip-login --noclear --noissue --login-options "-f root"/' -i "${TARGET_DIR}"/usr/lib/systemd/system/serial-getty@.service