diff options
Diffstat (limited to 'board/common/post-build.sh')
| -rwxr-xr-x | board/common/post-build.sh | 37 |
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 |
