aboutsummaryrefslogtreecommitdiff
path: root/board/post-build.sh
blob: cfdaec029a57079651fc10240331a61f7dae3009 (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
#!/bin/sh

set -u
set -e

. "${BR2_EXTERNAL_PIAUDIO_PATH}/board/common.sh"

# 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"

. "${BR2_EXTERNAL_PIAUDIO_PATH}/board/network.sh"
. "${BR2_EXTERNAL_PIAUDIO_PATH}/board/pulseaudio.sh"
. "${BR2_EXTERNAL_PIAUDIO_PATH}/board/bluetooth.sh"

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