From: Silvano Cirujano Cuesta <silvano.cirujano-cuesta@siemens.com>
To: Henning Schild <henning.schild@siemens.com>
Cc: Claudius Heine <ch@denx.de>, isar-users@googlegroups.com
Subject: Re: image-postproc-extension.bbclass modifying /etc/os-release
Date: Tue, 19 Jan 2021 11:37:00 +0100 [thread overview]
Message-ID: <12759268-1ad7-168a-dde9-4f2658567af1@siemens.com> (raw)
In-Reply-To: <20210119102246.53791a9c@md1za8fc.ad001.siemens.net>
On 19/01/2021 10:22, Henning Schild wrote:
> Am Tue, 19 Jan 2021 09:50:27 +0100
> schrieb Silvano Cirujano Cuesta <silvano.cirujano-cuesta@siemens.com>:
>
>> On 19/01/2021 09:33, Henning Schild wrote:
>>> Am Tue, 19 Jan 2021 09:25:31 +0100
>>> schrieb "[ext] Henning Schild" <henning.schild@siemens.com>:
>>>
>>>> Am Mon, 18 Jan 2021 13:35:53 +0100
>>>> schrieb Claudius Heine <ch@denx.de>:
>>>>
>>>>> Hi Silvano,
>>>>>
>>>>> On 2021-01-18 12:35, Silvano Cirujano Cuesta wrote:
>>>>>> I might try to provide a fix, if we agree that the current
>>>>>> implementation has an issue.
>>>>>>
>>>>>> @Claudius: you wrote the original code [1]. Do you remember why
>>>>>> you implemented it this way? Do you remember if you were aware of
>>>>>> the issue I mentioned and you provided a mitigation for the issue
>>>>>> that I see (assuming my analysis is right)?
>>>>>>
>>>>>> [1]
>>>>>> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Filbers%2Fisar%2Fcommit%2F13ce96e5bc84b60f2fa7ccfe93dde045461884e6&data=04%7C01%7Csilvano.cirujano-cuesta%40siemens.com%7C7170c79e6ec14d6df1ac08d8bc5bcaf8%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C637466449720721035%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ejDae1qkGm4bNOnsk1oRZeGGkJLs7tXVmhHx%2B4pnv2Q%3D&reserved=0
>>>>>>
>>>>>> Silvano
>>>>>>
>>>>>> On 15/01/2021 15:26, [ext] Silvano Cirujano Cuesta wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> I've noticed that '/etc/os-release' is being changed on the
>>>>>>> image in meta/classes/image-postproc-extension.bbclass [1].
>>>>>>> What BTW ends up changing '/usr/lib/os-release', since it's
>>>>>>> only a symlink. But both '/etc/os-release' and
>>>>>>> '/usr/lib/os-release' are owned by 'base-files'...
>>>>>>>
>>>>>>> An upgrade of 'base-files' would be replacing (silently, since
>>>>>>> is not marked as a configuration file) '/usr/lib/os-release'
>>>>>>> with the version of the upstream 'base-files' package and
>>>>>>> possibly breaking any tools in the system relying on certain
>>>>>>> values in that file.
>>>>>>>
>>>>>>> Is there a reason that I'm missing for doing so instead of the
>>>>>>> Debian-way (file diversion with dpkg-divert)? Or any hack that
>>>>>>> I've overseen that avoids the mentioned breakage?
>>>>> Interesting, I didn't remember that `/etc/os-release` is a
>>>>> symlink, could that be something that has changed in more recent
>>>>> debian versions?
>>>>>
>>>>> If so then, of course that needs to be fixed.
>>>> the problem seems to be that it is a symlink, otherwise one would
>>>> assume that changes in /etc/ are allowed and covered by the config
>>>> file exception and will be subject to merging if an updated package
>>>> comes around.
>>>>
>>>> My guess would be that we need to
>>>> - make it a copy instead of a symlink
>>>> - modify it
>>> Alternative would be to create /etc/os-release-isar as that modified
>>> copy, and replace the symlink target /etc/os-release ->
>>> /etc/os-release-isar
>> No, nothing touching /etc/os-release off-band will block "base-files"
>> from restoring it. Creating another package touching /etc/os-release
>> will create a conflict that will be detected by dpkg. Either upstream
>> "base-files" is not there or we create a file diversion for
>> /etc/os-release. IMO we are creating a Debian Derivative and as
>> therefore I'd consider their re-/de-branding guidelines (see separate
>> thread).
>>> We can not have the modified file be part of any package, at least
>>> not with its final content. The version control command has to
>>> happen on every rootfs build and has to come "late", and a package
>>> would not have that property. Plus a package would become subject
>>> to potential false sharing in the multiconfig case ... The fields
>>> we change are mostly image-properties, and not generic
>> Image post-processing is deemed to fail.
>>
>> Sorry, I don't understand what you mean with "a package would become
>> subject to potential false sharing in the multiconfig case". A
>> package created on build-time can contain those image properties,
>> right? I might be missing something...
> No a package can not do the job, unfortunately. That is why we violate
> the rule that every modification should be part of a package. It is not
> because that file is potentially already owned by another package, that
> can always be solved with overwriting in a package hook.
What do you mean with "package hook"? A package "postinst" script?
>
> The package would need to have a unique name and version for every new
> output of "git describe" and for every image description. In
> multiconfig we build multiple images in one tree, sharing isar-apt.
We can create a removal file diversion for /usr/lib/os-release (leaving /etc/os-release untouched, that way the Debian manpage for os-release still applies). This approach has following attributes:
- /usr/lib/os-release is not managed by any package and that way post-processing it is not an issue and dpkg won't break anything
- Debian os-release manpage still applies
If going for the other approach (create our own "base-files" package) we can do pretty much the same:
- the package doesn't provide /usr/lib/os-release, leaving it package-unmanaged
- image post-processing to create the file becomes a requirement
Silvano
>
> Henning
>
>> Silvano
>>
>>> Henning
>>>
>>>> In this case an update of the base-files package should leave it
>>>> alone or ask for a merge. And i think that would be OK behaviour.
>>>>
>>>> Henning
>>>>
>>>>> regards,
>>>>> Claudius
>>>>>
--
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2021-01-19 10:37 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-15 14:26 Silvano Cirujano Cuesta
2021-01-18 11:35 ` Silvano Cirujano Cuesta
2021-01-18 12:35 ` Claudius Heine
2021-01-18 14:52 ` Silvano Cirujano Cuesta
2021-01-19 8:25 ` Henning Schild
2021-01-19 8:33 ` Henning Schild
2021-01-19 8:50 ` Silvano Cirujano Cuesta
2021-01-19 9:22 ` Henning Schild
2021-01-19 10:37 ` Silvano Cirujano Cuesta [this message]
2021-01-22 8:52 ` Claudius Heine
2021-01-22 9:47 ` Silvano Cirujano Cuesta
2021-01-22 10:33 ` Claudius Heine
2021-01-22 11:36 ` Silvano Cirujano Cuesta
2021-02-05 11:55 ` vijaikumar....@gmail.com
2021-02-05 14:57 ` Silvano Cirujano Cuesta
2021-02-07 9:02 ` vijai kumar
2021-02-08 8:50 ` Silvano Cirujano Cuesta
2021-02-09 6:02 ` vijai kumar
2021-02-10 9:22 ` Baurzhan Ismagulov
2021-02-11 5:54 ` vijaikumar....@gmail.com
2021-02-11 8:49 ` Baurzhan Ismagulov
2021-02-11 10:34 ` vijaikumar....@gmail.com
2021-01-19 8:43 ` Silvano Cirujano Cuesta
2021-01-19 9:08 ` Henning Schild
2021-01-19 9:14 ` Henning Schild
2021-01-19 9:30 ` Silvano Cirujano Cuesta
2021-01-19 9:11 ` Claudius Heine
2021-01-19 8:43 ` Henning Schild
2021-01-19 9:03 ` Silvano Cirujano Cuesta
2021-01-19 9:38 ` Henning Schild
2021-02-08 17:20 ` Baurzhan Ismagulov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=12759268-1ad7-168a-dde9-4f2658567af1@siemens.com \
--to=silvano.cirujano-cuesta@siemens.com \
--cc=ch@denx.de \
--cc=henning.schild@siemens.com \
--cc=isar-users@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox