Bug 207377 - [10.3-BETA2] freebsd-update relying on kern.bootfile copies around entire filesystem
Summary: [10.3-BETA2] freebsd-update relying on kern.bootfile copies around entire fil...
Status: Closed DUPLICATE of bug 202710
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-20 20:39 UTC by Hannes Hauswedell
Modified: 2016-12-20 22:03 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hannes Hauswedell 2016-02-20 20:39:40 UTC
I am just updating to 10.3-BETA2 with freebsd-update and it starting copying my entire filesystem into /boot/kernel.old/
After some debugging I found out that this is due to a mechanism where it detects the kernel dir from kern.bootfile. Since I have a slightly more sophisticated setup where I use grub, this variable ends up being /kernel
=> freebsd-update assumes that / is the kerneldir and copies *everything* into the backup dir as mentioned above.

I think this is bad behaviour, a smart thing would be to check if the directory pointed to by kern.bootfile actually contains a kernel file, and if not ask the user to specify the directory or skip the backup process entirely. Most users rely on snapshots nowadays so this step is not really crucial.

And / should never be accepted as KERNELDIR IMHO.

Thank you!
Comment 1 Harlan Stenn 2016-08-18 00:09:05 UTC
I have several Atom machines where this happens.  The value of kern.bootfile is "/kernel" instead of "/boot/kernel/kernel".
Comment 2 Ed Maste freebsd_committer freebsd_triage 2016-12-20 22:03:39 UTC

*** This bug has been marked as a duplicate of bug 202710 ***