https://blue-build.org/ logo
Key file does not have key “VERSION_ID” in group “...
# questions
y
Hi, I recently asked in the dev channel by mistake about updating
os-release
contents so that a date is included that shows when the image was created. For example, silverblue does the following formatting style and is preserved in blue-build systems if you don't override the
PRETTY_NAME
entry.
Fedora Silverblue 43.20251105.0
I was told this wasn't supported, and since I wanted this same formatting, I tried doing my own modification with the following:
Copy code
yaml
# ...
  - type: os-release
    properties:
      ID: fedora_maetel
      ID_LIKE: fedora
      Name: Maetel
      PRETTY_NAME: Maetel [Fedora] Image
  
  - type: containerfile
    snippets:
      - RUN sed -e 's/PRETTY_NAME=.*/PRETTY_NAME="Maetel [Fedora] '$( date +%y%m%d )'"/' /etc/os-release > /etc/os-release
# ...
This logically seemed like it wouldn't break the system, and AFAIK the
os-release
formatting is exactly as it should be. Any attempt to boot into this system however results in the following error:
Copy code
error: Key file does not have key “VERSION_ID” in group “os-release”
There must be some other step I'm missing here. Any advice? Likewise, any chance this timestamping feature could be added to the nu script for the os-release module?
a
message has been deleted
g
You're using
> /etc/os-release
which overwrites the file entirely. I'd suggest piping through
tee
to see what's being put into the file
So
| tee /etc/os-release
instead
y
Ah, you're right that
tee
is the correct way to do this here. I wasn't aware of how the
>
redirect will truncate the target file first before running the
sed
operation, effectively nuking the file. Thanks for the help.
I really should have tested this on a local file for inplace overwrites first, instead of writing it to another file and doing a diff locally.