Skip to content

Commit

Permalink
05core/*: display Ignition warnings on the console
Browse files Browse the repository at this point in the history
Fixes coreos/fedora-coreos-tracker#1125

This change displays all Ignition warnings on the console. Also, renamed
the existing Ignition service to make it more generalized for handling
status information about the Ignition run.
  • Loading branch information
sohankunkerkar committed Mar 25, 2022
1 parent ec96e60 commit 9436e96
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ enable bootupd.socket
# Ideally it should have been added as part of base Fedora - but since it was arch specific, it was not added: https://bugzilla.redhat.com/show_bug.cgi?id=1433859
enable rtas_errd.service
enable clevis-luks-askpass.path
# Provide information if no ignition is provided
enable coreos-check-ignition-config.service
# Provide status information about the Ignition run
enable coreos-ignition-status-info.service

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This service provides status information about the
# Ignition run, which includes Ignition warnings and
# information if no Ignition config is provided.
[Unit]
Description=Create Ignition Status Issue Files
Before=systemd-user-sessions.service
ConditionPathExists=/etc/.ignition-result.json

[Service]
Type=oneshot
ExecStart=/usr/libexec/coreos-ignition-status-info
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ else
>> /run/issue.d/30_coreos_ignition_provisioning.issue
fi

# This is for displaying Ignition warnings on the console
# TODO: Find a way to query journald logs before the system switches to real root
IGNITION_WARNINGS=$(journalctl -t ignition -o json-pretty -b 0 -p warning | jq -r '.MESSAGE')
if [ -n "${IGNITION_WARNINGS}" ]; then
echo "$(while read line; do echo "Ignition: $line"; done <<< ${IGNITION_WARNINGS})" \
>> /run/issue.d/30_coreos_ignition_warnings.issue
fi

# Our makeshift way of getting /run/issue.d semantics. See:
# https://github.com/coreos/console-login-helper-messages/blob/e06fc88ae8fbcc3a422bc8c686f70c15aebb9d9a/usr/lib/console-login-helper-messages/issue.defs#L8-L17
ln -sf /run/issue.d/30_coreos_ignition_provisioning.issue /etc/issue.d/
ln -sf /run/issue.d/30_coreos_ignition_warnings.issue /etc/issue.d/

0 comments on commit 9436e96

Please sign in to comment.