From: deraadt Date: Thu, 2 Dec 2021 17:18:39 +0000 (+0000) Subject: unmount real root partition from /mnt before the cgi/random actions X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=da3b7e6e421a20f0e536819cea00fc8bdd118137;p=openbsd unmount real root partition from /mnt before the cgi/random actions which run asyncronously and can grab vnodes race to make the umount fail spuriously problem seen and diagnosed by Yuichiro NAITO ok florian --- diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index 4a8a2e74991..f686691f01b 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sub,v 1.1184 2021/11/02 16:54:01 kn Exp $ +# $OpenBSD: install.sub,v 1.1185 2021/12/02 17:18:39 deraadt Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015, Robert Peichaer @@ -3258,17 +3258,19 @@ do_upgrade() { # Configure the network. enable_network - # Fetch list of mirror servers and installer choices from previous runs. - start_cgiinfo - # Create a skeletal /etc/fstab which is usable for the upgrade process. munge_fstab + # Do not need to look in /mnt anymore + umount /mnt || { echo "Can't umount $ROOTDEV!"; exit; } + + # Fetch list of mirror servers and installer choices from previous runs. + start_cgiinfo + # fsck -p non-root filesystems in /etc/fstab. check_fs # Mount filesystems in /etc/fstab. - umount /mnt || { echo "Can't umount $ROOTDEV!"; exit; } mount_fs rm -f /mnt/bsd.upgrade /mnt/auto_upgrade.conf