NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Issue when suspending sysinst(8) with Ctrl+Z



Hello Rocky and all,

"Rocky Hotas" writes:
> [...]
> When installing NetBSD, there is sometimes need to go to a prompt to read
> dmesg or run some other commands. This is possible (and suggested by the
> guide), typing Ctrl+Z: then, sysinst(8) itself prints that it can be resumed
> typing `exit' or Ctrl+D.
>
> With the NetBSD 8.0 sysinst(8) on amd64, `exit' or Ctrl+D produce the effect
> to restart sysinst(8) from the beginning, so any possible setting/setup made
> till that point is lost. I would like to signal this for anyone who tries to
> install NetBSD 8.0 and needs to suspend sysinst(8).
>
> Leot and I investigated a bit about this problem and it seems to be an sh(1)
> bug. It was not present in -current. In 8.0, after having updated and
> rebuilt the code of sh(1), sysinst(8) worked correctly.
>
> The problem continues to affect, obviously, all the (at least, amd64)
> existing install images of NetBSD 8.0, with the related version of sh(1).
> [...]

Adding more details about the debugging we have done the problem
was in the following lines of install.sh
(src/distrib/amd64/cdroms/install.sh,-r1.4):

    92  while [ -n "${cmd}" ]
    93  do
    94          ${cmd}
    95          if [ $? = 4 ]; then
    96                  echo "Oops, something went wrong - we will try again"
    97                  exit
    98          else
    99                  if [ -n "$(jobs)" ]; then
   100                          tput clear
   101                          echo "You have stopped sysinst, return to it by" \
   102                                  "typing 'exit' or ^D."
   103                          ${SHELL} -i
   104                          cmd="fg"
   105                  else
   106                          cmd=""
   107                  fi
   108          fi
   109  done

Tracing netbsd-8 or NetBSD-current sh(1) when ^Z-ing reveals:

 | [1] + Suspended               ${cmd}
 | + '[' 146 = 4 ']'
 | + jobs
 | + '[' -n '[1] + Suspended               ${cmd}' ']'
 | + tput clear
 | + echo 'You have stopped sysinst, return to it by' "typing 'exit' or ^D."
 | + /bin/sh -i

...while with 8.0 sh(1):

 | [1] + Suspended               ${cmd}
 | + '[' 146 = 4 ']'
 | + jobs
 | + '[' -n '' ']'
 | + cmd=''
 | + '[' -n '' ']'
 | + echo TERM=wsvt25 >/tmp/sysinst.term
 | + echo
 | + echo "To return to the installer, quit this shell by typing 'exit' or ^D."
 | + exec /bin/sh

I.e. in 8.0 "$(jobs)" is not expanded to the string printed while
it is expanded in netbsd-8 and -current.

We have not tracked the pullup but the change was pulluped to
netbsd-8 so if you are installing netbsd-8 (not the 8.0 formal
release) you can safetely supsend sysinst(8) and recover it as
documented in the Guide.


Home | Main Index | Thread Index | Old Index