Skip to content

Commit a68b629

Browse files
Fix ttys for 6.6 kernel:
For some reason the 6.6 kernel has issues with ttys when they are not explicitly set in the linuxkit yaml. Signed-off-by: Jacob Weinstock <[email protected]>
1 parent ec7b28f commit a68b629

File tree

1 file changed

+47
-4
lines changed

1 file changed

+47
-4
lines changed

linuxkit-templates/hook.template.yaml

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,49 @@ services:
9191
- /etc/motd:/etc/motd
9292
- /etc/os-release:/etc/os-release
9393
- /:/host_root
94+
- /dev:/dev
95+
- /dev/console:/dev/console
96+
- /usr/bin/nerdctl:/usr/bin/nerdctl
9497
env:
9598
- INSECURE=true
99+
devices:
100+
- path: all
101+
type: b
102+
- path: "/dev/console"
103+
type: c
104+
major: 5
105+
minor: 1
106+
mode: "0666"
107+
- path: "/dev/tty0"
108+
type: c
109+
major: 4
110+
minor: 0
111+
mode: "0666"
112+
- path: "/dev/tty1"
113+
type: c
114+
major: 4
115+
minor: 1
116+
mode: "0666"
117+
- path: "/dev/ttyS0"
118+
type: c
119+
major: 4
120+
minor: 64
121+
mode: "0666"
122+
- path: "/dev/ttyS1"
123+
type: c
124+
major: 4
125+
minor: 65
126+
mode: "0666"
127+
- path: "/dev/ttyAMA0"
128+
type: c
129+
major: 204
130+
minor: 64
131+
mode: "0666"
132+
- path: "/dev/ttyAMA1"
133+
type: c
134+
major: 204
135+
minor: 65
136+
mode: "0666"
96137

97138
- name: hook-docker
98139
image: "${HOOK_CONTAINER_DOCKER_IMAGE}"
@@ -105,7 +146,7 @@ services:
105146
options: [ "rw", "nosuid", "noexec", "nodev", "relatime" ]
106147
destination: /sys/fs/cgroup
107148
binds.add:
108-
#- /dev/console:/dev/console
149+
- /dev/console:/dev/console
109150
- /dev:/dev
110151
- /etc/resolv.conf:/etc/resolv.conf
111152
- /lib/modules:/lib/modules
@@ -117,6 +158,9 @@ services:
117158
- /var/run/images
118159
- /var/run/docker
119160
- /var/run/worker
161+
devices:
162+
- path: all
163+
type: b
120164

121165
- name: hook-bootkit
122166
image: "${HOOK_CONTAINER_BOOTKIT_IMAGE}"
@@ -155,12 +199,11 @@ services:
155199
files:
156200
- path: etc/profile.d/local.sh
157201
contents: |
158-
alias docker='ctr -n services.linuxkit tasks exec --tty --exec-id cmd hook-docker docker'
159-
alias docker-shell='ctr -n services.linuxkit tasks exec --tty --exec-id shell hook-docker sh'
202+
alias docker='nerdctl -n services.linuxkit exec -it hook-docker docker'
203+
alias docker-shell='nerdctl -n services.linuxkit exec -it hook-docker sh'
160204
export PS1='HookOS ${HOOK_VERSION}:\w\$ '
161205
# only print WARNING or higher kernel messages to console
162206
echo 4 > /proc/sys/kernel/printk
163-
resize
164207
mode: "0644"
165208

166209
- path: etc/motd

0 commit comments

Comments
 (0)