summaryrefslogtreecommitdiff
path: root/board/common/post-build.sh
blob: d96b74bc9b2fab0205293d3bc9f801fe2b5b186a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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