Dnia 2015-07-22, o godz. 13:20:10
Joakim Tjernlund <joakim.tjernl...@transmode.se> napisał(a):

> On Wed, 2015-07-22 at 14:30 +0200, Michał Górny wrote:
> > 
> > Joakim Tjernlund <joakim.tjernl...@transmode.se> napisał:
> > 
> > > We got an embedded gentoo system where we need to manage many conf
> > > files under /etc that we have
> > > modified and should be under our control when an SW upgrade is
> > > performed.
> > > 
> > > Cloning every ebuild where we have modified its conf file(s) under /etc
> > > feels awkward so
> > > I am looking for some other way to do this automatically during SW
> > > upgrade and I figured
> > > this can not be an unique problem for us, so I wonder how other people
> > > have solved this problem?
> > > Our customers will not use emerge directly and we will provide binary
> > > pkgs.
> > > 
> > > Any ideas welcome :)
> > > 
> > > Jocke
> > 
> > Maybe post-phase hooks would help you. Not around a PC right now but I 
> > think they're described in portage.5. 
> > Long story short, you create per-package env files in /etc/portage/env (you 
> > can pin them generically or to a 
> > specific version, or package spec via package.env) and declare 
> > post_src_install() where you add your custom 
> > config files atop the package.  
> > 
> 
> hmm, that sounds interesting but I don't quite get what to do, you think I 
> should copy over /etc/inittab after
> it has been installed by sys-apps/sysvinit with my own version(which is 
> stored where?)

Yes, exactly. You can either copy your own, or modify (sed? patch?)
the standard one. You can store it anywhere, download (unless you
use network-sandbox) from the net or just inline via here-doc syntax.

> This gave me an idea though:
> In /etc/portage/env/install-mask.conf I add
>   INSTALL_MASK="${INSTALL_MASK} /etc/inittab /etc/xxx"
> then in /etc/portage/package.env/install-mask
>   sys-apps/sysvinit install-mask.conf
>   sys-apps/xxx install-mask.conf
>   ...
> (Can I do this from my own custom profile instead? how?)
> 
> This should prevent sys-apps/sysvinit to install conf files I want to manage, 
> right?
> 
> Then I create my own new ebuild holding all config files I have changed 
> myself.

Sure. Though I don't understand why would you set it per ebuild -- you
can set it in make.conf globally in that case, or in make.defaults in
your profile. If doing the latter, remember to use
INSTALL_MASK="${INSTALL_MASK} ..." if you want to add additional dirs
afterwards.

-- 
Best regards,
Michał Górny
<http://dev.gentoo.org/~mgorny/>

Attachment: pgpMCRn0FeRGG.pgp
Description: OpenPGP digital signature

Reply via email to