Merge pull request #2365 from deitch/test-dev-existence-getty

Test dev existence getty
This commit is contained in:
Justin Cormack 2017-08-07 20:32:39 +01:00 committed by GitHub
commit e61794a344
22 changed files with 28 additions and 22 deletions

View File

@ -53,7 +53,7 @@ services:
image: linuxkit/acpid:79e5c20de96e1633c9c40935b99dde45aefba37b image: linuxkit/acpid:79e5c20de96e1633c9c40935b99dde45aefba37b
# Enable getty for easier debugging # Enable getty for easier debugging
- name: getty - name: getty
image: linuxkit/getty:2c841cdc34396e3fa8f25b62d112808f63f16df6 image: linuxkit/getty:797cb79e0a229fcd16ebf44a0da74bcec03968ec
env: env:
- INSECURE=true - INSECURE=true
# Run ntpd to keep time synchronised in the VM # Run ntpd to keep time synchronised in the VM

View File

@ -18,7 +18,7 @@ onboot:
command: ["/usr/bin/mountie", "/var/lib/docker"] command: ["/usr/bin/mountie", "/var/lib/docker"]
services: services:
- name: getty - name: getty
image: linuxkit/getty:2c841cdc34396e3fa8f25b62d112808f63f16df6 image: linuxkit/getty:797cb79e0a229fcd16ebf44a0da74bcec03968ec
env: env:
- INSECURE=true - INSECURE=true
- name: rngd - name: rngd

View File

@ -16,7 +16,7 @@ onboot:
image: linuxkit/metadata:cec86f3e1c260c9eafefa80c262fceb40c182ddf image: linuxkit/metadata:cec86f3e1c260c9eafefa80c262fceb40c182ddf
services: services:
- name: getty - name: getty
image: linuxkit/getty:2c841cdc34396e3fa8f25b62d112808f63f16df6 image: linuxkit/getty:797cb79e0a229fcd16ebf44a0da74bcec03968ec
env: env:
- INSECURE=true - INSECURE=true
- name: rngd - name: rngd

View File

@ -14,7 +14,7 @@ onboot:
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"] command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
services: services:
- name: getty - name: getty
image: linuxkit/getty:2c841cdc34396e3fa8f25b62d112808f63f16df6 image: linuxkit/getty:797cb79e0a229fcd16ebf44a0da74bcec03968ec
# to make insecure with passwordless root login, uncomment following lines # to make insecure with passwordless root login, uncomment following lines
#env: #env:
# - INSECURE=true # - INSECURE=true

View File

@ -11,7 +11,7 @@ onboot:
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"] command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
services: services:
- name: getty - name: getty
image: linuxkit/getty:2c841cdc34396e3fa8f25b62d112808f63f16df6 image: linuxkit/getty:797cb79e0a229fcd16ebf44a0da74bcec03968ec
env: env:
- INSECURE=true - INSECURE=true
trust: trust:

View File

@ -7,7 +7,7 @@ init:
- linuxkit/containerd:f69bc5b8ec0392e2d34d3fd3bfdb7266ef6d4ed4 - linuxkit/containerd:f69bc5b8ec0392e2d34d3fd3bfdb7266ef6d4ed4
services: services:
- name: getty - name: getty
image: linuxkit/getty:2c841cdc34396e3fa8f25b62d112808f63f16df6 image: linuxkit/getty:797cb79e0a229fcd16ebf44a0da74bcec03968ec
env: env:
- INSECURE=true - INSECURE=true
- name: rngd - name: rngd

View File

@ -13,7 +13,7 @@ onboot:
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"] command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
services: services:
- name: getty - name: getty
image: linuxkit/getty:2c841cdc34396e3fa8f25b62d112808f63f16df6 image: linuxkit/getty:797cb79e0a229fcd16ebf44a0da74bcec03968ec
env: env:
- INSECURE=true - INSECURE=true
- name: redis - name: redis

View File

