From e58d55960959304fd565a39ee9fcddd9aee8e1c1 Mon Sep 17 00:00:00 2001 From: Kelvin Fan Date: Thu, 3 Dec 2020 16:54:03 -0500 Subject: [PATCH] fedora-coreos-base: Add postprocess script to configure `login.defs` Add `/run/motd.d` as one of the directories that `login(1)` reads from to display the MOTD. This is required for newer versions of `console-login-helper-messages` to function properly. The script can be dropped when `util-linux` adds `/run/motd.d` as a default in Fedora 34. https://src.fedoraproject.org/rpms/util-linux/pull-request/8 https://github.com/coreos/fedora-coreos-tracker/issues/704#issuecomment-772862174 --- manifests/fedora-coreos-base.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/manifests/fedora-coreos-base.yaml b/manifests/fedora-coreos-base.yaml index 0f43eefbfd..e64ff993bb 100644 --- a/manifests/fedora-coreos-base.yaml +++ b/manifests/fedora-coreos-base.yaml @@ -96,6 +96,20 @@ postprocess: DNSStubListener=no EOF + # Edit `login.defs` to configure `login(1)` to read from `/run/motd.d` for + # displaying the MOTD. This is required for newer versions of + # `console-login-helper-messages` to function properly. + # This will be dropped once Fedora util-linux adds `/run/motd.d` as a default + # in Fedora 34. + # https://src.fedoraproject.org/rpms/util-linux/pull-request/8 + # https://github.com/coreos/fedora-coreos-tracker/issues/704#issuecomment-772862174 + - | + #!/usr/bin/env bash + source /etc/os-release + if [ ${VERSION_ID} -lt 34 ]; then + echo 'MOTD_FILE=/usr/share/misc/motd:/run/motd:/run/motd.d:/etc/motd:/etc/motd.d' >> /etc/login.defs + fi + packages: # Security - selinux-policy-targeted