Bug 196055 - freebsd-update to 10.1-RELEASE-p2 tries to remove / and installed /usr/lib32 on amd64
Summary: freebsd-update to 10.1-RELEASE-p2 tries to remove / and installed /usr/lib32 ...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.1-RELEASE
Hardware: amd64 Any
: Normal Affects Many People
Assignee: Colin Percival
URL:
Keywords: needs-qa
: 196091 196147 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-12-17 09:33 UTC by Bradley T. Hughes
Modified: 2015-01-06 06:42 UTC (History)
20 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bradley T. Hughes freebsd_committer freebsd_triage 2014-12-17 09:33:30 UTC
I ran freebsd-update(8) this morning to update my 10.1-RELEASE-p1 machine to 10.1-RELEASE-p2. After a 'fetch', freebsd-update reports that it will remove / (the root directory):

    # freebsd-update fetch
    Fetching metadata signature for 10.1-RELEASE from update2.freebsd.org... done.
    Fetching metadata index... done.
    Fetching 2 metadata patches.. done.
    Applying metadata patches... done.
    Inspecting system... done.
    Preparing to download files... done.
    Fetching 8 patches..... done.
    Applying patches... done.
    Fetching 313 files... done.

    The following files will be removed as part of updating to 10.1-RELEASE-p2:
    /

    The following files will be added as part of updating to 10.1-RELEASE-p2:
    ...
    #

When installing the updates, it appears that freebsd-update actually tries to remove / as well:

    # freebsd-update install
    Installing updates...rmdir: ///: Is a directory
     done.
    #
