Re: controlling installation from a serial terminal
On Fri, 15 Jan 1999 09:13:54 +0000, Enrique Zanardi <ezanardi@ull.es> wrote:
> There's already support for serial consoles on Sparc and
> VME/m68k. It's trivial to use that on other architectures where the
> kernel supports them. It's just a matter of #define SERIAL_CONSOLE
> on dinstall.h for i386 and booting with the proper kernel parameter
> (console=/dev/ttyS*).
[...]
> I would try using a 2.1.x kernel. There may be other problems, as
> the floppies have been tested with 2.0.x kernels only, but it may
> work.
I got the first part of the installation to work via a serial port by
configuring a 2.1.132 kernel with
CONFIG_SERIAL=y
CONFIG_SERIAL_CONSOLE=y
making the attached changes to init.c, and using the boot parameter
console=/dev/ttyS0. The boot parameter sends the boot messages out
the serial port, and the init.c changes sends the dinstall messages
there. The other computer was configured as 9600 n 8 1, and the
connection was made with a null modem cable (LapLink).
At some point, I would like to see these incorporated into
boot-floppies, but I suppose not before 2.0 is released. I still have
to get the rest of the kernel configuration right, make a real 2.1.132
kernel image package, check out the rest of the installation, and
probably make a few more changes I had not forseen.
One question: I would like to enable serial port logins after the
second boot by adding the appropriate lines to /etc/inittab. I see
these options:
- Incorporate the change into the standard files. Would that
represent a security problem or something?
- Add code to dinstall or something to make the change if the
console=/dev/ttyS? boot parameter was specified.
- dinstall makes the change, but asks the user first.
I suppose I am stuck asking for a special kernel for this option.
(The CONFIG_SERIAL_CONSOLE probably would not hurt, but some some may
not want CONFIG_SERIAL.) I would hope eventually to incorporate the
necessary changes into the standard rescue floppy and base.tgz,
though.
- Jim Van Zandt
--- init.c.orig Sun Jan 10 14:41:21 1999
+++ init.c Thu Jan 21 20:08:39 1999
@@ -303,12 +303,19 @@
/* Should catch the syntax of Sparc kernel console setting. */
/* The kernel does not recognize a serial console when getting*/
/* console=/dev/ttySX !! */
+ /* /dev/ttySx works with the 2.1.132 i386 kernel - jrv */
else if ( strcmp(__environ[j], "console=ttya") == 0 ) {
serial_console=1;
}
else if ( strcmp(__environ[j], "console=ttyb") == 0 ) {
serial_console=2;
}
+ else if ( strcmp(__environ[j], "console=ttyS0") == 0 ) {
+ serial_console=3;
+ }
+ else if ( strcmp(__environ[j], "console=ttyS1") == 0 ) {
+ serial_console=4;
+ }
/* standard console settings */
else if ( strncmp(__environ[j], "console=", 8) == 0 ) {
first_terminal=&(__environ[j][8]);
@@ -412,6 +419,12 @@
break;
case 2:
strcpy( console, "/dev/cua1" );
+ break;
+ case 3:
+ strcpy( console, "/dev/ttyS0" );
+ break;
+ case 4:
+ strcpy( console, "/dev/ttyS1" );
break;
default:
tty = ttyname(0);
Reply to: