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) mike@erdelynet.com 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 (24.37.242.64) on
Aside from this, this is great news to see something new like this!
Comments
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 (84.137.109.226) martin@oneiros.de on http://www.oneiros.de
Comments
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...
http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/src/usr.sbin/sysmerge/sysmerge.sh?content-type=text/plain
Comments
By Martin Schröder (84.137.111.3) martin@oneiros.de 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
cd /usr/src/usr.sbin/httpd
make -f Makefile.bsd-wrapper distribution
See Absolute OpenBSD, p. 333
Comments
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) markpeloquin@gmail.com on
By Jim Razmus II (jim) jtr2-undeadly@bonetruck.org on http://www.bonetruck.org/
Comments
By sthen (2a01:348:108:155:20a:e4ff:fe2d:99ee) on
There's an easy way around that, involving cvs rm ;-)
By Didier wiroth (158.64.58.6) http://www.wiroth.net on http://www.wiroth.net
THANKS a lot!
Comments
By Anonymous Coward (82.114.74.98) on
http://www.openbsd.org/cgi-bin/man.cgi?query=sysmerge&sektion=8&apropos=0&manpath=OpenBSD+Current&arch=i386
It first appeared in OpenBSD 4.4 tho :D :
>HISTORY
> The sysmerge script first appeared in OpenBSD 4.4.
>
>AUTHORS
> The sysmerge shell script was written by Antoine Jacoutot
> <ajacoutot@openbsd.org> 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 (84.41.179.194) han@mijncomputer.nl 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.