Skip to content
This repository was archived by the owner on Jul 12, 2024. It is now read-only.

Commit e62c990

Browse files
committed
fix: Correct SELinux permissions
1 parent d37d747 commit e62c990

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

docs/main.md

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,11 @@ $ sudo tee /usr/lib/systemd/system/minitel-getty@.service <<'EOT'
132132
# (at your option) any later version.
133133
134134
[Unit]
135-
Description=Getty on %I
135+
Description=Serial Getty on %I
136136
Documentation=man:agetty(8) man:systemd-getty-generator(8)
137137
Documentation=http://0pointer.de/blog/projects/serial-console.html
138-
After=systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target
138+
BindsTo=dev-%i.device
139+
After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target
139140
After=rc-local.service
140141
141142
# If additional gettys are spawned during boot then we should make
@@ -150,36 +151,24 @@ IgnoreOnIsolate=yes
150151
Conflicts=rescue.service
151152
Before=rescue.service
152153
153-
# On systems without virtual consoles, don't start any getty. Note
154-
# that serial gettys are covered by serial-getty@.service, not this
155-
# unit.
156-
ConditionPathExists=/dev/%I
157-
158154
[Service]
159-
# the VT is cleared by TTYVTDisallocate
160155
# The '-o' option value tells agetty to replace 'login' arguments with an
161156
# option to preserve environment (-p), followed by '--' for safety, and then
162157
# the entered username.
163-
ExecStart=/sbin/agetty -o '-p -- \\u' --noclear -c %I 4800 m1b-x80 $TERM
158+
ExecStart=/usr/bin/sh -c "sudo stty -F /dev/ttyUSB0 4800 istrip cs7 parenb -parodd brkint ignpar icrnl ixon ixany opost onlcr cread hupcl isig icanon echo echoe echok && /sbin/agetty -o '-p -- \\u' -c %I 4800 m1b-x80 $TERM"
164159
Type=idle
165160
Restart=always
166-
RestartSec=0
167161
UtmpIdentifier=%I
168162
TTYPath=/dev/%I
169163
TTYReset=yes
170164
TTYVHangup=yes
171-
TTYVTDisallocate=yes
172165
IgnoreSIGPIPE=no
173166
SendSIGHUP=yes
174167
175-
# Unset locale for the console getty since the console has problems
176-
# displaying some internationalized messages.
177-
UnsetEnvironment=LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDEN>
178-
179168
[Install]
180169
WantedBy=getty.target
181-
DefaultInstance=tty1
182170
EOT
171+
$ sudo chcon -t tty_device_t /dev/ttyUSB0
183172
$ sudo systemctl daemon-reload
184173
$ sudo systemctl enable --now minitel-getty@ttyUSB0
185174
```

0 commit comments

Comments
 (0)