Permalink
Browse files

Move bootscreen to TTY7

  • Loading branch information...
NEMS Linux
NEMS Linux committed Feb 8, 2019
1 parent 38a9c4a commit 2fe266b4fbf05924334af5889d0ee89475382508
Showing with 41 additions and 5 deletions.
  1. +41 −5 build/010-tty
@@ -3,18 +3,54 @@

apt install -y dialog

if [[ ! -d /etc/systemd/system/getty@tty1.service.d ]]; then
mkdir /etc/systemd/system/getty@tty1.service.d
# Disable TTY1
if [[ -d /etc/systemd/system/getty@tty1.service.d ]]; then
rm -rf /etc/systemd/system/getty@tty1.service.d
fi
systemctl disable getty@tty1.service
systemctl stop getty@tty1.service

# Use TTY7
if [[ ! -d /etc/systemd/system/getty@tty7.service.d ]]; then
mkdir /etc/systemd/system/getty@tty7.service.d
fi
systemctl disable getty@tty7.service
systemctl stop getty@tty7.service
echo "
[Service]
ExecStart=
ExecStart=-/usr/local/share/nems/nems-scripts/bootscreen.sh
StandardInput=tty
StandardOutput=tty
" > /etc/systemd/system/getty@tty1.service.d/override.conf
" > /etc/systemd/system/getty@tty7.service.d/override.conf
systemctl daemon-reload
systemctl enable getty@tty1.service
systemctl start getty@tty1.service
systemctl enable getty@tty7.service
systemctl start getty@tty7.service
chvt 7

if [[ ! -f /etc/rc.local ]]; then
echo "#!/bin/sh -e
" > /etc/rc.local
chmod +x /etc/rc.local
fi

if grep -q '"exit 0"' /etc/rc.local; then
sed -i~ '/"exit 0"/d' /etc/rc.local
fi

if ! grep -q "NEMS00001" /etc/rc.local; then

addition="# NEMS00001 Use TTY7\nchvt 7\n\n"

if grep -q "exit" /etc/rc.local; then
# This file contains an exit command, so make sure our new command comes before it
/bin/sed -i -- 's,exit,'"$addition"'exit,g' /etc/rc.local
else
# No exit command within the file, so just add it
echo "PLACEHERE" >> /etc/rc.local
/bin/sed -i -- 's,PLACEHERE,'"$addition"'exit 0,g' /etc/rc.local
fi
/bin/systemctl stop rc-local.service
/bin/systemctl start rc-local.service
fi

0 comments on commit 2fe266b

Please sign in to comment.