post-build.sh 660 B

12345678910111213141516171819
  1. #!/bin/sh
  2. set -u
  3. set -e
  4. # Add a console on tty1
  5. if [ -e ${TARGET_DIR}/etc/inittab ]; then
  6. grep -qE '^tty1::' ${TARGET_DIR}/etc/inittab || \
  7. sed -i '/GENERIC_SERIAL/a\
  8. tty1::respawn:/sbin/getty -L tty1 0 vt100 # HDMI console' ${TARGET_DIR}/etc/inittab
  9. # systemd doesn't use /etc/inittab, enable getty.tty1.service instead
  10. elif [ -d ${TARGET_DIR}/etc/systemd ]; then
  11. mkdir -p "${TARGET_DIR}/etc/systemd/system/getty.target.wants"
  12. ln -sf /lib/systemd/system/getty@.service \
  13. "${TARGET_DIR}/etc/systemd/system/getty.target.wants/getty@tty1.service"
  14. fi
  15. # exnsure overlays exists for genimage
  16. mkdir -p "${BINARIES_DIR}/rpi-firmware/overlays"