Problems with packaging /etc and etcupdate(8)
Vinícius Zavam
egypcio at googlemail.com
Thu Jun 7 15:49:39 UTC 2018
2017-11-13 20:51 GMT+01:00 Brad Davis <brd at freebsd.org>:
>
> On Mon, Nov 13, 2017 at 09:26:49AM -0800, John Baldwin wrote:
> > I had assumed that in a pkgbase setup, one wouldn't use etcupdate or
mergemaster.
> > Instead, my understanding is that pkg was going to "learn" about
configuration
> > files and would grow etcupdate-like functionality to merge in changes
to configuration
> > files during upgrades (and would also support 'pkg confdiff', etc. so
that
> > 'pkg confdiff -a' would replace 'etcupdate diff' for example, but would
also support
> > packages built from ports, not just base system conf files). Each
pkgbase package
> > would contain its associated /etc files as configuration files in this
scheme.
>
> To that end Will and I have been working on a patch to move all files in
head/etc/
> to the places they belong. I am probably ~75% of the way through them so
> far. Once I get the last bit wrapped up, I will post a review.
>
>
> Regards,
> Brad Davis
I am sorry for getting back into this thread, but talking to some friends a
while ago it occurred me that something I run at home could be useful for
others here - related to etcupdate and updates using pkg-base (on HEAD).
I'll not cover the delete-files things here, and I must admit that I was
not following the mailing list for a while :\
so, after building world, kernel and creating the respective distfiles
(base.txz, kernel.txz) my build server generates the "etc.tbz" using the
following command:
# etcupdate build -B -s /usr/src /dist/etc.tbz
in another machine (my laptop, also running HEAD), where I extract the
distfiles for base and kernel, here is how I deal with updating/upgrading:
~ fetch *.txz stuff, and etc.tbz
~ extract kernel.txz to /
# rm -rf /var/db/etcupdate/previous
# mkdir -p /var/db/etcupdate/current
# mkdir -p /var/db/meu
# tar --unlink -xjpf /whatever/etc.tbz -C /var/db/meu/etc
for FILE in $(find /var/db/meu/etc -type f | cut -d\/ -f6-9); do
d=$(dirname ${FILE})
f=$(basename ${FILE})
mkdir -p /var/db/etcupdate/previous/$d
cp -a /$d/$f /var/db/etcupdate/previous/$d/$f 2>/dev/null
done
# etcupdate -p -F -t /var/db/meu/etc.tbz
# etcupdate resolve -p
# etcupdate diff > /var/db/meu/etc.diff.pre
~ extract base.txz to /
# etcupdate -F -t /var/db/meu/etc.tbz
# etcupdate resolve
# etcupdate diff > /var/db/meu/etc.diff
~ reboot.
well, it's indeed NOT an .ucl to be used direclty with pkg, but the idea of
scripting it is there. right?
--
Vinícius Zavam
keybase.io/egypcio/key.asc
More information about the freebsd-pkgbase
mailing list