Chris H
2015-Mar-10 19:01 UTC
There has to be a better way of merging /etc during a major freebsd-update
On Tue, 10 Mar 2015 10:17:18 -0500 Adam Vande More <amvandemore at gmail.com> wrote> On Tue, Mar 10, 2015 at 7:05 AM, Peter Olsson <list-freebsd-stable at jyborn.se > > wrote: > > > This flag to mergemaster saved a lot of work when I did > > upgrades the old way, with cvsup and the make steps and > > then mergemaster: > > > > https://svnweb.freebsd.org/base?view=revision&revision=221780 > > I'd venture to guess the script will work fine on older installs, but > testing should be done first.Isn't that pretty much what the -F flag, I mentioned does? "-F If the files differ only by VCS Id ($FreeBSD) install the new file." In all honesty, I too got stuck answering "y" ~100 times, way back when. And decided I needed to either find a better way, or see if the mergemaster(8) had any secrets I wasn't aware of. ;-) --Chris> > -- > Adam > _______________________________________________ > freebsd-stable at freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe at freebsd.org"
Adam Vande More
2015-Mar-10 19:08 UTC
There has to be a better way of merging /etc during a major freebsd-update
On Tue, Mar 10, 2015 at 2:01 PM, Chris H <bsd-lists at bsdforge.com> wrote:> > > > > > > https://svnweb.freebsd.org/base?view=revision&revision=221780 > > > > I'd venture to guess the script will work fine on older installs, but > > testing should be done first. > Isn't that pretty much what the -F flag, I mentioned does? > "-F If the files differ only by VCS Id ($FreeBSD) install the > new file." >Op asked for a freebsd-update solution which excludes any mergemaster solution short of at least a partial rewrite. -- Adam
Peter Olsson
2015-Mar-10 19:18 UTC
There has to be a better way of merging /etc during a major freebsd-update
On Tue, Mar 10, 2015 at 12:01:54PM -0700, Chris H wrote:> On Tue, 10 Mar 2015 10:17:18 -0500 Adam Vande More <amvandemore at gmail.com> > wrote > > > On Tue, Mar 10, 2015 at 7:05 AM, Peter Olsson <list-freebsd-stable at jyborn.se > > > wrote: > > > > > This flag to mergemaster saved a lot of work when I did > > > upgrades the old way, with cvsup and the make steps and > > > then mergemaster: > > > > > > > https://svnweb.freebsd.org/base?view=revision&revision=221780 > > > > I'd venture to guess the script will work fine on older installs, but > > testing should be done first. > Isn't that pretty much what the -F flag, I mentioned does? > "-F If the files differ only by VCS Id ($FreeBSD) install the > new file." > In all honesty, I too got stuck answering "y" ~100 times, way > back when. And decided I needed to either find a better way, > or see if the mergemaster(8) had any secrets I wasn't > aware of. ;-)I think you are mixing up mergemaster with merge. Freebsd-update uses merge, not mergemaster. (But I will try running freebsd-update without merging /etc, and use mergemaster -F instead. Should solve my problem.) Peter Olsson
Ben Morrow
2015-Mar-10 22:06 UTC
There has to be a better way of merging /etc during a major freebsd-update
Quoth Peter Olsson <list-freebsd-stable at jyborn.se>:> > (But I will try running freebsd-update without merging /etc, > and use mergemaster -F instead. Should solve my problem.)I'm fairly sure this won't do what you want, and in fact won't work at all, unless your /etc is identical to the stock /etc installed from the ISO. (Which it isn't, of course.) installworld specifically avoids installing the files in /etc; then, when you run mergemaster, it installs the new versions of those files into a temporary directory and merges them with the existing /etc. freebsd-update works a little differently: because it doesn't have a source tree available, it has to fetch the stock versions of the files in /etc for the release you're upgrading from, so that it can patch them to the new release and then merge the changes into your current /etc. If you tell freebsd-update to install /etc without merging it will blindly update files you haven't changed (which is probably what you want) but (I think) will fail to update the files that you have changed, because it uses binary patches which won't apply to your modified versions. If you want a rather hackish solution, you could try something like this: - Rename /etc to /oldetc. - Find yourself a copy of the stock /etc for the version you are upgrading from. (tar -xpf base.txz --include /etc) - Run freebsd-update with /etc removed from the merge list. This will (should?) give you a stock /etc for the version you are upgrading to. - Rename /etc -> /tmp/etc, /oldetc -> /etc and run mergemaster with -t /tmp. Obviously I would script this if I was doing more than one or two machines. Ben