@ -14,7 +14,7 @@ onboot:
command: ["/sbin/rngd", "-1"] command: ["/sbin/rngd", "-1"]
services: services:
- name: getty - name: getty
image: linuxkit/getty:2c841cdc34396e3fa8f25b62d112808f63f16df6 image: linuxkit/getty:797cb79e0a229fcd16ebf44a0da74bcec03968ec
env: env:
- INSECURE=true - INSECURE=true
- name: rngd - name: rngd

View File

@ -24,7 +24,7 @@ onboot:
command: ["/swap.sh", "--path", "/var/external/swap", "--size", "1G", "--encrypt"] command: ["/swap.sh", "--path", "/var/external/swap", "--size", "1G", "--encrypt"]
services: services:
- name: getty - name: getty
image: linuxkit/getty:2c841cdc34396e3fa8f25b62d112808f63f16df6 image: linuxkit/getty:797cb79e0a229fcd16ebf44a0da74bcec03968ec
env: env:
- INSECURE=true - INSECURE=true
- name: rngd - name: rngd

View File

@ -14,7 +14,7 @@ onboot:
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"] command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
services: services:
- name: getty - name: getty
image: linuxkit/getty:2c841cdc34396e3fa8f25b62d112808f63f16df6 image: linuxkit/getty:797cb79e0a229fcd16ebf44a0da74bcec03968ec
env: env:
- INSECURE=true - INSECURE=true
- name: tss - name: tss

View File

@ -11,7 +11,7 @@ onboot:
image: linuxkit/sysctl:154913b72c6f1f33eb408609fca9963628e8c051 image: linuxkit/sysctl:154913b72c6f1f33eb408609fca9963628e8c051
services: services:
- name: getty - name: getty
image: linuxkit/getty:2c841cdc34396e3fa8f25b62d112808f63f16df6 image: linuxkit/getty:797cb79e0a229fcd16ebf44a0da74bcec03968ec
env: env:
- INSECURE=true - INSECURE=true
- name: rngd - name: rngd

View File

@ -16,7 +16,7 @@ onboot:
image: linuxkit/metadata:cec86f3e1c260c9eafefa80c262fceb40c182ddf image: linuxkit/metadata:cec86f3e1c260c9eafefa80c262fceb40c182ddf
services: services:
- name: getty - name: getty
image: linuxkit/getty:2c841cdc34396e3fa8f25b62d112808f63f16df6 image: linuxkit/getty:797cb79e0a229fcd16ebf44a0da74bcec03968ec
env: env:
- INSECURE=true - INSECURE=true
- name: rngd - name: rngd

View File

@ -18,7 +18,7 @@ onshutdown:
command: ["/bin/echo", "so long and thanks for all the fish"] command: ["/bin/echo", "so long and thanks for all the fish"]
services: services:
- name: getty - name: getty
image: linuxkit/getty:2c841cdc34396e3fa8f25b62d112808f63f16df6 image: linuxkit/getty:797cb79e0a229fcd16ebf44a0da74bcec03968ec
env: env:
- INSECURE=true - INSECURE=true
- name: rngd - name: rngd

View File

