Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Jun 2018 17:49:37 +0200
From:      =?UTF-8?Q?Vin=C3=ADcius_Zavam?= <egypcio@googlemail.com>
To:        Brad Davis <brd@freebsd.org>
Cc:        John Baldwin <jhb@freebsd.org>, Glen Barber <gjb@freebsd.org>, freebsd-pkgbase@freebsd.org, Will Andrews <will@freebsd.org>
Subject:   Re: Problems with packaging /etc and etcupdate(8)
Message-ID:  <CA%2BKr6DPLgZxF-ZV-D0Z-yv%2B-Z_Vm=9G3JTzpjoi-t5TcedLkmQ@mail.gmail.com>
In-Reply-To: <20171113195144.GH53537@corpmail.liquidneon.com>
References:  <20170927163012.GA99112@FreeBSD.org> <20171113172054.GA23670@FreeBSD.org> <1972909.hTPcQf8OeH@ralph.baldwin.cx> <20171113195144.GH53537@corpmail.liquidneon.com>

next in thread | previous in thread | raw e-mail | index | archive | help
2017-11-13 20:51 GMT+01:00 Brad Davis <brd@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=3D$(dirname ${FILE})
      f=3D$(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=C3=ADcius Zavam
keybase.io/egypcio/key.asc



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2BKr6DPLgZxF-ZV-D0Z-yv%2B-Z_Vm=9G3JTzpjoi-t5TcedLkmQ>