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 28, 2022
1 parent ec96e60 commit 4a90aaa
Show file tree
Hide file tree
Showing 4 changed files with 28 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,16 @@
# This service writes issue files describing 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-write-issue
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ 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
journalctl -t ignition -o json-pretty -b 0 -p warning | jq -r '.MESSAGE' | while read
line; do
if [ "$line" != "" ]; then
echo "Ignition: $line" >> /run/issue.d/30_coreos_ignition_warnings.issue
fi
done

# 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 4a90aaa

Please sign in to comment.