From 8b2420f74367e4973be0dd9556c021588abfe591 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Sat, 30 May 2026 09:58:45 +0200 Subject: Initial commit --- board/common/post-build.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 board/common/post-build.sh (limited to 'board/common/post-build.sh') 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 -- cgit v1.2.3