Skip to content

Commit

Permalink
cmd-run: Convert motd message to storage.files[] entry
Browse files Browse the repository at this point in the history
Much neater than having it be a systemd service. Also only runs once, so
if we rerun the same disk with `--persist` we're not appending the
message again.
  • Loading branch information
jlebon authored and dustymabe committed May 15, 2019
1 parent 3297051 commit 393b8e0
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/cmd-run
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ if [ -z "${IGNITION_CONFIG_FILE:-}" ]; then
# The text gets interspersed with user input/program output on the tty.
# Bump the default to ERROR (3).
kernel.printk = 3 4 1 7
EOF
)

coreos_assembler_motd=$(cat << 'EOF' | base64 --wrap 0
ICMP traffic (ping) does not work with QEMU and user mode networking.
To exit, press Ctrl-A and then X.
EOF
)

Expand All @@ -125,6 +132,13 @@ EOF
"path": "/etc/sysctl.d/10-coreos-assembler.conf",
"contents": { "source": "data:text/plain;base64,${coreos_assembler_sysctl}" },
"mode": 420
},
{
"path": "/etc/motd",
"append": [
{ "source": "data:text/plain;base64,${coreos_assembler_motd}" }
],
"mode": 420
}
]
},
Expand All @@ -138,11 +152,6 @@ EOF
"contents": "[Service]\\nTTYVTDisallocate=no\\nExecStart=\\nExecStart=-/usr/sbin/agetty --autologin core --noclear %I \$TERM\\n"
}
]
},
{
"name": "serial-getty-motd.service",
"enabled": true,
"contents": "[Unit]\\nDescription=Helper message to exit QEMU monitor to /etc/motd\\nBefore=getty.target\\n[Service]\\nType=oneshot\\nExecStart=/bin/sh -c '/usr/bin/echo \\"ICMP traffic (ping) does not work with QEMU and user mode networking.\\\\nTo exit, press Ctrl-A and then X.\\\\n\\" >> /etc/motd'\\n[Install]\\nWantedBy=getty.target\\n"
}
${ign_var_srv_mount}
]
Expand Down

0 comments on commit 393b8e0

Please sign in to comment.