On 22/07/2015 14:05, Joakim Tjernlund wrote:
> On Wed, 2015-07-22 at 07:14 -0400, Rich Freeman wrote:
>> On Wed, Jul 22, 2015 at 6:17 AM, Panagiotis Christopoulos
>> <[email protected]> wrote:
>>>
>>> you can subscribe to gentoo-embedded mailing list and ask there, as your 
>>> product
>>> is embedded. Also, man make.conf and search for CONFIG_PROTECT. If I 
>>> understood
>>> you correctly, it may be what you need.
>>>
>>
>> That list is certainly a  a good place if it is active, but I get the
>> impression that he wants to package/manage his config files in some
>> way.  That is, install package foo, and then automatically get his
>> config files for foo.
> 
> Yes, I need to be able to change my own config files too over time.
> 
>>
>> Short of going to a true config management system, I'd consider just
>> having a tarball/etc full of config files that you unpack after you've
>> set up your system (or clone it from a git repo or whatever).  If you
>> have config files for packages you didn't install it isn't a big deal
>> - they just use up a few inodes, and if you install the packages later
>> the CONFIG_PROTECT settings will prevent them from being overwritten.
>>
>> A portage-based alternative is to stick them all in a package(s)
>> (which will generate collision warnings, and since it would respect
>> config protect it would mean you have to merge in all the changes), or
>> fork all the ebuilds.  I just don't think portage is really meant as a
>> full-fleged configuration management tool.
> 
> There can not be any manual merges after an SW update here.
> 
> I started to look at INSTALL_MASK, what if I set INSTALL_MASK
> to point to all conf files I want to manage myself.
> Then /etc/inittab etc. will not be touched when updating init
> 
> Then I add my own ebuild containing my modified conf files but how to
> manage INSTALL_MASK, CONFIG_PROTECT etc.? 
> Is it possible from within the ebuild change INSTALL_MASK, CONFIG_PROTECT?
> Then I could just zap INSTALL_MASK before installing my files.
> 
> 
>> Also, if you're doing lots of these installs you might want to look at
>> a true config management tool like ansible or puppet/chef.  That could
>> take care of all the installation as well as the configuration, and
>> could be tied into portage.
> 
> sound complicated for what I want to do
> 

You could take the approach FreeNAS uses: /etc is a tmpfs mount.

If I read you correctly, upgrades are done with the appliance off-line
in the style of flashing a DSL router? In that case, upgrades will be
done in maintenance mode, with /etc not mounted. So *MASK* and *CONFIG*
don't even feature at all, just let emerge do it's thing as normal and
your customizations are not even in the picture. Your ebuild containg
config files should install copies somewhere appropriate, like /var/mystuff/

Last step of the install is to mount the /etc tmpfs, copy the existing
on-disk /etc to it then copy /var/mystuff to /etc. They will overwrite
portage's versions but so what? You know you want them changed and you
have persistent pristine original copies of portage's versions and your
mods. Finally, reboot.

This whole last step must also happen after reboot, so make it a custom
init script in an appropriate runlevel where you can launch it as needed
during upgrade and reboot.


-- 
Alan McKinnon
[email protected]


Reply via email to