Bug 194746

Summary: /etc/freebsd-update.conf shouldn't include src as an Component on the Components line
Product: Base System Reporter: Derek Schrock <dereks>
Component: confAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Many People CC: kczekirda, nwhitehorn
Priority: ---    
Version: 9.3-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch for bsdinstall
none
patch for bsdinstall
none
patch for bsdinstall config
none
patch for freebsd-update none

Description Derek Schrock 2014-11-01 19:44:10 UTC
Since the src component is optional part of the FreeBSD base system more often than not you'll always end up with these type of error messages from freebsd-update fetch/install:


$ freebsd-update fetch
...
The following files will be added as part of updating to 10.0-RELEASE-p11:
/usr/src/contrib/tzdata/zone1970.tab
...
$ freebsd-update install
Installing updates...install: ///usr/src/contrib/tzdata/zone1970.tab: No such file or directory
 done.
$

If you want to keep /usr/src up to date then you should have to add that to /etc/freebsd-update.conf or freebsd-update(8) should be smart and not try to install components that are not installed.

freebsd-update should have some logic to understand an empty /usr/src/ means I don't care about the src component even though it's on the Components line in freebsd-update.conf.
Comment 1 Kamil Czekirda freebsd_committer freebsd_triage 2015-04-23 21:30:31 UTC
Created attachment 155928 [details]
patch for bsdinstall
Comment 2 Kamil Czekirda freebsd_committer freebsd_triage 2015-04-23 22:37:24 UTC
Comment on attachment 155928 [details]
patch for bsdinstall

>--- config.old	2015-02-08 11:00:26.000000000 +0100
>+++ config	2015-04-23 23:26:34.236700377 +0200
>@@ -40,6 +40,14 @@
> 
> cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHROOT/boot
> 
>+src=
>+for dist in $DISTRIBUTIONS; do
>+		[ "$dist" = "src.txz" ] && src=1
>+done
>+
>+[ ! "$src" ] && sed -i.bu 's/^Components src/Components/g' $BSDINSTALL_CHROOT/etc/freebsd-update.conf
>+
>+
> [ "${debugFile#+}" ] && cp "${debugFile#+}" $BSDINSTALL_CHROOT/var/log/
> 
> # Set up other things from installed config
Comment 3 Kamil Czekirda freebsd_committer freebsd_triage 2015-04-23 22:43:52 UTC
Created attachment 155929 [details]
patch for bsdinstall
Comment 4 Kamil Czekirda freebsd_committer freebsd_triage 2015-04-23 22:46:45 UTC
Created attachment 155930 [details]
patch for bsdinstall config
Comment 5 Nathan Whitehorn freebsd_committer freebsd_triage 2015-04-24 17:04:34 UTC
Thanks for this! It seems like a good idea, but I'm very hesitant to patch files in the base system from the installer: it adds magic to something that is supposed to only be tar. Do you know how hard it would be to patch freebsd-update to be smarter instead?
Comment 6 Kamil Czekirda freebsd_committer freebsd_triage 2015-04-24 18:04:57 UTC
Created attachment 155952 [details]
patch for freebsd-update
Comment 7 Nathan Whitehorn freebsd_committer freebsd_triage 2015-04-24 18:36:37 UTC
That looks great to me, thanks. Anyone else have opinions?
Comment 8 Kamil Czekirda freebsd_committer freebsd_triage 2015-04-24 18:46:51 UTC
Revision created:
https://reviews.freebsd.org/D2364