From cd1ab2280c9af3fc91eece6eb1be30336a36a025 Mon Sep 17 00:00:00 2001 From: Colin Percival Date: Wed, 16 Oct 2013 18:36:53 +0000 Subject: [PATCH] When installing updates, install new directories first and remove old directories last. This is generally handled by the fact that the list of filesystem objects is sorted, but this sorting is broken by code which moves .so files ahead (so that they're present before any binaries which use them)... that code also moved .so files ahead of directories, which is a problem for upgrading to 10.0 where there's a new directory containing new .so files. Errata Notice Candidate. --- usr.sbin/freebsd-update/freebsd-update.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index ef63c0cfbe34..49db090aaa8f 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -2814,15 +2814,23 @@ Kernel updates have been installed. Please reboot and run # If we haven't already dealt with the world, deal with it. if ! [ -f $1/worlddone ]; then + # Create any necessary directories first + grep -vE '^/boot/' $1/INDEX-NEW | + grep -E '^[^|]+\|d\|' > INDEX-NEW + install_from_index INDEX-NEW || return 1 + # Install new shared libraries next grep -vE '^/boot/' $1/INDEX-NEW | + grep -vE '^[^|]+\|d\|' | grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 # Deal with everything else grep -vE '^/boot/' $1/INDEX-OLD | + grep -vE '^[^|]+\|d\|' | grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD grep -vE '^/boot/' $1/INDEX-NEW | + grep -vE '^[^|]+\|d\|' | grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 install_delete INDEX-OLD INDEX-NEW || return 1 @@ -2868,11 +2876,20 @@ again to finish installing updates. # Remove old shared libraries grep -vE '^/boot/' $1/INDEX-NEW | + grep -vE '^[^|]+\|d\|' | grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW grep -vE '^/boot/' $1/INDEX-OLD | + grep -vE '^[^|]+\|d\|' | grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD install_delete INDEX-OLD INDEX-NEW || return 1 + # Remove old directories + grep -vE '^/boot/' $1/INDEX-OLD | + grep -E '^[^|]+\|d\|' > INDEX-OLD + grep -vE '^/boot/' $1/INDEX-OLD | + grep -E '^[^|]+\|d\|' > INDEX-OLD + install_delete INDEX-OLD INDEX-NEW || return 1 + # Remove temporary files rm INDEX-OLD INDEX-NEW }