[Cerowrt-devel] trying a pcengines box

Alan Jenkins alan.christopher.jenkins at gmail.com
Sat Apr 23 05:52:37 EDT 2016


On 23/04/2016, Dave Taht <dave.taht at gmail.com> wrote:
> I have it built and running 16.04 off of the msata card now. :woot:
>
> last major trick - always install openssl-server before rebooting.
>
> (I haven't figured out how to make systemd do a serial console either, yet).

Huh, it's supposed to just work, following the kernel settings.

pasting from Google cache, as Poetterings blog is down -


To make use of a serial console, just use console=ttyS0 on the kernel
command line, and systemd will automatically start a getty on it for
you."

By default systemd will instantiate one serial-getty at .service on the
main kernel[4] console, if it is not a virtual terminal

This logic is implemented in a generator called
systemd-getty-generator that is run early at boot and pulls in the
necessary services depending on the execution environment.

sometimes there's the need to manually configure a serial getty, for
example, if more than one serial login prompt is needed or the kernel
console should be redirected to a different terminal than the login
prompt. To facilitate this it is sufficient to instantiate
serial-getty at .service once for each serial port you want it to run
on[7]:

# systemctl enable serial-getty at ttyS2.service
# systemctl start serial-getty at ttyS2.service

Sometimes, there's the need to configure the login prompt in even more
detail. For example, if the default baud rate configured by the kernel
is not correct or other agetty parameters need to be changed. In such
a case simply copy the default unit template to /etc/systemd/system
and edit it there:

# cp /usr/lib/systemd/system/serial-getty at .service
/etc/systemd/system/serial-getty at ttyS2.service
# vi /etc/systemd/system/serial-getty at ttyS2.service
 .... now make your changes to the agetty command line ...
# ln -s /etc/systemd/system/serial-getty at ttyS2.service
/etc/systemd/system/getty.target.wants/
# systemctl daemon-reload
# systemctl start serial-getty at ttyS2.service

This creates a unit file that is specific to serial port ttyS2, so
that you can make specific changes to this port and this port only.


[7] Note that this systemctl enable syntax only works with systemd 188
and newer (i.e. F18). On older versions use ln -s
/usr/lib/systemd/system/serial-getty at .service
/etc/systemd/system/getty.target.wants/serial-getty at ttyS2.service ;
systemctl daemon-reload instead.


More information about the Cerowrt-devel mailing list