2014-06-17 10:22 GMT+02:00 Martin Richard <[email protected]>:
>
> I'll explore the ssh solution, see if starting a daemon in the initramfs
> can give me what I want.
>
A quick follow-up:
Starting an ssh daemon in initramfs was complicated, in particular, once
the real root filesystem is set, the connection becomes useless (see
switch_root in /usr/share/initramfs-tools/init).
In fact, it is possible to start a terminal, and it is quite easy, by
adding a script in /etc/init.d/ that will start the terminal and use rc.d
to schedule it soon enough:
/etc/init.d/rescueterm.sh:
#! /bin/sh
### BEGIN INIT INFO
# Provides: rescueterm
# Required-Start: keyboard-setup
# Required-Stop:
# Should-Start:
# Default-Start: S
# Default-Stop:
# X-Interactive: true
# Short-Description: Start a console on tty8 without using inittab
### END INIT INFO
PATH=/sbin:/bin:/usr/bin
. /lib/lsb/init-functions
case "$1" in
start|"")
log_begin_msg "Starting rescue terminal"
# openvt is used because it's not blocking, while getty is.
LOGIN_TIMEOUT=0 openvt -c8 login
log_end_msg
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop)
# No-op
;;
*)
echo "Usage: rescueterm.sh [start|stop]" >&2
exit 3
;;
esac
:
and enable it: update-rc.d rescueterm.sh enable S
(if there is a better way to embed code on the list, don't hesitate to tell
me...!)
Cheers,
Martin