Comment 1 Bradley T. Hughes freebsd_committer freebsd_triage 2014-12-17 10:13:31 UTC
As pointed out on IRC (#freebsd on freenode), running 'freebsd-update fetch' again reports that it still wants to remove the root directory:

    # freebsd-update fetch
    Looking up update.FreeBSD.org mirrors... 5 mirrors found.
    Fetching metadata signature for 10.1-RELEASE from update5.freebsd.org... done.
    Fetching metadata index... done.
    Inspecting system... done.
    Preparing to download files... done.

    The following files will be removed as part of updating to 10.1-RELEASE-p2:
    /
    #
Comment 2 Harrison Grundy 2014-12-17 12:27:51 UTC
Occurs here as well.
Comment 3 Matthieu Volat 2014-12-17 12:32:21 UTC
Same story here, also from 10.1-RELEASE-p1 amd64 hosts. And if `freebsd-update fetch install` was called, the only way to cancel is to kill() it from another term?
Comment 4 everytrash 2014-12-17 14:20:09 UTC
 Affects me too
Comment 5 sf(jungleboogie) 2014-12-17 15:21:10 UTC
No affecting me
FreeBSD naked 10.1-RELEASE FreeBSD 10.1-RELEASE #0 r274401: Tue Nov 11 22:51:51 UTC 2014     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  i386

sudo freebsd-update fetch
Password:
Looking up update.FreeBSD.org mirrors... none found.
Fetching metadata signature for 10.1-RELEASE from update.FreeBSD.org... done.
Fetching metadata index... done.
Fetching 2 metadata patches.. done.
Applying metadata patches... done.
Inspecting system... done.
Preparing to download files... done.
Fetching 5 patches... done.
Applying patches... done.

The following files will be updated as part of updating to 10.1-RELEASE-p2:
/bin/freebsd-version
/usr/lib/private/libunbound.a
/usr/lib/private/libunbound.so.5
/usr/lib/private/libunbound_p.a
/usr/sbin/unbound
jungle@naked:~ % sudo freebsd-update install
Installing updates... done.
Comment 6 pvoigt 2014-12-17 15:37:54 UTC
I have just tested this in a VirtualBox VM and it looks as if I am affected too:

# freebsd-update fetch
...
The following files will be updated as part of updating to 10.1-RELEASE-p2:
/bin/freebsd-version
/usr/lib/private/libunbound.a
/usr/lib/private/libunbound.so.5
/usr/lib/private/libunbound_p.a
/usr/sbin/unbound
/usr/src/contrib/unbound/iterator/iterator.c
/usr/src/contrib/unbound/iterator/iterator.h
/usr/src/sys/conf/newvers.sh

# freebsd-update install
Installing updates...rmdir: ///: Is a directory
 done.

However:
# freebsd-version 
10.1-RELEASE-p2

My conclusion: New files have been at least partly installed.
Comment 7 everytrash 2014-12-17 15:52:09 UTC
I try the command (freebsd-update fetch) again and i get this:

Looking up update.FreeBSD.org mirrors... 5 mirrors found.
Fetching metadata signature for 10.1-RELEASE from update6.freebsd.org... done.
Fetching metadata index... done.
Inspecting system... done.
Preparing to download files... done.

The following files will be removed as part of updating to 10.1-RELEASE-p2:
/
Comment 8 sf(jungleboogie) 2014-12-17 15:54:29 UTC
(In reply to pvoigt from comment #6)
> I have just tested this in a VirtualBox VM and it looks as if I am affected
> too:
> 

Was it amd64 or i386? Maybe you can test the opposite of what you previously tried to see what the results are.
Comment 9 pvoigt 2014-12-17 15:58:08 UTC
(In reply to sf(jungleboogie) from comment #8)
> (In reply to pvoigt from comment #6)
> > I have just tested this in a VirtualBox VM and it looks as if I am affected
> > too:
> > 
> 
> Was it amd64 or i386? Maybe you can test the opposite of what you previously
> tried to see what the results are.

Well, I was on amd64.
Comment 10 John Nielsen 2014-12-17 18:14:54 UTC
I am seeing the same thing on amd64. Proceeding does install the updates (and removing / fails, thankfully) but it is definitely worrisome.

Also of note--this update decided to install what looked like all of /lib32 on a host where this directory did not previously exist. In this instance I don't mind (in fact, I've wondered previously if there were a way to install new distribution sets using freebsd-update), but it was a surprise.
Comment 11 Henrik Hudson 2014-12-17 18:42:37 UTC
Same issue.

a) it tries to install /usr/lib32/ which I don't need.
b) tries to delete /

system is a clean install of 10.1-REL that was updated to -p1 a few days ago.

amd64 in this case.
Comment 12 sf(jungleboogie) 2014-12-17 18:51:30 UTC
See bug 195302

So my system (i386) is unaffected since I have the /usr/lib32/.

Maybe the subject can be amended to clarify the architecture.
Comment 13 jnn 2014-12-17 19:38:06 UTC
Same thing happens on my 10.1-p1, amd64

It proposes to first delete / and then install a bunch of /usr/lib32/.

This is from "freebsd-update fetch" - I don't think I'll be running "freebsd-update install" until there is a resolution for this.
Comment 14 Robroy Gregg 2014-12-18 04:56:29 UTC
Same here while trying to update from 10.1-RELEASE-p1 amd64.
Comment 15 Harrison Grundy 2014-12-18 13:30:09 UTC
For those users who got /usr/lib32 and did not want it, has it been installed in the past, (say, on FreeBSD 10.0)?
Comment 16 everytrash 2014-12-18 13:53:38 UTC
(In reply to Harrison Grundy from comment #15)
> For those users who got /usr/lib32 and did not want it, has it been
> installed in the past, (say, on FreeBSD 10.0)?

No. In the past the folder /usr/lib32 contains:

/usr/lib32/dtrace:
total 0

/usr/lib32/i18n:
total 0

/usr/lib32/private:
total 0
Comment 17 David O'Rourke 2014-12-18 13:58:04 UTC
(In reply to Harrison Grundy from comment #15)
> For those users who got /usr/lib32 and did not want it, has it been
> installed in the past, (say, on FreeBSD 10.0)?

The FreeBSD install I first experienced this on was installed at FreeBSD 10.1-RELEASE and had never had FreeBSD 10.0 installed.

This is on an amd64 install.
Comment 18 Matthias M. 2014-12-18 14:07:32 UTC
Hi, all our x86_64 machines are affected , too.
But none of our i386 machines is as far as i know.

Is it possible to patch from 10.1-RELEASE to 10.1-RELEASE-p1 ?
Comment 19 Harrison Grundy 2014-12-18 14:28:01 UTC
It's worth noting that the update does not, in fact, delete /. Since I'm using lib32, I've run it on my machines here without any ill effects.
Comment 20 Harrison Grundy 2014-12-18 14:36:50 UTC
Passing this along from the mailing lists (Thanks, gavin)

olli hauer <ohauer@gmx.de> writes:
> Is there an issue with freebsd-update or an special reason the update
> wants to install lib32?

Yes.  The freebsd-update distribution for 10.1 was incorrectly built
without lib32; as a result, freebsd-update deletes lib32 when upgrading
from older releases (see https://bugs.freebsd.org/195302).  The only way
to fix that was to reintroduce lib32 in the next patch release.
Unfortunately, freebsd-update is not able to tell that a newly created
file belongs to a distribution which is not installed or disabled in
freebsd-update.conf.  We decided that this was the lesser of two evils.

I will make an announcement later regarding this and the "rm /" issue.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no
Comment 21 Kmcdon 2014-12-18 17:15:44 UTC
I didn't see anything regarding this on this thread, but I wanted to add that the issue is affecting me as well, however, it also seems that after applying these patches, 'shutdown -r' no longer restarts, it will only shutdown.
Comment 22 Igor Pavlov 2014-12-18 23:10:10 UTC
# freebsd-update fetch
Looking up update.FreeBSD.org mirrors... 5 mirrors found.
Fetching metadata signature for 10.1-RELEASE from update3.freebsd.org... done.
Fetching metadata index... done.
Inspecting system... done.
Preparing to download files... done.

The following files will be removed as part of updating to 10.1-RELEASE-p2:
/


So, it will delete root directory after the reboot?
What should I do to prevent it?
Comment 23 Harrison Grundy 2014-12-18 23:12:00 UTC
/ won't be deleted since it's a directory not a file. It's safe to ignore, just scary sounding.
Comment 24 Sydney Meyer 2014-12-21 03:01:17 UTC
*** Bug 196147 has been marked as a duplicate of this bug. ***
Comment 25 Harrison Grundy 2015-01-06 06:41:02 UTC
*** Bug 196091 has been marked as a duplicate of this bug. ***
Comment 26 Harrison Grundy 2015-01-06 06:42:46 UTC
Fixed by r276086 & FreeBSD-EN-14:13.freebsd-update