public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Claudius Heine <ch@denx.de>
To: Silvano Cirujano Cuesta <silvano.cirujano-cuesta@siemens.com>,
	Henning Schild <henning.schild@siemens.com>
Cc: isar-users@googlegroups.com
Subject: Re: image-postproc-extension.bbclass modifying /etc/os-release
Date: Fri, 22 Jan 2021 09:52:18 +0100	[thread overview]
Message-ID: <402794f7-74a3-ab50-972e-7682d5388ff2@denx.de> (raw)
In-Reply-To: <12759268-1ad7-168a-dde9-4f2658567af1@siemens.com>

Hi Silvano,

On 2021-01-19 11:37, Silvano Cirujano Cuesta wrote:
> 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
I looked at the manpage of os-release and it does not state that 
`/etc/os-release` can or should not be a file:

```
        The file /etc/os-release takes precedence over 
/usr/lib/os-release. Applications should check for the former, and 
exclusively use its data if it exists, and only fall back to 
/usr/lib/os-release if
        it is missing. Applications should not read data from both files 
at the same time.  /usr/lib/os-release is the recommended place to store 
OS release information as part of vendor trees.
        /etc/os-release should be a relative symlink to 
/usr/lib/os-release, to provide compatibility with applications only 
looking at /etc/. A relative symlink instead of an absolute symlink is 
necessary
        to avoid breaking the link in a chroot or initrd environment 
such as dracut.

        os-release contains data that is defined by the operating system 
vendor and should generally not be changed by the administrator.

        As this file only encodes names and identifiers it should not be 
localized.

        The /etc/os-release and /usr/lib/os-release files might be 
symlinks to other files, but it is important that the file is available 
from earliest boot on, and hence must be located on the root file
        system.
```

So why not make sure `/etc/os-release` is a file and do this:

     dpkg-divert --add --local --no-rename /etc/os-release

in the post processing step? Shouldn't this prevent any future 
base-files update from preventing to overwrite the `/etc/os-release`?

The only issue I would see if someone performs a distribution upgrade 
and now the `/etc/os-release` no longer contains the correct version, 
but other than an apt.conf hook that updates `/etc/os-release` based on 
new information from `/usr/lib/os-release` after an upgrade, I don't see 
a way to do this automatically.

I would rather divert '/etc/os-release' in a postprocessing script than 
`/usr/lib/os-release` because, I see the post-processing more of a local 
configuration.

For multiple reasons we cannot used a package to write the version 
information, so that is out of the picture anyway.

The only other way would be to create a new file just for the image or 
build version, but that would break compatibility now.

regards,
Claudius

  reply	other threads:[~2021-01-22  8:52 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
2021-01-22  8:52               ` Claudius Heine [this message]
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=402794f7-74a3-ab50-972e-7682d5388ff2@denx.de \
    --to=ch@denx.de \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=silvano.cirujano-cuesta@siemens.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