image: enable serial console access for MiniConstellation to simplify troubleshooting (#964)

- enable serial console access for QEMU / mini Constellation
- print motd if serial console access is enabled
This commit is contained in:
Malte Poll 2023-01-13 16:01:45 +01:00 committed by GitHub
parent 5dcaf84e23
commit 82462fab17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,7 @@
[Output] [Output]
KernelCommandLine=constel.csp=qemu KernelCommandLine=constel.csp=qemu
OutputDirectory=mkosi.output.qemu OutputDirectory=mkosi.output.qemu
[Content]
Autologin=yes
Environment=CONSOLE_MOTD=true

View File

@ -21,6 +21,17 @@ mv /etc/issue.d /usr/lib/issue.d || true
rm -f /etc/issue rm -f /etc/issue
rm -f /etc/issue.net rm -f /etc/issue.net
# add motd for constellation console access
if [[ "${CONSOLE_MOTD:-false}" == "true" ]]; then
cat <<EOF > /usr/lib/motd.d/10-constellation-console-access.motd
~ Welcome to Constellation! ~
Usually, on release versions of Constellation running in the cloud, you are not able to login through the serial console.
This shell access is specifically granted for debug images and MiniConstellation to allow users to research the environment Constellation runs in.
Have fun! Feel free to report any issues to GitHub or security@edgeless.systems (for security vulnerabilities only).
EOF
fi
# update /etc/os-release # update /etc/os-release
echo "IMAGE_ID=\"${IMAGE_ID}\"" >> /etc/os-release echo "IMAGE_ID=\"${IMAGE_ID}\"" >> /etc/os-release
echo "IMAGE_VERSION=\"${IMAGE_VERSION}\"" >> /etc/os-release echo "IMAGE_VERSION=\"${IMAGE_VERSION}\"" >> /etc/os-release

View File

@ -4,5 +4,7 @@ d /var/log/kubernetes/audit/ 0700 0 0 -
d /run/state/bin 0755 0 0 - - d /run/state/bin 0755 0 0 - -
C /run/issue.d - - - - /usr/lib/issue.d/ C /run/issue.d - - - - /usr/lib/issue.d/
C /run/issue - - - - /usr/lib/issue C /run/issue - - - - /usr/lib/issue
C /run/motd.d - - - - /usr/lib/motd.d/
C /run/motd - - - - /usr/lib/motd
# merge all CNI binaries in writable folder until containerd can use multiple CNI bins: https://github.com/containerd/containerd/issues/6600 # merge all CNI binaries in writable folder until containerd can use multiple CNI bins: https://github.com/containerd/containerd/issues/6600
C /opt/cni/bin - - - - /usr/libexec/cni/ C /opt/cni/bin - - - - /usr/libexec/cni/