Commit 8f97074e authored by Harald Sitter's avatar Harald Sitter

split ttyS1 setup from early first start

early first start also installs coredumpd. we MUST NOT do this on a live
system as the apt update will screw up the offline test which partially
relies on there actually being no internet, not only temporarily!
parent f761f1fd
......@@ -35,10 +35,3 @@ system('systemctl stop apt-daily.service')
puts "#{$0} Adding systemd-coredump."
system 'apt update' || raise
system 'apt install -y systemd-coredump' || raise
# ttyS1 is set up by our kvm wrapper, it ordinarily isn't available
# Also see bin/kvm_arg_injector for additional information.
puts "#{$0} Letting systemd-journald log to ttyS1."
system 'sed -i "s%.*ForwardToConsole=.*%ForwardToConsole=yes%g" /etc/systemd/journald.conf' || raise
system 'sed -i "s%.*TTYPath=.*%TTYPath=/dev/ttyS1%g" /etc/systemd/journald.conf' || raise
system 'systemctl restart systemd-journald' || raise
#!/usr/bin/env ruby
#
# Copyright (C) 2018 Harald Sitter <sitter@kde.org>
#
# This program is free software) || raise you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation) || raise either version 2 of
# the License or (at your option) version 3 or any later version
# accepted by the membership of KDE e.V. (or its successor approved
# by the membership of KDE e.V.), which shall act as a proxy
# defined in Section 14 of version 3 of the license.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY) || raise without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# ttyS1 is set up by our kvm wrapper, it ordinarily isn't available
# Also see bin/kvm_arg_injector for additional information.
puts "#{$0} Letting systemd-journald log to ttyS1."
system 'sed -i "s%.*ForwardToConsole=.*%ForwardToConsole=yes%g" /etc/systemd/journald.conf' || raise
system 'sed -i "s%.*TTYPath=.*%TTYPath=/dev/ttyS1%g" /etc/systemd/journald.conf' || raise
system 'systemctl restart systemd-journald' || raise
......@@ -223,12 +223,11 @@ sub boot {
assert_script_run 'wget ' . data_url('permissions_check.rb'), 16;
assert_script_run 'ruby permissions_check.rb', 16;
# This primarily makes sure apt isn't hogged by apt-daily AND most
# importantly sets up a journald console output for /dev/ttyS1.
# This primarily to set up journald console output for /dev/ttyS1.
# This script will also be run for the final system on first start and
# retained in the image.
assert_script_run 'wget ' . data_url('early_first_start.rb'), 16;
assert_script_sudo 'ruby early_first_start.rb', 60 * 5;
assert_script_run 'wget ' . data_url('setup_journald_ttyS1.rb'), 16;
assert_script_sudo 'ruby setup_journald_ttyS1.rb', 60 * 5;
# TODO: maybe control via env var?
# assert_script_run 'wget ' . data_url('enable_qdebug.rb'), 16;
......
......@@ -37,6 +37,9 @@ sub run {
select_console 'log-console';
assert_script_run 'wget ' . data_url('setup_journald_ttyS1.rb'), 16;
assert_script_sudo 'ruby setup_journald_ttyS1.rb', 60 * 5;
# General purpose hook.
assert_script_run 'wget ' . data_url('early_first_start.rb'), 16;
assert_script_sudo 'ruby early_first_start.rb', 60 * 5;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment