Yokai
11/06/2025, 5:00 AMos-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:
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:
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?Answer Overflow
11/06/2025, 5:00 AMgmpinder
11/06/2025, 5:19 AM> /etc/os-release which overwrites the file entirely. I'd suggest piping through tee to see what's being put into the filegmpinder
11/06/2025, 5:20 AM| tee /etc/os-release insteadYokai
11/06/2025, 9:16 AMtee 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.Yokai
11/06/2025, 9:17 AM