summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Peichaer <rpe@cvs.openbsd.org>2016-10-30 13:27:06 +0000
committerRobert Peichaer <rpe@cvs.openbsd.org>2016-10-30 13:27:06 +0000
commit1c6959eb59202b4b5483155dc34394a38d072314 (patch)
tree1b26eb343e1156c34d281fa0ec7a0bf45839676f
parent28fbbb8274fc8025d62afbd7fa75f31ce8cc2515 (diff)
Search for and create a prefetch area only for nonlocal sources.
This enables the installer to verify local set files even if the prefetch area would not fit on the local disk. OK krw@ on a similar diff Idea from and OK naddy@ Feedback and OK tb@
-rw-r--r--distrib/miniroot/install.sub25
1 files changed, 14 insertions, 11 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index 43f3383c14a..7f6c96f39fc 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,5 +1,5 @@
#!/bin/ksh
-# $OpenBSD: install.sub,v 1.928 2016/10/29 18:36:12 rpe Exp $
+# $OpenBSD: install.sub,v 1.929 2016/10/30 13:27:05 rpe Exp $
#
# Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback
# Copyright (c) 2015, Robert Peichaer <rpe@openbsd.org>
@@ -1382,11 +1382,12 @@ install_files() {
! isin SHA256.sig $_files &&
_issue="Directory does not contain SHA256.sig" && break
- # Find a filesystem to store the prefetched sets. Prefer file-
- # systems which are not used during extraction. They need to
- # have 512 MB free space. Otherwise use any other filesystem
- # having 2 GB free space to prevent overflow during extraction.
- _tmpfs=$( (
+ # For non-local sources find a filesystem to store the prefetched
+ # sets. Prefer filesystems which are not used during extraction.
+ # They need to have 512 MB free space. Otherwise use any other
+ # filesystem having 2 GB free space to prevent overflow during
+ # extraction.
+ $_srclocal || _tmpfs=$( (
for fs in /mnt/{{,var/}tmp,home,usr{/local,}}; do
df -k $fs 2>/dev/null | grep " $fs\$"
done
@@ -1400,11 +1401,13 @@ install_files() {
done
) )
- if [[ -d $_tmpfs ]]; then
- ! _tmpsrc=$(tmpdir "$_tmpfs/sets") &&
- _issue="Cannot create prefetch area" && break
- else
- _issue="Cannot determine prefetch area" && break
+ if ! $_srclocal; then
+ if [[ -d $_tmpfs ]]; then
+ ! _tmpsrc=$(tmpdir "$_tmpfs/sets") &&
+ _issue="Cannot create prefetch area" && break
+ else
+ _issue="Cannot determine prefetch area" && break
+ fi
fi
# Cleanup from previous runs.