@ -15,6 +15,12 @@ start_getty() {
term="linux" term="linux"
[ "$speed" = "$1" ] && speed=115200 [ "$speed" = "$1" ] && speed=115200
# does the device even exist?
if [ ! -c /dev/$tty ]; then
echo "getty: cmdline has console=$tty but /dev/$tty is not a character device; not starting getty for $tty" | tee /dev/console
return
fi
case "$tty" in case "$tty" in
ttyS*|ttyAMA*|ttyUSB*|ttyMFD*) ttyS*|ttyAMA*|ttyUSB*|ttyMFD*)
line="-L" line="-L"
@ -35,7 +41,7 @@ start_getty() {
if ! grep -q -w "$tty" "$securetty"; then if ! grep -q -w "$tty" "$securetty"; then
# we could not find the tty in securetty, so start a getty but warn that root login will not work # we could not find the tty in securetty, so start a getty but warn that root login will not work
echo "getty: cmdline has console=$tty but does not exist in $securetty; will not be able to log in as root on this tty $tty." > /dev/$tty echo "getty: cmdline has console=$tty but does not exist in $securetty; will not be able to log in as root on this tty $tty." | tee /dev/$tty
fi fi
# respawn forever # respawn forever
infinite_loop setsid.getty -w /sbin/agetty $loginargs $line $speed $tty $term & infinite_loop setsid.getty -w /sbin/agetty $loginargs $line $speed $tty $term &

View File

@ -28,7 +28,7 @@ onboot:
- /var/lib:/var/lib - /var/lib:/var/lib
services: services:
- name: getty - name: getty
image: linuxkit/getty:2c841cdc34396e3fa8f25b62d112808f63f16df6 image: linuxkit/getty:797cb79e0a229fcd16ebf44a0da74bcec03968ec
env: env:
- INSECURE=true - INSECURE=true
- name: rngd - name: rngd

View File

@ -28,7 +28,7 @@ onboot:
- /var/lib:/var/lib - /var/lib:/var/lib
services: services:
- name: getty - name: getty
image: linuxkit/getty:2c841cdc34396e3fa8f25b62d112808f63f16df6 image: linuxkit/getty:797cb79e0a229fcd16ebf44a0da74bcec03968ec
env: env:
- INSECURE=true - INSECURE=true
- name: rngd - name: rngd

View File

@ -11,7 +11,7 @@ onboot:
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"] command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
services: services:
- name: getty - name: getty
image: linuxkit/getty:2c841cdc34396e3fa8f25b62d112808f63f16df6 image: linuxkit/getty:797cb79e0a229fcd16ebf44a0da74bcec03968ec
env: env:
- INSECURE=true - INSECURE=true
trust: trust:

View File

@ -12,7 +12,7 @@ onboot:
image: linuxkit/sysctl:154913b72c6f1f33eb408609fca9963628e8c051 image: linuxkit/sysctl:154913b72c6f1f33eb408609fca9963628e8c051
services: services:
- name: getty - name: getty
image: linuxkit/getty:2c841cdc34396e3fa8f25b62d112808f63f16df6 image: linuxkit/getty:797cb79e0a229fcd16ebf44a0da74bcec03968ec
env: env:
- INSECURE=true - INSECURE=true
- name: rngd - name: rngd

View File

@ -30,7 +30,7 @@ services:
- name: sshd - name: sshd
image: linuxkit/sshd:505a985d7bd7a90f15eca9cb4dc6ec92789d51a0 image: linuxkit/sshd:505a985d7bd7a90f15eca9cb4dc6ec92789d51a0
- name: getty - name: getty
image: linuxkit/getty:2c841cdc34396e3fa8f25b62d112808f63f16df6 image: linuxkit/getty:797cb79e0a229fcd16ebf44a0da74bcec03968ec
env: env:
- INSECURE=true - INSECURE=true
files: files:

View File

@ -14,7 +14,7 @@ onboot:
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"] command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
services: services:
- name: getty - name: getty
image: linuxkit/getty:2c841cdc34396e3fa8f25b62d112808f63f16df6 image: linuxkit/getty:797cb79e0a229fcd16ebf44a0da74bcec03968ec
env: env:
- INSECURE=true - INSECURE=true
- name: rngd - name: rngd

View File

@ -23,7 +23,7 @@ onboot:
image: linuxkit/metadata:cec86f3e1c260c9eafefa80c262fceb40c182ddf image: linuxkit/metadata:cec86f3e1c260c9eafefa80c262fceb40c182ddf
services: services:
- name: getty - name: getty
image: linuxkit/getty:2c841cdc34396e3fa8f25b62d112808f63f16df6 image: linuxkit/getty:797cb79e0a229fcd16ebf44a0da74bcec03968ec
env: env:
- INSECURE=true - INSECURE=true
- name: qemu-ga - name: qemu-ga

View File

@ -12,7 +12,7 @@ onboot:
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"] command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
services: services:
- name: getty - name: getty
image: linuxkit/getty:2c841cdc34396e3fa8f25b62d112808f63f16df6 image: linuxkit/getty:797cb79e0a229fcd16ebf44a0da74bcec03968ec
files: files:
- path: etc/getty.shadow - path: etc/getty.shadow
# sample sets password for root to "abcdefgh" (without quotes) # sample sets password for root to "abcdefgh" (without quotes)