diff options
author | Robert Peichaer <rpe@cvs.openbsd.org> | 2017-02-28 19:42:39 +0000 |
---|---|---|
committer | Robert Peichaer <rpe@cvs.openbsd.org> | 2017-02-28 19:42:39 +0000 |
commit | a8f9126e829657d181cc53be9b343960c97ca408 (patch) | |
tree | fbcb2c7208a6033c529092be0ca25cf9d6c2bcdb | |
parent | 25a4445792aa876b76bb9fa94760e6e083e72650 (diff) |
Create the /etc/installurl file during upgrade too if a mirror was
used and if the file did not yet exist.
discussed with aja@ and deraadt@
OK tb@ aja@
-rw-r--r-- | distrib/miniroot/install.sub | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index feac47413d9..5c796c83d22 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sub,v 1.978 2017/02/28 18:32:15 rpe Exp $ +# $OpenBSD: install.sub,v 1.979 2017/02/28 19:42:38 rpe Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015, Robert Peichaer <rpe@openbsd.org> @@ -2535,8 +2535,9 @@ finish_up() { done </mnt/etc/fstab fi - # Create /etc/installurl with the mirror used during install. - if [[ $MODE == install && -n $INSTALL_MIRROR ]]; then + # Create /etc/installurl with the mirror used during install or upgrade + # if it does not yet exist. + if [[ -n $INSTALL_MIRROR && ! -f /mnt/etc/installurl ]]; then echo "$INSTALL_URL" >/mnt/etc/installurl fi |