busybox: port textmode runlevel and textmode shell to systemd

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2013-08-18 19:41:24 +02:00
parent 51c746262e
commit c0e0dc88a0
5 changed files with 35 additions and 29 deletions

View File

@ -76,6 +76,9 @@
disk=*)
disk="${arg#*=}"
;;
textmode)
INIT_ARGS="$INIT_ARGS --unit=textmode.target"
;;
installer)
INIT_ARGS="$INIT_ARGS --unit=installer.target"
;;

View File

@ -1,29 +0,0 @@
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
# start text mode shell
#
# runlevels: textmode
TTY="1"
while true; do
PS1="\007\]\[\e[1;32m\]\h\[\e[1;32m\]:\[\e[1;34m\]\w \[\e[0m\]\\$ "
openvt -w -c $TTY /bin/sh
done

View File

@ -90,6 +90,7 @@ USER_PWD="`$ROOT/$TOOLCHAIN/bin/cryptpw -m sha512 $USER_PASSWORD`"
fi
enable_service debug-shell.service
enable_service shell.service
enable_service show-version.service
enable_service var.mount
enable_service var-log-debug.service

View File

@ -0,0 +1,22 @@
[Unit]
Description=Textmode Shell
After=multi-user.target
[Service]
Environment=TTY=1
WorkingDirectory=/storage
ExecStart=/bin/sh -c 'clear; lsb_release; . /etc/profile; exec /bin/sh'
Restart=always
RestartSec=0
StandardInput=tty
TTYPath=/dev/tty1
TTYReset=yes
TTYVHangup=yes
KillMode=process
IgnoreSIGPIPE=no
# bash ignores SIGTERM
KillSignal=SIGHUP
[Install]
WantedBy=textmode.target

View File

@ -0,0 +1,9 @@
[Unit]
Description=Textmode
Requires=multi-user.target
After=multi-user.target
Conflicts=rescue.target
AllowIsolate=yes
[Install]
Alias=default.target