# mergemaster.mtree modified locally issue?



## esheesle (Aug 20, 2012)

Running Freebsd 8.2 and have been using freebsd-update since before version 8.  No big problems before and now all of a sudden I'm getting this (freebsd-update fetch output along with uname -a to show kernel is default):


```
%freebsd-update fetch
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching metadata signature for 8.2-RELEASE from update5.FreeBSD.org... done.
Fetching metadata index... done.
Inspecting system... done.
Preparing to download files... done.

The following files are affected by updates, but no changes have
been downloaded because the files have been modified locally:
/var/db/mergemaster.mtree

No updates needed to update system to 8.2-RELEASE-p10.

WARNING: FreeBSD 8.2-RELEASE-p9 HAS PASSED ITS END-OF-LIFE DATE.
Any security issues discovered after Tue Jul 31 20:00:00 EDT 2012
will not have been corrected.
```


```
%uname -a
FreeBSD myhost.com 8.2-RELEASE-p9 FreeBSD 8.2-RELEASE-p9 #0: Mon Jun 11 22:27:05 UTC 2012     [email]root@i386-builder.daemonology.net[/email]:/usr/obj/usr/src/sys/GENERIC  i386
```

When I run freebsd-update IDS it shows just about every file having the wrong signature.  Any ideas how to get things working again?


----------



## cpm@ (Aug 20, 2012)

You need to recompile and install your custom GENERIC kernel in order for 'uname -a' version to be updated.



> Older releases are not maintained and users are strongly encouraged to upgrade to one of the supported releases mentioned above.



Reference: http://security.freebsd.org/


----------



## esheesle (Aug 20, 2012)

I don't use a custom kernel.  I'm just trying to get to 8.2-RELEASE-p10 but it complains about mergemaster.mtree.  I've tried updating to 8.3 but i get prompted to manually edit every single file in /etc which I assume has something to do with the freebsd-update mergemaster error.


----------



## cpm@ (Aug 20, 2012)

Run the following command:

[CMD=]# freebsd-update upgrade -r 8.3-RELEASE[/CMD]


----------



## esheesle (Aug 20, 2012)

Did that and had every file in /etc need to be manually edited because auto merge couldn't manage it.


----------



## cpm@ (Aug 20, 2012)

Should work:

```
# cd /usr/src
# mergemaster -p
```


----------



## esheesle (Aug 20, 2012)

That should fix my system and allow upgrade via freebsd-update?


----------



## cpm@ (Aug 20, 2012)

One command all the process:

[CMD=]# cd /usr/src/ && mergemaster -p && make buildworld && make buildkernel KERNCONF=KERNNAME && make installkernel KERNCONF=KERNNAME && make installworld && mergemaster && shutdown -r +3[/CMD]


----------



## esheesle (Aug 20, 2012)

Won't that break my ability to use freebsd-update in the future because of a custom kernel?


----------



## cpm@ (Aug 20, 2012)

Check http://forums.freebsd.org/showpost.php?p=129997&postcount=8.


----------



## esheesle (Aug 20, 2012)

From reading that post I'm a bit confused though.  I don't run a custom kernel, just the GENERIC.  Why should I even need to build the kernel, as that will then make it custom?


----------



## esheesle (Aug 20, 2012)

Also, why is freebsd-update ids reporting all files as changed (I know i haven't changed most of those)?


----------



## esheesle (Aug 22, 2012)

So no clue on why all files in /etc are showing as changed during an update (and/or mergemaster.mtree is showing as modified when I haven't changed it)?


----------



## cpm@ (Aug 23, 2012)

From mergemaster(8):


> *-U*: Attempt to auto upgrade files that have not been user modified.This option can be dangerous when there are critical changes in the new versions that affect your running system.
> 
> *-i*: Automatically install any files that do not exist in the destination directory.
> 
> *-P*: Preserve files that you replace in /var/tmp/mergemaster/preserved-files-_date_, or another directory you specify in your mergemaster rc file.



Passing the *-U* argument to mergemaster will avoid you having to check each file separately. Other interesting options are *-i* and *-P* arguments. Next time, you can use this options to merge configurations:

```
$ mergemaster -iUP
```

Another way is to use /etc/mergemaster.rc, for example:


```
# Files to always avoid comparing (space separated)
IGNORE_FILES='/etc/crontab /etc/fstab /etc/group /etc/hosts /etc/inetd.conf 
/etc/make.conf /etc/master.passwd /etc/motd /etc/newsyslog.conf 
/etc/ntp.conf /etc/ntp.drift /etc/profile /etc/rc.conf /etc/resolv.conf 
/etc/services /etc/shells /etc/syslog.conf /etc/ssh/sshd_config 
/etc/ssh/ssh_host_key /etc/ssh/ssh_host_key.pub /etc/ssh/ssh_host_rsa_key 
/etc/ssh/ssh_host_rsa_key.pub /etc/passwd /etc/rc.conf.local 
/etc/zfs/exports /etc//namedb/named.conf /etc/periodic.conf 
/etc/hosts.allow /etc/hosts /etc/pf.conf /etc/sysctl.conf /etc/make.conf 
/etc/src.conf /etc/mail/aliases /etc/mail/mailer.conf /etc/remote 
/etc/ppp/ppp.conf /etc/nsswitch.conf /etc/locate.rc'
```

Another example:

```
# Automatically install files that do not exist on the system already
AUTO_INSTALL=yes
 
# Automatically upgrade files that have not been user modified
AUTO_UPGRADE=yes
 
# Preserve files that you replace
PRESERVE_FILES=yes
PRESERVE_FILES_DIR=/var/tmp/mergemaster/preserved-files-`date +%y%m%d-%H%M%S`
```


----------



## mix_room (Aug 23, 2012)

Why not just manually merge the files in /etc that can not be automatically merged. It won't take much longer.


----------



## esheesle (Sep 8, 2012)

Can anyone tell me what a freebsd8.2p9 version string should looks like(ex:  # $FreeBSD: src/etc/ntp.conf,v 1.2.2.1.4.1 2010/06/14 02:09:06 kensmith Exp $)?

That is what freebsd-update is complaining is different in every file.  If I could change it to the right string, then it would update properly without me intervening in every single file.


----------



## cpm@ (Sep 9, 2012)

esheesle said:
			
		

> Can anyone tell me what a freebsd8.2p9 version string should looks like(ex:  # $FreeBSD: src/etc/ntp.conf,v 1.2.2.1.4.1 2010/06/14 02:09:06 kensmith Exp $)?
> 
> That is what freebsd-update is complaining is different in every file.  If I could change it to the right string, then it would update properly without me intervening in every single file.



Set the variable UNAME_r in your environment, rebuild your kernel with a normal name or edit the script and replace all uses of uname -r with echo X.Y-RELEASE-pN in the normal form.

[CMD=]# setenv UNAME_r "8.2-RELEASE-p9"[/CMD]


----------

