Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: killthebabysitter on August 09, 2011, 03:22:52 PM
-
I'm trying to create a boot setup that can redirect the console output the serial port for debugging purposes.
I've managed to get it so that the
SYSLINUX 4.01 0x4c3de821 Copyright (C) 1994-2010 H. Peter Anvin et al
Loading /boot/bzImage.....
etc... all print to the serial console rather than the vga monitor, but the login is still printed to the vga instead.
Currently this is my extlinux.conf
SERIAL 0 115200
DEFAULT tinycore
LABEL tinycore
KERNEL /boot/bzImage
APPEND initrd=/boot/tinycore.gz quiet text nodhcp tce=UUID="f0cdd75c-71e4-41a9-8e9c-ed457e74cda5" console=ttyS0,115200
Can someone help me figure out what else I need to change to make the login go to ttyS0?
-
That'd be /etc/inittab. IIRC you also need to change the getty, there's been threads on this.
-
Look at your /etc/inittab file. You need to specify a serial port here, as explained on this page (http://www.vanemery.com/Linux/Serial/serial-console.html) which uses agetty from util-linux-ng.tcz, although getty is reported to work in these posts:
Login at /dev/ttyS0 (http://forum.tinycorelinux.net/index.php?topic=5809.0)
local root login (http://forum.tinycorelinux.net/index.php?topic=7880.0)
-
Thanks for the help:
Here's the steps I took to get it working.
extlinux.conf now looks like this
SERIAL 0 115200
DEFAULT tinycore
LABEL tinycore
KERNEL /boot/bzImage
APPEND initrd=/boot/tinycore.gz quiet text waitusb=5:UUID="f0cdd75c-71e4-41a9-8e9c-ed457e74cda5" tce=UUID="f0cdd75c-71e4-41a9-8e9c-ed457e74cda5" console=ttyS0,115200
I then decompressed tinycore.gz
mkdir file_system
cd file_system
zcat ../boot/tinycore.gz | sudo cpio -i -H newc -d
Then I changed /etc/inittab to the following
# /etc/inittab: init configuration for busybox init.
# Boot-time system configuration/initialization script.
#
::sysinit:/etc/init.d/rcS
# /sbin/getty respawn shell invocations for selected ttys.
tty1::respawn:/sbin/rungetty tty1 --autologin root
#tty2::respawn:/sbin/getty 38400 tty2
#tty3::respawn:/sbin/getty 38400 tty3
#tty4::respawn:/sbin/getty 38400 tty4
#tty5::respawn:/sbin/getty 38400 tty5
#tty6::respawn:/sbin/getty 38400 tty6
ttyS0::respawn:/sbin/getty 115200 ttyS0
# Stuff to do when restarting the init
# process, or before rebooting.
::restart:/etc/init.d/rc.shutdown
::restart:/sbin/init
::ctrlaltdel:/sbin/reboot
::shutdown:/etc/init.d/rc.shutdown
And changed /etc/securetty to
# /etc/securetty: List of terminals on which root is allowed to login.
#
console
# For people with serial port consoles
ttyS0
# Standard consoles
tty1
tty2
tty3
tty4
tty5
tty6
tty7
Then recompressed with
cd file_system
find | sudo cpio -o -H newc | gzip -2 > ../boot/tinycore.gz
Thanks for the help guys.
-
Thank you for the quick refresher. I use 9600 for speed out of compatibility with other devices.