summaryrefslogtreecommitdiff
path: root/distrib/miniroot
diff options
context:
space:
mode:
authorAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2011-07-14 14:54:58 +0000
committerAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2011-07-14 14:54:58 +0000
commitb6e486fb92c2a6d158421fb4b74cb7024a7947b1 (patch)
treefae9b7a0a4a950f75664bce19c31a2d80563cc84 /distrib/miniroot
parent239379290fa02445a08ad92886d319d627b6e521 (diff)
Fix a bug reported by "Remco" on misc@ where sysmerge(8) would fail to
run when upgrading using a CD. The reason was that at the time sysmerge(8) would run (and gets its sets), the CD would be unmounted. We are now taking a different approach and get the (x)etc sets anyway according to whether base and/or xbase was selected and put them under /tmp in the chroot. This way whatever upgrade method is chosen, the sets will always be in a consistent location. ok krw@
Diffstat (limited to 'distrib/miniroot')
-rw-r--r--distrib/miniroot/install.sub20
1 files changed, 9 insertions, 11 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index 9ad766422c7..e34bd84c188 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,4 +1,4 @@
-# $OpenBSD: install.sub,v 1.646 2011/07/09 17:53:58 halex Exp $
+# $OpenBSD: install.sub,v 1.647 2011/07/14 14:54:57 ajacoutot Exp $
# $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $
#
# Copyright (c) 1997-2009 Todd Miller, Theo de Raadt, Ken Westerback
@@ -1168,11 +1168,15 @@ install_files() {
GOTSETS="$GOTSETS $_f"
fi
- # save arguments for sysmerge(8)
+ # get sets and save arguments for sysmerge(8)
[[ $_f == base$VERSION.tgz ]] && \
- SM_ETC="$_src/etc$VERSION.tgz"
+ ftp $FTPOPTS -o /mnt/tmp/etc$VERSION.tgz \
+ -m "$_src/etc$VERSION.tgz" >/dev/null 2>&1 && \
+ SM_ARGS="-s /tmp/etc$VERSION.tgz"
[[ $_f == xbase$VERSION.tgz ]] && \
- SM_XETC="$_src/xetc$VERSION.tgz"
+ ftp $FTPOPTS -o /mnt/tmp/xetc$VERSION.tgz \
+ -m "$_src/xetc$VERSION.tgz" >/dev/null 2>&1 && \
+ SM_ARGSX="-x /tmp/xetc$VERSION.tgz"
done
}
@@ -1631,15 +1635,9 @@ install_sets() {
}
run_sysmerge() {
- if [[ -n "$SM_ETC" || -n "$SM_XETC" ]]; then
+ if [[ -n "$SM_ARGS" || -n "$SM_ARGSX" ]]; then
ask_yn "Merge the new etc/xetc install sets using sysmerge(8)?" no
if [[ $resp == y ]]; then \
- [[ X"$SM_ETC" != X"" ]] && \
- ftp $FTPOPTS -o /mnt/tmp/etc$VERSION.tgz -m "$SM_ETC" && \
- SM_ARGS="-s /tmp/etc$VERSION.tgz"
- [[ X"$SM_XETC" != X"" ]] && \
- ftp $FTPOPTS -o /mnt/tmp/xetc$VERSION.tgz -m "$SM_XETC" && \
- SM_ARGSX="-x /tmp/xetc$VERSION.tgz"
/mnt/usr/sbin/chroot /mnt /usr/sbin/sysmerge $SM_ARGS $SM_ARGSX
fi
fi