Contributed by merdely on from the one-less-package-to-install dept.
Back in the OpenBSD 3.0 days, Christian Weisgerber (naddy@) imported sysutils/mergemaster into the ports tree. This tool is very useful for updating /etc after upgrading OpenBSD (see previous story). Bringing mergemaster, or something like it, into the base system had been up for discussion for a while. Recently, Antoine Jacoutot (ajacoutot@) took the initiative to create a new script, sysmerge(8), starting from mergemaster and ending up with something specific to OpenBSD.
Like mergemaster, sysmerge will build the new /etc (and /var & /root) files for comparison from an OpenBSD source tree. A new feature in sysmerge, though, is the ability to use an etcXY.tgz tarball directly. Using the command:
sysmerge will silently compare your /etc to what is in etc43.tgz until it reaches differences. Then, like mergemaster, sysmerge will prompt you to (d)elete the new file (keeping the old one), (i)nstall the new file or (m)erge the files using sdiff(1). The -a switch tells sysmerge to run in "automatic mode", automatically installing missing files, creating databases and devices and disabling strict file comparison using CVS Ids when possible. The -s ... switch tells sysmerge where to find the etc files for the update. Either a top-level source directory or an etcXY.tgz tarball file can be specified. /usr/src is used by default.sysmerge -a -s /path/to/`arch -ks`/etc43.tgz
In automatic mode, once sysmerge is done comparing files, databases are rebuilt if their files have changed (like pwd.db, spwd.db, aliases.db, ...), new devices are created if a new MAKEDEV script is installed and directory permissions are verified. If -a was not specified, you are prompted to do these things.
This is a work in progress. Please test it out and provide feedback. Planned features include xetcXY.tgz support, possibly a non-interactive mode and a way to add files and directories to ignore during the comparison.
Thank you, Antoine, for working on sysmerge.
(Comments are closed)
By Mike Erdely (merdely) firstname.lastname@example.org on http://erdelynet.com/
And, I just noticed that the sysmerge(8) man page hasn't hit the man.cgi yet.
Until then, you can look at the man page's source.
By Anonymous Coward (126.96.36.199) on
Aside from this, this is great news to see something new like this!
By phessler (phessler) on first undead, then not, then undead again.
> Aside from this, this is great news to see something new like this!
yes, you can give it etc43.tgz from release(8). Or any version that release(8) packed.
By Anonymous Coward (2a01:348:159:2:21d:e0ff:fe3a:50cf) on
By Martin Schröder (188.8.131.52) email@example.com on http://www.oneiros.de
By sthen (2a01:348:108:155:20a:e4ff:fe2d:99ee) on
I don't know exactly what you're referring to, but it does handle sendmail cf files specially. See for yourself...
By Martin Schröder (184.108.40.206) firstname.lastname@example.org on http://www.oneiros.de
> I don't know exactly what you're referring to, but it does handle
The sendmail docs are installed under /etc. So before using mergemaster, you have to do
make -f Makefile.bsd-wrapper distribution
See Absolute OpenBSD, p. 333
By Anonymous Coward (2a01:348:108:155:20a:e4ff:fe2d:99ee) on
> > I don't know exactly what you're referring to, but it does handle
> The sendmail docs are installed under /etc.
You've lost me there, surely they're in /usr/share/doc/smm/08.sendmailop and 09.sendmail, with a README in /usr/share/sendmail?
> So before using mergemaster, you have to do
> cd /usr/src/usr.sbin/httpd
> make -f Makefile.bsd-wrapper distribution
Oh, you mean httpd? They're not under /etc but they are in etcXX.tgz; so taking a quick glance at the code I linked to (which should also work on earlier OS releases if you want to try it), that would depend on whether you ask sysmerge to update using etcXX.tgz or from source.
> See Absolute OpenBSD, p. 333
"page 333 is not part of this book preview", says Google.
By Mark Peloquin (incripshin) email@example.com on
By Jim Razmus II (jim) firstname.lastname@example.org on http://www.bonetruck.org/
By sthen (2a01:348:108:155:20a:e4ff:fe2d:99ee) on
There's an easy way around that, involving cvs rm ;-)
By Didier wiroth (220.127.116.11) http://www.wiroth.net on http://www.wiroth.net
THANKS a lot!
By Anonymous Coward (18.104.22.168) on
It first appeared in OpenBSD 4.4 tho :D :
> The sysmerge script first appeared in OpenBSD 4.4.
> The sysmerge shell script was written by Antoine Jacoutot
> <email@example.com> using FreeBSD mergemaster written by Douglas
> Barton <DougB@FreeBSD.org> as a base.
>OpenBSD 4.3 April 22, 2008
Nice tool indeed, been using mergemaster, looking forward to try this one out.
By Han (22.214.171.124) firstname.lastname@example.org on
I still prefer the method which I use in mergeslave. I keep the etcXX.tgz tarball of the current release. When I install the new release I extract it in $PWD/old/ and the new etcXX.tgz tarball in $PWD/new/, then create a diff between those two directories and then I apply that diff to my system.
Basically that's the idea which I use in OpenBSD-binary-upgrade.