Bug#221602: grub-installer: Should enable serial console on serial line installs
Package: grub-installer
Version: 0.24
Severity: important
When installing using a serial line console, grub-installer should
enable the serial line console at boot time when installed. This is
from a installation report:
I mentioned that I was on a serial console. I had to use the
installer as a rescue again in order to get a shell so I could add
the boot parameters back into the grub configuration file:
console=ttyS0,9600n8. Could this not be saved from the inital boot
parameters and applied to the config? Or at least ask about adding
it? The ability to add these parmeters in could be critical in
installs such as this. And since the first reboot is a critical
configuration step (base-config), not having access +like this could
i potentially break the install.
As far as I see, there is no code in grub-installer to detect a serial
console, and no way to pass the extra parameter into grub-install or
update-grub. There is code in lilo-installer to support serial
console.
# Use a serial console if current default console is a serial port.
# default console is last listed
defconsole=$(sed -e 's/.*console=/console=/' /proc/cmdline)
if echo "${defconsole}" | grep -q console=ttyS; then
PORT=$(echo "${defconsole}" | sed -e 's%^console=ttyS%%' -e 's%,.*%%')
SPEED=$(echo "${defconsole}" | sed -e 's%^console=ttyS[0-9]\+,%%' -e 's% .*%%')
SERIAL="${PORT},${SPEED}"
db_subst lilo-installer/serial-console PORT "ttyS${PORT}"
db_subst lilo-installer/serial-console SPEED "${SPEED}"
db_input medium lilo-installer/serial-console || [ $? -eq 30 ]
db_go || true
fi
[...]
if [ "${SERIAL}" ]; then
echo "serial=${SERIAL}" >> /target/etc/lilo.conf
fi
[...]
if [ "${SERIAL}" ]; then
echo " append=\"console=ttyS${SERIAL}\"" >> /target/etc/lilo.conf
fi
Perhaps this code should be generalized, and moved into rootskel? We
could set some cdebconf template variables to flag that the install is
a serial line, set the port device and the speed, and let the
{grub,lilo}-installer use these values.
Reply to: