On Wed, 2015-07-22 at 22:38 +0800, Jason Zaman wrote:
> On Wed, Jul 22, 2015 at 01:20:10PM +0000, Joakim Tjernlund wrote:
> > 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?)
> > 
> > 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.
> 
> Or you can put a script in /etc/portage/hooks/install/, it will get run
> after src_install() during generation of VDB and all that, you could
> probably move everything from /etc/ to /etc-orig/ then all packages will
> be have things set there, then put your own files in /etc and you can
> always refer to /etc-orig/ or even use overlayfs or something to mount
> your files on top so they cover the package ones.

This also seems viable, need to look at hooks and such though. Are such hooks 
native to portage?

 Jocke

Reply via email to