Tiny Core Linux

General TC => Programming & Scripting - Unofficial => Topic started by: akoch on March 24, 2016, 11:14:44 AM

Title: Patch: Enable gettys for kernel consoles
Post by: akoch on March 24, 2016, 11:14:44 AM
Hi,

i'm in the process of setting up TC in a PXE-boot environment with a serial-line as console. As TC does not support a serial console by default, i'm submitting this small patch, that has /init enable getty-lines in /etc/inittab for devices that are configured as kernel-console (e.g. "console=ttyS0,38400n8" on the kernel cmdline):

http://via.lunatica.net/~ak/tc7.0-SerialConsoleGettys.diff.txt (http://via.lunatica.net/~ak/tc7.0-SerialConsoleGettys.diff.txt)

I'd be happy if you would consider including it into the distribution.
Title: Re: Patch: Enable gettys for kernel consoles
Post by: curaga on March 24, 2016, 04:43:18 PM
Since the ARM users on Pi often also use a serial console, and that's on a different device, I'd like it to be included too, so the support is generic enough and not just x86.

Can any pi users comment?
Title: Re: Patch: Enable gettys for kernel consoles
Post by: bmarkus on March 25, 2016, 02:38:08 AM
In piCore since 6.0 serial consoled is enable in cmdline.txt

Code: [Select]
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/ram0 elevator=deadline rootwait quiet nortc loglevel=3 noembed
and started in bootlocal.sh

Code: [Select]
# Start serial terminal
/usr/sbin/startserialtty &

# Set CPU frequency governor to ondemand (default is performance)
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

# Load modules
/sbin/modprobe i2c-dev

# Start openssh daemon
/usr/local/etc/init.d/openssh start

# ------ Put other system startup commands below this line
Title: Re: Patch: Enable gettys for kernel consoles
Post by: akoch on March 29, 2016, 07:37:56 AM
I didn't try running TC on the pi, but from what i can see here, it would make sense to get rid of the /usr/sbin/startserialtty & in bootlocal.sh and include an appropriate line in inittab instead:

Code: [Select]
#ttyAMA0::respawn:/sbin/getty 115200 ttyAMA0 vt100
The (patched) /init would then enable this line on bootup.