3 # Copyright (c) 2017 Cisco and/or its affiliates.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at:
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
19 echo "********** CONFIGURING SERIAL CONSOLE **********"
20 cat - > /etc/systemd/system/serial-getty-digi@.service <<"_EOF"
23 # This service maintains a getty on ttyS0 from the point the system is
24 # started until it is shut down again.
25 # This file is part of systemd.
27 # systemd is free software; you can redistribute it and/or modify it
28 # under the terms of the GNU Lesser General Public License as published by
29 # the Free Software Foundation; either version 2.1 of the License, or
30 # (at your option) any later version.
33 Description=Serial Getty on %I
34 Documentation=man:agetty(8) man:systemd-getty-generator(8)
35 Documentation=http://0pointer.de/blog/projects/serial-console.html
37 After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service
38 After=rc-local.service
40 # If additional gettys are spawned during boot then we should make
41 # sure that this is synchronized before getty.target, even though
42 # getty.target didn't actually pull it in.
47 ExecStart=-/sbin/agetty -L %I 115200
62 cat - > /etc/default/grub <<"_EOF"
63 # If you change this file, run 'update-grub' afterwards to update
64 # /boot/grub/grub.cfg.
65 # For full documentation of the options in this file, see:
66 # info -f grub -n 'Simple configuration'
70 GRUB_DISABLE_SUBMENU=true
71 GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
72 GRUB_CMDLINE_LINUX="rhgb quiet console=tty0 console=ttyS0,115200n8"
75 GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
77 # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
78 #GRUB_DISABLE_LINUX_UUID=true
80 # Uncomment to disable generation of recovery mode menu entries
81 #GRUB_DISABLE_RECOVERY="true"
83 # Uncomment to get a beep at grub start
84 #GRUB_INIT_TUNE="480 440 1"
87 grub2-mkconfig -o /boot/grub2/grub.cfg
88 sudo systemctl enable serial-getty-digi@ttyS0.service
89 sudo systemctl start serial-getty-digi@ttyS0.service