%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
#!/bin/bash set -e trap true HUP INT QUIT TSTP echo_on () { stty echo; } trap echo_on EXIT # agetty only sets ICRNL if it has read the username and seen whether # it was terminated by CR or NL. We pass -n to agetty so that hasn't # happened and need to force it on. Yay UNIX! stty icrnl -echo # Check if the "snap" command is available - if not that means this # script ran too early (which should never happen because we use # After=core18.start-snapd.service) or that seeding fails. if ! command -v snap >/dev/null; then echo "Cannot find the 'snap' command. This means something went wrong." echo "Press [enter] to see log output that may help diagnose the issue." read -r REPLY journalctl -u core18.start-snapd.service # FIXME: Should we give a root shell here to allow developers to poke # around? The device is most likely unusable anyway if we reached # this point because seeding (and/or ordering) failed. echo "Press [enter] to retry" read -r REPLY exit 0 fi if [ "$(snap managed)" = "true" ]; then # check if we have extrausers that have no password set if grep -qE '^[-a-z0-9+.-_]+:x:' /var/lib/extrausers/passwd && ! grep -qE '^[-a-z0-9+.-_]+:\$[0-9]+\$.*:' /var/lib/extrausers/shadow; then tty=$(tty) tty=$(echo "${tty#/dev/}" | tr '/' '-') readargs=() filepath="/run/console-conf/login-details-${tty}.txt" if [ ! -f "${filepath}" ]; then mkdir -p /run/console-conf set +e /usr/share/subiquity/console-conf-write-login-details > "${filepath}.tmp" rval=$? set -e # A exit code of 2 from console-conf-write-login-details # means there are no scope global IP addresses. It will # have printed a message saying that you can't log in # until the device gets an IP address so we display that # but check every 5 seconds if an ip address has appeared. if [ $rval -eq 0 ]; then mv "${filepath}.tmp" "${filepath}" elif [ $rval -eq 2 ]; then mv "${filepath}.tmp" "${filepath}.noip" filepath="${filepath}.noip" readargs=(-t 5) else exit $rval fi fi cat "$filepath" set +e while :; do read -r "${readargs[@]}" REPLY if [ $? -le 128 ]; then # If we didn't time out, re-display everything. exit 0 fi if ip addr show | grep -qE "scope global"; then # If we timed out, but it appears that we may now have # an IP address, re-display everything. exit 0 fi done else touch /var/lib/console-conf/complete fi exit 0 fi cat /usr/share/subiquity/console-conf-wait read -r REPLY exec console-conf "$@"