Skip to content

Commit

Permalink
image: allow autologin on TTY1 for STACKIT cloud (#3499)
Browse files Browse the repository at this point in the history
  • Loading branch information
burgerdev authored Nov 27, 2024
1 parent 900fb3f commit 6d7f687
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Description=Export Constellation Debug Level to Environment

[Service]
Type=oneshot
ExecStart=/bin/bash -c "tr ' ' '\n' < /proc/cmdline | grep -q 'constellation.debug' && echo CONSTELLATION_DEBUG_FLAGS=--debug >> /run/constellation.env"
ExecStart=/bin/bash -c "tr ' ' '\n' < /proc/cmdline | grep -q 'constel.debug' && echo CONSTELLATION_DEBUG_FLAGS=--debug >> /run/constellation.env"
RemainAfterExit=yes

[Install]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ enable systemd-timesyncd.service
enable systemd-networkd.service
enable systemd-networkd-wait-online.service
enable configure-constel-csp.service
enable [email protected]
enable dbus.service
enable dbus-broker.service
enable dbus-daemon.service
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=autologin
ConditionPathExists=/proc/cmdline
ConditionKernelCommandLine=|constel.console
ConditionKernelCommandLine=|constel.debug

[Service]
ExecStart=
ExecStart=-/sbin/agetty -o '-p -f -- \\u' --noclear --autologin root %I $TERM
[Install]
WantedBy=multi-user.target
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[Unit]
Description=autologin
ConditionPathExists=/proc/cmdline
ConditionKernelCommandLine=|constellation.console
ConditionKernelCommandLine=|constellation.debug
ConditionKernelCommandLine=|constel.console
ConditionKernelCommandLine=|constel.debug

[Service]
ExecStart=
Expand Down
12 changes: 4 additions & 8 deletions image/system/variants.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ CSPS = [
"qemu",
]

base_cmdline = "selinux=1 enforcing=0 audit=0"
base_cmdline = "selinux=1 enforcing=0 audit=0 console=tty1 console=ttyS0"

csp_settings = {
"aws": {
Expand All @@ -62,20 +62,17 @@ csp_settings = {
},
"azure": {
"kernel_command_line_dict": {
"console": "ttyS0",
"constel.csp": "azure",
"mitigations": "auto,nosmt",
},
},
"gcp": {
"kernel_command_line_dict": {
"console": "ttyS0",
"constel.csp": "gcp",
"mitigations": "auto,nosmt",
},
},
"openstack": {
"kernel_command_line": "console=tty0 console=ttyS0 console=ttyS1",
"kernel_command_line_dict": {
"constel.csp": "openstack",
"kvm_amd.sev": "1",
Expand All @@ -85,9 +82,8 @@ csp_settings = {
},
},
"qemu": {
"kernel_command_line": "constellation.console", # All qemu images have console enabled independent of stream
"kernel_command_line": "constel.console", # All qemu images have console enabled independent of stream
"kernel_command_line_dict": {
"console": "ttyS0",
"constel.csp": "qemu",
"mitigations": "auto,nosmt",
},
Expand Down Expand Up @@ -135,10 +131,10 @@ attestation_variant_settings = {

stream_settings = {
"console": {
"kernel_command_line": "constellation.console",
"kernel_command_line": "constel.console",
},
"debug": {
"kernel_command_line": "constellation.debug",
"kernel_command_line": "constel.debug",
},
"nightly": {},
"stable": {},
Expand Down

0 comments on commit 6d7f687

Please sign in to comment.