Gentoo Archives: gentoo-dev

From: Joakim Tjernlund <joakim.tjernlund@×××××××××.se>
To: "gentoo-dev@l.g.o" <gentoo-dev@l.g.o>
Subject: SV: Re: [gentoo-dev] Managing etc/* in an embbeded system
Date: Thu, 23 Jul 2015 16:08:48
Message-Id: 1842gg084rgar30x8lkkgsn9.1437667711700@email.android.com
In Reply to: Re: [gentoo-dev] Managing etc/* in an embbeded system by Zac Medico
1 This looks really promising, I am traveling ATM but will look closer at this mid next week.
2
3 Thanks, Jocke
4
5
6 Jocke
7
8
9 -------- Originalmeddelande --------
10 Från: Zac Medico <zmedico@g.o>
11 Datum:
12 Till: gentoo-dev@l.g.o
13 Rubrik: Re: [gentoo-dev] Managing etc/* in an embbeded system
14
15
16 On 07/23/2015 12:46 AM, Joakim Tjernlund wrote:
17 > On Wed, 2015-07-22 at 19:47 -0400, Ian Stakenvicius wrote:
18 >>
19 >> Sent from an iPhone, sorry for the HTML...
20 >>
21 >>> On Jul 22, 2015, at 5:38 PM, Rich Freeman <rich0@g.o> wrote:
22 >>>
23 >>> On Wed, Jul 22, 2015 at 8:05 AM, Joakim Tjernlund
24 >>> <joakim.tjernlund@×××××××××.se> wrote:
25 >>>>
26 >>>> There can not be any manual merges after an SW update here.
27 >>>>
28 >>>> I started to look at INSTALL_MASK, what if I set INSTALL_MASK
29 >>>> to point to all conf files I want to manage myself.
30 >>>> Then /etc/inittab etc. will not be touched when updating init
31 >>>
32 >>> This sounds like overkill.
33 >>>
34 >>> If you've already installed a custom /etc/inittab, then when you
35 >>> emerge init, it won't overwrite your inittab even if you don't change
36 >>> anything in your portage config. emerge won't touch any files in /etc
37 >>> unless they don't already exist.
38 >>
39 >>
40 >> ..AND have been modified. IIRC if the hash of the config files match what they were when the package was
41 >> previously emerged, then the files are updated aren't they?
42 >>
43 >> I expect that this is fine in the situation described, but it's worth knowing that a config file left
44 >> unmodified may be replaced with a different vanilla config file later on.
45 >
46 > Sure, but what if I need to change a conf file in an installed system? Or rebuild a a system from scratch?
47 > The user only runs a one SW update command to update an installed system in the field and cannot edit a bunch
48 > of files too. Especially when there are hundreds of systems sitting in remote locations.
49
50 If you use the profile-bashrcs profile-formats setting [1], then your
51 profiles can use package.bashrc to define post_src_install and/or
52 INSTALL_MASK to remove unwanted config files from upstream packages.
53 Then you can easily replace the upstream config files with config files
54 installed by your own configurations installed by your own ebuilds.
55
56 > This is why I need a way change conf files automatically and I want to use ebuilds/profile as
57 > far as possible. I think there is room for some improvement here in portage to allow this kind
58 > of customization.
59
60 A template engine such as jinja [2] can be use to automate rendering of
61 your config files with settings that are specific to a particular system.
62
63 [1]
64 https://gitweb.gentoo.org/proj/portage.git/commit/?id=803dafc462027d6015721f40513abb5f57dc1178
65 [2] http://jinja.pocoo.org/
66 --
67 Thanks,
68 Zac