When root authorized keys are provided by mkosi they are not
newline-terminated so appending a public key to the file results
in a corrupt key, so just to be safe we add an empty line.
ssh-keygen -N '' -C '' -t rsa -f "$ROOTID"
mkdir -p 0700 /root/.ssh
-cat "$ROOTID".pub >> /root/.ssh/authorized_keys
+# Add a newline in case authorized_keys wasn't terminated correctly.
+echo >>/root/.ssh/authorized_keys
+cat "$ROOTID".pub >>/root/.ssh/authorized_keys
# set root pw to "foo", just to set it to something valid
# shellcheck disable=SC2016