On Wed, Jan 11, 2017 at 11:52:02AM +0000, Pedro Caetano wrote:
> Hi tech@
>
> I was running an headless installation via serial using today's snapshot
> (10th January), and noticed something odd in the end of the installation
> proccess.
>
> Transcription below:
> What timezone are you in? ('?' for list) [Canada/Mountain] Europe/Lisbon
> Saving configuration files...sed: /tmp/i/hosts: No such file or directory
> done.
> Making all device nodes...done.
> Multiprocessor machine; using bsd.mp instead of bsd.
The hosts file need not exist if no interfaces were configured (as is
noted in a comment a few lines after that sed command), so simply check
whether it exists before running sed:
Index: install.sub
===================================================================
RCS file: /var/cvs/src/distrib/miniroot/install.sub,v
retrieving revision 1.945
diff -u -p -r1.945 install.sub
--- install.sub 10 Jan 2017 17:50:58 -0000 1.945
+++ install.sub 11 Jan 2017 12:06:40 -0000
@@ -2715,7 +2715,8 @@ do_install(){
# manually.
# Remove entry for ftp.openbsd.org before final hosts file is created.
- sed -i '/129.128.5.191/d' /tmp/i/hosts
+ # Note we may have no hosts file if no interfaces were configured.
+ [[ -f /tmp/i/hosts ]] && sed -i '/129.128.5.191/d' /tmp/i/hosts
# Add common entries.
echo "127.0.0.1\tlocalhost" >/mnt/etc/hosts