--- install.sub.tmp +++ install.sub.tmp @@ -1377,7 +1377,10 @@ ask_until "$_q (name, lladdr, '?', or 'done')" \ ${_p:-$( (get_ifs netboot; get_ifs) | sed q )} - [[ $resp == done ]] && break + if [[ $resp == done ]]; then + NIFS=$(ls -1 /tmp/i/hostname.* 2>/dev/null | grep -c ^) + break + fi [[ $resp == '?' ]] && continue # Quote $resp to prevent user from confusing isin() by @@ -3170,6 +3173,21 @@ echo "\nConfiguring the root disk $ROOTDISK...\n" } +rdsshd_start() { + local _pid + if [[ -s /var/run/sshd.pid ]]; then + _pid=$( 1 )) && \ + kill -0 "$_pid" 2>/dev/null && return 0 + fi + if [[ ! -s /etc/ssh/ssh_host_ed25519_key ]]; then + /usr/bin/ssh-keygen -q -t ed25519 -N "" \ + -f /etc/ssh/ssh_host_ed25519_key || return 1 + fi + /usr/sbin/sshd -t -f /etc/ssh/sshd_config || return 1 + /usr/sbin/sshd -f /etc/ssh/sshd_config || return 1 +} + do_install() { local _rootkey _rootpass @@ -3190,7 +3208,20 @@ # Configure the network. donetconfig + if $AI && [[ $AI_RESPFILE == /auto_install.conf ]]; then + start_cgiinfo + wait_cgiinfo + rdsshd_start || err_exit "Could not start ramdisk sshd." + >/var/run/rdsshd.ready + cat <<__EOT +ramdisk sshd is running. +Connect as root with the matching key. +Run: install +__EOT + exit 0 + fi + # Fetch list of mirror servers and installer choices from previous runs. start_cgiinfo --- dot.profile.tmp +++ dot.profile.tmp @@ -130,6 +130,11 @@ if $timeout; then timeout=false echo + if [[ -f /auto_install.conf ]]; then + /install -af /auto_install.conf + [[ -f /var/run/rdsshd.ready ]] && break + continue + fi REPLY=a else # User has made a choice; stop the read timeout.