Question about lsb-release & os-release

770 views
Skip to first unread message

Bin

unread,
Jul 16, 2024, 1:15:37 PM7/16/24
to ChromiumOS Development
A part of ChromiumOS Configuration > /etc/lsb-release doc says: If it is not marked as Usable, then you must not parse it out for anything other than informational display to users.

Why I must not pase it out? the value of fields are just texts. 
Even if I read & analyze the text value from other program, it would not modify /etc/lsb-release or affect to other system.
What is the meaning of the 'parse' in here exactly? 
Reading? Analyzing? or Modifying?

Mike Frysinger

unread,
Jul 16, 2024, 1:42:24 PM7/16/24
to Bin, ChromiumOS Development
we do not guarantee the stability of the fields.  maybe they'll change formats, maybe we'll delete them, maybe they'll be locked to.
-mike

--
--
ChromiumOS Developers mailing list: chromiu...@chromium.org
View archives, change email options, or unsubscribe:
https://groups.google.com/a/chromium.org/group/chromium-os-dev

Denny Lockhart

unread,
Jul 16, 2024, 3:35:46 PM7/16/24
to ChromiumOS Development, Mike Frysinger, ChromiumOS Development, Bin
Bin,

The /etc/lsb-release file is evidently 'sourced' since it's contents are in your environment.
I know some of the variables are used in the .conf scripts under /etc/init/ on chromeOS.
So it is used for 'other than informational display to users' in some cases.

~DennyL 

Mike Frysinger

unread,
Jul 16, 2024, 3:43:38 PM7/16/24
to Denny Lockhart, ChromiumOS Development, Bin
eh ?  what do you mean they're "in your environment" ?  nothing sources these, nor could they as they aren't valid shell code.

$ dash -c '. /etc/lsb-release'
dash: 5: /etc/lsb-release: OS: not found
dash: 12: /etc/lsb-release: Build: not found
dash: 13: /etc/lsb-release: Syntax error: "(" unexpected

$ bash -c '. /etc/lsb-release'
/etc/lsb-release: line 5: OS: command not found
/etc/lsb-release: line 12: Build: command not found
/etc/lsb-release: line 13: syntax error near unexpected token `('
/etc/lsb-release: line 13: `CHROMEOS_RELEASE_DESCRIPTION=15948.0.0 (Test Build - root) developer-build betty'
-mike

Denny Lockhart

unread,
Jul 16, 2024, 3:56:16 PM7/16/24
to ChromiumOS Development, Mike Frysinger, ChromiumOS Development, Bin, Denny Lockhart
Mike,

I may be mistaken but when I compare the contents of /etc/lsb-release and the output of the 'env' command I find the same variables defined so I assumed the /etc/lsb-release file was sourced but maybe I assumed wrong.
However, the same variables in the file are in your environment but maybe through some other means than sourcing them.

Also, the 'ChromiumOS Configuration' document does say:
- 'If it is not marked as Usable, then you must not parse it out for anything other than informational display to users.'
The variables I see in the .conf scripts are marked as USABLE afaict.

~DennyL

Mike Frysinger

unread,
Jul 16, 2024, 3:59:00 PM7/16/24
to Denny Lockhart, ChromiumOS Development, Bin
yes, we have old code that predates the guidance, and we haven't spent time fixing them

if you're running shell in crosh, i think Chromium Ash will read lsb-release and put a few settings into the env.  also a historical artifact we haven't cleaned up.  but that is only for the browser and its children, it isn't for init services.
-mike
Reply all
Reply to author
Forward
0 new messages