patches and low-level development discussion
 help / color / mirror / code / Atom feed
blob a1846a29cf55892127feb7ecfc0adcd12f0497bd 1198 bytes (raw)
name: host/rootfs/image/etc/s6-linux-init/run-image/service/serial-getty-generator/run 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
 
#!/bin/execlineb -WS1
# SPDX-License-Identifier: EUPL-1.2+
# SPDX-FileCopyrightText: 2024-2025 Alyssa Ross <hi@alyssa.is>

# avoid concurrent operation
cgroup-setup --leaf -- $1
piperw 3 4
background {
  fdclose 3
  fdmove 2 4
  inotifywait -e MODIFY /sys/class/tty/console/active
}
fdclose 4
importas -i inotifywait_pid !

foreground {
  if { fdmove 0 3 grep -qx "Watches established." }
  background { fdmove 0 3 cat }
  fdclose 3

  # Wait until inotifywait is ready before updating serial gettys,
  # so that changes won't be missed in between updating and starting
  # inotifywait.
  pipeline { s6-instance-list /run/service/serial-getty }
  pipeline { sort }
  fdmove -c 3 0

  redirfd -r 0 /sys/class/tty/console/active
  pipeline { tr " " "\n" }
  pipeline { sort }

  pipeline { comm -3 - /proc/self/fd/3 }
  forstdin -Ep line
  case -N $line {
    "	?tty[0-9]*" { }
    "	(.*)" {
      importas -i tty 1
      s6-instance-delete /run/service/serial-getty $tty
    }
  }
  s6-instance-create /run/service/serial-getty $line
}

# Block until the active consoles change, then let s6 restart us.
unexport EXECLINE_STRICT # https://skarnet.org/lists/skaware/2246.html
wait -- $inotifywait_pid

debug log:

solving a1846a29cf55892127feb7ecfc0adcd12f0497bd ...
found a1846a29cf55892127feb7ecfc0adcd12f0497bd in https://inbox.spectrum-os.org/spectrum-devel/20260711-cgroups-v3-9-5cba61a20cba@gmail.com/ ||
	https://inbox.spectrum-os.org/spectrum-devel/20260721-cgroups-v4-8-46b2e5fff7b6@gmail.com/ ||
	https://inbox.spectrum-os.org/spectrum-devel/20260805-cgroups-v6-7-086c0f00f55f@gmail.com/ ||
	https://inbox.spectrum-os.org/spectrum-devel/20260731-cgroups-v5-7-b325bac9d34f@gmail.com/
found bf66ab0878fc6d8e77ca71a4a89e50c139a6bb11 in https://spectrum-os.org/git/spectrum
preparing index
index prepared:
100755 bf66ab0878fc6d8e77ca71a4a89e50c139a6bb11	host/rootfs/image/etc/s6-linux-init/run-image/service/serial-getty-generator/run

applying [1/1] https://inbox.spectrum-os.org/spectrum-devel/20260711-cgroups-v3-9-5cba61a20cba@gmail.com/
diff --git a/host/rootfs/image/etc/s6-linux-init/run-image/service/serial-getty-generator/run b/host/rootfs/image/etc/s6-linux-init/run-image/service/serial-getty-generator/run
index bf66ab0878fc6d8e77ca71a4a89e50c139a6bb11..a1846a29cf55892127feb7ecfc0adcd12f0497bd 100755

Checking patch host/rootfs/image/etc/s6-linux-init/run-image/service/serial-getty-generator/run...
Applied patch host/rootfs/image/etc/s6-linux-init/run-image/service/serial-getty-generator/run cleanly.

skipping https://inbox.spectrum-os.org/spectrum-devel/20260721-cgroups-v4-8-46b2e5fff7b6@gmail.com/ for a1846a29cf55892127feb7ecfc0adcd12f0497bd
skipping https://inbox.spectrum-os.org/spectrum-devel/20260805-cgroups-v6-7-086c0f00f55f@gmail.com/ for a1846a29cf55892127feb7ecfc0adcd12f0497bd
skipping https://inbox.spectrum-os.org/spectrum-devel/20260731-cgroups-v5-7-b325bac9d34f@gmail.com/ for a1846a29cf55892127feb7ecfc0adcd12f0497bd
index at:
100755 a1846a29cf55892127feb7ecfc0adcd12f0497bd	host/rootfs/image/etc/s6-linux-init/run-image/service/serial-getty-generator/run

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).